libcmis-0.4.1/0000755000175000001440000000000012200457455010137 500000000000000libcmis-0.4.1/cppcheck-test.sh.in0000755000175000001440000000015712156277657013601 00000000000000#!/bin/sh @CPPCHECK@ -q --enable=style,performance,portability,information --error-exitcode=1 @SRCDIR@ exit $? libcmis-0.4.1/src/0000755000175000001440000000000012200457455010726 500000000000000libcmis-0.4.1/src/Makefile.in0000644000175000001440000006061312200457433012715 00000000000000# Makefile.in generated by automake 1.13.4 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ @ENABLE_CLIENT_TRUE@bin_PROGRAMS = cmis-client$(EXEEXT) subdir = src DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/boost.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" PROGRAMS = $(bin_PROGRAMS) am__cmis_client_SOURCES_DIST = cmis-client.cxx @ENABLE_CLIENT_TRUE@am_cmis_client_OBJECTS = cmis-client.$(OBJEXT) cmis_client_OBJECTS = $(am_cmis_client_OBJECTS) am__DEPENDENCIES_1 = @ENABLE_CLIENT_TRUE@cmis_client_DEPENDENCIES = $(top_builddir)/src/libcmis/libcmis-@LIBCMIS_API_VERSION@.la \ @ENABLE_CLIENT_TRUE@ $(am__DEPENDENCIES_1) \ @ENABLE_CLIENT_TRUE@ $(am__DEPENDENCIES_1) \ @ENABLE_CLIENT_TRUE@ $(am__DEPENDENCIES_1) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CXXFLAGS) $(CXXFLAGS) AM_V_CXX = $(am__v_CXX_@AM_V@) am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) am__v_CXX_0 = @echo " CXX " $@; am__v_CXX_1 = CXXLD = $(CXX) CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) am__v_CXXLD_0 = @echo " CXXLD " $@; am__v_CXXLD_1 = SOURCES = $(cmis_client_SOURCES) DIST_SOURCES = $(am__cmis_client_SOURCES_DIST) RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BOOST_CPPFLAGS = @BOOST_CPPFLAGS@ BOOST_DATE_TIME_LDFLAGS = @BOOST_DATE_TIME_LDFLAGS@ BOOST_DATE_TIME_LIBS = @BOOST_DATE_TIME_LIBS@ BOOST_PROGRAM_OPTIONS_LDFLAGS = @BOOST_PROGRAM_OPTIONS_LDFLAGS@ BOOST_PROGRAM_OPTIONS_LIBS = @BOOST_PROGRAM_OPTIONS_LIBS@ BOOST_ROOT = @BOOST_ROOT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPCHECK = @CPPCHECK@ CPPFLAGS = @CPPFLAGS@ CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ CPPUNIT_LIBS = @CPPUNIT_LIBS@ CURL_CFLAGS = @CURL_CFLAGS@ CURL_LIBS = @CURL_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISTCHECK_CONFIGURE_FLAGS = @DISTCHECK_CONFIGURE_FLAGS@ DLLTOOL = @DLLTOOL@ DOCBOOK2MAN = @DOCBOOK2MAN@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBCMIS_API_VERSION = @LIBCMIS_API_VERSION@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SRCDIR = @SRCDIR@ STRIP = @STRIP@ VERSION = @VERSION@ XML2_CFLAGS = @XML2_CFLAGS@ XML2_LIBS = @XML2_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = libcmis libcmis-c @ENABLE_CLIENT_TRUE@AM_CXXFLAGS = -I$(top_srcdir)/src/libcmis/ $(XML2_CFLAGS) $(BOOST_CPPFLAGS) @ENABLE_CLIENT_TRUE@cmis_client_SOURCES = cmis-client.cxx @ENABLE_CLIENT_TRUE@cmis_client_LDADD = $(top_builddir)/src/libcmis/libcmis-@LIBCMIS_API_VERSION@.la \ @ENABLE_CLIENT_TRUE@ $(XML2_LIBS) \ @ENABLE_CLIENT_TRUE@ $(BOOST_PROGRAM_OPTIONS_LIBS) \ @ENABLE_CLIENT_TRUE@ $(BOOST_DATE_TIME_LIBS) \ @ENABLE_CLIENT_TRUE@ $(JSON_LIBS) all: all-recursive .SUFFIXES: .SUFFIXES: .cxx .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign src/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list cmis-client$(EXEEXT): $(cmis_client_OBJECTS) $(cmis_client_DEPENDENCIES) $(EXTRA_cmis_client_DEPENDENCIES) @rm -f cmis-client$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(cmis_client_OBJECTS) $(cmis_client_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmis-client.Po@am__quote@ .cxx.o: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< .cxx.obj: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cxx.lo: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile $(PROGRAMS) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(bindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-binPROGRAMS .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-binPROGRAMS clean-generic clean-libtool \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-binPROGRAMS install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am uninstall-binPROGRAMS # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: libcmis-0.4.1/src/Makefile.am0000644000175000001440000000056112156277657012722 00000000000000SUBDIRS = libcmis libcmis-c if ENABLE_CLIENT AM_CXXFLAGS = -I$(top_srcdir)/src/libcmis/ $(XML2_CFLAGS) $(BOOST_CPPFLAGS) bin_PROGRAMS = cmis-client cmis_client_SOURCES = cmis-client.cxx cmis_client_LDADD = $(top_builddir)/src/libcmis/libcmis-@LIBCMIS_API_VERSION@.la \ $(XML2_LIBS) \ $(BOOST_PROGRAM_OPTIONS_LIBS) \ $(BOOST_DATE_TIME_LIBS) \ $(JSON_LIBS) endif libcmis-0.4.1/src/libcmis/0000755000175000001440000000000012200457455012350 500000000000000libcmis-0.4.1/src/libcmis/oauth2-handler.hxx0000644000175000001440000000567412156277660015662 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2013 Cao Cuong Ngo * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #ifndef _OAUTH2_HANDLER_HXX_ #define _OAUTH2_HANDLER_HXX_ #include #include "base-session.hxx" #include "oauth2-providers.hxx" namespace libcmis { class OAuth2Data; } class OAuth2Handler { private: BaseSession* m_session; libcmis::OAuth2DataPtr m_data; std::string m_access; std::string m_refresh; OAuth2Parser m_oauth2Parser; public: OAuth2Handler( BaseSession* session, libcmis::OAuth2DataPtr data ) throw ( libcmis::Exception ); OAuth2Handler( const OAuth2Handler& copy ); ~OAuth2Handler( ); OAuth2Handler& operator=( const OAuth2Handler& copy ); std::string getAuthURL(); std::string getAccessToken( ) throw ( libcmis::Exception ) ; std::string getRefreshToken( ) throw ( libcmis::Exception ) ; // adding HTTP auth header std::string getHttpHeader( ) throw ( libcmis::Exception ) ; /** Exchange the previously obtained authentication code with the access/refresh tokens. \param authCode the authentication code normally obtained from authenticate method. */ void fetchTokens( std::string authCode ) throw ( libcmis::Exception ); void refresh( ) throw ( libcmis::Exception ); /** Get the authentication code given credentials. This method should be overridden to parse the authentication URL response, authenticate using the form and get the token to avoid asking the user to launch a web browser and do it himself. \return the authentication code to transform into access/refresh tokens. If no code is found, an empty string is returned. */ std::string oauth2Authenticate( ); protected: OAuth2Handler( ); }; #endif /* _OAUTH2_HANDLER_HXX_ */ libcmis-0.4.1/src/libcmis/ws-relatedmultipart.cxx0000644000175000001440000002327312156277660017044 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2011 SUSE * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #include #include #include #include "ws-relatedmultipart.hxx" #include "xml-utils.hxx" using namespace std; using namespace boost::uuids; RelatedPart::RelatedPart( string& name, string& type, string& content ) : m_name( name ), m_contentType( type ), m_content( content ) { } string RelatedPart::toString( string cid ) { string buf; buf += "Content-Id: <" + cid + ">\r\n"; buf += "Content-Type: " + getContentType( ) + "\r\n"; buf += "Content-Transfer-Encoding: binary\r\n\r\n"; buf += getContent( ); return buf; } RelatedMultipart::RelatedMultipart( ) : m_startId( ), m_startInfo( ), m_parts( ), m_boundary( ) { uuid uuid = random_generator()(); m_boundary = "--------uuid:" + to_string( uuid ); } RelatedMultipart::RelatedMultipart( const string& body, const string& contentType ) : m_startId( ), m_startInfo( ), m_parts( ), m_boundary( ) { // Parse the content-type size_t lastPos = 0; size_t pos = contentType.find_first_of( ";\"" ); while ( pos != string::npos ) { bool escaped = contentType[pos] == '"'; if ( escaped ) { // Look for the closing quote and then look for the ; after it pos = contentType.find( "\"", pos + 1 ); pos = contentType.find( ";", pos + 1 ); } string param = contentType.substr( lastPos, pos - lastPos ); size_t eqPos = param.find( "=" ); if ( eqPos != string::npos ) { string name = param.substr( 0, eqPos ); string value = param.substr( eqPos + 1 ); if ( value[0] == '"' && value[value.length() - 1] == '"' ) value = value.substr( 1, value.length( ) - 2 ); name = libcmis::trim( name ); if ( name == "start" ) { m_startId = value; // Remove the '<' '>' around the id if any if ( m_startId[0] == '<' && m_startId[m_startId.size()-1] == '>' ) m_startId = m_startId.substr( 1, m_startId.size() - 2 ); } else if ( name == "boundary" ) m_boundary = value; else if ( name == "start-info" ) m_startInfo = value; } if ( pos != string::npos ) { lastPos = pos + 1; pos = contentType.find_first_of( ";\"", lastPos ); } } // Parse the multipart string bodyFixed( body ); if ( bodyFixed.find( "--" + m_boundary + "\r\n" ) == 0 ) bodyFixed = "\r\n" + bodyFixed; string boundaryString( "\r\n--" + m_boundary + "\r\n" ); string endBoundaryString( "\r\n--" + m_boundary + "--" ); string headerSeparator( "\r\n\r\n" ); lastPos = 0; pos = bodyFixed.find( boundaryString ); while ( pos != string::npos ) { string part = bodyFixed.substr( lastPos, pos - lastPos ); size_t bodyPos = part.find( headerSeparator ); if ( bodyPos != string::npos ) { string headers = part.substr( 0, bodyPos ); string partBody = part.substr( bodyPos + headerSeparator.length( ) ); string cid; string type; do { string headerSep( "\r\n" ); size_t headerEndPos = headers.find( headerSep ); string header = headers.substr( 0, headerEndPos ); if ( headerEndPos != string::npos ) headers = headers.substr( headerEndPos + headerSep.length( ) ); else headers.clear( ); size_t colonPos = header.find( ":" ); string headerName = header.substr( 0, colonPos ); string headerValue = header.substr( colonPos + 1 ); if ( libcmis::tolower( headerName ) == libcmis::tolower( "Content-Id" ) ) { cid = libcmis::trim( headerValue ); // Remove the '<' '>' around the id if any if ( cid[0] == '<' && cid[cid.size()-1] == '>' ) cid = cid.substr( 1, cid.size() - 2 ); } else if ( headerName == "Content-Type" ) type = libcmis::trim( headerValue ); // TODO Handle the Content-Transfer-Encoding } while ( !headers.empty( ) ); if ( !cid.empty() && !type.empty( ) ) { string name; RelatedPartPtr relatedPart( new RelatedPart( name, type, partBody ) ); m_parts[cid] = relatedPart; } } lastPos = pos + boundaryString.length( ); pos = bodyFixed.find( boundaryString, lastPos ); if ( pos == string::npos ) pos = bodyFixed.find( endBoundaryString, lastPos ); } } vector< string > RelatedMultipart::getIds( ) { vector< string > ids; for ( map< string, RelatedPartPtr >::iterator it = m_parts.begin( ); it != m_parts.end( ); ++it ) { ids.push_back( it->first ); } return ids; } RelatedPartPtr RelatedMultipart::getPart( string& cid ) { RelatedPartPtr part; map< string, RelatedPartPtr >::iterator it = m_parts.find( cid ); if ( it != m_parts.end( ) ) part = it->second; return part; } string RelatedMultipart::addPart( RelatedPartPtr part ) { string cid = createPartId( part->getName( ) ); m_parts[cid] = part; return cid; } void RelatedMultipart::setStart( string& cid, string& startInfo ) { RelatedPartPtr start = getPart( cid ); if ( start.get( ) != NULL ) { m_startId = cid; m_startInfo = startInfo; } } string RelatedMultipart::getContentType( ) { string type = "multipart/related;"; RelatedPartPtr start = getPart( getStartId( ) ); if ( start.get( ) != NULL ) { type += "start=\"" + getStartId( ) + "\";"; string startType = start->getContentType( ); size_t pos = startType.find( ";" ); if ( pos != string::npos ) startType = startType.substr( 0, pos ); type += "type=\"" + startType + "\";"; } type += "boundary=\"" + m_boundary + "\";"; type += "start-info=\"" + m_startInfo + "\""; return type; } boost::shared_ptr< istringstream > RelatedMultipart::toStream( ) { string buf; // Output the start part first buf += "\r\n--" + m_boundary + "\r\n"; RelatedPartPtr part = getPart( getStartId( ) ); if ( part.get( ) != NULL ) { buf += part->toString( getStartId( ) ); } for ( map< string, RelatedPartPtr >::iterator it = m_parts.begin( ); it != m_parts.end( ); ++it ) { if ( it->first != getStartId( ) ) { buf += "\r\n--" + m_boundary + "\r\n"; buf += it->second->toString( it->first ); } } buf += "\r\n--" + m_boundary + "--\r\n"; boost::shared_ptr< istringstream > is( new istringstream( buf ) ); return is; } string RelatedMultipart::createPartId( const string& name ) { string cid( name + "*" ); // Generate the UUID part of the id uuid uuid = random_generator()(); cid += to_string( uuid ); cid += "@libcmis.sourceforge.net"; return cid; } boost::shared_ptr< istream > getStreamFromNode( xmlNodePtr node, RelatedMultipart& multipart ) { boost::shared_ptr< stringstream > stream; for ( xmlNodePtr child = node->children; child; child = child->next ) { if ( xmlStrEqual( child->name, BAD_CAST( "Include" ) ) ) { // Get the content from the multipart xmlChar* value = xmlGetProp( child, BAD_CAST( "href" ) ); string href( ( char* )value ); xmlFree( value ); // Get the Content ID from the href (cid:content-id) string id = href; if ( href.substr( 0, 4 ) == "cid:" ) { id = href.substr( 4 ); // URL-decode the id id = libcmis::unescape( id ); } RelatedPartPtr part = multipart.getPart( id ); if ( part != NULL ) stream.reset( new stringstream( part->getContent( ) ) ); } } // If there was no xop:Include, then use the content as base64 data if ( stream.get( ) == NULL ) { xmlChar* content = xmlNodeGetContent( node ); stream.reset( new stringstream( ) ); libcmis::EncodedData decoder( stream.get( ) ); decoder.setEncoding( "base64" ); decoder.decode( ( void* )content, 1, xmlStrlen( content ) ); decoder.finish( ); xmlFree( content ); } return stream; } libcmis-0.4.1/src/libcmis/atom-session.cxx0000644000175000001440000002224512173212453015436 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2011 SUSE * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #include #include #include #include #include "atom-document.hxx" #include "atom-folder.hxx" #include "atom-object-type.hxx" #include "atom-session.hxx" #include "xml-utils.hxx" using namespace std; AtomPubSession::AtomPubSession( string atomPubUrl, string repositoryId, string username, string password, bool noSslCheck, libcmis::OAuth2DataPtr oauth2, bool verbose ) throw ( libcmis::Exception ) : BaseSession( atomPubUrl, repositoryId, username, password, noSslCheck, oauth2, verbose ), m_repository( ) { initialize( ); } AtomPubSession::AtomPubSession( const AtomPubSession& copy ) : BaseSession( copy ), m_repository( copy.m_repository ) { } AtomPubSession::AtomPubSession( ) : BaseSession( ), m_repository( ) { } AtomPubSession& AtomPubSession::operator=( const AtomPubSession& copy ) { if ( this != © ) { BaseSession::operator=( copy ); m_repository = copy.m_repository; } return *this; } AtomPubSession::~AtomPubSession( ) { } void AtomPubSession::parseServiceDocument( const string& buf ) throw ( libcmis::Exception ) { // parse the content xmlDocPtr doc = xmlReadMemory( buf.c_str(), buf.size(), m_bindingUrl.c_str(), NULL, 0 ); if ( NULL != doc ) { // Check that we have an AtomPub service document xmlNodePtr root = xmlDocGetRootElement( doc ); if ( !xmlStrEqual( root->name, BAD_CAST( "service" ) ) ) throw libcmis::Exception( "Not an atompub service document" ); xmlXPathContextPtr xpathCtx = xmlXPathNewContext( doc ); // Register the Service Document namespaces libcmis::registerNamespaces( xpathCtx ); if ( NULL != xpathCtx ) { string workspacesXPath( "//app:workspace" ); xmlXPathObjectPtr xpathObj = xmlXPathEvalExpression( BAD_CAST( workspacesXPath.c_str() ), xpathCtx ); if ( xpathObj != NULL ) { int nbWorkspaces = 0; if ( xpathObj->nodesetval ) nbWorkspaces = xpathObj->nodesetval->nodeNr; for ( int i = 0; i < nbWorkspaces; i++ ) { try { AtomRepositoryPtr ws( new AtomRepository( xpathObj->nodesetval->nodeTab[i] ) ); // Check if we have a repository set if ( m_repositoryId.empty( ) && i == 0 ) m_repositoryId = ws->getId( ); // SharePoint is case insensitive for the id... if ( libcmis::tolower( ws->getId( ) ) == libcmis::tolower( m_repositoryId ) ) m_repository = ws; m_repositories.push_back( ws ); } catch ( const libcmis::Exception& ) { // Invalid repository, don't take care of this } } } } xmlXPathFreeContext( xpathCtx ); } else throw libcmis::Exception( "Failed to parse service document" ); xmlFreeDoc( doc ); } void AtomPubSession::initialize( ) throw ( libcmis::Exception ) { if ( m_repositories.empty() ) { // Pull the content from sAtomPubUrl string buf; try { buf = httpGetRequest( m_bindingUrl )->getStream( )->str( ); } catch ( const CurlException& e ) { throw e.getCmisException( ); } parseServiceDocument( buf ); } } AtomRepositoryPtr AtomPubSession::getAtomRepository( ) throw ( libcmis::Exception ) { return m_repository; } libcmis::RepositoryPtr AtomPubSession::getRepository( ) throw ( libcmis::Exception ) { return getAtomRepository( ); } bool AtomPubSession::setRepository( string repositoryId ) { vector< libcmis::RepositoryPtr > repos = getRepositories( ); bool found = false; for ( vector< libcmis::RepositoryPtr >::iterator it = repos.begin(); it != repos.end() && !found; ++it ) { libcmis::RepositoryPtr repo = *it; if ( repo->getId() == repositoryId ) { AtomRepositoryPtr atomRepo = boost::dynamic_pointer_cast< AtomRepository >( repo ); m_repository = atomRepo; m_repositoryId = repositoryId; found = true; } } return found; } libcmis::ObjectPtr AtomPubSession::createObjectFromEntryDoc( xmlDocPtr doc ) { libcmis::ObjectPtr cmisObject; if ( NULL != doc ) { // Get the atom:entry node xmlXPathContextPtr xpathCtx = xmlXPathNewContext( doc ); libcmis::registerNamespaces( xpathCtx ); if ( NULL != xpathCtx ) { const string& entriesReq( "//atom:entry" ); xmlXPathObjectPtr xpathObj = xmlXPathEvalExpression( BAD_CAST( entriesReq.c_str() ), xpathCtx ); if ( NULL != xpathObj && NULL != xpathObj->nodesetval && ( 0 < xpathObj->nodesetval->nodeNr ) ) { // Get the entry's base type string baseTypeReq = "//atom:entry[1]//cmis:propertyId[@propertyDefinitionId='cmis:baseTypeId']/cmis:value/text()"; string baseType = libcmis::getXPathValue( xpathCtx, baseTypeReq ); xmlNodePtr node = xpathObj->nodesetval->nodeTab[0]; if ( baseType == "cmis:folder" ) { cmisObject.reset( new AtomFolder( this, node ) ); } else if ( baseType == "cmis:document" ) { cmisObject.reset( new AtomDocument( this, node ) ); } else { // Not a valid CMIS atom entry... weird } } xmlXPathFreeObject( xpathObj ); } xmlXPathFreeContext( xpathCtx ); } return cmisObject; } libcmis::ObjectPtr AtomPubSession::getObject( string id ) throw ( libcmis::Exception ) { string pattern = getAtomRepository()->getUriTemplate( UriTemplate::ObjectById ); map< string, string > vars; vars[URI_TEMPLATE_VAR_ID] = id; vars[string( "includeAllowableActions" )] = string( "true" ); string url = createUrl( pattern, vars ); try { string buf = httpGetRequest( url )->getStream( )->str( ); xmlDocPtr doc = xmlReadMemory( buf.c_str(), buf.size(), url.c_str(), NULL, 0 ); libcmis::ObjectPtr cmisObject = createObjectFromEntryDoc( doc ); xmlFreeDoc( doc ); return cmisObject; } catch ( const CurlException& e ) { if ( ( e.getErrorCode( ) == CURLE_HTTP_RETURNED_ERROR ) && ( e.getHttpStatus( ) == 404 ) ) { string msg = "No such node: "; msg += id; throw libcmis::Exception( msg, "objectNotFound" ); } else throw e.getCmisException(); } } libcmis::ObjectPtr AtomPubSession::getObjectByPath( string path ) throw ( libcmis::Exception ) { string pattern = getAtomRepository()->getUriTemplate( UriTemplate::ObjectByPath ); map< string, string > vars; vars[URI_TEMPLATE_VAR_PATH] = path; vars[string( "includeAllowableActions" )] = string( "true" ); string url = createUrl( pattern, vars ); try { string buf = httpGetRequest( url )->getStream( )->str( ); xmlDocPtr doc = xmlReadMemory( buf.c_str(), buf.size(), url.c_str(), NULL, 0 ); libcmis::ObjectPtr cmisObject = createObjectFromEntryDoc( doc ); xmlFreeDoc( doc ); return cmisObject; } catch ( const CurlException& e ) { if ( ( e.getErrorCode( ) == CURLE_HTTP_RETURNED_ERROR ) && ( e.getHttpStatus( ) == 404 ) ) { string msg = "No node corresponding to path: "; msg += path; throw libcmis::Exception( msg, "objectNotFound" ); } else throw e.getCmisException(); } } libcmis::ObjectTypePtr AtomPubSession::getType( string id ) throw ( libcmis::Exception ) { libcmis::ObjectTypePtr type( new AtomObjectType( this, id ) ); return type; } libcmis-0.4.1/src/libcmis/libcmis.hxx0000644000175000001440000000276112167544732014460 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2011 SUSE * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #ifndef _LIBCMIS_HXX_ #define _LIBCMIS_HXX_ #include "allowable-actions.hxx" #include "document.hxx" #include "exception.hxx" #include "folder.hxx" #include "oauth2-data.hxx" #include "object-type.hxx" #include "object.hxx" #include "property-type.hxx" #include "property.hxx" #include "rendition.hxx" #include "repository.hxx" #include "session-factory.hxx" #include "session.hxx" #include "xml-utils.hxx" #include "xmlserializable.hxx" #endif libcmis-0.4.1/src/libcmis/oauth2-providers.hxx0000644000175000001440000000450512176731173016246 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2013 Cao Cuong Ngo * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #ifndef _OAUTH2_PROVIDERS_HXX_ #define _OAUTH2_PROVIDERS_HXX_ #include class BaseSession; typedef std::string ( *OAuth2Parser ) ( BaseSession* session, const std::string& authUrl, const std::string& username, const std::string& password ); class OAuth2Providers { public : static std::string OAuth2Gdrive( BaseSession* session, const std::string& authUrl, const std::string& username, const std::string& password ); static std::string OAuth2Alfresco( BaseSession* session, const std::string& authUrl, const std::string& username, const std::string& password ); static OAuth2Parser getOAuth2Parser( const std::string& baseUrl ); /* * Parse the authorization code from the response page * in the input tag, with id = code */ static std::string parseCode ( const char* response ); /* * Parse input values and redirect link from the response page */ static int parseResponse ( const char* response, std::string& post, std::string& link ); }; #endif /* _OAUTH2_PROVIDERS_HXX_ */ libcmis-0.4.1/src/libcmis/ws-soap.cxx0000644000175000001440000002774712046455405014427 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2011 SUSE * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #include #include #include #include #include #include #include "ws-soap.hxx" #include "xml-utils.hxx" using namespace std; using namespace boost::uuids; SoapFault::SoapFault( xmlNodePtr node, SoapResponseFactory* factory ) : exception( ), m_faultcode( ), m_faultstring( ), m_detail( ), m_message( ) { for ( xmlNodePtr child = node->children; child; child = child->next ) { if ( xmlStrEqual( child->name, BAD_CAST( "faultcode" ) ) ) { xmlChar* content = xmlNodeGetContent( child ); xmlChar* prefix = NULL; xmlChar* localName = xmlSplitQName2( content, &prefix ); if (localName == NULL) localName = xmlStrdup( content ); m_faultcode = string( ( char* )localName ); xmlFree( content ); xmlFree( localName ); } else if ( xmlStrEqual( child->name, BAD_CAST( "faultstring" ) ) ) { xmlChar* content = xmlNodeGetContent( child ); m_faultstring = string( ( char* )content ); xmlFree( content ); } else if ( xmlStrEqual( child->name, BAD_CAST( "detail" ) ) ) { m_detail = factory->parseFaultDetail( child ); } } m_message = getFaultcode() + ": " + getFaultstring(); for ( vector< SoapFaultDetailPtr >::const_iterator it = m_detail.begin( ); it != m_detail.end( ); ++it ) { m_message += "\n" + ( *it )->toString( ); } } const char* SoapFault::what( ) const throw ( ) { return m_message.c_str( ); } SoapResponseFactory::SoapResponseFactory( ) : m_mapping( ), m_namespaces( ), m_detailMapping( ), m_session( NULL ) { } SoapResponseFactory::SoapResponseFactory( const SoapResponseFactory& copy ) : m_mapping( copy.m_mapping ), m_namespaces( copy.m_namespaces ), m_detailMapping( copy.m_detailMapping ), m_session( copy.m_session ) { } SoapResponseFactory& SoapResponseFactory::operator=( const SoapResponseFactory& copy ) { if ( this != © ) { m_mapping = copy.m_mapping; m_namespaces = copy.m_namespaces; m_detailMapping = copy.m_detailMapping; m_session = copy.m_session; } return *this; } vector< SoapResponsePtr > SoapResponseFactory::parseResponse( string& xml ) throw ( SoapFault ) { // Create a fake multipart RelatedMultipart multipart; string name = "root"; string type = "text/xml"; string info; RelatedPartPtr part( new RelatedPart( name, type, xml ) ); string cid = multipart.addPart( part ); multipart.setStart( cid, info ); // Then parse it normally return parseResponse( multipart ); } vector< SoapResponsePtr > SoapResponseFactory::parseResponse( RelatedMultipart& multipart ) throw ( SoapFault ) { string xml; RelatedPartPtr part = multipart.getPart( multipart.getStartId( ) ); if ( part.get() != NULL ) xml = part->getContent( ); vector< SoapResponsePtr > responses; xmlDocPtr doc = xmlReadMemory( xml.c_str(), xml.size(), "", NULL, 0 ); if ( NULL != doc ) { xmlXPathContextPtr xpathCtx = xmlXPathNewContext( doc ); libcmis::registerSoapNamespaces( xpathCtx ); for ( map< string, string >::iterator it = m_namespaces.begin( ); it != m_namespaces.end( ); ++it ) { xmlXPathRegisterNs( xpathCtx, BAD_CAST( it->first.c_str() ), BAD_CAST( it->second.c_str( ) ) ); } if ( NULL != xpathCtx ) { string bodyXPath( "//soap-env:Body/*" ); xmlXPathObjectPtr xpathObj = xmlXPathEvalExpression( BAD_CAST( bodyXPath.c_str() ), xpathCtx ); if ( xpathObj != NULL ) { int nbChildren = 0; if ( xpathObj->nodesetval ) nbChildren = xpathObj->nodesetval->nodeNr; for ( int i = 0; i < nbChildren; i++ ) { xmlNodePtr node = xpathObj->nodesetval->nodeTab[i]; // Is it a fault? if ( xmlStrEqual( BAD_CAST( NS_SOAP_ENV_URL ), node->ns->href ) && xmlStrEqual( BAD_CAST( "Fault" ), node->name ) ) { throw SoapFault( node, this ); } SoapResponsePtr response = createResponse( node, multipart ); if ( NULL != response.get( ) ) responses.push_back( response ); } } } xmlXPathFreeContext( xpathCtx ); } xmlFreeDoc( doc ); return responses; } SoapResponsePtr SoapResponseFactory::createResponse( xmlNodePtr node, RelatedMultipart& multipart ) { SoapResponsePtr response; string ns( ( const char* ) node->ns->href ); string name( ( const char* ) node->name ); string id = "{" + ns + "}" + name; map< string, SoapResponseCreator >::iterator it = m_mapping.find( id ); if ( it != m_mapping.end( ) ) { SoapResponseCreator creator = it->second; response = creator( node, multipart, m_session ); } return response; } vector< SoapFaultDetailPtr > SoapResponseFactory::parseFaultDetail( xmlNodePtr node ) { vector< SoapFaultDetailPtr > detail; for ( xmlNodePtr child = node->children; child; child = child->next ) { string ns; if ( child->ns != NULL ) ns = string( ( const char* ) child->ns->href ); string name( ( const char* ) child->name ); string id = "{" + ns + "}" + name; map< string, SoapFaultDetailCreator >::iterator it = m_detailMapping.find( id ); if ( it != m_detailMapping.end( ) ) { SoapFaultDetailCreator creator = it->second; detail.push_back( creator( child ) ); } } return detail; } RelatedMultipart& SoapRequest::getMultipart( string& username, string& password ) { // Generate the envelope and add it to the multipart string envelope = createEnvelope( username, password ); string name( "root" ); string type( "application/xop+xml;charset=UTF-8;type=\"text/xml\"" ); RelatedPartPtr envelopePart( new RelatedPart( name, type, envelope ) ); string rootId = m_multipart.addPart( envelopePart ); // Set the envelope as the start part of the multipart string startInfo( "text/xml" ); m_multipart.setStart( rootId, startInfo ); return m_multipart; } string SoapRequest::createEnvelope( string& username, string& password ) { xmlBufferPtr buf = xmlBufferCreate( ); xmlTextWriterPtr writer = xmlNewTextWriterMemory( buf, 0 ); xmlTextWriterStartDocument( writer, NULL, NULL, NULL ); /* Sample envelope: 2012-06-14T09:20:29Z 2012-06-15T09:20:29Z admin admin 2012-06-14T09:20:29Z */ xmlChar* wsseUrl = BAD_CAST( "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" ); xmlChar* wsuUrl = BAD_CAST( "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" ); // Use an unsecure password transmission (PasswordText) because some clients can't support the PasswordDigest. xmlChar* passTypeStr = BAD_CAST( "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText" ); // Created must be a UTC time with no more than 3 digits fractional seconds. boost::posix_time::ptime created( boost::posix_time::second_clock::universal_time( ) ); boost::posix_time::ptime expires( created ); expires = expires + boost::gregorian::days( 1 ); string createdStr = libcmis::writeDateTime( created ); string expiresStr = libcmis::writeDateTime( expires ); xmlTextWriterStartElement( writer, BAD_CAST( "S:Envelope" ) ); xmlTextWriterWriteAttribute( writer, BAD_CAST( "xmlns:S" ), BAD_CAST( NS_SOAP_ENV_URL ) ); xmlTextWriterWriteAttribute( writer, BAD_CAST( "xmlns:wsu" ), wsuUrl ); xmlTextWriterWriteAttribute( writer, BAD_CAST( "xmlns:wsse" ), wsseUrl ); xmlTextWriterStartElement( writer, BAD_CAST( "S:Header" ) ); // Write out the Basic Security Profile 1.0 compliant headers xmlTextWriterStartElement( writer, BAD_CAST( "wsse:Security" ) ); xmlTextWriterStartElement( writer, BAD_CAST( "wsse:Timestamp" ) ); xmlTextWriterStartElement( writer, BAD_CAST( "wsse:Created" ) ); xmlTextWriterWriteRaw( writer, BAD_CAST( createdStr.c_str( ) ) ); xmlTextWriterEndElement( writer ); // End of Created xmlTextWriterStartElement( writer, BAD_CAST( "wsse:Expires" ) ); xmlTextWriterWriteRaw( writer, BAD_CAST( expiresStr.c_str( ) ) ); xmlTextWriterEndElement( writer ); // End of Expires xmlTextWriterEndElement( writer ); // End of Timestamp xmlTextWriterStartElement( writer, BAD_CAST( "wsse:UsernameToken" ) ); xmlTextWriterWriteElement( writer, BAD_CAST( "wsse:Username" ), BAD_CAST( username.c_str( ) ) ); xmlTextWriterStartElement( writer, BAD_CAST( "wsse:Password" ) ); xmlTextWriterWriteAttribute( writer, BAD_CAST( "Type" ), passTypeStr ); xmlTextWriterWriteRaw( writer, BAD_CAST( password.c_str( ) ) ); xmlTextWriterEndElement( writer ); // End of Password xmlTextWriterStartElement( writer, BAD_CAST( "wsu:Created" ) ); xmlTextWriterWriteRaw( writer, BAD_CAST( createdStr.c_str( ) ) ); xmlTextWriterEndElement( writer ); // End of Created xmlTextWriterEndElement( writer ); // End of UsernameToken xmlTextWriterEndElement( writer ); // End of Security xmlTextWriterEndElement( writer ); // End of S:Header xmlTextWriterStartElement( writer, BAD_CAST( "S:Body" ) ); toXml( writer ); xmlTextWriterEndElement( writer ); // End of S:Body xmlTextWriterEndElement( writer ); // End of S:Envelope xmlTextWriterEndDocument( writer ); string str( ( const char * )xmlBufferContent( buf ) ); xmlFreeTextWriter( writer ); xmlBufferFree( buf ); return str; } libcmis-0.4.1/src/libcmis/base-session.cxx0000644000175000001440000006656112200225477015422 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2011 SUSE * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #include #include #include #include #include #include "base-session.hxx" #include "oauth2-handler.hxx" #include "session-factory.hxx" #include "xml-utils.hxx" using namespace std; namespace { size_t lcl_getHeaders( void *ptr, size_t size, size_t nmemb, void *userdata ) { libcmis::HttpResponse* response = static_cast< libcmis::HttpResponse* >( userdata ); string buf( ( const char* ) ptr, size * nmemb ); size_t sepPos = buf.find( ':' ); if ( sepPos != string::npos ) { string name( buf, 0, sepPos ); string value = buf.substr( sepPos + 1 ); value = libcmis::trim( value ); response->getHeaders()[name] = value; if ( "Content-Transfer-Encoding" == name ) response->getData( )->setEncoding( value ); } return nmemb; } size_t lcl_bufferData( void* buffer, size_t size, size_t nmemb, void* data ) { libcmis::EncodedData* encoded = static_cast< libcmis::EncodedData* >( data ); encoded->decode( buffer, size, nmemb ); return nmemb; } size_t lcl_readStream( void* buffer, size_t size, size_t nmemb, void* data ) { istream& is = *( static_cast< istream* >( data ) ); char* out = ( char * ) buffer; is.read( out, size * nmemb ); return is.gcount( ) / size; } curlioerr lcl_ioctlStream( CURL* /*handle*/, int cmd, void* data ) { curlioerr errCode = CURLIOE_OK; switch ( cmd ) { case CURLIOCMD_RESTARTREAD: { istream& is = *( static_cast< istream* >( data ) ); is.clear( ); is.seekg( 0, ios::beg ); if ( !is.good() ) { fprintf ( stderr, "rewind failed\n" ); errCode = CURLIOE_FAILRESTART; } } break; case CURLIOCMD_NOP: break; default: errCode = CURLIOE_UNKNOWNCMD; } return errCode; } } BaseSession::BaseSession( string bindingUrl, string repositoryId, string username, string password, bool noSslCheck, libcmis::OAuth2DataPtr oauth2, bool verbose ) throw ( libcmis::Exception ) : Session( ), m_curlHandle( NULL ), m_no100Continue( false ), m_oauth2Handler( NULL ), m_bindingUrl( bindingUrl ), m_repositoryId( repositoryId ), m_username( username ), m_password( password ), m_authProvided( false ), m_repositories( ), m_verbose( verbose ), m_noHttpErrors( false ), m_noSSLCheck( noSslCheck ), m_refreshedToken( false ) { curl_global_init( CURL_GLOBAL_ALL ); m_curlHandle = curl_easy_init( ); if ( oauth2 && oauth2->isComplete( ) ){ setOAuth2Data( oauth2 ); } } BaseSession::BaseSession( const BaseSession& copy ) : Session( ), m_curlHandle( NULL ), m_no100Continue( copy.m_no100Continue ), m_oauth2Handler( copy.m_oauth2Handler ), m_bindingUrl( copy.m_bindingUrl ), m_repositoryId( copy.m_repositoryId ), m_username( copy.m_username ), m_password( copy.m_password ), m_authProvided( copy.m_authProvided ), m_repositories( copy.m_repositories ), m_verbose( copy.m_verbose ), m_noHttpErrors( copy.m_noHttpErrors ), m_noSSLCheck( copy.m_noSSLCheck ), m_refreshedToken( false ) { // Not sure how sharing curl handles is safe. curl_global_init( CURL_GLOBAL_ALL ); m_curlHandle = curl_easy_init( ); } BaseSession::BaseSession( ) : Session( ), m_curlHandle( NULL ), m_no100Continue( false ), m_oauth2Handler( NULL ), m_bindingUrl( ), m_repositoryId( ), m_username( ), m_password( ), m_authProvided( false ), m_repositories( ), m_verbose( false ), m_noHttpErrors( false ), m_noSSLCheck( false ), m_refreshedToken( false ) { curl_global_init( CURL_GLOBAL_ALL ); m_curlHandle = curl_easy_init( ); } BaseSession& BaseSession::operator=( const BaseSession& copy ) { if ( this != © ) { m_curlHandle = NULL; m_no100Continue = copy.m_no100Continue; m_oauth2Handler = copy.m_oauth2Handler; m_bindingUrl = copy.m_bindingUrl; m_repositoryId = copy.m_repositoryId; m_username = copy.m_username; m_password = copy.m_password; m_authProvided = copy.m_authProvided; m_repositories = copy.m_repositories; m_verbose = copy.m_verbose; m_noHttpErrors = copy.m_noHttpErrors; m_noSSLCheck = copy.m_noSSLCheck; m_refreshedToken = copy.m_refreshedToken; // Not sure how sharing curl handles is safe. curl_global_init( CURL_GLOBAL_ALL ); m_curlHandle = curl_easy_init( ); } return *this; } BaseSession::~BaseSession( ) { if ( NULL != m_curlHandle ) curl_easy_cleanup( m_curlHandle ); delete( m_oauth2Handler ); } string& BaseSession::getUsername( ) throw ( CurlException ) { checkCredentials( ); return m_username; } string& BaseSession::getPassword( ) throw ( CurlException ) { checkCredentials( ); return m_password; } string BaseSession::createUrl( const string& pattern, map< string, string > variables ) { string url( pattern ); // Decompose the pattern and replace the variables by their values map< string, string >::iterator it = variables.begin( ); while ( it != variables.end( ) ) { string name = "{"; name += it->first; name += "}"; string value = it->second; // Search and replace the variable size_t pos = url.find( name ); if ( pos != string::npos ) { // Escape the URL by chunks url = url.replace( pos, name.size(), libcmis::escape( value ) ); } ++it; } // Cleanup the remaining unset variables size_t pos1 = url.find( '{' ); while ( pos1 != string::npos ) { // look for the closing bracket size_t pos2 = url.find( '}', pos1 ); if ( pos2 != string::npos ) url.erase( pos1, pos2 - pos1 + 1 ); pos1 = url.find( '{', pos1 - 1 ); } return url; } libcmis::HttpResponsePtr BaseSession::httpGetRequest( string url ) throw ( CurlException ) { // Reset the handle for the request curl_easy_reset( m_curlHandle ); initProtocols( ); libcmis::HttpResponsePtr response( new libcmis::HttpResponse( ) ); curl_easy_setopt( m_curlHandle, CURLOPT_WRITEFUNCTION, lcl_bufferData ); curl_easy_setopt( m_curlHandle, CURLOPT_WRITEDATA, response->getData( ).get( ) ); curl_easy_setopt( m_curlHandle, CURLOPT_HEADERFUNCTION, &lcl_getHeaders ); curl_easy_setopt( m_curlHandle, CURLOPT_WRITEHEADER, response.get() ); // fix Cloudoku too many redirects error // note: though curl doc says -1 is the default for MAXREDIRS, the error i got // said it was 0 curl_easy_setopt( m_curlHandle, CURLOPT_MAXREDIRS, 100); try { httpRunRequest( url ); response->getData( )->finish( ); } catch ( const CurlException& e ) { // If the access token is expired, we get 401 error, // Need to use the refresh token to get a new one. if ( getHttpStatus( ) == 401 && !getRefreshToken( ).empty( ) && !m_refreshedToken ) { // Refresh the token m_oauth2Handler->refresh( ); // Resend the query try { // Avoid infinite recursive call m_refreshedToken = true; response = httpGetRequest( url ); m_refreshedToken = false; } catch (const CurlException& ) { throw; } m_refreshedToken = false; } else throw; } m_refreshedToken = false; return response; } libcmis::HttpResponsePtr BaseSession::httpPutRequest( string url, istream& is, vector< string > headers ) throw ( CurlException ) { // Duplicate istream in case we need to retry string isStr( static_cast< stringstream const&>( stringstream( ) << is.rdbuf( ) ).str( ) ); istringstream isOriginal( isStr ), isBackup( isStr ); // Reset the handle for the request curl_easy_reset( m_curlHandle ); initProtocols( ); libcmis::HttpResponsePtr response( new libcmis::HttpResponse( ) ); curl_easy_setopt( m_curlHandle, CURLOPT_WRITEFUNCTION, lcl_bufferData ); curl_easy_setopt( m_curlHandle, CURLOPT_WRITEDATA, response->getData( ).get( ) ); curl_easy_setopt( m_curlHandle, CURLOPT_HEADERFUNCTION, &lcl_getHeaders ); curl_easy_setopt( m_curlHandle, CURLOPT_WRITEHEADER, response.get() ); // Get the stream length is.seekg( 0, ios::end ); long size = is.tellg( ); is.seekg( 0, ios::beg ); curl_easy_setopt( m_curlHandle, CURLOPT_INFILESIZE, size ); curl_easy_setopt( m_curlHandle, CURLOPT_READDATA, &isOriginal ); curl_easy_setopt( m_curlHandle, CURLOPT_READFUNCTION, lcl_readStream ); curl_easy_setopt( m_curlHandle, CURLOPT_UPLOAD, 1 ); curl_easy_setopt( m_curlHandle, CURLOPT_IOCTLFUNCTION, lcl_ioctlStream ); curl_easy_setopt( m_curlHandle, CURLOPT_IOCTLDATA, &isOriginal ); // If we know for sure that 100-Continue won't be accepted, // don't even try with it to save one HTTP request. if ( m_no100Continue ) headers.push_back( "Expect:" ); try { httpRunRequest( url, headers ); response->getData( )->finish(); } catch ( const CurlException& e ) { long status = getHttpStatus( ); /** If we had a HTTP 417 response, this is likely to be due to some HTTP 1.0 proxy / server not accepting the "Expect: 100-continue" header. Try to disable this header and try again. */ if ( status == 417 && !m_no100Continue) { // Remember that we don't want 100-Continue for the future requests m_no100Continue = true; response = httpPutRequest( url, isBackup, headers ); } // If the access token is expired, we get 401 error, // Need to use the refresh token to get a new one. if ( status == 401 && !getRefreshToken( ).empty( ) && !m_refreshedToken ) { // Refresh the token m_oauth2Handler->refresh( ); // Resend the query try { // Avoid infinite recursive call m_refreshedToken = true; response = httpPutRequest( url, isBackup, headers ); m_refreshedToken = false; } catch (const CurlException& ) { m_refreshedToken = false; throw; } } // Has tried but failed if ( ( status != 417 || m_no100Continue ) && ( status != 401 || getRefreshToken( ).empty( ) || m_refreshedToken ) ) throw; } m_refreshedToken = false; return response; } libcmis::HttpResponsePtr BaseSession::httpPostRequest( const string& url, istream& is, const string& contentType, bool redirect ) throw ( CurlException ) { // Duplicate istream in case we need to retry string isStr( static_cast< stringstream const&>( stringstream( ) << is.rdbuf( ) ).str( ) ); istringstream isOriginal( isStr ), isBackup( isStr ); // Reset the handle for the request curl_easy_reset( m_curlHandle ); initProtocols( ); libcmis::HttpResponsePtr response( new libcmis::HttpResponse( ) ); curl_easy_setopt( m_curlHandle, CURLOPT_WRITEFUNCTION, lcl_bufferData ); curl_easy_setopt( m_curlHandle, CURLOPT_WRITEDATA, response->getData( ).get( ) ); curl_easy_setopt( m_curlHandle, CURLOPT_HEADERFUNCTION, &lcl_getHeaders ); curl_easy_setopt( m_curlHandle, CURLOPT_WRITEHEADER, response.get() ); // Get the stream length is.seekg( 0, ios::end ); long size = is.tellg( ); is.seekg( 0, ios::beg ); curl_easy_setopt( m_curlHandle, CURLOPT_POSTFIELDSIZE, size ); curl_easy_setopt( m_curlHandle, CURLOPT_READDATA, &isOriginal ); curl_easy_setopt( m_curlHandle, CURLOPT_READFUNCTION, lcl_readStream ); curl_easy_setopt( m_curlHandle, CURLOPT_POST, 1 ); curl_easy_setopt( m_curlHandle, CURLOPT_IOCTLFUNCTION, lcl_ioctlStream ); curl_easy_setopt( m_curlHandle, CURLOPT_IOCTLDATA, &isOriginal ); vector< string > headers; headers.push_back( string( "Content-Type:" ) + contentType ); // If we know for sure that 100-Continue won't be accepted, // don't even try with it to save one HTTP request. if ( m_no100Continue ) headers.push_back( "Expect:" ); try { httpRunRequest( url, headers, redirect ); response->getData( )->finish(); } catch ( const CurlException& e ) { long status = getHttpStatus( ); /** If we had a HTTP 417 response, this is likely to be due to some HTTP 1.0 proxy / server not accepting the "Expect: 100-continue" header. Try to disable this header and try again. */ if ( status == 417 && !m_no100Continue ) { // Remember that we don't want 100-Continue for the future requests m_no100Continue = true; response = httpPostRequest( url, isBackup, contentType, redirect ); } // If the access token is expired, we get 401 error, // Need to use the refresh token to get a new one. if ( status == 401 && !getRefreshToken( ).empty( ) && !m_refreshedToken ) { // Refresh the token m_oauth2Handler->refresh( ); // Resend the query try { // Avoid infinite recursive call m_refreshedToken = true; response = httpPostRequest( url, isBackup, contentType, redirect ); m_refreshedToken = false; } catch (const CurlException& ) { m_refreshedToken = false; throw; } } // Has tried but failed if ( ( status != 417 || m_no100Continue ) && ( status != 401 || getRefreshToken( ).empty( ) || m_refreshedToken ) ) throw; } m_refreshedToken = false; return response; } void BaseSession::httpDeleteRequest( string url ) throw ( CurlException ) { // Reset the handle for the request curl_easy_reset( m_curlHandle ); initProtocols( ); curl_easy_setopt( m_curlHandle, CURLOPT_CUSTOMREQUEST, "DELETE" ); try { httpRunRequest( url ); } catch ( const CurlException& e ) { // If the access token is expired, we get 401 error, // Need to use the refresh token to get a new one. if ( getHttpStatus( ) == 401 && !getRefreshToken( ).empty( ) && !m_refreshedToken ) { // Refresh the token m_oauth2Handler->refresh( ); // Resend the query try { // Avoid infinite recursive call m_refreshedToken = true; httpDeleteRequest( url ); m_refreshedToken = false; } catch (const CurlException& ) { m_refreshedToken = false; throw; } } else throw; } m_refreshedToken = false; } void BaseSession::checkCredentials( ) throw ( CurlException ) { // Check that we have the complete credentials libcmis::AuthProviderPtr authProvider = libcmis::SessionFactory::getAuthenticationProvider(); if ( authProvider && !m_authProvided && ( m_username.empty() || m_password.empty() ) ) { m_authProvided = authProvider->authenticationQuery( m_username, m_password ); if ( !m_authProvided ) { throw CurlException( "User cancelled authentication request" ); } } } void BaseSession::httpRunRequest( string url, vector< string > headers, bool redirect ) throw ( CurlException ) { // Redirect curl_easy_setopt( m_curlHandle, CURLOPT_FOLLOWLOCATION, redirect); // Activate the cookie engine curl_easy_setopt( m_curlHandle, CURLOPT_COOKIEFILE, "" ); // Grab something from the web curl_easy_setopt( m_curlHandle, CURLOPT_URL, url.c_str() ); // Set the headers struct curl_slist *headers_slist = NULL; for ( vector< string >::iterator it = headers.begin( ); it != headers.end( ); ++it ) headers_slist = curl_slist_append( headers_slist, it->c_str( ) ); // If we are using OAuth2, then add the proper header with token to authenticate // Otherwise, just set the credentials normally using in libcurl options if ( m_oauth2Handler != NULL && !m_oauth2Handler->getHttpHeader( ).empty() ) { headers_slist = curl_slist_append( headers_slist, m_oauth2Handler->getHttpHeader( ).c_str( ) ); } else if ( !getUsername().empty() && !getPassword().empty() ) { curl_easy_setopt( m_curlHandle, CURLOPT_HTTPAUTH, CURLAUTH_ANY ); #if LIBCURL_VERSION_VALUE >= 0x071301 curl_easy_setopt( m_curlHandle, CURLOPT_USERNAME, getUsername().c_str() ); curl_easy_setopt( m_curlHandle, CURLOPT_PASSWORD, getPassword().c_str() ); #else string userpwd = getUsername() + ":" + getPassword(); curl_easy_setopt( m_curlHandle, CURLOPT_USERPWD, userpwd.c_str( ) ); #endif } curl_easy_setopt( m_curlHandle, CURLOPT_HTTPHEADER, headers_slist ); // Set the proxy configuration if any if ( !libcmis::SessionFactory::getProxy( ).empty() ) { curl_easy_setopt( m_curlHandle, CURLOPT_PROXY, libcmis::SessionFactory::getProxy( ).c_str() ); #if LIBCURL_VERSION_VALUE >= 0x071304 curl_easy_setopt( m_curlHandle, CURLOPT_NOPROXY, libcmis::SessionFactory::getNoProxy( ).c_str() ); #endif const string& proxyUser = libcmis::SessionFactory::getProxyUser( ); const string& proxyPass = libcmis::SessionFactory::getProxyPass( ); if ( !proxyUser.empty( ) && !proxyPass.empty( ) ) { curl_easy_setopt( m_curlHandle, CURLOPT_PROXYAUTH, CURLAUTH_ANY ); #if LIBCURL_VERSION_VALUE >= 0X071301 curl_easy_setopt( m_curlHandle, CURLOPT_PROXYUSERNAME, proxyUser.c_str( ) ); curl_easy_setopt( m_curlHandle, CURLOPT_PROXYPASSWORD, proxyPass.c_str( ) ); #else string userpwd = proxyUser + ":" + proxyPass; curl_easy_setopt( m_curlHandle, CURLOPT_PROXYUSERPWD, userpwd.c_str( ) ); #endif } } // Get some feedback when something wrong happens char errBuff[CURL_ERROR_SIZE]; curl_easy_setopt( m_curlHandle, CURLOPT_ERRORBUFFER, errBuff ); // We want to get the response even if there is an Http error if ( !m_noHttpErrors ) curl_easy_setopt( m_curlHandle, CURLOPT_FAILONERROR, 1 ); if ( m_verbose ) curl_easy_setopt( m_curlHandle, CURLOPT_VERBOSE, 1 ); // We want to get the certificate infos in error cases #if LIBCURL_VERSION_VALUE >= 0X071301 curl_easy_setopt( m_curlHandle, CURLOPT_CERTINFO, 1 ); #endif if ( m_noSSLCheck ) { #if LIBCURL_VERSION_VALUE >= 0x070801 curl_easy_setopt(m_curlHandle, CURLOPT_SSL_VERIFYHOST, 0); #endif #if LIBCURL_VERSION_VALUE >= 0x070402 curl_easy_setopt(m_curlHandle, CURLOPT_SSL_VERIFYPEER, 0); #endif } // Perform the query CURLcode errCode = curl_easy_perform( m_curlHandle ); // Free the headers list curl_slist_free_all( headers_slist ); // Process the response bool isHttpError = errCode == CURLE_HTTP_RETURNED_ERROR; if ( CURLE_OK != errCode && !( m_noHttpErrors && isHttpError ) ) { long httpError = 0; curl_easy_getinfo( m_curlHandle, CURLINFO_RESPONSE_CODE, &httpError ); bool errorFixed = false; #if LIBCURL_VERSION_VALUE >= 0X071301 // If we had a bad certificate, then try to get more details if ( CURLE_SSL_CACERT == errCode ) { vector< string > certificates; // We somehow need to rerun the request to get the certificate curl_easy_setopt(m_curlHandle, CURLOPT_SSL_VERIFYHOST, 0); curl_easy_setopt(m_curlHandle, CURLOPT_SSL_VERIFYPEER, 0); errCode = curl_easy_perform( m_curlHandle ); union { struct curl_slist *to_info; struct curl_certinfo *to_certinfo; } ptr; ptr.to_info = NULL; CURLcode res = curl_easy_getinfo(m_curlHandle, CURLINFO_CERTINFO, &ptr.to_info); if ( !res && ptr.to_info ) { // We need the first certificate in the chain only if ( ptr.to_certinfo->num_of_certs > 0 ) { struct curl_slist *slist; string certStart( "Cert:" ); for ( slist = ptr.to_certinfo->certinfo[0]; slist; slist = slist->next ) { string data( slist->data ); size_t startPos = data.find( certStart ); if ( startPos == 0 ) { startPos = certStart.length(); data = data.substr( startPos ); certificates.push_back( data ); } } } } if ( !certificates.empty() ) { libcmis::CertValidationHandlerPtr validationHandler = libcmis::SessionFactory::getCertificateValidationHandler( ); bool ignoreCert = validationHandler && validationHandler->validateCertificate( certificates ); if ( ignoreCert ) { m_noSSLCheck = true; isHttpError = errCode == CURLE_HTTP_RETURNED_ERROR; errorFixed = ( CURLE_OK == errCode || ( m_noHttpErrors && isHttpError ) ); if ( !errorFixed ) curl_easy_getinfo( m_curlHandle, CURLINFO_RESPONSE_CODE, &httpError ); } else { throw CurlException( "Invalid SSL certificate" ); } } } #endif if ( !errorFixed ) throw CurlException( string( errBuff ), errCode, url, httpError ); } } long BaseSession::getHttpStatus( ) { long status = 0; curl_easy_getinfo( m_curlHandle, CURLINFO_RESPONSE_CODE, &status ); return status; } void BaseSession::setOAuth2Data( libcmis::OAuth2DataPtr oauth2 ) throw ( libcmis::Exception ) { m_oauth2Handler = new OAuth2Handler( this, oauth2 ); string authCode; // Try to get the authentication code using the given provider. authCode = m_oauth2Handler->oauth2Authenticate( ); // If that didn't work, call the fallback provider from SessionFactory try { if ( authCode.empty( ) ) { libcmis::OAuth2AuthCodeProvider fallbackProvider = libcmis::SessionFactory::getOAuth2AuthCodeProvider( ); if ( fallbackProvider != NULL ) { char * code = fallbackProvider( m_oauth2Handler->getAuthURL().c_str(), getUsername().c_str(), getPassword().c_str() ); if ( code != NULL ) { authCode = string( code ); free( code ); } } } } catch ( const CurlException& e ) { // Thrown by getUsername() and getPassword() if user cancels the credentials request throw e.getCmisException( ); } // If still no auth code, then raise an exception if ( authCode.empty( ) ) throw libcmis::Exception( "Couldn't get OAuth authentication code", "permissionDenied" ); m_oauth2Handler->fetchTokens( string( authCode ) ); } void BaseSession::setNoSSLCertificateCheck( bool noCheck ) { m_noSSLCheck = noCheck; } vector< libcmis::RepositoryPtr > BaseSession::getRepositories( ) { return m_repositories; } libcmis::FolderPtr BaseSession::getRootFolder() throw ( libcmis::Exception ) { return getFolder( getRootId() ); } libcmis::FolderPtr BaseSession::getFolder( string id ) throw ( libcmis::Exception ) { libcmis::ObjectPtr object = getObject( id ); libcmis::FolderPtr folder = boost::dynamic_pointer_cast< libcmis::Folder >( object ); return folder; } const char* CurlException::what( ) const throw () { if ( !isCancelled( ) ) { stringstream buf; buf << "CURL error - " << ( unsigned int ) m_code << ": "; buf << m_message; m_errorMessage = buf.str( ); return m_errorMessage.c_str( ); } return m_message.c_str( ); } libcmis::Exception CurlException::getCmisException( ) const { string msg; string type( "runtime" ); switch ( m_httpStatus ) { case 400: msg = string( what() ) + string( ": " ) + m_url; type = "invalidArgument"; break; case 401: msg = "Authentication failure"; type = "permissionDenied"; break; case 403: msg = "Invalid credentials"; type = "permissionDenied"; break; case 404: msg = "Invalid URL: " + m_url; type = "objectNotFound"; break; case 405: msg = string( what() ) + string( ": " ) + m_url; type = "notSupported"; break; case 409: msg = "Editing conflict error"; type = "updateConflict"; break; default: msg = what(); if ( !isCancelled( ) ) msg += ": " + m_url; else type = "permissionDenied"; break; } return libcmis::Exception( msg, type ); } void BaseSession::initProtocols( ) { const unsigned long protocols = CURLPROTO_HTTP | CURLPROTO_HTTPS; curl_easy_setopt(m_curlHandle, CURLOPT_PROTOCOLS, protocols); curl_easy_setopt(m_curlHandle, CURLOPT_REDIR_PROTOCOLS, protocols); } string BaseSession::getRefreshToken( ) throw ( libcmis::Exception ) { string refreshToken; if ( m_oauth2Handler ) refreshToken = m_oauth2Handler->getRefreshToken( ); return refreshToken; } libcmis-0.4.1/src/libcmis/object-type.cxx0000644000175000001440000002516312156277660015260 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2011 SUSE * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #include "object-type.hxx" #include "xml-utils.hxx" #include "property.hxx" using namespace std; namespace libcmis { ObjectType::ObjectType( ) : m_refreshTimestamp( 0 ), m_id( ), m_localName( ), m_localNamespace( ), m_displayName( ), m_queryName( ), m_description( ), m_parentTypeId( ), m_baseTypeId( ), m_creatable( false ), m_fileable( false ), m_queryable( false ), m_fulltextIndexed( false ), m_includedInSupertypeQuery( false ), m_controllablePolicy( false ), m_controllableAcl( false ), m_versionable( false ), m_contentStreamAllowed( libcmis::ObjectType::Allowed ), m_propertiesTypes( ) { } ObjectType::ObjectType( xmlNodePtr node ) : m_refreshTimestamp( 0 ), m_id( ), m_localName( ), m_localNamespace( ), m_displayName( ), m_queryName( ), m_description( ), m_parentTypeId( ), m_baseTypeId( ), m_creatable( false ), m_fileable( false ), m_queryable( false ), m_fulltextIndexed( false ), m_includedInSupertypeQuery( false ), m_controllablePolicy( false ), m_controllableAcl( false ), m_versionable( false ), m_contentStreamAllowed( libcmis::ObjectType::Allowed ), m_propertiesTypes( ) { initializeFromNode( node ); } ObjectType::ObjectType( const ObjectType& copy ) : m_refreshTimestamp( copy.m_refreshTimestamp ), m_id( copy.m_id ), m_localName( copy.m_localName ), m_localNamespace( copy.m_localNamespace ), m_displayName( copy.m_displayName ), m_queryName( copy.m_queryName ), m_description( copy.m_description ), m_parentTypeId( copy.m_parentTypeId ), m_baseTypeId( copy.m_baseTypeId ), m_creatable( copy.m_creatable ), m_fileable( copy.m_fileable ), m_queryable( copy.m_queryable ), m_fulltextIndexed( copy.m_fulltextIndexed ), m_includedInSupertypeQuery( copy.m_includedInSupertypeQuery ), m_controllablePolicy( copy.m_controllablePolicy ), m_controllableAcl( copy.m_controllableAcl ), m_versionable( copy.m_versionable ), m_contentStreamAllowed( copy.m_contentStreamAllowed ), m_propertiesTypes( copy.m_propertiesTypes ) { } ObjectType& ObjectType::operator=( const ObjectType& copy ) { if ( this != © ) { m_refreshTimestamp = copy.m_refreshTimestamp; m_id = copy.m_id; m_localName = copy.m_localName; m_localNamespace = copy.m_localNamespace; m_displayName = copy.m_displayName; m_queryName = copy.m_queryName; m_description = copy.m_description; m_parentTypeId = copy.m_parentTypeId; m_baseTypeId = copy.m_baseTypeId; m_creatable = copy.m_creatable; m_fileable = copy.m_fileable; m_queryable = copy.m_queryable; m_fulltextIndexed = copy.m_fulltextIndexed; m_includedInSupertypeQuery = copy.m_includedInSupertypeQuery; m_controllablePolicy = copy.m_controllablePolicy; m_controllableAcl = copy.m_controllableAcl; m_versionable = copy.m_versionable; m_contentStreamAllowed = copy.m_contentStreamAllowed; m_propertiesTypes = copy.m_propertiesTypes; } return *this; } void ObjectType::initializeFromNode( xmlNodePtr typeNode ) { if ( typeNode != NULL ) { for ( xmlNodePtr child = typeNode->children; child; child = child->next ) { xmlChar* content = xmlNodeGetContent( child ); if ( content != NULL ) { string value( ( const char * ) content, xmlStrlen( content ) ); if ( xmlStrEqual( child->name, BAD_CAST( "id" ) ) ) m_id = value; else if ( xmlStrEqual( child->name, BAD_CAST( "localName" ) ) ) m_localName = value; else if ( xmlStrEqual( child->name, BAD_CAST( "localNamespace" ) ) ) m_localNamespace = value; else if ( xmlStrEqual( child->name, BAD_CAST( "displayName" ) ) ) m_displayName = value; else if ( xmlStrEqual( child->name, BAD_CAST( "queryName" ) ) ) m_queryName = value; else if ( xmlStrEqual( child->name, BAD_CAST( "description" ) ) ) m_description = value; else if ( xmlStrEqual( child->name, BAD_CAST( "baseId" ) ) ) m_baseTypeId = value; else if ( xmlStrEqual( child->name, BAD_CAST( "parentId" ) ) ) m_parentTypeId = value; else if ( xmlStrEqual( child->name, BAD_CAST( "creatable" ) ) ) m_creatable = libcmis::parseBool( value ); else if ( xmlStrEqual( child->name, BAD_CAST( "fileable" ) ) ) m_fileable = libcmis::parseBool( value ); else if ( xmlStrEqual( child->name, BAD_CAST( "queryable" ) ) ) m_queryable = libcmis::parseBool( value ); else if ( xmlStrEqual( child->name, BAD_CAST( "fulltextIndexed" ) ) ) m_fulltextIndexed = libcmis::parseBool( value ); else if ( xmlStrEqual( child->name, BAD_CAST( "includedInSupertypeQuery" ) ) ) m_includedInSupertypeQuery = libcmis::parseBool( value ); else if ( xmlStrEqual( child->name, BAD_CAST( "controllablePolicy" ) ) ) m_controllablePolicy = libcmis::parseBool( value ); else if ( xmlStrEqual( child->name, BAD_CAST( "controllableACL" ) ) ) m_controllableAcl = libcmis::parseBool( value ); else if ( xmlStrEqual( child->name, BAD_CAST( "versionable" ) ) ) m_versionable = libcmis::parseBool( value ); else if ( xmlStrEqual( child->name, BAD_CAST( "contentStreamAllowed" ) ) ) { libcmis::ObjectType::ContentStreamAllowed streamAllowed = libcmis::ObjectType::Allowed; if ( value == "notallowed" ) streamAllowed = libcmis::ObjectType::NotAllowed; else if ( value == "required" ) streamAllowed = libcmis::ObjectType::Required; m_contentStreamAllowed = streamAllowed; } else { libcmis::PropertyTypePtr type( new libcmis::PropertyType( child ) ); m_propertiesTypes[ type->getId() ] = type; } xmlFree( content ); } } m_refreshTimestamp = time( NULL ); } } void ObjectType::refresh( ) throw ( Exception ) { } ObjectTypePtr ObjectType::getParentType( ) throw ( Exception ) { ObjectTypePtr empty; return empty; } ObjectTypePtr ObjectType::getBaseType( ) throw ( Exception ) { ObjectTypePtr empty; return empty; } vector< ObjectTypePtr > ObjectType::getChildren( ) throw ( Exception ) { vector< ObjectTypePtr > empty; return empty; } string ObjectType::toString( ) { stringstream buf; buf << "Type Description:" << endl << endl; buf << "Id: " << getId( ) << endl; buf << "Display name: " << getDisplayName( ) << endl; buf << "Parent type: " << m_parentTypeId << endl; buf << "Base type: " << m_baseTypeId << endl; buf << "Children types [(id) Name]: " << endl; try { vector< libcmis::ObjectTypePtr > children = getChildren( ); for ( vector< libcmis::ObjectTypePtr >::iterator it = children.begin(); it != children.end(); ++it ) { libcmis::ObjectTypePtr type = *it; buf << " (" << type->getId( ) << ")\t" << type->getDisplayName( ) << endl; } } catch ( const libcmis::Exception& ) { // Ignore it } buf << "Creatable: " << isCreatable( ) << endl; buf << "Fileable: " << isFileable( ) << endl; buf << "Queryable: " << isQueryable( ) << endl; buf << "Full text indexed: " << isFulltextIndexed( ) << endl; buf << "Included in supertype query: " << isIncludedInSupertypeQuery( ) << endl; buf << "Controllable policy: " << isControllablePolicy( ) << endl; buf << "Controllable ACL: " << isControllableACL( ) << endl; buf << "Versionable: " << isVersionable( ) << endl; buf << "Property Definitions [RO/RW (id) Name]: " << endl; map< string, libcmis::PropertyTypePtr > propsTypes = getPropertiesTypes( ); for ( map< string, libcmis::PropertyTypePtr >::iterator it = propsTypes.begin( ); it != propsTypes.end( ); ++it ) { libcmis::PropertyTypePtr propType = it->second; string updatable( "RO" ); if ( propType->isUpdatable( ) ) updatable = string( "RW" ); buf << " " << updatable << "\t (" << propType->getId( ) << ")\t" << propType->getDisplayName( ) << endl; } return buf.str(); } } libcmis-0.4.1/src/libcmis/ws-navigationservice.cxx0000644000175000001440000000556512025555356017202 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2011 SUSE * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #include "ws-navigationservice.hxx" #include "ws-requests.hxx" #include "ws-session.hxx" using namespace std; NavigationService::NavigationService( WSSession* session ) : m_session( session ), m_url( session->getServiceUrl( "NavigationService" ) ) { } NavigationService::NavigationService( const NavigationService& copy ) : m_session( copy.m_session ), m_url( copy.m_url ) { } NavigationService::~NavigationService( ) { } NavigationService& NavigationService::operator=( const NavigationService& copy ) { if ( this != © ) { m_session = copy.m_session; m_url = copy.m_url; } return *this; } vector< libcmis::FolderPtr > NavigationService::getObjectParents( std::string repoId, std::string objectId ) throw ( libcmis::Exception ) { vector< libcmis::FolderPtr > parents; GetObjectParents request( repoId, objectId ); vector< SoapResponsePtr > responses = m_session->soapRequest( m_url, request ); if ( responses.size( ) == 1 ) { SoapResponse* resp = responses.front( ).get( ); GetObjectParentsResponse* response = dynamic_cast< GetObjectParentsResponse* >( resp ); if ( response != NULL ) parents = response->getParents( ); } return parents; } vector< libcmis::ObjectPtr > NavigationService::getChildren( string repoId, string folderId ) throw ( libcmis::Exception ) { vector< libcmis::ObjectPtr > children; GetChildren request( repoId, folderId ); vector< SoapResponsePtr > responses = m_session->soapRequest( m_url, request ); if ( responses.size( ) == 1 ) { SoapResponse* resp = responses.front( ).get( ); GetChildrenResponse* response = dynamic_cast< GetChildrenResponse* >( resp ); if ( response != NULL ) children = response->getChildren( ); } return children; } libcmis-0.4.1/src/libcmis/session-factory.cxx0000644000175000001440000001017312175751364016155 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2011 SUSE * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #include "atom-session.hxx" #include "gdrive-session.hxx" #include "session-factory.hxx" #include "ws-session.hxx" using namespace std; namespace libcmis { AuthProviderPtr SessionFactory::s_authProvider; OAuth2AuthCodeProvider SessionFactory::s_oauth2AuthCodeProvider; string SessionFactory::s_proxy; string SessionFactory::s_noProxy; string SessionFactory::s_proxyUser; string SessionFactory::s_proxyPass; CertValidationHandlerPtr SessionFactory::s_certValidationHandler; void SessionFactory::setProxySettings( string proxy, string noProxy, string proxyUser, string proxyPass ) { SessionFactory::s_proxy = proxy; SessionFactory::s_noProxy = noProxy; SessionFactory::s_proxyUser = proxyUser; SessionFactory::s_proxyPass = proxyPass; } Session* SessionFactory::createSession( string bindingUrl, string username, string password, string repository, bool noSslCheck, libcmis::OAuth2DataPtr oauth2, bool verbose ) throw ( Exception ) { Session* session = NULL; if ( !bindingUrl.empty( ) ) { // Try the special cases based on the binding URL if ( bindingUrl == "https://www.googleapis.com/drive/v2" ) { session = new GDriveSession( bindingUrl, username, password, oauth2, verbose ); } else { // Try the CMIS cases: we need to autodetect the binding type try { session = new AtomPubSession( bindingUrl, repository, username, password, noSslCheck, oauth2, verbose ); } catch ( const Exception& e ) { if ( e.getType( ) == "permissionDenied" ) throw; } if ( session == NULL ) { // We couldn't get an AtomSession, we may have an URL for the WebService binding try { session = new WSSession( bindingUrl, repository, username, password, noSslCheck, oauth2, verbose ); } catch ( const Exception& e ) { if ( e.getType( ) == "permissionDenied" ) throw; } } } } return session; } vector< RepositoryPtr > SessionFactory::getRepositories( string bindingUrl, string username, string password, bool verbose ) throw ( Exception ) { vector< RepositoryPtr > repos; Session* session = createSession( bindingUrl, username, password, string(), false, OAuth2DataPtr(), verbose ); if ( session != NULL ) { repos = session->getRepositories( ); delete session; } return repos; } } libcmis-0.4.1/src/libcmis/atom-object-type.hxx0000644000175000001440000000432212013207335016175 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2011 SUSE * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #ifndef _ATOM_OBJECT_TYPE_HXX_ #define _ATOM_OBJECT_TYPE_HXX_ #include "atom-session.hxx" #include "object-type.hxx" class AtomObjectType : public libcmis::ObjectType { private: AtomPubSession* m_session; std::string m_selfUrl; std::string m_childrenUrl; public: AtomObjectType( AtomPubSession* session, std::string id ) throw ( libcmis::Exception ); AtomObjectType( AtomPubSession* session, xmlNodePtr node ) throw ( libcmis::Exception ); AtomObjectType( const AtomObjectType& copy ); virtual ~AtomObjectType( ); AtomObjectType& operator=( const AtomObjectType& copy ); virtual void refresh( ) throw ( libcmis::Exception ) { refreshImpl( NULL ); } virtual libcmis::ObjectTypePtr getParentType( ) throw ( libcmis::Exception ); virtual libcmis::ObjectTypePtr getBaseType( ) throw ( libcmis::Exception ); virtual std::vector< libcmis::ObjectTypePtr > getChildren( ) throw ( libcmis::Exception ); private: void refreshImpl( xmlDocPtr doc ) throw ( libcmis::Exception ); void extractInfos( xmlDocPtr doc ) throw ( libcmis::Exception ); }; #endif libcmis-0.4.1/src/libcmis/ws-requests.hxx0000644000175000001440000005222412177715320015331 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2011 SUSE * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #ifndef _WS_REQUESTS_HXX_ #define _WS_REQUESTS_HXX_ #include #include #include #include #include #include #include #include "document.hxx" #include "exception.hxx" #include "folder.hxx" #include "object.hxx" #include "object-type.hxx" #include "repository.hxx" #include "ws-soap.hxx" class CmisSoapFaultDetail : public SoapFaultDetail { private: std::string m_type; long m_code; std::string m_message; CmisSoapFaultDetail( xmlNodePtr node ); public: ~CmisSoapFaultDetail( ) throw ( ) { }; std::string getType( ) { return m_type; } int getCode( ) { return m_code; } std::string getMessage( ) { return m_message; } libcmis::Exception toException( ); static SoapFaultDetailPtr create( xmlNodePtr node ); }; boost::shared_ptr< libcmis::Exception > getCmisException( const SoapFault& fault ); void writeCmismStream( xmlTextWriterPtr writer, RelatedMultipart& multipart, boost::shared_ptr< std::ostream >, std::string& contentType, std::string filename ); /** getRepositories request. */ class GetRepositories : public SoapRequest { public: GetRepositories( ) { }; ~GetRepositories( ) { }; void toXml( xmlTextWriterPtr writer ); }; class GetRepositoriesResponse : public SoapResponse { private: std::map< std::string, std::string > m_repositories; GetRepositoriesResponse( ) : SoapResponse( ), m_repositories( ) { }; public: /** Parse cmism:getRepositoriesResponse. This function assumes that the node is the expected one: this is normally ensured by the SoapResponseFactory. */ static SoapResponsePtr create( xmlNodePtr node, RelatedMultipart& multipart, SoapSession* session ); std::map< std::string, std::string > getRepositories( ) { return m_repositories; } }; class GetRepositoryInfo : public SoapRequest { private: std::string m_id; public: GetRepositoryInfo( std::string id ) : m_id( id ) { }; ~GetRepositoryInfo( ) { }; void toXml( xmlTextWriterPtr writer ); }; class GetRepositoryInfoResponse : public SoapResponse { private: libcmis::RepositoryPtr m_repository; GetRepositoryInfoResponse( ) : SoapResponse( ), m_repository( ) { }; public: /** Parse cmism:getRepositoriesResponse. This function assumes that the node is the expected one: this is normally ensured by the SoapResponseFactory. */ static SoapResponsePtr create( xmlNodePtr node, RelatedMultipart& multipart, SoapSession* session ); libcmis::RepositoryPtr getRepository( ) { return m_repository; } }; class GetTypeDefinition : public SoapRequest { private: std::string m_repositoryId; std::string m_typeId; public: GetTypeDefinition( std::string repoId, std::string typeId ) : m_repositoryId( repoId ), m_typeId( typeId ) { } ~GetTypeDefinition( ) { } void toXml( xmlTextWriterPtr writer ); }; class GetTypeDefinitionResponse : public SoapResponse { private: libcmis::ObjectTypePtr m_type; GetTypeDefinitionResponse( ) : SoapResponse( ), m_type( ) { } public: /** Parse cmism:getTypeDefinitionResponse. This function assumes that the node is the expected one: this is normally ensured by the SoapResponseFactory. */ static SoapResponsePtr create( xmlNodePtr node, RelatedMultipart& multipart, SoapSession* session ); libcmis::ObjectTypePtr getType( ) { return m_type; } }; class GetTypeChildren : public SoapRequest { private: std::string m_repositoryId; std::string m_typeId; public: GetTypeChildren( std::string repoId, std::string typeId ) : m_repositoryId( repoId ), m_typeId( typeId ) { } ~GetTypeChildren( ) { } void toXml( xmlTextWriterPtr writer ); }; class GetTypeChildrenResponse : public SoapResponse { private: std::vector< libcmis::ObjectTypePtr > m_children; GetTypeChildrenResponse( ) : SoapResponse( ), m_children( ) { } public: /** Parse cmism:getTypeChildrenResponse. This function assumes that the node is the expected one: this is normally ensured by the SoapResponseFactory. */ static SoapResponsePtr create( xmlNodePtr node, RelatedMultipart& multipart, SoapSession* session ); std::vector< libcmis::ObjectTypePtr > getChildren( ) { return m_children; } }; #undef GetObject class GetObject : public SoapRequest { private: std::string m_repositoryId; std::string m_id; public: GetObject( std::string repoId, std::string id ) : m_repositoryId( repoId ), m_id( id ) { } ~GetObject( ) { } void toXml( xmlTextWriterPtr writer ); }; class GetObjectResponse : public SoapResponse { private: libcmis::ObjectPtr m_object; GetObjectResponse( ) : SoapResponse( ), m_object( ) { } public: /** Parse cmism:getObjectResponse. This function assumes that the node is the expected one: this is normally ensured by the SoapResponseFactory. */ static SoapResponsePtr create( xmlNodePtr node, RelatedMultipart& multipart, SoapSession* session ); libcmis::ObjectPtr getObject( ) { return m_object; } }; class GetObjectByPath : public SoapRequest { private: std::string m_repositoryId; std::string m_path; public: GetObjectByPath( std::string repoId, std::string path ) : m_repositoryId( repoId ), m_path( path ) { } ~GetObjectByPath( ) { } void toXml( xmlTextWriterPtr writer ); }; class UpdateProperties : public SoapRequest { private: std::string m_repositoryId; std::string m_objectId; const std::map< std::string, libcmis::PropertyPtr >& m_properties; std::string m_changeToken; public: UpdateProperties( std::string repoId, std::string objectId, const std::map< std::string, libcmis::PropertyPtr >& properties, std::string changeToken ) : m_repositoryId( repoId ), m_objectId( objectId ), m_properties( properties ), m_changeToken( changeToken ) { } ~UpdateProperties( ) { } void toXml( xmlTextWriterPtr writer ); }; class UpdatePropertiesResponse : public SoapResponse { private: std::string m_id; UpdatePropertiesResponse( ) : SoapResponse( ), m_id( ) { } public: /** Parse cmism:updatePropertiesResponse. This function assumes that the node is the expected one: this is normally ensured by the SoapResponseFactory. */ static SoapResponsePtr create( xmlNodePtr node, RelatedMultipart& multipart, SoapSession* session ); std::string getObjectId( ) { return m_id; } }; class DeleteObject : public SoapRequest { private: std::string m_repositoryId; std::string m_objectId; bool m_allVersions; public: DeleteObject( std::string repoId, std::string objectId, bool allVersions ) : m_repositoryId( repoId ), m_objectId( objectId ), m_allVersions( allVersions ) { } ~DeleteObject( ) { } void toXml( xmlTextWriterPtr writer ); }; class DeleteTree : public SoapRequest { private: std::string m_repositoryId; std::string m_folderId; bool m_allVersions; libcmis::UnfileObjects::Type m_unfile; bool m_continueOnFailure; public: DeleteTree( std::string repoId, std::string folderId, bool allVersions, libcmis::UnfileObjects::Type unfile, bool continueOnFailure ) : m_repositoryId( repoId ), m_folderId( folderId ), m_allVersions( allVersions ), m_unfile( unfile ), m_continueOnFailure( continueOnFailure ) { } ~DeleteTree( ) { } void toXml( xmlTextWriterPtr writer ); }; class DeleteTreeResponse : public SoapResponse { private: std::vector< std::string > m_failedIds; DeleteTreeResponse( ) : SoapResponse( ), m_failedIds( ) { } public: /** Parse cmism:deleteTreeResponse. This function assumes that the node is the expected one: this is normally ensured by the SoapResponseFactory. */ static SoapResponsePtr create( xmlNodePtr node, RelatedMultipart& multipart, SoapSession* session ); std::vector< std::string > getFailedIds( ) { return m_failedIds; } }; class MoveObject : public SoapRequest { private: std::string m_repositoryId; std::string m_objectId; std::string m_destId; std::string m_srcId; public: MoveObject( std::string repoId, std::string objectId, std::string destId, std::string srcId ) : m_repositoryId( repoId ), m_objectId( objectId ), m_destId( destId ), m_srcId( srcId ) { } ~MoveObject( ) { } void toXml( xmlTextWriterPtr writer ); }; class GetContentStream : public SoapRequest { private: std::string m_repositoryId; std::string m_objectId; public: GetContentStream( std::string repoId, std::string objectId ) : m_repositoryId( repoId ), m_objectId( objectId ) { } ~GetContentStream( ) { } void toXml( xmlTextWriterPtr writer ); }; class GetContentStreamResponse : public SoapResponse { private: boost::shared_ptr< std::istream > m_stream; GetContentStreamResponse( ) : SoapResponse( ), m_stream( ) { } public: /** Parse cmism:getContentStreamResponse. This function assumes that the node is the expected one: this is normally ensured by the SoapResponseFactory. */ static SoapResponsePtr create( xmlNodePtr node, RelatedMultipart& multipart, SoapSession* session ); boost::shared_ptr< std::istream> getStream( ) { return m_stream; } }; class GetObjectParents : public SoapRequest { private: std::string m_repositoryId; std::string m_objectId; public: GetObjectParents( std::string repoId, std::string objectId ) : m_repositoryId( repoId ), m_objectId( objectId ) { } ~GetObjectParents( ) { } void toXml( xmlTextWriterPtr writer ); }; class GetObjectParentsResponse : public SoapResponse { private: std::vector< libcmis::FolderPtr > m_parents; GetObjectParentsResponse( ) : SoapResponse( ), m_parents( ) { } public: /** Parse cmism:getObjectParentsResponse. This function assumes that the node is the expected one: this is normally ensured by the SoapResponseFactory. */ static SoapResponsePtr create( xmlNodePtr node, RelatedMultipart& multipart, SoapSession* session ); std::vector< libcmis::FolderPtr > getParents( ) { return m_parents; } }; class GetChildren : public SoapRequest { private: std::string m_repositoryId; std::string m_folderId; public: GetChildren( std::string repoId, std::string folderId ) : m_repositoryId( repoId ), m_folderId( folderId ) { } ~GetChildren( ) { } void toXml( xmlTextWriterPtr writer ); }; class GetChildrenResponse : public SoapResponse { private: std::vector< libcmis::ObjectPtr > m_children; GetChildrenResponse( ) : SoapResponse( ), m_children( ) { } public: /** Parse cmism:getChildrenResponse. This function assumes that the node is the expected one: this is normally ensured by the SoapResponseFactory. */ static SoapResponsePtr create( xmlNodePtr node, RelatedMultipart& multipart, SoapSession* session ); std::vector< libcmis::ObjectPtr > getChildren( ) { return m_children; } }; class CreateFolder : public SoapRequest { private: std::string m_repositoryId; const std::map< std::string, libcmis::PropertyPtr >& m_properties; std::string m_folderId; public: CreateFolder( std::string repoId, const std::map< std::string, libcmis::PropertyPtr >& properties, std::string folderId ) : m_repositoryId( repoId ), m_properties( properties ), m_folderId( folderId ) { } ~CreateFolder( ) { } void toXml( xmlTextWriterPtr writer ); }; class CreateFolderResponse : public SoapResponse { private: std::string m_id; CreateFolderResponse( ) : SoapResponse( ), m_id( ) { } public: /** Parse cmism:createFolderResponse. This function assumes that the node is the expected one: this is normally ensured by the SoapResponseFactory. */ static SoapResponsePtr create( xmlNodePtr node, RelatedMultipart& multipart, SoapSession* session ); std::string getObjectId( ) { return m_id; } }; class CreateDocument : public SoapRequest { private: std::string m_repositoryId; const std::map< std::string, libcmis::PropertyPtr >& m_properties; std::string m_folderId; boost::shared_ptr< std::ostream > m_stream; std::string m_contentType; std::string m_filename; public: CreateDocument( std::string repoId, const std::map< std::string, libcmis::PropertyPtr >& properties, std::string folderId, boost::shared_ptr< std::ostream > stream, std::string contentType, std::string filename ) : m_repositoryId( repoId ), m_properties( properties ), m_folderId( folderId ), m_stream( stream ), m_contentType( contentType ), m_filename( filename ) { } ~CreateDocument( ) { } void toXml( xmlTextWriterPtr writer ); }; class SetContentStream : public SoapRequest { private: std::string m_repositoryId; std::string m_objectId; bool m_overwrite; std::string m_changeToken; boost::shared_ptr< std::ostream > m_stream; std::string m_contentType; std::string m_filename; public: SetContentStream( std::string repoId, std::string objectId, bool overwrite, std::string changeToken, boost::shared_ptr< std::ostream > stream, std::string contentType, std::string filename ) : m_repositoryId( repoId ), m_objectId( objectId ), m_overwrite( overwrite ), m_changeToken( changeToken ), m_stream( stream ), m_contentType( contentType ), m_filename( filename ) { } ~SetContentStream( ) { } void toXml( xmlTextWriterPtr writer ); }; class GetRenditions : public SoapRequest { private: std::string m_repositoryId; std::string m_objectId; std::string m_filter; public: GetRenditions( std::string repoId, std::string objectId, std::string filter ) : m_repositoryId( repoId ), m_objectId( objectId ), m_filter( filter ) { } ~GetRenditions( ) { } void toXml( xmlTextWriterPtr writer ); }; class GetRenditionsResponse : public SoapResponse { private: std::vector< libcmis::RenditionPtr > m_renditions; GetRenditionsResponse( ) : SoapResponse( ), m_renditions( ) { } public: /** Parse cmism:getRenditionsResponse. This function assumes that the node is the expected one: this is normally ensured by the SoapResponseFactory. */ static SoapResponsePtr create( xmlNodePtr node, RelatedMultipart& multipart, SoapSession* session ); std::vector< libcmis::RenditionPtr > getRenditions( ) { return m_renditions; } }; class CheckOut : public SoapRequest { private: std::string m_repositoryId; std::string m_objectId; public: CheckOut( std::string repoId, std::string objectId ) : m_repositoryId( repoId ), m_objectId( objectId ) { } ~CheckOut( ) { } void toXml( xmlTextWriterPtr writer ); }; class CheckOutResponse : public SoapResponse { private: std::string m_objectId; CheckOutResponse( ) : SoapResponse( ), m_objectId( ) { } public: /** Parse cmism:checkOutResponse. This function assumes that the node is the expected one: this is normally ensured by the SoapResponseFactory. */ static SoapResponsePtr create( xmlNodePtr node, RelatedMultipart& multipart, SoapSession* session ); std::string getObjectId( ) { return m_objectId; } }; class CancelCheckOut : public SoapRequest { private: std::string m_repositoryId; std::string m_objectId; public: CancelCheckOut( std::string repoId, std::string objectId ) : m_repositoryId( repoId ), m_objectId( objectId ) { } ~CancelCheckOut( ) { } void toXml( xmlTextWriterPtr writer ); }; class CheckIn : public SoapRequest { private: std::string m_repositoryId; std::string m_objectId; bool m_isMajor; const std::map< std::string, libcmis::PropertyPtr >& m_properties; boost::shared_ptr< std::ostream > m_stream; std::string m_contentType; std::string m_fileName; std::string m_comment; public: CheckIn( std::string repoId, std::string objectId, bool isMajor, const std::map< std::string, libcmis::PropertyPtr >& properties, boost::shared_ptr< std::ostream > stream, std::string contentType, std::string fileName, std::string comment ) : m_repositoryId( repoId ), m_objectId( objectId ), m_isMajor( isMajor ), m_properties( properties ), m_stream( stream ), m_contentType( contentType ), m_fileName( fileName ), m_comment( comment ) { } ~CheckIn( ) { } void toXml( xmlTextWriterPtr writer ); }; class CheckInResponse : public SoapResponse { private: std::string m_objectId; CheckInResponse( ) : SoapResponse( ), m_objectId( ) { } public: /** Parse cmism:checkInResponse. This function assumes that the node is the expected one: this is normally ensured by the SoapResponseFactory. */ static SoapResponsePtr create( xmlNodePtr node, RelatedMultipart& multipart, SoapSession* session ); std::string getObjectId( ) { return m_objectId; } }; class GetAllVersions : public SoapRequest { private: std::string m_repositoryId; std::string m_objectId; public: GetAllVersions( std::string repoId, std::string objectId ) : m_repositoryId( repoId ), m_objectId( objectId ) { } ~GetAllVersions( ) { } void toXml( xmlTextWriterPtr writer ); }; class GetAllVersionsResponse : public SoapResponse { private: std::vector< libcmis::DocumentPtr > m_objects; GetAllVersionsResponse( ) : SoapResponse( ), m_objects( ) { } public: /** Parse cmism:getAllVersionsResponse. This function assumes that the node is the expected one: this is normally ensured by the SoapResponseFactory. */ static SoapResponsePtr create( xmlNodePtr node, RelatedMultipart& multipart, SoapSession* session ); std::vector< libcmis::DocumentPtr > getObjects( ) { return m_objects; } }; #endif libcmis-0.4.1/src/libcmis/rendition.hxx0000644000175000001440000000564412177740522015030 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2013 Cao Cuong Ngo * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #ifndef _RENDITION_HXX_ #define _RENDITION_HXX_ #include #include #include namespace libcmis { class Rendition { private: Rendition( ); std::string m_streamId; std::string m_mimeType; std::string m_kind; std::string m_href; std::string m_title; long m_length; long m_width; long m_height; std::string m_renditionDocumentId; public: Rendition( std::string streamId, std::string mimeType, std::string kind, std::string href, std::string title = std::string( ), long length = -1, long width = -1, long height = -1, std::string renditionDocumentId = std::string( ) ); /** Parse an XML node of type cmisRenditionType */ Rendition( xmlNodePtr node ); ~Rendition( ); bool isThumbnail( ) { return m_kind == "cmis:thumbnail"; } std::string getStreamId( ) const { return m_streamId; } std::string getMimeType( ) const { return m_mimeType; } std::string getKind( ) const { return m_kind; } std::string getUrl( ) const { return m_href; } std::string getTitle( ) const { return m_title; } /** Provides the stream length in bytes or a negative value if missing. */ long getLength( ) const { return m_length; } long getWidth( ) const { return m_width; } long getHeight( ) const { return m_height; } std::string getRenditionDocumentId( ) { return m_renditionDocumentId; } std::string toString( ); }; typedef ::boost::shared_ptr< Rendition > RenditionPtr; } #endif libcmis-0.4.1/src/libcmis/ws-requests.cxx0000644000175000001440000010237312200150232015303 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2011 SUSE * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #include "ws-document.hxx" #include "ws-folder.hxx" #include "ws-object.hxx" #include "ws-object-type.hxx" #include "ws-requests.hxx" #include "xml-utils.hxx" using namespace std; using libcmis::PropertyPtrMap; CmisSoapFaultDetail::CmisSoapFaultDetail( xmlNodePtr node ) : SoapFaultDetail( ), m_type( ), m_code( 0 ), m_message( ) { // Extract the type, code and message for ( xmlNodePtr child = node->children; child; child = child->next ) { xmlChar* content = xmlNodeGetContent( child ); string value( ( char * )content ); xmlFree( content ); if ( xmlStrEqual( child->name, BAD_CAST( "type" ) ) ) { m_type = value; } else if ( xmlStrEqual( child->name, BAD_CAST( "code" ) ) ) { try { m_code = libcmis::parseInteger( value ); } catch ( const libcmis::Exception& ) { // Simply leave the default error code if unparsable } } else if ( xmlStrEqual( child->name, BAD_CAST( "message" ) ) ) { m_message = value; } } } libcmis::Exception CmisSoapFaultDetail::toException( ) { libcmis::Exception e( m_message, m_type ); return e; } boost::shared_ptr< libcmis::Exception > getCmisException( const SoapFault& fault ) { boost::shared_ptr< libcmis::Exception > exception; vector< SoapFaultDetailPtr > details = fault.getDetail( ); for ( vector< SoapFaultDetailPtr >::iterator it = details.begin( ); it != details.end( ) && exception.get( ) == NULL; ++ it ) { boost::shared_ptr< CmisSoapFaultDetail > cmisDetail = boost::dynamic_pointer_cast< CmisSoapFaultDetail >( *it ); if ( cmisDetail.get( ) != NULL ) exception.reset( new libcmis::Exception( cmisDetail->toException( ) ) ); } return exception; } void writeCmismStream( xmlTextWriterPtr writer, RelatedMultipart& multipart, boost::shared_ptr< ostream > os, string& contentType, string filename ) { // Get the stream as a string istream is( os->rdbuf( ) ); is.seekg( 0, ios::end ); long size = is.tellg( ); is.seekg( 0, ios::beg ); char* buf = new char[ size ]; is.read( buf, size ); string content( buf, size ); delete[ ] buf; xmlTextWriterWriteFormatElement( writer, BAD_CAST( "cmism:length" ), "%ld", static_cast(content.size( )) ); xmlTextWriterWriteElement( writer, BAD_CAST( "cmism:mimeType" ), BAD_CAST( contentType.c_str( ) ) ); if ( !filename.empty( ) ) xmlTextWriterWriteElement( writer, BAD_CAST( "cmism:filename" ), BAD_CAST( filename.c_str( ) ) ); xmlTextWriterStartElement( writer, BAD_CAST( "cmism:stream" ) ); string name( "stream" ); RelatedPartPtr streamPart( new RelatedPart( name, contentType, content ) ); string partHref = "cid:"; partHref += multipart.addPart( streamPart ); xmlTextWriterStartElement( writer, BAD_CAST( "xop:Include" ) ); xmlTextWriterWriteAttribute( writer, BAD_CAST( "xmlns:xop" ), BAD_CAST( "http://www.w3.org/2004/08/xop/include" ) ); xmlTextWriterWriteAttribute( writer, BAD_CAST( "href" ), BAD_CAST( partHref.c_str( ) ) ); xmlTextWriterEndElement( writer ); // xop:Include xmlTextWriterEndElement( writer ); // cmism:stream } SoapFaultDetailPtr CmisSoapFaultDetail::create( xmlNodePtr node ) { return SoapFaultDetailPtr( new CmisSoapFaultDetail( node ) ); } void GetRepositories::toXml( xmlTextWriterPtr writer ) { xmlTextWriterStartElement( writer, BAD_CAST( "cmism:getRepositories" ) ); xmlTextWriterWriteAttribute( writer, BAD_CAST( "xmlns" ), BAD_CAST( NS_CMIS_URL ) ); xmlTextWriterWriteAttribute( writer, BAD_CAST( "xmlns:cmism" ), BAD_CAST( NS_CMISM_URL ) ); xmlTextWriterEndElement( writer ); } SoapResponsePtr GetRepositoriesResponse::create( xmlNodePtr node, RelatedMultipart&, SoapSession* ) { GetRepositoriesResponse* response = new GetRepositoriesResponse( ); // Look for the cmiss:repositories children for ( xmlNodePtr child = node->children; child; child = child->next ) { if ( xmlStrEqual( child->name, BAD_CAST( "repositories" ) ) ) { string id; string name; // Look for repositoryId and repositoryName for ( xmlNodePtr repoChild = child->children; repoChild; repoChild = repoChild->next ) { xmlChar* content = xmlNodeGetContent( repoChild ); string value( ( char* ) content ); xmlFree( content ); if ( xmlStrEqual( repoChild->name, BAD_CAST( "repositoryId" ) ) ) { id = value; } else if ( xmlStrEqual( repoChild->name, BAD_CAST( "repositoryName" ) ) ) { name = value; } } if ( !id.empty( ) ) response->m_repositories[ id ] = name; } } return SoapResponsePtr( response ); } void GetRepositoryInfo::toXml( xmlTextWriterPtr writer ) { xmlTextWriterStartElement( writer, BAD_CAST( "cmism:getRepositoryInfo" ) ); xmlTextWriterWriteAttribute( writer, BAD_CAST( "xmlns" ), BAD_CAST( NS_CMIS_URL ) ); xmlTextWriterWriteAttribute( writer, BAD_CAST( "xmlns:cmism" ), BAD_CAST( NS_CMISM_URL ) ); xmlTextWriterWriteElement( writer, BAD_CAST( "cmism:repositoryId" ), BAD_CAST( m_id.c_str( ) ) ); xmlTextWriterEndElement( writer ); } SoapResponsePtr GetRepositoryInfoResponse::create( xmlNodePtr node, RelatedMultipart&, SoapSession* ) { GetRepositoryInfoResponse* response = new GetRepositoryInfoResponse( ); for ( xmlNodePtr child = node->children; child; child = child->next ) { if ( xmlStrEqual( child->name, BAD_CAST( "repositoryInfo" ) ) ) { libcmis::RepositoryPtr repository( new libcmis::Repository( child ) ); response->m_repository = repository; } } return SoapResponsePtr( response ); } void GetTypeDefinition::toXml( xmlTextWriterPtr writer ) { xmlTextWriterStartElement( writer, BAD_CAST( "cmism:getTypeDefinition" ) ); xmlTextWriterWriteAttribute( writer, BAD_CAST( "xmlns" ), BAD_CAST( NS_CMIS_URL ) ); xmlTextWriterWriteAttribute( writer, BAD_CAST( "xmlns:cmism" ), BAD_CAST( NS_CMISM_URL ) ); xmlTextWriterWriteElement( writer, BAD_CAST( "cmism:repositoryId" ), BAD_CAST( m_repositoryId.c_str( ) ) ); xmlTextWriterWriteElement( writer, BAD_CAST( "cmism:typeId" ), BAD_CAST( m_typeId.c_str( ) ) ); xmlTextWriterEndElement( writer ); } SoapResponsePtr GetTypeDefinitionResponse::create( xmlNodePtr node, RelatedMultipart&, SoapSession* session ) { GetTypeDefinitionResponse* response = new GetTypeDefinitionResponse( ); WSSession* wsSession = dynamic_cast< WSSession* >( session ); for ( xmlNodePtr child = node->children; child; child = child->next ) { if ( xmlStrEqual( child->name, BAD_CAST( "type" ) ) ) { libcmis::ObjectTypePtr type( new WSObjectType( wsSession, child ) ); response->m_type = type; } } return SoapResponsePtr( response ); } void GetTypeChildren::toXml( xmlTextWriterPtr writer ) { xmlTextWriterStartElement( writer, BAD_CAST( "cmism:getTypeChildren" ) ); xmlTextWriterWriteAttribute( writer, BAD_CAST( "xmlns" ), BAD_CAST( NS_CMIS_URL ) ); xmlTextWriterWriteAttribute( writer, BAD_CAST( "xmlns:cmism" ), BAD_CAST( NS_CMISM_URL ) ); xmlTextWriterWriteElement( writer, BAD_CAST( "cmism:repositoryId" ), BAD_CAST( m_repositoryId.c_str( ) ) ); xmlTextWriterWriteElement( writer, BAD_CAST( "cmism:typeId" ), BAD_CAST( m_typeId.c_str( ) ) ); xmlTextWriterWriteElement( writer, BAD_CAST( "cmism:includePropertyDefinitions" ), BAD_CAST( "true" ) ); xmlTextWriterEndElement( writer ); } SoapResponsePtr GetTypeChildrenResponse::create( xmlNodePtr node, RelatedMultipart&, SoapSession* session ) { GetTypeChildrenResponse* response = new GetTypeChildrenResponse( ); WSSession* wsSession = dynamic_cast< WSSession* >( session ); for ( xmlNodePtr child = node->children; child; child = child->next ) { if ( xmlStrEqual( child->name, BAD_CAST( "types" ) ) ) { for ( xmlNodePtr gdchild = child->children; gdchild; gdchild = gdchild->next ) { if ( xmlStrEqual( gdchild->name, BAD_CAST( "types" ) ) ) { libcmis::ObjectTypePtr type( new WSObjectType( wsSession, gdchild ) ); response->m_children.push_back( type ); } } } } return SoapResponsePtr( response ); } void GetObject::toXml( xmlTextWriterPtr writer ) { xmlTextWriterStartElement( writer, BAD_CAST( "cmism:getObject" ) ); xmlTextWriterWriteAttribute( writer, BAD_CAST( "xmlns" ), BAD_CAST( NS_CMIS_URL ) ); xmlTextWriterWriteAttribute( writer, BAD_CAST( "xmlns:cmism" ), BAD_CAST( NS_CMISM_URL ) ); xmlTextWriterWriteElement( writer, BAD_CAST( "cmism:repositoryId" ), BAD_CAST( m_repositoryId.c_str( ) ) ); xmlTextWriterWriteElement( writer, BAD_CAST( "cmism:objectId" ), BAD_CAST( m_id.c_str( ) ) ); xmlTextWriterWriteElement( writer, BAD_CAST( "cmism:includeAllowableActions" ), BAD_CAST( "true" ) ); // Ask for renditions... some servers like Alfresco are providing them only this way // and it saves time (another HTTP request) anyway. xmlTextWriterWriteElement( writer, BAD_CAST( "cmism:renditionFilter" ), BAD_CAST( "*" ) ); xmlTextWriterEndElement( writer ); } SoapResponsePtr GetObjectResponse::create( xmlNodePtr node, RelatedMultipart&, SoapSession* session ) { GetObjectResponse* response = new GetObjectResponse( ); WSSession* wsSession = dynamic_cast< WSSession* >( session ); for ( xmlNodePtr child = node->children; child; child = child->next ) { if ( xmlStrEqual( child->name, BAD_CAST( "object" ) ) ) { libcmis::ObjectPtr object; WSObject tmp( wsSession, child ); if ( tmp.getBaseType( ) == "cmis:folder" ) { object.reset( new WSFolder( tmp ) ); } else if ( tmp.getBaseType( ) == "cmis:document" ) { object.reset( new WSDocument( tmp ) ); } else { // This should never happen... but who knows if the standard is 100% repected? object.reset( new WSObject( wsSession, child ) ); } response->m_object = object; } } return SoapResponsePtr( response ); } void GetObjectByPath::toXml( xmlTextWriterPtr writer ) { xmlTextWriterStartElement( writer, BAD_CAST( "cmism:getObjectByPath" ) ); xmlTextWriterWriteAttribute( writer, BAD_CAST( "xmlns" ), BAD_CAST( NS_CMIS_URL ) ); xmlTextWriterWriteAttribute( writer, BAD_CAST( "xmlns:cmism" ), BAD_CAST( NS_CMISM_URL ) ); xmlTextWriterWriteElement( writer, BAD_CAST( "cmism:repositoryId" ), BAD_CAST( m_repositoryId.c_str( ) ) ); xmlTextWriterWriteElement( writer, BAD_CAST( "cmism:path" ), BAD_CAST( m_path.c_str( ) ) ); xmlTextWriterWriteElement( writer, BAD_CAST( "cmism:includeAllowableActions" ), BAD_CAST( "true" ) ); xmlTextWriterEndElement( writer ); } void UpdateProperties::toXml( xmlTextWriterPtr writer ) { xmlTextWriterStartElement( writer, BAD_CAST( "cmism:updateProperties" ) ); xmlTextWriterWriteAttribute( writer, BAD_CAST( "xmlns:cmis" ), BAD_CAST( NS_CMIS_URL ) ); xmlTextWriterWriteAttribute( writer, BAD_CAST( "xmlns:cmism" ), BAD_CAST( NS_CMISM_URL ) ); xmlTextWriterWriteElement( writer, BAD_CAST( "cmism:repositoryId" ), BAD_CAST( m_repositoryId.c_str( ) ) ); xmlTextWriterWriteElement( writer, BAD_CAST( "cmism:objectId" ), BAD_CAST( m_objectId.c_str( ) ) ); if ( !m_changeToken.empty( ) ) xmlTextWriterWriteElement( writer, BAD_CAST( "cmism:changeToken" ), BAD_CAST( m_changeToken.c_str( ) ) ); xmlTextWriterStartElement( writer, BAD_CAST( "cmism:properties" ) ); for ( PropertyPtrMap::const_iterator it = m_properties.begin( ); it != m_properties.end( ); ++it ) { libcmis::PropertyPtr property = it->second; if( property->getPropertyType( )->isUpdatable( ) ) property->toXml( writer ); } xmlTextWriterEndElement( writer ); // cmis:properties xmlTextWriterEndElement( writer ); } SoapResponsePtr UpdatePropertiesResponse::create( xmlNodePtr node, RelatedMultipart&, SoapSession* ) { UpdatePropertiesResponse* response = new UpdatePropertiesResponse( ); for ( xmlNodePtr child = node->children; child; child = child->next ) { if ( xmlStrEqual( child->name, BAD_CAST( "objectId" ) ) ) { xmlChar* content = xmlNodeGetContent( child ); if ( content != NULL ) { string value( ( char* ) content ); xmlFree( content ); response->m_id = value; } } } return SoapResponsePtr( response ); } void DeleteObject::toXml( xmlTextWriterPtr writer ) { xmlTextWriterStartElement( writer, BAD_CAST( "cmism:deleteObject" ) ); xmlTextWriterWriteAttribute( writer, BAD_CAST( "xmlns:cmism" ), BAD_CAST( NS_CMISM_URL ) ); xmlTextWriterWriteElement( writer, BAD_CAST( "cmism:repositoryId" ), BAD_CAST( m_repositoryId.c_str( ) ) ); xmlTextWriterWriteElement( writer, BAD_CAST( "cmism:objectId" ), BAD_CAST( m_objectId.c_str( ) ) ); string allVersionsStr( "false" ); if ( m_allVersions ) allVersionsStr = "true"; xmlTextWriterWriteElement( writer, BAD_CAST( "cmism:allVersions" ), BAD_CAST( allVersionsStr.c_str( ) ) ); xmlTextWriterEndElement( writer ); } void DeleteTree::toXml( xmlTextWriterPtr writer ) { xmlTextWriterStartElement( writer, BAD_CAST( "cmism:deleteTree" ) ); xmlTextWriterWriteAttribute( writer, BAD_CAST( "xmlns:cmism" ), BAD_CAST( NS_CMISM_URL ) ); xmlTextWriterWriteElement( writer, BAD_CAST( "cmism:repositoryId" ), BAD_CAST( m_repositoryId.c_str( ) ) ); xmlTextWriterWriteElement( writer, BAD_CAST( "cmism:folderId" ), BAD_CAST( m_folderId.c_str( ) ) ); string allVersionsStr( "false" ); if ( m_allVersions ) allVersionsStr = "true"; xmlTextWriterWriteElement( writer, BAD_CAST( "cmism:allVersions" ), BAD_CAST( allVersionsStr.c_str( ) ) ); string unfileStr( "" ); switch ( m_unfile ) { case libcmis::UnfileObjects::Unfile: unfileStr = "unfile"; break; case libcmis::UnfileObjects::DeleteSingleFiled: unfileStr = "deletesinglefiled"; break; case libcmis::UnfileObjects::Delete: unfileStr = "delete"; break; default: break; } if ( !unfileStr.empty( ) ) xmlTextWriterWriteElement( writer, BAD_CAST( "cmism:unfileObjects" ), BAD_CAST( unfileStr.c_str( ) ) ); string continueStr( "false" ); if ( m_continueOnFailure ) continueStr = "true"; xmlTextWriterWriteElement( writer, BAD_CAST( "cmism:continueOnFailure" ), BAD_CAST( continueStr.c_str( ) ) ); xmlTextWriterEndElement( writer ); } SoapResponsePtr DeleteTreeResponse::create( xmlNodePtr node, RelatedMultipart&, SoapSession* ) { DeleteTreeResponse* response = new DeleteTreeResponse( ); for ( xmlNodePtr child = node->children; child; child = child->next ) { if ( xmlStrEqual( child->name, BAD_CAST( "failedToDelete" ) ) ) { for ( xmlNodePtr gdchild = child->children; gdchild; gdchild = gdchild->next ) { if ( xmlStrEqual( gdchild->name, BAD_CAST( "objectIds" ) ) ) { xmlChar* content = xmlNodeGetContent( gdchild ); if ( content != NULL ) { string value( ( char* ) content ); xmlFree( content ); response->m_failedIds.push_back( value ); } } } } } return SoapResponsePtr( response ); } void MoveObject::toXml( xmlTextWriterPtr writer ) { xmlTextWriterStartElement( writer, BAD_CAST( "cmism:moveObject" ) ); xmlTextWriterWriteAttribute( writer, BAD_CAST( "xmlns:cmism" ), BAD_CAST( NS_CMISM_URL ) ); xmlTextWriterWriteElement( writer, BAD_CAST( "cmism:repositoryId" ), BAD_CAST( m_repositoryId.c_str( ) ) ); xmlTextWriterWriteElement( writer, BAD_CAST( "cmism:objectId" ), BAD_CAST( m_objectId.c_str( ) ) ); xmlTextWriterWriteElement( writer, BAD_CAST( "cmism:targetFolderId" ), BAD_CAST( m_destId.c_str( ) ) ); xmlTextWriterWriteElement( writer, BAD_CAST( "cmism:sourceFolderId" ), BAD_CAST( m_srcId.c_str( ) ) ); xmlTextWriterEndElement( writer ); } void GetContentStream::toXml( xmlTextWriterPtr writer ) { xmlTextWriterStartElement( writer, BAD_CAST( "cmism:getContentStream" ) ); xmlTextWriterWriteAttribute( writer, BAD_CAST( "xmlns" ), BAD_CAST( NS_CMIS_URL ) ); xmlTextWriterWriteAttribute( writer, BAD_CAST( "xmlns:cmism" ), BAD_CAST( NS_CMISM_URL ) ); xmlTextWriterWriteElement( writer, BAD_CAST( "cmism:repositoryId" ), BAD_CAST( m_repositoryId.c_str( ) ) ); xmlTextWriterWriteElement( writer, BAD_CAST( "cmism:objectId" ), BAD_CAST( m_objectId.c_str( ) ) ); xmlTextWriterEndElement( writer ); } SoapResponsePtr GetContentStreamResponse::create( xmlNodePtr node, RelatedMultipart& multipart, SoapSession* ) { GetContentStreamResponse* response = new GetContentStreamResponse( ); for ( xmlNodePtr child = node->children; child; child = child->next ) { if ( xmlStrEqual( child->name, BAD_CAST( "contentStream" ) ) ) { for ( xmlNodePtr gdchild = child->children; gdchild; gdchild = gdchild->next ) { if ( xmlStrEqual( gdchild->name, BAD_CAST( "stream" ) ) ) { xmlChar* content = xmlNodeGetContent( gdchild ); if ( content != NULL ) { // We can either have directly the base64 encoded data or // an pointing to another part of the multipart response->m_stream = getStreamFromNode( gdchild, multipart ); } } } } } return SoapResponsePtr( response ); } void GetObjectParents::toXml( xmlTextWriterPtr writer ) { xmlTextWriterStartElement( writer, BAD_CAST( "cmism:getObjectParents" ) ); xmlTextWriterWriteAttribute( writer, BAD_CAST( "xmlns:cmism" ), BAD_CAST( NS_CMISM_URL ) ); xmlTextWriterWriteElement( writer, BAD_CAST( "cmism:repositoryId" ), BAD_CAST( m_repositoryId.c_str( ) ) ); xmlTextWriterWriteElement( writer, BAD_CAST( "cmism:objectId" ), BAD_CAST( m_objectId.c_str( ) ) ); xmlTextWriterWriteElement( writer, BAD_CAST( "cmism:includeAllowableActions" ), BAD_CAST( "true" ) ); xmlTextWriterEndElement( writer ); } SoapResponsePtr GetObjectParentsResponse::create( xmlNodePtr node, RelatedMultipart&, SoapSession* session ) { GetObjectParentsResponse* response = new GetObjectParentsResponse( ); WSSession* wsSession = dynamic_cast< WSSession* >( session ); for ( xmlNodePtr child = node->children; child; child = child->next ) { if ( xmlStrEqual( child->name, BAD_CAST( "parents" ) ) ) { for ( xmlNodePtr gdchild = child->children; gdchild; gdchild = gdchild->next ) { if ( xmlStrEqual( gdchild->name, BAD_CAST( "object" ) ) ) { libcmis::FolderPtr parent; WSObject tmp( wsSession, gdchild ); if ( tmp.getBaseType( ) == "cmis:folder" ) { parent.reset( new WSFolder( tmp ) ); response->m_parents.push_back( parent ); } } } } } return SoapResponsePtr( response ); } void GetChildren::toXml( xmlTextWriterPtr writer ) { xmlTextWriterStartElement( writer, BAD_CAST( "cmism:getChildren" ) ); xmlTextWriterWriteAttribute( writer, BAD_CAST( "xmlns:cmism" ), BAD_CAST( NS_CMISM_URL ) ); xmlTextWriterWriteElement( writer, BAD_CAST( "cmism:repositoryId" ), BAD_CAST( m_repositoryId.c_str( ) ) ); xmlTextWriterWriteElement( writer, BAD_CAST( "cmism:folderId" ), BAD_CAST( m_folderId.c_str( ) ) ); xmlTextWriterWriteElement( writer, BAD_CAST( "cmism:includeAllowableActions" ), BAD_CAST( "true" ) ); xmlTextWriterEndElement( writer ); } SoapResponsePtr GetChildrenResponse::create( xmlNodePtr node, RelatedMultipart&, SoapSession* session ) { GetChildrenResponse* response = new GetChildrenResponse( ); WSSession* wsSession = dynamic_cast< WSSession* >( session ); for ( xmlNodePtr child = node->children; child; child = child->next ) { if ( xmlStrEqual( child->name, BAD_CAST( "objects" ) ) ) { for ( xmlNodePtr gdchild = child->children; gdchild; gdchild = gdchild->next ) { if ( xmlStrEqual( gdchild->name, BAD_CAST( "objects" ) ) ) { for ( xmlNodePtr gdgdchild = gdchild->children; gdgdchild; gdgdchild = gdgdchild->next ) { if ( xmlStrEqual( gdgdchild->name, BAD_CAST( "object" ) ) ) { libcmis::ObjectPtr object; WSObject tmp( wsSession, gdgdchild ); if ( tmp.getBaseType( ) == "cmis:folder" ) { object.reset( new WSFolder( tmp ) ); } else if ( tmp.getBaseType( ) == "cmis:document" ) { object.reset( new WSDocument( tmp ) ); } else { // This should never happen... but who knows if the standard is 100% repected? object.reset( new WSObject( wsSession, gdgdchild ) ); } response->m_children.push_back( object ); } } } } } } return SoapResponsePtr( response ); } void CreateFolder::toXml( xmlTextWriterPtr writer ) { xmlTextWriterStartElement( writer, BAD_CAST( "cmism:createFolder" ) ); xmlTextWriterWriteAttribute( writer, BAD_CAST( "xmlns:cmis" ), BAD_CAST( NS_CMIS_URL ) ); xmlTextWriterWriteAttribute( writer, BAD_CAST( "xmlns:cmism" ), BAD_CAST( NS_CMISM_URL ) ); xmlTextWriterWriteElement( writer, BAD_CAST( "cmism:repositoryId" ), BAD_CAST( m_repositoryId.c_str( ) ) ); xmlTextWriterStartElement( writer, BAD_CAST( "cmism:properties" ) ); for ( PropertyPtrMap::const_iterator it = m_properties.begin( ); it != m_properties.end( ); ++it ) { libcmis::PropertyPtr property = it->second; property->toXml( writer ); } xmlTextWriterEndElement( writer ); // cmis:properties xmlTextWriterWriteElement( writer, BAD_CAST( "cmism:folderId" ), BAD_CAST( m_folderId.c_str( ) ) ); xmlTextWriterEndElement( writer ); } SoapResponsePtr CreateFolderResponse::create( xmlNodePtr node, RelatedMultipart&, SoapSession* ) { CreateFolderResponse* response = new CreateFolderResponse( ); for ( xmlNodePtr child = node->children; child; child = child->next ) { if ( xmlStrEqual( child->name, BAD_CAST( "objectId" ) ) ) { xmlChar* content = xmlNodeGetContent( child ); if ( content != NULL ) { string value( ( char* ) content ); xmlFree( content ); response->m_id = value; } } } return SoapResponsePtr( response ); } void CreateDocument::toXml( xmlTextWriterPtr writer ) { xmlTextWriterStartElement( writer, BAD_CAST( "cmism:createDocument" ) ); xmlTextWriterWriteAttribute( writer, BAD_CAST( "xmlns:cmis" ), BAD_CAST( NS_CMIS_URL ) ); xmlTextWriterWriteAttribute( writer, BAD_CAST( "xmlns:cmism" ), BAD_CAST( NS_CMISM_URL ) ); xmlTextWriterWriteElement( writer, BAD_CAST( "cmism:repositoryId" ), BAD_CAST( m_repositoryId.c_str( ) ) ); xmlTextWriterStartElement( writer, BAD_CAST( "cmism:properties" ) ); for ( PropertyPtrMap::const_iterator it = m_properties.begin( ); it != m_properties.end( ); ++it ) { libcmis::PropertyPtr property = it->second; property->toXml( writer ); } xmlTextWriterEndElement( writer ); // cmis:properties xmlTextWriterWriteElement( writer, BAD_CAST( "cmism:folderId" ), BAD_CAST( m_folderId.c_str( ) ) ); xmlTextWriterStartElement( writer, BAD_CAST( "cmism:contentStream" ) ); writeCmismStream( writer, m_multipart, m_stream, m_contentType, m_filename ); xmlTextWriterEndElement( writer ); // cmism:contentStream xmlTextWriterEndElement( writer ); } void SetContentStream::toXml( xmlTextWriterPtr writer ) { xmlTextWriterStartElement( writer, BAD_CAST( "cmism:setContentStream" ) ); xmlTextWriterWriteAttribute( writer, BAD_CAST( "xmlns:cmis" ), BAD_CAST( NS_CMIS_URL ) ); xmlTextWriterWriteAttribute( writer, BAD_CAST( "xmlns:cmism" ), BAD_CAST( NS_CMISM_URL ) ); xmlTextWriterWriteElement( writer, BAD_CAST( "cmism:repositoryId" ), BAD_CAST( m_repositoryId.c_str( ) ) ); xmlTextWriterWriteElement( writer, BAD_CAST( "cmism:objectId" ), BAD_CAST( m_objectId.c_str( ) ) ); string overwrite( "false" ); if ( m_overwrite ) overwrite = "true"; xmlTextWriterWriteElement( writer, BAD_CAST( "cmism:overwriteFlag" ), BAD_CAST( overwrite.c_str( ) ) ); if ( !m_changeToken.empty( ) ) xmlTextWriterWriteElement( writer, BAD_CAST( "cmism:changeToken" ), BAD_CAST( m_changeToken.c_str( ) ) ); xmlTextWriterStartElement( writer, BAD_CAST( "cmism:contentStream" ) ); writeCmismStream( writer, m_multipart, m_stream, m_contentType, m_filename ); xmlTextWriterEndElement( writer ); // cmism:contentStream xmlTextWriterEndElement( writer ); } void GetRenditions::toXml( xmlTextWriterPtr writer ) { xmlTextWriterStartElement( writer, BAD_CAST( "cmism:getRenditions" ) ); xmlTextWriterWriteAttribute( writer, BAD_CAST( "xmlns:cmism" ), BAD_CAST( NS_CMISM_URL ) ); xmlTextWriterWriteElement( writer, BAD_CAST( "cmism:repositoryId" ), BAD_CAST( m_repositoryId.c_str( ) ) ); xmlTextWriterWriteElement( writer, BAD_CAST( "cmism:objectId" ), BAD_CAST( m_objectId.c_str( ) ) ); xmlTextWriterWriteElement( writer, BAD_CAST( "cmism:renditionFilter" ), BAD_CAST( m_filter.c_str( ) ) ); xmlTextWriterEndElement( writer ); } SoapResponsePtr GetRenditionsResponse::create( xmlNodePtr node, RelatedMultipart&, SoapSession* ) { GetRenditionsResponse* response = new GetRenditionsResponse( ); for ( xmlNodePtr child = node->children; child; child = child->next ) { if ( xmlStrEqual( child->name, BAD_CAST( "renditions" ) ) ) { libcmis::RenditionPtr rendition( new libcmis::Rendition( child ) ); response->m_renditions.push_back( rendition ); } } return SoapResponsePtr( response ); } void CheckOut::toXml( xmlTextWriterPtr writer ) { xmlTextWriterStartElement( writer, BAD_CAST( "cmism:checkOut" ) ); xmlTextWriterWriteAttribute( writer, BAD_CAST( "xmlns:cmis" ), BAD_CAST( NS_CMIS_URL ) ); xmlTextWriterWriteAttribute( writer, BAD_CAST( "xmlns:cmism" ), BAD_CAST( NS_CMISM_URL ) ); xmlTextWriterWriteElement( writer, BAD_CAST( "cmism:repositoryId" ), BAD_CAST( m_repositoryId.c_str( ) ) ); xmlTextWriterWriteElement( writer, BAD_CAST( "cmism:objectId" ), BAD_CAST( m_objectId.c_str( ) ) ); xmlTextWriterEndElement( writer ); } SoapResponsePtr CheckOutResponse::create( xmlNodePtr node, RelatedMultipart&, SoapSession* ) { CheckOutResponse* response = new CheckOutResponse( ); for ( xmlNodePtr child = node->children; child; child = child->next ) { if ( xmlStrEqual( child->name, BAD_CAST( "objectId" ) ) ) { xmlChar* content = xmlNodeGetContent( child ); if ( content != NULL ) { string value( ( char* ) content ); xmlFree( content ); response->m_objectId = value; } } } return SoapResponsePtr( response ); } void CancelCheckOut::toXml( xmlTextWriterPtr writer ) { xmlTextWriterStartElement( writer, BAD_CAST( "cmism:cancelCheckOut" ) ); xmlTextWriterWriteAttribute( writer, BAD_CAST( "xmlns:cmis" ), BAD_CAST( NS_CMIS_URL ) ); xmlTextWriterWriteAttribute( writer, BAD_CAST( "xmlns:cmism" ), BAD_CAST( NS_CMISM_URL ) ); xmlTextWriterWriteElement( writer, BAD_CAST( "cmism:repositoryId" ), BAD_CAST( m_repositoryId.c_str( ) ) ); xmlTextWriterWriteElement( writer, BAD_CAST( "cmism:objectId" ), BAD_CAST( m_objectId.c_str( ) ) ); xmlTextWriterEndElement( writer ); } void CheckIn::toXml( xmlTextWriterPtr writer ) { xmlTextWriterStartElement( writer, BAD_CAST( "cmism:checkIn" ) ); xmlTextWriterWriteAttribute( writer, BAD_CAST( "xmlns:cmis" ), BAD_CAST( NS_CMIS_URL ) ); xmlTextWriterWriteAttribute( writer, BAD_CAST( "xmlns:cmism" ), BAD_CAST( NS_CMISM_URL ) ); xmlTextWriterWriteElement( writer, BAD_CAST( "cmism:repositoryId" ), BAD_CAST( m_repositoryId.c_str( ) ) ); xmlTextWriterWriteElement( writer, BAD_CAST( "cmism:objectId" ), BAD_CAST( m_objectId.c_str( ) ) ); string major = "false"; if ( m_isMajor ) major = "true"; xmlTextWriterWriteElement( writer, BAD_CAST( "cmism:major" ), BAD_CAST( major.c_str( ) ) ); if ( m_properties.empty( ) ) { xmlTextWriterStartElement( writer, BAD_CAST( "cmism:properties" ) ); for ( PropertyPtrMap::const_iterator it = m_properties.begin( ); it != m_properties.end( ); ++it ) { libcmis::PropertyPtr property = it->second; property->toXml( writer ); } xmlTextWriterEndElement( writer ); // cmis:properties } if ( m_stream.get( ) ) { xmlTextWriterStartElement( writer, BAD_CAST( "cmism:contentStream" ) ); writeCmismStream( writer, m_multipart, m_stream, m_contentType, m_fileName ); xmlTextWriterEndElement( writer ); // cmism:contentStream } xmlTextWriterWriteElement( writer, BAD_CAST( "cmism:checkinComment" ), BAD_CAST( m_comment.c_str( ) ) ); xmlTextWriterEndElement( writer ); } SoapResponsePtr CheckInResponse::create( xmlNodePtr node, RelatedMultipart&, SoapSession* ) { CheckInResponse* response = new CheckInResponse( ); for ( xmlNodePtr child = node->children; child; child = child->next ) { if ( xmlStrEqual( child->name, BAD_CAST( "objectId" ) ) ) { xmlChar* content = xmlNodeGetContent( child ); if ( content != NULL ) { string value( ( char* ) content ); xmlFree( content ); response->m_objectId = value; } } } return SoapResponsePtr( response ); } void GetAllVersions::toXml( xmlTextWriterPtr writer ) { xmlTextWriterStartElement( writer, BAD_CAST( "cmism:getAllVersions" ) ); xmlTextWriterWriteAttribute( writer, BAD_CAST( "xmlns:cmism" ), BAD_CAST( NS_CMISM_URL ) ); xmlTextWriterWriteElement( writer, BAD_CAST( "cmism:repositoryId" ), BAD_CAST( m_repositoryId.c_str( ) ) ); xmlTextWriterWriteElement( writer, BAD_CAST( "cmism:objectId" ), BAD_CAST( m_objectId.c_str( ) ) ); xmlTextWriterWriteElement( writer, BAD_CAST( "cmism:includeAllowableActions" ), BAD_CAST( "true" ) ); xmlTextWriterEndElement( writer ); } SoapResponsePtr GetAllVersionsResponse::create( xmlNodePtr node, RelatedMultipart&, SoapSession* session ) { GetAllVersionsResponse* response = new GetAllVersionsResponse( ); WSSession* wsSession = dynamic_cast< WSSession* >( session ); for ( xmlNodePtr child = node->children; child; child = child->next ) { if ( xmlStrEqual( child->name, BAD_CAST( "objects" ) ) ) { WSObject tmp( wsSession, child ); if ( tmp.getBaseType( ) == "cmis:document" ) { libcmis::DocumentPtr object( new WSDocument( tmp ) ); response->m_objects.push_back( object ); } } } return SoapResponsePtr( response ); } libcmis-0.4.1/src/libcmis/atom-folder.cxx0000644000175000001440000002630412156277660015242 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2011 SUSE * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #include #include "atom-document.hxx" #include "atom-folder.hxx" #include "atom-session.hxx" #include "xml-utils.hxx" using namespace std; using libcmis::PropertyPtrMap; namespace { } AtomFolder::AtomFolder( AtomPubSession* session, xmlNodePtr entryNd ) : libcmis::Object( session ), libcmis::Folder( session ), AtomObject( session ) { xmlDocPtr doc = libcmis::wrapInDoc( entryNd ); refreshImpl( doc ); xmlFreeDoc( doc ); } AtomFolder::~AtomFolder( ) { } vector< libcmis::ObjectPtr > AtomFolder::getChildren( ) throw ( libcmis::Exception ) { AtomLink* childrenLink = getLink( "down", "application/atom+xml;type=feed" ); // Some servers aren't giving the GetChildren properly... if not defined, we need to try // as we may have the right to proceed. if ( ( NULL == childrenLink ) || ( getAllowableActions( ).get() && ( !getAllowableActions()->isAllowed( libcmis::ObjectAction::GetChildren ) && getAllowableActions()->isDefined( libcmis::ObjectAction::GetChildren ) ) ) ) throw libcmis::Exception( string( "GetChildren not allowed on node " ) + getId() ); vector< libcmis::ObjectPtr > children; string pageUrl = childrenLink->getHref( ); bool hasNext = true; while ( hasNext ) { string buf; try { buf = getSession()->httpGetRequest( pageUrl )->getStream( )->str( ); } catch ( const CurlException& e ) { throw e.getCmisException( ); } xmlDocPtr doc = xmlReadMemory( buf.c_str(), buf.size(), pageUrl.c_str(), NULL, 0 ); if ( NULL != doc ) { xmlXPathContextPtr xpathCtx = xmlXPathNewContext( doc ); libcmis::registerNamespaces( xpathCtx ); if ( NULL != xpathCtx ) { // Check if there is a next link to handled paged results const string& nextReq( "/atom:feed/atom:link[@rel='next']/attribute::href" ); string nextHref = libcmis::getXPathValue( xpathCtx, nextReq ); hasNext = !nextHref.empty( ); if ( hasNext ) pageUrl = nextHref; // Get the page entries const string& entriesReq( "//atom:entry" ); xmlXPathObjectPtr xpathObj = xmlXPathEvalExpression( BAD_CAST( entriesReq.c_str() ), xpathCtx ); if ( NULL != xpathObj && NULL != xpathObj->nodesetval ) { int size = xpathObj->nodesetval->nodeNr; for ( int i = 0; i < size; i++ ) { xmlNodePtr node = xpathObj->nodesetval->nodeTab[i]; xmlDocPtr entryDoc = libcmis::wrapInDoc( node ); libcmis::ObjectPtr cmisObject = getSession()->createObjectFromEntryDoc( entryDoc ); if ( cmisObject.get() ) children.push_back( cmisObject ); xmlFreeDoc( entryDoc ); } } xmlXPathFreeObject( xpathObj ); } xmlXPathFreeContext( xpathCtx ); } else { throw libcmis::Exception( "Failed to parse folder infos" ); } xmlFreeDoc( doc ); } return children; } libcmis::FolderPtr AtomFolder::createFolder( const PropertyPtrMap& properties ) throw( libcmis::Exception ) { AtomLink* childrenLink = getLink( "down", "application/atom+xml;type=feed" ); if ( ( NULL == childrenLink ) || ( getAllowableActions( ).get() && !getAllowableActions()->isAllowed( libcmis::ObjectAction::CreateFolder ) ) ) throw libcmis::Exception( string( "CreateFolder not allowed on folder " ) + getId(), "permissionDenied" ); xmlBufferPtr buf = xmlBufferCreate( ); xmlTextWriterPtr writer = xmlNewTextWriterMemory( buf, 0 ); xmlTextWriterStartDocument( writer, NULL, NULL, NULL ); // Copy and remove the readonly properties before serializing boost::shared_ptr< ostream > stream; AtomObject::writeAtomEntry( writer, properties, stream, string( ) ); xmlTextWriterEndDocument( writer ); string str( ( const char * )xmlBufferContent( buf ) ); istringstream is( str ); xmlFreeTextWriter( writer ); xmlBufferFree( buf ); libcmis::HttpResponsePtr response; try { response = getSession( )->httpPostRequest( childrenLink->getHref( ), is, "application/atom+xml;type=entry" ); } catch ( const CurlException& e ) { throw e.getCmisException( ); } string respBuf = response->getStream( )->str( ); xmlDocPtr doc = xmlReadMemory( respBuf.c_str(), respBuf.size(), getInfosUrl().c_str(), NULL, 0 ); if ( NULL == doc ) throw libcmis::Exception( "Failed to parse object infos" ); libcmis::ObjectPtr created = getSession( )->createObjectFromEntryDoc( doc ); xmlFreeDoc( doc ); libcmis::FolderPtr newFolder = boost::dynamic_pointer_cast< libcmis::Folder >( created ); if ( !newFolder.get( ) ) throw libcmis::Exception( string( "Created object is not a folder: " ) + created->getId( ), "constraint" ); return newFolder; } libcmis::DocumentPtr AtomFolder::createDocument( const PropertyPtrMap& properties, boost::shared_ptr< ostream > os, string contentType, string ) throw ( libcmis::Exception ) { AtomLink* childrenLink = getLink( "down", "application/atom+xml;type=feed" ); if ( ( NULL == childrenLink ) || ( getAllowableActions( ).get() && !getAllowableActions()->isAllowed( libcmis::ObjectAction::CreateDocument ) && getAllowableActions()->isDefined( libcmis::ObjectAction::CreateDocument ) ) ) throw libcmis::Exception( string( "CreateDocument not allowed on folder " ) + getId() ); stringstream ss; xmlOutputBufferPtr buf = xmlOutputBufferCreateIO(libcmis::stringstream_write_callback, NULL, &ss, NULL); xmlTextWriterPtr writer = xmlNewTextWriter(buf); xmlTextWriterStartDocument( writer, NULL, NULL, NULL ); AtomObject::writeAtomEntry( writer, properties, os, contentType ); xmlTextWriterEndDocument( writer ); xmlFreeTextWriter( writer ); libcmis::HttpResponsePtr response; try { response = getSession( )->httpPostRequest( childrenLink->getHref( ), ss, "application/atom+xml;type=entry" ); } catch ( const CurlException& e ) { throw e.getCmisException( ); } string respBuf = response->getStream( )->str( ); xmlDocPtr doc = xmlReadMemory( respBuf.c_str(), respBuf.size(), getInfosUrl().c_str(), NULL, XML_PARSE_NOERROR ); if ( NULL == doc ) { // We may not have the created document entry in the response body: this is // the behaviour of some servers, but the standard says we need to look for // the Location header. map< string, string >& headers = response->getHeaders( ); map< string, string >::iterator it = headers.find( "Location" ); // Some servers like Lotus Live aren't sending Location header, but Content-Location if ( it == headers.end( ) ) it = headers.find( "Content-Location" ); if ( it != headers.end() ) { try { response = getSession( )->httpGetRequest( it->second ); respBuf = response->getStream( )->str( ); doc = xmlReadMemory( respBuf.c_str(), respBuf.size(), getInfosUrl().c_str(), NULL, XML_PARSE_NOERROR ); } catch ( const CurlException& e ) { throw e.getCmisException( ); } } // if doc is still NULL after that, then throw an exception if ( NULL == doc ) throw libcmis::Exception( "Missing expected response from server" ); } libcmis::ObjectPtr created = getSession( )->createObjectFromEntryDoc( doc ); xmlFreeDoc( doc ); libcmis::DocumentPtr newDocument = boost::dynamic_pointer_cast< libcmis::Document >( created ); if ( !newDocument.get( ) ) throw libcmis::Exception( string( "Created object is not a document: " ) + created->getId( ) ); return newDocument; } vector< string > AtomFolder::removeTree( bool allVersions, libcmis::UnfileObjects::Type unfile, bool continueOnError ) throw ( libcmis::Exception ) { AtomLink* treeLink = getLink( "down", "application/cmistree+xml" ); if ( NULL == treeLink ) treeLink = getLink( "http://docs.oasis-open.org/ns/cmis/link/200908/foldertree", "application/cmistree+xml" ); if ( ( NULL == treeLink ) || ( getAllowableActions( ).get() && !getAllowableActions()->isAllowed( libcmis::ObjectAction::DeleteTree ) ) ) throw libcmis::Exception( string( "DeleteTree not allowed on folder " ) + getId() ); try { string deleteUrl = treeLink->getHref( ); if ( deleteUrl.find( '?' ) != string::npos ) deleteUrl += "&"; else deleteUrl += "?"; // Add the all versions parameter string allVersionsStr = "TRUE"; if ( !allVersions ) allVersionsStr = "FALSE"; deleteUrl += "allVersions=" + allVersionsStr; // Add the unfileObjects parameter string unfileStr; switch ( unfile ) { case libcmis::UnfileObjects::Delete: unfileStr = "delete"; break; case libcmis::UnfileObjects::DeleteSingleFiled: unfileStr = "deletesinglefiled"; break; case libcmis::UnfileObjects::Unfile: unfileStr = "unfile"; break; default: break; } deleteUrl += "&unfileObjects=" + unfileStr; // Add the continueOnFailure parameter string continueOnErrorStr = "TRUE"; if ( !continueOnError ) continueOnErrorStr = "FALSE"; deleteUrl += "&continueOnFailure=" + continueOnErrorStr; getSession( )->httpDeleteRequest( deleteUrl ); } catch ( const CurlException& e ) { throw e.getCmisException( ); } // TODO Implement getting the failedIDs using a GET request on the same URL return vector< string >( ); } libcmis-0.4.1/src/libcmis/document.hxx0000644000175000001440000001317612156277660014657 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2011 SUSE * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #ifndef _DOCUMENT_HXX_ #define _DOCUMENT_HXX_ #include #include #include #include #include "exception.hxx" #include "object.hxx" namespace libcmis { class Folder; class Session; /** Interface for a CMIS Document object. */ class Document : public virtual Object { public: Document( Session* session ) : Object( session ) { } virtual ~Document( ) { } /** Get the folder parents for the document. Note that an unfiled document will have no parent folder. @return the parents folder if any. */ virtual std::vector< boost::shared_ptr< Folder > > getParents( ) throw ( Exception ) = 0; /** Get the content stream without using a temporary file.

The stream may not contain anything if there is no content or if something wrong happened during the download.

@param streamId of the rendition @return An input stream to read the data from. @throws Exception if anything wrong happened during the file transfer. In such a case, the content of the stream can't be guaranteed. */ virtual boost::shared_ptr< std::istream > getContentStream( std::string streamId = std::string( ) ) throw ( Exception ) = 0; /** Set or replace the content stream of the document. @param is the output stream containing the new data for the content stream @param contentType the mime-type of the new content stream @param filename the filename to set for the file @param overwrite if set to false, don't overwrite the content stream if one is already set. @throw Exception if anything happens during the upload like a wrong authentication, no rights to set the stream, server doesn't have the ContentStreamUpdatability capability. */ virtual void setContentStream( boost::shared_ptr< std::ostream > os, std::string contentType, std::string filename, bool overwrite = true ) throw ( Exception ) = 0; /** Get the content mime type. */ virtual std::string getContentType( ); /** Get the content stream filename. */ virtual std::string getContentFilename( ); /** Get the content length in bytes. */ virtual long getContentLength( ); /** Checks out the document and returns the object corresponding to the created Private Working Copy. \return the Private Working Copy document */ virtual boost::shared_ptr< Document > checkOut( ) throw ( Exception ) = 0; /** Cancels the checkout if the document is a private working copy, or throws an exception. */ virtual void cancelCheckout( ) throw ( Exception ) = 0; /** Check in the private working copy and create a new version or throw an exception. The current object will be updated to reflect the changes performed on the server side. \param isMajor defines it the version to create is a major or minor one \param comment contains the checkin comment \param properties the properties to set the new version \param stream the content stream to set for the new version \param contentType the mime type of the stream to set \return the document with the new version */ virtual boost::shared_ptr< Document > checkIn( bool isMajor, std::string comment, const std::map< std::string, PropertyPtr >& properties, boost::shared_ptr< std::ostream > stream, std::string contentType, std::string fileName ) throw ( Exception ) = 0; virtual std::vector< boost::shared_ptr< Document > > getAllVersions( ) throw ( Exception ) = 0; // virtual methods form Object virtual std::vector< std::string > getPaths( ); virtual std::string toString( ); }; typedef ::boost::shared_ptr< Document > DocumentPtr; } #endif libcmis-0.4.1/src/libcmis/Makefile.in0000644000175000001440000007373412200457433014347 00000000000000# Makefile.in generated by automake 1.13.4 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/libcmis DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/depcomp \ $(libcmis_@LIBCMIS_API_VERSION@_la_include_HEADERS) ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/boost.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(libdir)" \ "$(DESTDIR)$(libcmis_@LIBCMIS_API_VERSION@_la_includedir)" LTLIBRARIES = $(lib_LTLIBRARIES) $(noinst_LTLIBRARIES) am__DEPENDENCIES_1 = libcmis_@LIBCMIS_API_VERSION@_la_DEPENDENCIES = libcmis.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) am_libcmis_@LIBCMIS_API_VERSION@_la_OBJECTS = dummy.lo libcmis_@LIBCMIS_API_VERSION@_la_OBJECTS = \ $(am_libcmis_@LIBCMIS_API_VERSION@_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = libcmis_@LIBCMIS_API_VERSION@_la_LINK = $(LIBTOOL) $(AM_V_lt) \ --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link \ $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) \ $(libcmis_@LIBCMIS_API_VERSION@_la_LDFLAGS) $(LDFLAGS) -o $@ libcmis_la_LIBADD = am_libcmis_la_OBJECTS = session-factory.lo base-session.lo \ allowable-actions.lo document.lo folder.lo oauth2-data.lo \ object.lo object-type.lo property.lo property-type.lo \ repository.lo xml-utils.lo atom-object-type.lo \ atom-document.lo atom-folder.lo atom-object.lo atom-session.lo \ atom-workspace.lo ws-document.lo ws-folder.lo \ ws-navigationservice.lo ws-object.lo ws-object-type.lo \ ws-objectservice.lo ws-relatedmultipart.lo \ ws-repositoryservice.lo ws-requests.lo ws-soap.lo \ ws-session.lo ws-versioningservice.lo gdrive-document.lo \ gdrive-folder.lo gdrive-object.lo gdrive-object-type.lo \ gdrive-property.lo gdrive-repository.lo gdrive-session.lo \ gdrive-utils.lo json-utils.lo oauth2-handler.lo rendition.lo \ oauth2-providers.lo libcmis_la_OBJECTS = $(am_libcmis_la_OBJECTS) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CXXFLAGS) $(CXXFLAGS) AM_V_CXX = $(am__v_CXX_@AM_V@) am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) am__v_CXX_0 = @echo " CXX " $@; am__v_CXX_1 = CXXLD = $(CXX) CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) am__v_CXXLD_0 = @echo " CXXLD " $@; am__v_CXXLD_1 = COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libcmis_@LIBCMIS_API_VERSION@_la_SOURCES) \ $(libcmis_la_SOURCES) DIST_SOURCES = $(libcmis_@LIBCMIS_API_VERSION@_la_SOURCES) \ $(libcmis_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac HEADERS = $(libcmis_@LIBCMIS_API_VERSION@_la_include_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BOOST_CPPFLAGS = @BOOST_CPPFLAGS@ BOOST_DATE_TIME_LDFLAGS = @BOOST_DATE_TIME_LDFLAGS@ BOOST_DATE_TIME_LIBS = @BOOST_DATE_TIME_LIBS@ BOOST_PROGRAM_OPTIONS_LDFLAGS = @BOOST_PROGRAM_OPTIONS_LDFLAGS@ BOOST_PROGRAM_OPTIONS_LIBS = @BOOST_PROGRAM_OPTIONS_LIBS@ BOOST_ROOT = @BOOST_ROOT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPCHECK = @CPPCHECK@ CPPFLAGS = @CPPFLAGS@ CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ CPPUNIT_LIBS = @CPPUNIT_LIBS@ CURL_CFLAGS = @CURL_CFLAGS@ CURL_LIBS = @CURL_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISTCHECK_CONFIGURE_FLAGS = @DISTCHECK_CONFIGURE_FLAGS@ DLLTOOL = @DLLTOOL@ DOCBOOK2MAN = @DOCBOOK2MAN@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBCMIS_API_VERSION = @LIBCMIS_API_VERSION@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SRCDIR = @SRCDIR@ STRIP = @STRIP@ VERSION = @VERSION@ XML2_CFLAGS = @XML2_CFLAGS@ XML2_LIBS = @XML2_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CXXFLAGS = -I$(top_srcdir)/src/libcmis $(XML2_CFLAGS) $(CURL_CFLAGS) $(BOOST_CPPFLAGS) -O0 libcmis_@LIBCMIS_API_VERSION@_la_include_HEADERS = \ allowable-actions.hxx \ document.hxx \ exception.hxx \ folder.hxx \ oauth2-data.hxx \ object-type.hxx \ object.hxx \ property-type.hxx \ property.hxx \ rendition.hxx \ repository.hxx \ session-factory.hxx \ session.hxx \ xml-utils.hxx \ xmlserializable.hxx \ libcmis.hxx noinst_LTLIBRARIES = libcmis.la lib_LTLIBRARIES = libcmis-@LIBCMIS_API_VERSION@.la libcmis_@LIBCMIS_API_VERSION@_la_SOURCES = \ dummy.cxx libcmis_la_SOURCES = \ $(libcmis_headers_public) \ session-factory.cxx \ base-session.hxx \ base-session.cxx \ allowable-actions.cxx \ document.cxx \ folder.cxx \ oauth2-data.cxx \ object.cxx \ object-type.cxx \ property.cxx \ property-type.cxx \ repository.cxx \ xml-utils.cxx \ atom-document.hxx \ atom-folder.hxx \ atom-object.hxx \ atom-object-type.hxx \ atom-object-type.cxx \ atom-session.hxx \ atom-document.cxx \ atom-folder.cxx \ atom-object.cxx \ atom-session.cxx \ atom-workspace.hxx \ atom-workspace.cxx \ ws-document.hxx \ ws-document.cxx \ ws-folder.hxx \ ws-folder.cxx \ ws-navigationservice.hxx \ ws-navigationservice.cxx \ ws-object.hxx \ ws-object.cxx \ ws-object-type.hxx \ ws-object-type.cxx \ ws-objectservice.hxx \ ws-objectservice.cxx \ ws-relatedmultipart.hxx \ ws-relatedmultipart.cxx \ ws-repositoryservice.hxx \ ws-repositoryservice.cxx \ ws-requests.hxx \ ws-requests.cxx \ ws-soap.hxx \ ws-soap.cxx \ ws-session.hxx \ ws-session.cxx \ ws-versioningservice.hxx \ ws-versioningservice.cxx \ gdrive-allowable-actions.hxx \ gdrive-document.hxx \ gdrive-document.cxx \ gdrive-folder.hxx \ gdrive-folder.cxx \ gdrive-object.hxx \ gdrive-object.cxx \ gdrive-object-type.hxx \ gdrive-object-type.cxx \ gdrive-property.hxx \ gdrive-property.cxx \ gdrive-repository.hxx \ gdrive-repository.cxx \ gdrive-session.hxx \ gdrive-session.cxx \ gdrive-utils.hxx \ gdrive-utils.cxx \ json-utils.hxx \ json-utils.cxx \ oauth2-handler.hxx \ oauth2-handler.cxx \ rendition.cxx \ oauth2-providers.hxx \ oauth2-providers.cxx libcmis_@LIBCMIS_API_VERSION@_la_LDFLAGS = -export-dynamic -no-undefined -version-info 4:1:0 libcmis_@LIBCMIS_API_VERSION@_la_LIBADD = \ libcmis.la \ $(XML2_LIBS) \ $(CURL_LIBS) \ $(BOOST_SMART_PTR_LIBS) \ $(BOOST_DATE_TIME_LIBS) libcmis_@LIBCMIS_API_VERSION@_la_includedir = $(includedir)/libcmis-@LIBCMIS_API_VERSION@/libcmis all: all-am .SUFFIXES: .SUFFIXES: .cxx .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/libcmis/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign src/libcmis/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libcmis-@LIBCMIS_API_VERSION@.la: $(libcmis_@LIBCMIS_API_VERSION@_la_OBJECTS) $(libcmis_@LIBCMIS_API_VERSION@_la_DEPENDENCIES) $(EXTRA_libcmis_@LIBCMIS_API_VERSION@_la_DEPENDENCIES) $(AM_V_CXXLD)$(libcmis_@LIBCMIS_API_VERSION@_la_LINK) -rpath $(libdir) $(libcmis_@LIBCMIS_API_VERSION@_la_OBJECTS) $(libcmis_@LIBCMIS_API_VERSION@_la_LIBADD) $(LIBS) libcmis.la: $(libcmis_la_OBJECTS) $(libcmis_la_DEPENDENCIES) $(EXTRA_libcmis_la_DEPENDENCIES) $(AM_V_CXXLD)$(CXXLINK) $(libcmis_la_OBJECTS) $(libcmis_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/allowable-actions.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom-document.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom-folder.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom-object-type.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom-object.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom-session.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom-workspace.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/base-session.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/document.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dummy.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/folder.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gdrive-document.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gdrive-folder.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gdrive-object-type.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gdrive-object.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gdrive-property.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gdrive-repository.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gdrive-session.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gdrive-utils.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/json-utils.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/oauth2-data.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/oauth2-handler.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/oauth2-providers.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/object-type.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/object.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/property-type.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/property.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rendition.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/repository.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/session-factory.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ws-document.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ws-folder.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ws-navigationservice.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ws-object-type.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ws-object.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ws-objectservice.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ws-relatedmultipart.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ws-repositoryservice.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ws-requests.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ws-session.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ws-soap.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ws-versioningservice.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xml-utils.Plo@am__quote@ .cxx.o: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< .cxx.obj: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cxx.lo: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-libcmis_@LIBCMIS_API_VERSION@_la_includeHEADERS: $(libcmis_@LIBCMIS_API_VERSION@_la_include_HEADERS) @$(NORMAL_INSTALL) @list='$(libcmis_@LIBCMIS_API_VERSION@_la_include_HEADERS)'; test -n "$(libcmis_@LIBCMIS_API_VERSION@_la_includedir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(libcmis_@LIBCMIS_API_VERSION@_la_includedir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libcmis_@LIBCMIS_API_VERSION@_la_includedir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(libcmis_@LIBCMIS_API_VERSION@_la_includedir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(libcmis_@LIBCMIS_API_VERSION@_la_includedir)" || exit $$?; \ done uninstall-libcmis_@LIBCMIS_API_VERSION@_la_includeHEADERS: @$(NORMAL_UNINSTALL) @list='$(libcmis_@LIBCMIS_API_VERSION@_la_include_HEADERS)'; test -n "$(libcmis_@LIBCMIS_API_VERSION@_la_includedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(libcmis_@LIBCMIS_API_VERSION@_la_includedir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(libcmis_@LIBCMIS_API_VERSION@_la_includedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ clean-noinstLTLIBRARIES mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: \ install-libcmis_@LIBCMIS_API_VERSION@_la_includeHEADERS install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-libLTLIBRARIES install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-libLTLIBRARIES \ uninstall-libcmis_@LIBCMIS_API_VERSION@_la_includeHEADERS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool clean-noinstLTLIBRARIES \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-libLTLIBRARIES \ install-libcmis_@LIBCMIS_API_VERSION@_la_includeHEADERS \ install-man install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am uninstall-libLTLIBRARIES \ uninstall-libcmis_@LIBCMIS_API_VERSION@_la_includeHEADERS # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: libcmis-0.4.1/src/libcmis/gdrive-utils.hxx0000644000175000001440000000443712173212453015443 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2013 Cao Cuong Ngo * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #ifndef _GDRIVE_UTILS_HXX_ #define _GDRIVE_UTILS_HXX_ #include #include "property.hxx" #include "json-utils.hxx" static const std::string GDRIVE_FOLDER_MIME_TYPE = "application/vnd.google-apps.folder" ; static const std::string GDRIVE_UPLOAD_LINKS = "https://www.googleapis.com/upload/drive/v2/files/"; class GdriveUtils { public : // Convert a GDrive Property key to a CMIS key static std::string toCmisKey( const std::string& key); // Convert a CMIS key to GDrive key static std::string toGdriveKey( const std::string& key ); // Convert CMIS properties to GDrive properties static Json toGdriveJson( const libcmis::PropertyPtrMap& properties ); // Check if a property is updatable static bool checkUpdatable( const std::string& key); // Check if a property has multiple values static bool checkMultiValued( const std::string& key); // Create a Json array from a ParentId static Json createJsonFromParentId( const std::string& parentId ); // Parse a Gdrive property value to CMIS values static std::vector< std::string > parseGdriveProperty( std::string key, Json jsonValue ); }; #endif libcmis-0.4.1/src/libcmis/gdrive-document.cxx0000644000175000001440000002145512175751364016126 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2013 Cao Cuong Ngo * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #include "gdrive-document.hxx" #include "gdrive-folder.hxx" #include "gdrive-session.hxx" #include "json-utils.hxx" #include "rendition.hxx" #include "gdrive-utils.hxx" using namespace std; using namespace libcmis; GDriveDocument::GDriveDocument( GDriveSession* session ) : libcmis::Object( session), libcmis::Document( session ), GDriveObject( session ), m_isGoogleDoc( false ) { } GDriveDocument::GDriveDocument( GDriveSession* session, Json json, string id, string name ) : libcmis::Object( session), libcmis::Document( session ), GDriveObject( session, json, id, name ), m_isGoogleDoc( false ) { m_isGoogleDoc = getContentType( ).find( "google" ) != string::npos; getRenditions( ); } GDriveDocument::~GDriveDocument( ) { } string GDriveDocument::getDownloadUrl( string streamId ) { string streamUrl; vector< RenditionPtr > renditions = getRenditions( ); if ( renditions.empty( ) ) return streamUrl; if ( !streamId.empty( ) ) { // Find the rendition associated with the streamId for ( vector< RenditionPtr >::iterator it = renditions.begin( ) ; it != renditions.end(); ++it ) { if ( (*it)->getStreamId( ) == streamId ) { streamUrl = (*it)->getUrl( ); break; } } } else { // Automatically find the rendition // Prefer ODF format for ( vector< RenditionPtr >::iterator it = renditions.begin( ) ; it != renditions.end(); ++it ) if ( (*it)->getMimeType( ).find( "opendocument") != string::npos ) return (*it)->getUrl( ); // Then MS format for ( vector< RenditionPtr >::iterator it = renditions.begin( ) ; it != renditions.end(); ++it ) if ( (*it)->getMimeType( ).find( "officedocument") != string::npos ) return (*it)->getUrl( ); // If not found, take the first one streamUrl = renditions.front( )->getUrl( ); } return streamUrl; } vector< libcmis::FolderPtr > GDriveDocument::getParents( ) throw ( libcmis::Exception ) { vector< libcmis::FolderPtr > parents; vector< string > parentsId = getMultiStringProperty( "cmis:parentId" ); // Create folder objects from parent IDs for ( vector< string >::iterator it = parentsId.begin( ); it != parentsId.end( ); ++it) { string parentId = ( *it ); libcmis::ObjectPtr obj = getSession( )->getObject( parentId ); libcmis::FolderPtr parent = boost::dynamic_pointer_cast< libcmis::Folder >( obj ); parents.push_back( parent ); } return parents; } boost::shared_ptr< istream > GDriveDocument::getContentStream( string streamId ) throw ( libcmis::Exception ) { boost::shared_ptr< istream > stream; string streamUrl = getDownloadUrl( streamId ); if ( streamUrl.empty( ) ) throw libcmis::Exception( "can not found stream url" ); try { stream = getSession( )->httpGetRequest( streamUrl )->getStream( ); } catch ( const CurlException& e ) { throw e.getCmisException( ); } return stream; } void GDriveDocument::uploadStream( boost::shared_ptr< ostream > os, string contentType ) throw ( libcmis::Exception ) { if ( !os.get( ) ) throw libcmis::Exception( "Missing stream" ); if ( !isImmutable( ) ) throw libcmis::Exception( string ( "Document " + getId( )+ " is not editable" ) ); string putUrl = getUploadUrl( ) + getId( ); // If it's a Google document, convert it if ( isGoogleDoc( ) ) putUrl += "?convert=true"; // Upload stream boost::shared_ptr< istream> is ( new istream ( os->rdbuf( ) ) ); vector headers; headers.push_back( string( "Content-Type: " ) + contentType ); try { getSession()->httpPutRequest( putUrl, *is, headers ); } catch ( const CurlException& e ) { throw e.getCmisException( ); } long httpStatus = getSession( )->getHttpStatus( ); if ( httpStatus < 200 || httpStatus >= 300 ) throw libcmis::Exception( "Document content wasn't set for" "some reason" ); refresh( ); } void GDriveDocument::setContentStream( boost::shared_ptr< ostream > os, string contentType, string fileName, bool /*overwrite*/ ) throw ( libcmis::Exception ) { if ( !os.get( ) ) throw libcmis::Exception( "Missing stream" ); if ( !isImmutable( ) ) throw libcmis::Exception( string ( "Document " + getId( )+ " is not editable" ) ); string metaUrl = getUrl( ); // If it's a Google document, convert it if ( isGoogleDoc( ) ) metaUrl += "?convert=true"; // Update file name meta information if ( !fileName.empty( ) && fileName != getContentFilename( ) ) { Json metaJson; Json fileJson( fileName.c_str( ) ); metaJson.add("title", fileJson ); std::istringstream is( metaJson.toString( ) ); vector headers; headers.push_back( "Content-Type: application/json" ); try { getSession()->httpPutRequest( metaUrl, is, headers ); } catch ( const CurlException& e ) { throw e.getCmisException( ); } } // Upload stream uploadStream( os, contentType ); } libcmis::DocumentPtr GDriveDocument::checkOut( ) throw ( libcmis::Exception ) { // GDrive doesn't have CheckOut, so just return the same document here libcmis::ObjectPtr obj = getSession( )->getObject( getId( ) ); libcmis::DocumentPtr checkout = boost::dynamic_pointer_cast< libcmis::Document > ( obj ); return checkout; } void GDriveDocument::cancelCheckout( ) throw ( libcmis::Exception ) { // Don't do anything since we don't have CheckOut } libcmis::DocumentPtr GDriveDocument::checkIn( bool /*isMajor*/, std::string /*comment*/, const PropertyPtrMap& properties, boost::shared_ptr< std::ostream > stream, std::string contentType, std::string fileName ) throw ( libcmis::Exception ) { // GDrive doesn't have CheckIn, so just upload the properties, // the content stream and fetch the new document resource. updateProperties( properties ); setContentStream( stream, contentType, fileName ); libcmis::ObjectPtr obj = getSession( )->getObject( getId( ) ); libcmis::DocumentPtr checkin = boost::dynamic_pointer_cast< libcmis::Document > ( obj ); return checkin; } vector< libcmis::DocumentPtr > GDriveDocument::getAllVersions( ) throw ( libcmis::Exception ) { vector< libcmis::DocumentPtr > revisions; string versionUrl = getUrl( ) + "/revisions"; // Run the http request to get the properties definition string res; try { res = getSession()->httpGetRequest( versionUrl )->getStream()->str(); } catch ( const CurlException& e ) { throw e.getCmisException( ); } Json jsonRes = Json::parse( res ); Json::JsonVector objs = jsonRes["items"].getList( ); string parentId = getStringProperty( "cmis:parentId" ); // Create document objects from Json objects for(unsigned int i = 0; i < objs.size(); i++) { objs[i].add( "parents", GdriveUtils::createJsonFromParentId( parentId ) ); libcmis::DocumentPtr revision( new GDriveDocument( getSession(), objs[i], getId( ), getName( ) ) ); revisions.push_back( revision ); } return revisions; } libcmis-0.4.1/src/libcmis/ws-object.hxx0000644000175000001440000000407512177732044014727 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2011 SUSE * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #ifndef _WS_OBJECT_HXX_ #define _WS_OBJECT_HXX_ #include "folder.hxx" #include "object.hxx" #include "ws-session.hxx" class WSObject : public virtual libcmis::Object { protected: WSObject( WSSession* session ); public: WSObject( WSSession* session, xmlNodePtr node ); WSObject( const WSObject& copy ); virtual ~WSObject( ); WSObject& operator=( const WSObject& copy ); virtual std::vector< libcmis::RenditionPtr > getRenditions( std::string filter ) throw ( libcmis::Exception ); virtual libcmis::ObjectPtr updateProperties( const std::map< std::string, libcmis::PropertyPtr >& properties ) throw ( libcmis::Exception ); virtual void refresh( ) throw ( libcmis::Exception ); virtual void remove( bool allVersions = true ) throw ( libcmis::Exception ); virtual void move( libcmis::FolderPtr source, libcmis::FolderPtr destination ) throw ( libcmis::Exception ); WSSession* getSession( ); }; #endif libcmis-0.4.1/src/libcmis/property-type.hxx0000644000175000001440000001034612173212453015664 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2011 SUSE * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #ifndef _PROPERTY_TYPE_HXX_ #define _PROPERTY_TYPE_HXX_ #include #include #include namespace libcmis { class PropertyType { public: enum Type { String, Integer, Decimal, Bool, DateTime }; private: std::string m_id; std::string m_localName; std::string m_localNamespace; std::string m_displayName; std::string m_queryName; Type m_type; std::string m_xmlType; bool m_multiValued; bool m_updatable; bool m_inherited; bool m_required; bool m_queryable; bool m_orderable; bool m_openChoice; public: /// Default constructor, mostly present for testing. PropertyType( ); PropertyType( xmlNodePtr node ); PropertyType( const PropertyType& copy ); virtual ~PropertyType( ) { }; PropertyType& operator=( const PropertyType& copy ); std::string getId( ) { return m_id; } std::string getLocalName( ) { return m_localName; } std::string getLocalNamespace( ) { return m_localNamespace; } std::string getDisplayName( ) { return m_displayName; } std::string getQueryName( ) { return m_queryName; } Type getType( ) { return m_type; } std::string getXmlType( ) { return m_xmlType; } bool isMultiValued( ) { return m_multiValued; } bool isUpdatable( ) { return m_updatable; } bool isInherited( ) { return m_inherited; } bool isRequired( ) { return m_required; } bool isQueryable( ) { return m_queryable; } bool isOrderable( ) { return m_orderable; } bool isOpenChoice( ) { return m_openChoice; } void setId( std::string id ) { m_id = id; } void setLocalName( std::string localName ) { m_localName = localName; } void setLocalNamespace( std::string localNamespace ) { m_localNamespace = localNamespace; } void setDisplayName( std::string displayName ) { m_displayName = displayName; } void setQueryName( std::string queryName ) { m_queryName = queryName; } void setType( Type type ) { m_type = type; } void setMultiValued( bool multivalued ) { m_multiValued = multivalued; } void setUpdatable( bool updatable ) { m_updatable = updatable; } void setInherited( bool inherited ) { m_inherited = inherited; } void setRequired( bool required ) { m_required = required; } void setQueryable( bool queryable ) { m_queryable = queryable; } void setOrderable( bool orderable ) { m_orderable = orderable; } void setOpenChoice( bool openChoice ) { m_openChoice = openChoice; } void setTypeFromXml( std::string typeStr ); void setTypeFromJsonType( std::string jsonType ); }; typedef ::boost::shared_ptr< PropertyType > PropertyTypePtr; } #endif libcmis-0.4.1/src/libcmis/allowable-actions.hxx0000644000175000001440000000746112156277660016441 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2011 SUSE * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #ifndef _ALLOWABLE_ACTIONS_HXX_ #define _ALLOWABLE_ACTIONS_HXX_ #include #include #include #include #include "exception.hxx" namespace libcmis { class Object; class ObjectAction { public: enum Type { DeleteObject, UpdateProperties, GetFolderTree, GetProperties, GetObjectRelationships, GetObjectParents, GetFolderParent, GetDescendants, MoveObject, DeleteContentStream, CheckOut, CancelCheckOut, CheckIn, SetContentStream, GetAllVersions, AddObjectToFolder, RemoveObjectFromFolder, GetContentStream, ApplyPolicy, GetAppliedPolicies, RemovePolicy, GetChildren, CreateDocument, CreateFolder, CreateRelationship, DeleteTree, GetRenditions, GetACL, ApplyACL }; private: Type m_type; bool m_enabled; bool m_valid; public: ObjectAction( xmlNodePtr node ); virtual ~ObjectAction( ){ } Type getType( ) { return m_type; } bool isEnabled( ) { return m_enabled; } bool isValid( ) { return m_valid; } /** Parses the permission name into one of the enum values or throws an exception for invalid input strings. */ static Type parseType( std::string type ) throw ( Exception ); }; /** Class providing access to the allowed actions on an object. */ class AllowableActions { protected: std::map< ObjectAction::Type, bool > m_states; public: /** Default constructor for testing purpose */ AllowableActions( ); AllowableActions( xmlNodePtr node ); AllowableActions( const AllowableActions& copy ); virtual ~AllowableActions( ); AllowableActions& operator=( const AllowableActions& copy ); /** Returns the permissions for the corresponding actions. */ bool isAllowed( ObjectAction::Type action ); /** Returns true if the action was defined, false if the default value is used. */ bool isDefined( ObjectAction::Type action ); std::string toString( ); }; typedef boost::shared_ptr< AllowableActions > AllowableActionsPtr; } #endif libcmis-0.4.1/src/libcmis/Makefile.am0000644000175000001440000000475412200457173014333 00000000000000AM_CXXFLAGS = -I$(top_srcdir)/src/libcmis $(XML2_CFLAGS) $(CURL_CFLAGS) $(BOOST_CPPFLAGS) -O0 libcmis_@LIBCMIS_API_VERSION@_la_include_HEADERS = \ allowable-actions.hxx \ document.hxx \ exception.hxx \ folder.hxx \ oauth2-data.hxx \ object-type.hxx \ object.hxx \ property-type.hxx \ property.hxx \ rendition.hxx \ repository.hxx \ session-factory.hxx \ session.hxx \ xml-utils.hxx \ xmlserializable.hxx \ libcmis.hxx noinst_LTLIBRARIES = libcmis.la lib_LTLIBRARIES = libcmis-@LIBCMIS_API_VERSION@.la libcmis_@LIBCMIS_API_VERSION@_la_SOURCES = \ dummy.cxx libcmis_la_SOURCES = \ $(libcmis_headers_public) \ session-factory.cxx \ base-session.hxx \ base-session.cxx \ allowable-actions.cxx \ document.cxx \ folder.cxx \ oauth2-data.cxx \ object.cxx \ object-type.cxx \ property.cxx \ property-type.cxx \ repository.cxx \ xml-utils.cxx \ atom-document.hxx \ atom-folder.hxx \ atom-object.hxx \ atom-object-type.hxx \ atom-object-type.cxx \ atom-session.hxx \ atom-document.cxx \ atom-folder.cxx \ atom-object.cxx \ atom-session.cxx \ atom-workspace.hxx \ atom-workspace.cxx \ ws-document.hxx \ ws-document.cxx \ ws-folder.hxx \ ws-folder.cxx \ ws-navigationservice.hxx \ ws-navigationservice.cxx \ ws-object.hxx \ ws-object.cxx \ ws-object-type.hxx \ ws-object-type.cxx \ ws-objectservice.hxx \ ws-objectservice.cxx \ ws-relatedmultipart.hxx \ ws-relatedmultipart.cxx \ ws-repositoryservice.hxx \ ws-repositoryservice.cxx \ ws-requests.hxx \ ws-requests.cxx \ ws-soap.hxx \ ws-soap.cxx \ ws-session.hxx \ ws-session.cxx \ ws-versioningservice.hxx \ ws-versioningservice.cxx \ gdrive-allowable-actions.hxx \ gdrive-document.hxx \ gdrive-document.cxx \ gdrive-folder.hxx \ gdrive-folder.cxx \ gdrive-object.hxx \ gdrive-object.cxx \ gdrive-object-type.hxx \ gdrive-object-type.cxx \ gdrive-property.hxx \ gdrive-property.cxx \ gdrive-repository.hxx \ gdrive-repository.cxx \ gdrive-session.hxx \ gdrive-session.cxx \ gdrive-utils.hxx \ gdrive-utils.cxx \ json-utils.hxx \ json-utils.cxx \ oauth2-handler.hxx \ oauth2-handler.cxx \ rendition.cxx \ oauth2-providers.hxx \ oauth2-providers.cxx libcmis_@LIBCMIS_API_VERSION@_la_LDFLAGS = -export-dynamic -no-undefined -version-info 4:1:0 libcmis_@LIBCMIS_API_VERSION@_la_LIBADD = \ libcmis.la \ $(XML2_LIBS) \ $(CURL_LIBS) \ $(BOOST_SMART_PTR_LIBS) \ $(BOOST_DATE_TIME_LIBS) libcmis_@LIBCMIS_API_VERSION@_la_includedir = $(includedir)/libcmis-@LIBCMIS_API_VERSION@/libcmis libcmis-0.4.1/src/libcmis/gdrive-object.hxx0000644000175000001440000000640212177712512015550 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2013 SUSE * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #ifndef _GDRIVE_OBJECT_HXX_ #define _GDRIVE_OBJECT_HXX_ #include "gdrive-session.hxx" #include "json-utils.hxx" #include "object.hxx" /** Class representing an object for Google Drive protocol. This class overrides quite a number of its parent class methods to git the Google Drive API into the libcmis API. In order to reuse more of the base Object class, this class needs to map the main properties (like id, name, etc) to CMIS property ids (cmis:id, cmis:name, etc). */ class GDriveObject : public virtual libcmis::Object { public: GDriveObject( GDriveSession* session ); // Create a GDrive document from Json properties. // In case it's a revision, keep the ID and the name of the original file. GDriveObject( GDriveSession* session, Json json, std::string id = std::string( ), std::string name = std::string( ) ); GDriveObject( const GDriveObject& copy ); virtual ~GDriveObject( ) { } GDriveObject& operator=( const GDriveObject& copy ); void initializeFromJson( Json json, std::string id = std::string( ), std::string name = std::string( ) ); void refreshImpl( Json json ); Json createJsonFromParentId( const std::string& parentId ); std::string getUrl( ); std::string getUploadUrl( ); std::vector< std::string > getMultiStringProperty( const std::string& propertyName ); virtual std::vector< libcmis::RenditionPtr> getRenditions( std::string filter = std::string( ) ) throw ( libcmis::Exception ); virtual boost::shared_ptr< Object > updateProperties( const libcmis::PropertyPtrMap& properties ) throw ( libcmis::Exception ); virtual void refresh( ) throw ( libcmis::Exception ); virtual void remove( bool allVersions = true ) throw ( libcmis::Exception ); virtual void move( boost::shared_ptr< libcmis::Folder > source, boost::shared_ptr< libcmis::Folder > destination ) throw ( libcmis::Exception ); protected: GDriveSession* getSession( ); }; #endif libcmis-0.4.1/src/libcmis/ws-object.cxx0000644000175000001440000000655112200150077014706 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2011 SUSE * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #include "ws-object.hxx" using namespace std; using libcmis::PropertyPtrMap; WSObject::WSObject( WSSession* session ) : libcmis::Object( session ) { } WSObject::WSObject( WSSession* session, xmlNodePtr node ) : libcmis::Object( session, node ) { } WSObject::WSObject( const WSObject& copy ) : libcmis::Object( copy ) { } WSObject::~WSObject( ) { } WSObject& WSObject::operator=( const WSObject& copy ) { if ( this != © ) { libcmis::Object::operator=( copy ); } return *this; } vector< libcmis::RenditionPtr > WSObject::getRenditions( string filter ) throw ( libcmis::Exception ) { // Check that the server supports that optional feature. There is no need to check it // when getting the object as we may get them by shear luck libcmis::RepositoryPtr repo = getSession( )->getRepository( ); bool isCapable = repo && repo->getCapability( libcmis::Repository::Renditions ) == "read"; if ( m_renditions.empty() && isCapable ) { string repoId = getSession( )->getRepositoryId( ); m_renditions = getSession( )->getObjectService( ).getRenditions( repoId, this->getId( ), filter ); } return m_renditions; } libcmis::ObjectPtr WSObject::updateProperties( const PropertyPtrMap& properties ) throw ( libcmis::Exception ) { string repoId = getSession( )->getRepositoryId( ); return getSession( )->getObjectService( ).updateProperties( repoId, this->getId( ), properties, this->getChangeToken( ) ); } void WSObject::refresh( ) throw ( libcmis::Exception ) { libcmis::ObjectPtr object = m_session->getObject( getId( ) ); WSObject* const other = dynamic_cast< WSObject* >( object.get( ) ); if ( other != NULL ) *this = *other; } void WSObject::remove( bool allVersions ) throw ( libcmis::Exception ) { string repoId = getSession( )->getRepositoryId( ); getSession( )->getObjectService( ).deleteObject( repoId, this->getId( ), allVersions ); } void WSObject::move( libcmis::FolderPtr source, libcmis::FolderPtr destination ) throw ( libcmis::Exception ) { string repoId = getSession( )->getRepositoryId( ); getSession( )->getObjectService( ).move( repoId, getId( ), destination->getId( ), source->getId( ) ); refresh( ); } WSSession* WSObject::getSession( ) { return dynamic_cast< WSSession* >( m_session ); } libcmis-0.4.1/src/libcmis/document.cxx0000644000175000001440000000634212177664703014650 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2011 SUSE * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #include "document.hxx" #include "folder.hxx" using namespace std; using libcmis::PropertyPtrMap; namespace libcmis { vector< string > Document::getPaths( ) { vector< string > paths; try { vector< libcmis::FolderPtr > parents = getParents( ); for ( vector< libcmis::FolderPtr >::iterator it = parents.begin( ); it != parents.end(); ++it ) { string path = ( *it )->getPath( ); if ( path[path.size() - 1] != '/' ) path += "/"; path += getName( ); paths.push_back( path ); } } catch ( const libcmis::Exception& ) { // We may not have the permission to get the parents } return paths; } string Document::getContentType( ) { return getStringProperty( "cmis:contentStreamMimeType" ); } string Document::getContentFilename( ) { return getStringProperty( "cmis:contentStreamFileName" ); } long Document::getContentLength( ) { long contentLength = 0; PropertyPtrMap::const_iterator it = getProperties( ).find( string( "cmis:contentStreamLength" ) ); if ( it != getProperties( ).end( ) && it->second != NULL && !it->second->getLongs( ).empty( ) ) contentLength = it->second->getLongs( ).front( ); return contentLength; } string Document::toString( ) { stringstream buf; buf << "Document Object:" << endl << endl; buf << Object::toString(); try { vector< libcmis::FolderPtr > parents = getParents( ); buf << "Parents ids: "; for ( vector< libcmis::FolderPtr >::iterator it = parents.begin(); it != parents.end(); ++it ) buf << "'" << ( *it )->getId( ) << "' "; buf << endl; } catch ( const libcmis::Exception& ) { } buf << "Content Type: " << getContentType( ) << endl; buf << "Content Length: " << getContentLength( ) << endl; buf << "Content Filename: " << getContentFilename( ) << endl; return buf.str(); } } libcmis-0.4.1/src/libcmis/xml-utils.hxx0000644000175000001440000001275412156277660015000 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2011 SUSE * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #ifndef _XML_UTILS_HXX_ #define _XML_UTILS_HXX_ #include #include #include #include #include #include #include #include #include "exception.hxx" #define NS_CMIS_PREFIX "cmis" #define NS_CMISRA_PREFIX "cmisra" #define NS_SOAP_ENV_PREFIX "soap-env" #define NS_CMIS_URL "http://docs.oasis-open.org/ns/cmis/core/200908/" #define NS_CMISRA_URL "http://docs.oasis-open.org/ns/cmis/restatom/200908/" #define NS_CMISM_URL "http://docs.oasis-open.org/ns/cmis/messaging/200908/" #define NS_CMISW_URL "http://docs.oasis-open.org/ns/cmis/ws/200908/" #define NS_APP_URL "http://www.w3.org/2007/app" #define NS_ATOM_URL "http://www.w3.org/2005/Atom" #define NS_SOAP_URL "http://schemas.xmlsoap.org/wsdl/soap/" #define NS_SOAP_ENV_URL "http://schemas.xmlsoap.org/soap/envelope/" #define LIBCURL_VERSION_VALUE ( \ ( LIBCURL_VERSION_MAJOR << 16 ) | ( LIBCURL_VERSION_MINOR << 8 ) | ( LIBCURL_VERSION_PATCH ) \ ) namespace libcmis { /** Class used to decode a stream. An instance of this class can hold remaining un-decoded data to use for a future decode call. */ class EncodedData { private: xmlTextWriterPtr m_writer; FILE* m_stream; std::ostream* m_outStream; std::string m_encoding; bool m_decode; unsigned long m_pendingValue; int m_pendingRank; size_t m_missingBytes; public: EncodedData( FILE* stream ); EncodedData( std::ostream* stream ); EncodedData( const EncodedData& rCopy ); EncodedData( xmlTextWriterPtr writer ); EncodedData& operator=( const EncodedData& rCopy ); void setEncoding( std::string encoding ) { m_encoding = encoding; } void decode( void* buf, size_t size, size_t nmemb ); void encode( void* buf, size_t size, size_t nmemb ); void finish( ); private: void write( void* buf, size_t size, size_t nmemb ); void decodeBase64( const char* buf, size_t len ); void encodeBase64( const char* buf, size_t len ); }; class HttpResponse { private: std::map< std::string, std::string > m_headers; boost::shared_ptr< std::stringstream > m_stream; boost::shared_ptr< EncodedData > m_data; public: HttpResponse( ); ~HttpResponse( ) { }; std::map< std::string, std::string >& getHeaders( ) { return m_headers; } boost::shared_ptr< EncodedData > getData( ) { return m_data; } boost::shared_ptr< std::stringstream > getStream( ) { return m_stream; } }; typedef boost::shared_ptr< HttpResponse > HttpResponsePtr; void registerNamespaces( xmlXPathContextPtr xpathCtx ); /** Register the CMIS and WSDL / SOAP namespaces */ void registerCmisWSNamespaces( xmlXPathContextPtr xpathCtx ); /** Register only the WSD / SOAP namespaces. */ void registerSoapNamespaces( xmlXPathContextPtr xpathCtx ); std::string getXPathValue( xmlXPathContextPtr xpathCtx, std::string req ); xmlDocPtr wrapInDoc( xmlNodePtr entryNode ); /** Utility extracting an attribute value from an Xml Node, based on the attribute name. */ std::string getXmlNodeAttributeValue( xmlNodePtr node, const char* attributeName ) throw ( Exception ); /** Parse a xsd:dateTime string and return the corresponding UTC posix time. */ boost::posix_time::ptime parseDateTime( std::string dateTimeStr ); /// Write a UTC time object to an xsd:dateTime string std::string writeDateTime( boost::posix_time::ptime time ); bool parseBool( std::string str ) throw ( Exception ); long parseInteger( std::string str ) throw ( Exception ); double parseDouble( std::string str ) throw ( Exception ); /** Trim spaces on the left and right of a string. */ std::string trim( const std::string& str ); std::string base64encode( const std::string& str ); std::string sha1( const std::string& str ); std::string tolower( std::string sText ); int stringstream_write_callback(void * context, const char * s, int len); std::string escape( std::string str ); std::string unescape( std::string str ); } #endif libcmis-0.4.1/src/libcmis/exception.hxx0000644000175000001440000000336412175751364015034 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2011 SUSE * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #ifndef _EXCEPTION_HXX_ #define _EXCEPTION_HXX_ #include #include namespace libcmis { class Exception : public std::exception { private: std::string m_message; std::string m_type; public: Exception( std::string message, std::string type = "runtime" ) : exception( ), m_message( message ), m_type( type ) { } ~Exception( ) throw () { } virtual const char* what() const throw() { return m_message.c_str( ); } std::string getType( ) const { return m_type; } }; } #endif libcmis-0.4.1/src/libcmis/base-session.hxx0000644000175000001440000001330312175751364015423 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2011 SUSE * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #ifndef _BASE_SESSION_HXX_ #define _BASE_SESSION_HXX_ #include #include #include #include #include #include #include #include #include "exception.hxx" #include "oauth2-data.hxx" #include "session.hxx" #include "xml-utils.hxx" class OAuth2Handler; class CurlException : public std::exception { private: std::string m_message; CURLcode m_code; std::string m_url; long m_httpStatus; bool m_cancelled; mutable std::string m_errorMessage; public: CurlException( std::string message, CURLcode code, std::string url, long httpStatus ) : exception( ), m_message( message ), m_code( code ), m_url( url ), m_httpStatus( httpStatus ), m_cancelled( false ), m_errorMessage( ) { } CurlException( std::string message ) : exception( ), m_message( message ), m_code( CURLE_OK ), m_url( ), m_httpStatus( 0 ), m_cancelled( true ), m_errorMessage( ) { } ~CurlException( ) throw () { } virtual const char* what( ) const throw (); CURLcode getErrorCode( ) const { return m_code; } std::string getErrorMessage( ) const { return m_message; } bool isCancelled( ) const { return m_cancelled; } long getHttpStatus( ) const { return m_httpStatus; } libcmis::Exception getCmisException ( ) const; }; class BaseSession : public libcmis::Session { private: CURL* m_curlHandle; bool m_no100Continue; protected: OAuth2Handler* m_oauth2Handler; std::string m_bindingUrl; std::string m_repositoryId; std::string m_username; std::string m_password; bool m_authProvided; std::vector< libcmis::RepositoryPtr > m_repositories; bool m_verbose; bool m_noHttpErrors; bool m_noSSLCheck; bool m_refreshedToken; public: BaseSession( std::string sBindingUrl, std::string repository, std::string username, std::string password, bool noSslCheck = false, libcmis::OAuth2DataPtr oauth2 = libcmis::OAuth2DataPtr(), bool verbose = false ) throw ( libcmis::Exception ); BaseSession( const BaseSession& copy ); ~BaseSession( ); BaseSession& operator=( const BaseSession& copy ); std::string& getUsername( ) throw ( CurlException ); std::string& getPassword( ) throw ( CurlException ); std::string& getRepositoryId( ) { return m_repositoryId; } /** Don't throw the HTTP errors as CurlExceptions. */ void setNoHttpErrors( bool noHttpErrors ) { m_noHttpErrors = noHttpErrors; } /** Set the OAuth2 data and get the access / refresh tokens. */ void setOAuth2Data( libcmis::OAuth2DataPtr oauth2 ) throw ( libcmis::Exception ); // Utility methods std::string getRootId( ) throw ( libcmis::Exception ) { return getRepository()->getRootId( ); } std::string createUrl( const std::string& pattern, std::map< std::string, std::string > variables ); std::string getBindingUrl( ) { return m_bindingUrl; } libcmis::HttpResponsePtr httpGetRequest( std::string url ) throw ( CurlException ); libcmis::HttpResponsePtr httpPutRequest( std::string url, std::istream& is, std::vector< std::string > headers ) throw ( CurlException ); libcmis::HttpResponsePtr httpPostRequest( const std::string& url, std::istream& is, const std::string& contentType, bool redirect = true ) throw ( CurlException ); void httpDeleteRequest( std::string url ) throw ( CurlException ); long getHttpStatus( ); // Session methods virtual void setNoSSLCertificateCheck( bool noCheck ); virtual std::vector< libcmis::RepositoryPtr > getRepositories( ); virtual libcmis::FolderPtr getRootFolder() throw ( libcmis::Exception ); virtual libcmis::FolderPtr getFolder( std::string id ) throw ( libcmis::Exception ); virtual std::string getRefreshToken( ) throw ( libcmis::Exception ); protected: BaseSession( ); private: void checkCredentials( ) throw ( CurlException ); void httpRunRequest( std::string url, std::vector< std::string > headers = std::vector< std::string > ( ), bool redirect = true ) throw ( CurlException ); void initProtocols( ); }; #endif libcmis-0.4.1/src/libcmis/ws-document.hxx0000644000175000001440000000471012156277660015300 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2011 SUSE * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #ifndef _WS_DOCUMENT_HXX_ #define _WS_DOCUMENT_HXX_ #include "document.hxx" #include "folder.hxx" #include "ws-object.hxx" class WSDocument : public libcmis::Document, public WSObject { public: WSDocument( const WSObject& object ); virtual ~WSDocument( ); virtual std::vector< libcmis::FolderPtr > getParents( ) throw ( libcmis::Exception ); virtual boost::shared_ptr< std::istream > getContentStream( std::string streamId = std::string( ) ) throw ( libcmis::Exception ); virtual void setContentStream( boost::shared_ptr< std::ostream > os, std::string contentType, std::string fileName, bool overwrite = true ) throw ( libcmis::Exception ); virtual libcmis::DocumentPtr checkOut( ) throw ( libcmis::Exception ); virtual void cancelCheckout( ) throw ( libcmis::Exception ); virtual libcmis::DocumentPtr checkIn( bool isMajor, std::string comment, const std::map< std::string, libcmis::PropertyPtr >& properties, boost::shared_ptr< std::ostream > stream, std::string contentType, std::string fileName ) throw ( libcmis::Exception ); virtual std::vector< libcmis::DocumentPtr > getAllVersions( ) throw ( libcmis::Exception ); }; #endif libcmis-0.4.1/src/libcmis/object.hxx0000644000175000001440000001330612177712167014301 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2011 SUSE * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #ifndef _OBJECT_HXX_ #define _OBJECT_HXX_ #include #include #include #include #ifndef __cplusplus #include #endif #include #include #include #include "allowable-actions.hxx" #include "exception.hxx" #include "object-type.hxx" #include "property.hxx" #include "xmlserializable.hxx" #include "rendition.hxx" namespace libcmis { class Folder; class Session; /** Class representing any CMIS object. */ class Object : public XmlSerializable { protected: Session* m_session; ObjectTypePtr m_typeDescription; time_t m_refreshTimestamp; /** Type id used as cache before we get it as a property */ std::string m_typeId; std::map< std::string, PropertyPtr > m_properties; boost::shared_ptr< AllowableActions > m_allowableActions; std::vector< RenditionPtr > m_renditions; void initializeFromNode( xmlNodePtr node ); public: Object( Session* session ); Object( Session* session, xmlNodePtr node ); Object( const Object& copy ); virtual ~Object( ) { } Object& operator=( const Object& copy ); virtual std::string getId( ); virtual std::string getName( ); virtual std::string getStringProperty( const std::string& propertyName ); /** Computes the paths for the objects. Note that folders will have only path, documents may have several ones and there may be cases where there is no path at all (unfiled objects); */ virtual std::vector< std::string > getPaths( ); virtual std::string getBaseType( ); virtual std::string getType( ); virtual std::string getCreatedBy( ); virtual boost::posix_time::ptime getCreationDate( ); virtual std::string getLastModifiedBy( ); virtual boost::posix_time::ptime getLastModificationDate( ); virtual std::string getChangeToken( ); virtual bool isImmutable( ); /** Gives access to the properties of the object. \attention API users should consider this method as read-only as the changed properties won't be updated to the server. Updating the returned map may lead to changes loss when calling updateProperties. \sa updateProperties to change properties on the server */ virtual libcmis::PropertyPtrMap& getProperties( ); /** Get the renditions of the object. \param filter is defined by the CMIS spec section 2.2.1.2.4.1. By default, this value is just ignored, but some bindings and servers may use it. \attention The streamId of the rendition is used in getContentStream( ) */ virtual std::vector< RenditionPtr> getRenditions( std::string filter = std::string( ) ) throw ( Exception ); virtual AllowableActionsPtr getAllowableActions( ) { return m_allowableActions; } /** Update the object properties and return the updated object. \attention even if the returned object may have the same Id than 'this' and thus representing the same object on the server, those are still two different instances to ease memory handling. */ virtual boost::shared_ptr< Object > updateProperties( const PropertyPtrMap& properties ) throw ( Exception ) = 0; virtual ObjectTypePtr getTypeDescription( ); /** Reload the data from the server. */ virtual void refresh( ) throw ( Exception ) = 0; virtual time_t getRefreshTimestamp( ) { return m_refreshTimestamp; } virtual void remove( bool allVersions = true ) throw ( Exception ) = 0; virtual void move( boost::shared_ptr< Folder > source, boost::shared_ptr< Folder > destination ) throw ( Exception ) = 0; virtual std::string getThumbnailUrl( ) throw ( Exception ); /** Dump the object as a string for debugging or display purpose. */ virtual std::string toString( ); void toXml( xmlTextWriterPtr writer ); }; typedef ::boost::shared_ptr< Object > ObjectPtr; } #endif libcmis-0.4.1/src/libcmis/ws-folder.hxx0000644000175000001440000000421012023641341014710 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2011 SUSE * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #ifndef _WS_FOLDER_HXX_ #define _WS_FOLDER_HXX_ #include "document.hxx" #include "folder.hxx" #include "ws-object.hxx" #include "ws-session.hxx" class WSFolder : public libcmis::Folder, public WSObject { public: WSFolder( const WSObject& object ); virtual ~WSFolder( ); // virtual pure methods from Folder virtual std::vector< libcmis::ObjectPtr > getChildren( ) throw ( libcmis::Exception ); virtual libcmis::FolderPtr createFolder( const std::map< std::string, libcmis::PropertyPtr >& properties ) throw ( libcmis::Exception ); virtual libcmis::DocumentPtr createDocument( const std::map< std::string, libcmis::PropertyPtr >& properties, boost::shared_ptr< std::ostream > os, std::string contentType, std::string fileName ) throw ( libcmis::Exception ); virtual std::vector< std::string > removeTree( bool allVersion = true, libcmis::UnfileObjects::Type unfile = libcmis::UnfileObjects::Delete, bool continueOnError = false ) throw ( libcmis::Exception ); }; #endif libcmis-0.4.1/src/libcmis/ws-versioningservice.cxx0000644000175000001440000001027412156277660017223 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2011 SUSE * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #include "ws-versioningservice.hxx" #include "ws-requests.hxx" #include "ws-session.hxx" using namespace std; using libcmis::PropertyPtrMap; VersioningService::VersioningService( WSSession* session ) : m_session( session ), m_url( session->getServiceUrl( "VersioningService" ) ) { } VersioningService::VersioningService( const VersioningService& copy ) : m_session( copy.m_session ), m_url( copy.m_url ) { } VersioningService::~VersioningService( ) { } VersioningService& VersioningService::operator=( const VersioningService& copy ) { if ( this != © ) { m_session = copy.m_session; m_url = copy.m_url; } return *this; } libcmis::DocumentPtr VersioningService::checkOut( string repoId, string documentId ) throw ( libcmis::Exception ) { libcmis::DocumentPtr pwc; CheckOut request( repoId, documentId ); vector< SoapResponsePtr > responses = m_session->soapRequest( m_url, request ); if ( responses.size( ) == 1 ) { SoapResponse* resp = responses.front( ).get( ); CheckOutResponse* response = dynamic_cast< CheckOutResponse* >( resp ); if ( response != NULL ) { string pwcId = response->getObjectId( ); libcmis::ObjectPtr object = m_session->getObject( pwcId ); pwc = boost::dynamic_pointer_cast< libcmis::Document >( object ); } } return pwc; } void VersioningService::cancelCheckOut( string repoId, string documentId ) throw ( libcmis::Exception ) { CancelCheckOut request( repoId, documentId ); m_session->soapRequest( m_url, request ); } libcmis::DocumentPtr VersioningService::checkIn( string repoId, string objectId, bool isMajor, const PropertyPtrMap& properties, boost::shared_ptr< ostream > stream, string contentType, string fileName, string comment ) throw ( libcmis::Exception ) { libcmis::DocumentPtr newVersion; CheckIn request( repoId, objectId, isMajor, properties, stream, contentType, fileName, comment ); vector< SoapResponsePtr > responses = m_session->soapRequest( m_url, request ); if ( responses.size( ) == 1 ) { SoapResponse* resp = responses.front( ).get( ); CheckInResponse* response = dynamic_cast< CheckInResponse* >( resp ); if ( response != NULL ) { string newId = response->getObjectId( ); libcmis::ObjectPtr object = m_session->getObject( newId ); newVersion = boost::dynamic_pointer_cast< libcmis::Document >( object ); } } return newVersion; } vector< libcmis::DocumentPtr > VersioningService::getAllVersions( string repoId, string objectId ) throw ( libcmis::Exception ) { vector< libcmis::DocumentPtr > versions; GetAllVersions request( repoId, objectId ); vector< SoapResponsePtr > responses = m_session->soapRequest( m_url, request ); if ( responses.size( ) == 1 ) { SoapResponse* resp = responses.front( ).get( ); GetAllVersionsResponse* response = dynamic_cast< GetAllVersionsResponse* >( resp ); if ( response != NULL ) { versions = response->getObjects( ); } } return versions; } libcmis-0.4.1/src/libcmis/object.cxx0000644000175000001440000002622412177746535014305 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2011 SUSE * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #include "object.hxx" #include "session.hxx" #include "xml-utils.hxx" using namespace std; namespace libcmis { Object::Object( Session* session ) : m_session( session ), m_typeDescription( ), m_refreshTimestamp( 0 ), m_typeId( ), m_properties( ), m_allowableActions( ), m_renditions( ) { } Object::Object( Session* session, xmlNodePtr node ) : m_session( session ), m_typeDescription( ), m_refreshTimestamp( 0 ), m_typeId( ), m_properties( ), m_allowableActions( ), m_renditions( ) { initializeFromNode( node ); } Object::Object( const Object& copy ) : m_session( copy.m_session ), m_typeDescription( copy.m_typeDescription ), m_refreshTimestamp( copy.m_refreshTimestamp ), m_typeId( copy.m_typeId ), m_properties( copy.m_properties ), m_allowableActions( copy.m_allowableActions ), m_renditions( copy.m_renditions ) { } Object& Object::operator=( const Object& copy ) { if ( this != © ) { m_session = copy.m_session; m_typeDescription = copy.m_typeDescription; m_refreshTimestamp = copy.m_refreshTimestamp; m_typeId = copy.m_typeId; m_properties = copy.m_properties; m_allowableActions = copy.m_allowableActions; m_renditions = copy.m_renditions; } return *this; } void Object::initializeFromNode( xmlNodePtr node ) { // Even if node is NULL we'll have an empty doc, so no need // to worry about it. xmlDocPtr doc = wrapInDoc( node ); xmlXPathContextPtr xpathCtx = xmlXPathNewContext( doc ); libcmis::registerNamespaces( xpathCtx ); if ( NULL != xpathCtx ) { // Get the allowableActions xmlXPathObjectPtr xpathObj = xmlXPathEvalExpression( BAD_CAST( "//cmis:allowableActions" ), xpathCtx ); if ( xpathObj && xpathObj->nodesetval && xpathObj->nodesetval->nodeNr > 0 ) { xmlNodePtr actionsNode = xpathObj->nodesetval->nodeTab[0]; m_allowableActions.reset( new libcmis::AllowableActions( actionsNode ) ); } xmlXPathFreeObject( xpathObj ); // First get the type id as it will give us the property definitions string typeIdReq( "//cmis:propertyId[@propertyDefinitionId='cmis:objectTypeId']/cmis:value/text()" ); m_typeId = libcmis::getXPathValue( xpathCtx, typeIdReq ); string propertiesReq( "//cmis:properties/*" ); xpathObj = xmlXPathEvalExpression( BAD_CAST( propertiesReq.c_str() ), xpathCtx ); if ( NULL != xpathObj && NULL != xpathObj->nodesetval ) { int size = xpathObj->nodesetval->nodeNr; for ( int i = 0; i < size; i++ ) { xmlNodePtr propertyNode = xpathObj->nodesetval->nodeTab[i]; libcmis::PropertyPtr property = libcmis::parseProperty( propertyNode, getTypeDescription( ) ); if ( property != NULL ) m_properties[ property->getPropertyType( )->getId() ] = property; } } xmlXPathFreeObject( xpathObj ); // Get the renditions xpathObj = xmlXPathEvalExpression( BAD_CAST( "//cmis:rendition" ), xpathCtx ); if ( xpathObj && xpathObj->nodesetval && xpathObj->nodesetval->nodeNr > 0 ) { xmlNodePtr renditionNode = xpathObj->nodesetval->nodeTab[0]; libcmis::RenditionPtr rendition( new libcmis::Rendition( renditionNode ) ); m_renditions.push_back( rendition ); } xmlXPathFreeObject( xpathObj ); } xmlXPathFreeContext( xpathCtx ); xmlFreeDoc( doc ); m_refreshTimestamp = time( NULL ); } string Object::getStringProperty( const string& propertyName ) { string name; PropertyPtrMap::const_iterator it = getProperties( ).find( string( propertyName ) ); if ( it != getProperties( ).end( ) && it->second != NULL && !it->second->getStrings( ).empty( ) ) name = it->second->getStrings( ).front( ); return name; } string Object::getId( ) { return getStringProperty( "cmis:objectId" ); } string Object::getName( ) { return getStringProperty( "cmis:name" ); } string Object::getBaseType( ) { return getStringProperty( "cmis:baseTypeId" ); } string Object::getType( ) { string value = getStringProperty( "cmis:objectTypeId" ); if ( value.empty( ) ) value = m_typeId; return value; } string Object::getCreatedBy( ) { return getStringProperty( "cmis:createdBy" ); } string Object::getLastModifiedBy( ) { return getStringProperty( "cmis:lastModifiedBy" ); } string Object::getChangeToken( ) { return getStringProperty( "cmis:changeToken" ); } vector< string > Object::getPaths( ) { return vector< string > ( ); } boost::posix_time::ptime Object::getCreationDate( ) { boost::posix_time::ptime value; PropertyPtrMap::const_iterator it = getProperties( ).find( string( "cmis:creationDate" ) ); if ( it != getProperties( ).end( ) && it->second != NULL && !it->second->getDateTimes( ).empty( ) ) value = it->second->getDateTimes( ).front( ); return value; } boost::posix_time::ptime Object::getLastModificationDate( ) { boost::posix_time::ptime value; PropertyPtrMap::const_iterator it = getProperties( ).find( string( "cmis:lastModificationDate" ) ); if ( it != getProperties( ).end( ) && it->second != NULL && !it->second->getDateTimes( ).empty( ) ) value = it->second->getDateTimes( ).front( ); return value; } bool Object::isImmutable( ) { bool value = false; PropertyPtrMap::const_iterator it = getProperties( ).find( string( "cmis:isImmutable" ) ); if ( it != getProperties( ).end( ) && it->second != NULL && !it->second->getBools( ).empty( ) ) value = it->second->getBools( ).front( ); return value; } PropertyPtrMap& Object::getProperties( ) { return m_properties; } libcmis::ObjectTypePtr Object::getTypeDescription( ) { if ( !m_typeDescription.get( ) && m_session != NULL ) m_typeDescription = m_session->getType( getType( ) ); return m_typeDescription; } vector< RenditionPtr> Object::getRenditions( string /*filter*/ ) throw ( Exception ) { return m_renditions; } string Object::getThumbnailUrl( ) throw ( Exception ) { string url; vector< RenditionPtr > renditions = getRenditions( ); for ( vector< RenditionPtr >::iterator it = renditions.begin( ); it != renditions.end( ); ++it) { if ( (*it)->getKind( ) == "cmis:thumbnail" ) return (*it)->getUrl( ); } return url; } string Object::toString( ) { stringstream buf; buf << "Id: " << getId() << endl; buf << "Name: " << getName() << endl; buf << "Type: " << getType() << endl; buf << "Base type: " << getBaseType() << endl; buf << "Created on " << boost::posix_time::to_simple_string( getCreationDate() ) << " by " << getCreatedBy() << endl; buf << "Last modified on " << boost::posix_time::to_simple_string( getLastModificationDate() ) << " by " << getLastModifiedBy() << endl; buf << "Change token: " << getChangeToken() << endl; // Write Allowable Actions if ( getAllowableActions( ) ) buf << endl << getAllowableActions( )->toString( ) << endl; // Write remaining properties static const char* skippedProps[] = { "cmis:name", "cmis:baseTypeId", "cmis:objectTypeId", "cmis:createdBy", "cmis:creationDate", "cmis:lastModifiedBy", "cmis:lastModificationDate", "cmis::changeToken" }; int skippedCount = sizeof( skippedProps ) / sizeof( char* ); for ( PropertyPtrMap::iterator it = getProperties( ).begin(); it != getProperties( ).end( ); ++it ) { string propId = it->first; bool toSkip = false; for ( int i = 0; i < skippedCount && !toSkip; ++i ) { toSkip = propId == skippedProps[i]; } if ( !toSkip ) { libcmis::PropertyPtr prop = it->second; if ( prop != NULL && prop->getPropertyType( ) != NULL ) { buf << prop->getPropertyType( )->getDisplayName( ) << "( " << prop->getPropertyType()->getId( ) << " ): " << endl; vector< string > strValues = prop->getStrings( ); for ( vector< string >::iterator valueIt = strValues.begin( ); valueIt != strValues.end( ); ++valueIt ) { buf << "\t" << *valueIt << endl; } } } } vector< libcmis::RenditionPtr > renditions = getRenditions( ); if ( !renditions.empty() ) { buf << "Renditions: " << endl; for ( vector< libcmis::RenditionPtr >::iterator it = renditions.begin(); it != renditions.end(); ++it ) { buf << ( *it )->toString( ) << endl; } } return buf.str(); } void Object::toXml( xmlTextWriterPtr writer ) { // Output the properties xmlTextWriterStartElement( writer, BAD_CAST( "cmis:properties" ) ); for ( PropertyPtrMap::iterator it = getProperties( ).begin( ); it != getProperties( ).end( ); ++it ) { it->second->toXml( writer ); } xmlTextWriterEndElement( writer ); // cmis:properties } } libcmis-0.4.1/src/libcmis/gdrive-repository.hxx0000644000175000001440000000240612200225660016507 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2013 Cao Cuong Ngo * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #ifndef _GDRIVE_REPOSITORY_HXX_ #define _GDRIVE_REPOSITORY_HXX_ #include class GdriveRepository: public libcmis::Repository { public: GdriveRepository( ); }; #endif libcmis-0.4.1/src/libcmis/atom-document.cxx0000644000175000001440000003751212156277660015610 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2011 SUSE * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #include #include #include #include #include "atom-document.hxx" #include "atom-session.hxx" #include "xml-utils.hxx" using namespace std; using namespace libcmis; AtomDocument::AtomDocument( AtomPubSession* session ) : libcmis::Object( session ), libcmis::Document( session ), AtomObject( session ), m_contentUrl( ) { } AtomDocument::AtomDocument( AtomPubSession* session, xmlNodePtr entryNd ) : libcmis::Object( session ), libcmis::Document( session ), AtomObject( session ), m_contentUrl( ) { xmlDocPtr doc = libcmis::wrapInDoc( entryNd ); refreshImpl( doc ); xmlFreeDoc( doc ); } AtomDocument::~AtomDocument( ) { } vector< libcmis::FolderPtr > AtomDocument::getParents( ) throw ( libcmis::Exception ) { AtomLink* parentsLink = getLink( "up", "" ); if ( ( NULL == parentsLink ) || ( getAllowableActions( ).get() && !getAllowableActions()->isAllowed( libcmis::ObjectAction::GetObjectParents ) ) ) throw libcmis::Exception( string( "GetObjectParents not allowed on node " ) + getId() ); vector< libcmis::FolderPtr > parents; string buf; try { buf = getSession()->httpGetRequest( parentsLink->getHref( ) )->getStream( )->str( ); } catch ( const CurlException& e ) { throw e.getCmisException( ); } xmlDocPtr doc = xmlReadMemory( buf.c_str(), buf.size(), parentsLink->getHref( ).c_str(), NULL, 0 ); if ( NULL != doc ) { xmlXPathContextPtr xpathCtx = xmlXPathNewContext( doc ); libcmis::registerNamespaces( xpathCtx ); if ( NULL != xpathCtx ) { const string& entriesReq( "//atom:entry" ); xmlXPathObjectPtr xpathObj = xmlXPathEvalExpression( BAD_CAST( entriesReq.c_str() ), xpathCtx ); if ( NULL != xpathObj && NULL != xpathObj->nodesetval ) { int size = xpathObj->nodesetval->nodeNr; for ( int i = 0; i < size; i++ ) { xmlNodePtr node = xpathObj->nodesetval->nodeTab[i]; xmlDocPtr entryDoc = libcmis::wrapInDoc( node ); libcmis::ObjectPtr object = getSession()->createObjectFromEntryDoc( entryDoc ); libcmis::FolderPtr folder = boost::dynamic_pointer_cast< libcmis::Folder >( object ); if ( folder.get() ) parents.push_back( folder ); xmlFreeDoc( entryDoc ); } } xmlXPathFreeObject( xpathObj ); } xmlXPathFreeContext( xpathCtx ); } else { throw libcmis::Exception( "Failed to parse folder infos" ); } xmlFreeDoc( doc ); return parents; } boost::shared_ptr< istream > AtomDocument::getContentStream( string /*streamId*/ ) throw ( libcmis::Exception ) { if ( getAllowableActions().get() && !getAllowableActions()->isAllowed( libcmis::ObjectAction::GetContentStream ) ) throw libcmis::Exception( string( "GetContentStream is not allowed on document " ) + getId() ); boost::shared_ptr< istream > stream; try { stream = getSession()->httpGetRequest( m_contentUrl )->getStream( ); } catch ( const CurlException& e ) { throw e.getCmisException( ); } return stream; } void AtomDocument::setContentStream( boost::shared_ptr< ostream > os, string contentType, string fileName, bool overwrite ) throw ( libcmis::Exception ) { if ( !os.get( ) ) throw libcmis::Exception( "Missing stream" ); if ( getAllowableActions().get() && !getAllowableActions()->isAllowed( libcmis::ObjectAction::GetContentStream ) ) throw libcmis::Exception( string( "SetContentStream is not allowed on document " ) + getId() ); string overwriteStr( "false" ); if ( overwrite ) overwriteStr = "true"; string urlPattern( m_contentUrl ); if ( urlPattern.find( '?' ) != string::npos ) urlPattern += "&"; else urlPattern += "?"; urlPattern += "overwriteFlag={overwriteFlag}"; map< string, string > params; params["overwriteFlag"] = overwriteStr; // Use the changeToken if set on the object if ( !getChangeToken().empty() ) { urlPattern += "&changeToken={changeToken}"; params["changeToken"] = getChangeToken(); } string putUrl = getSession()->createUrl( urlPattern, params ); bool tryBase64 = false; do { try { boost::shared_ptr< istream> is ( new istream ( os->rdbuf( ) ) ); if ( tryBase64 ) { tryBase64 = false; // Encode the content stringstream* encodedIn = new stringstream( ); libcmis::EncodedData encoder( encodedIn ); encoder.setEncoding( "base64" ); int bufLength = 1000; char* buf = new char[ bufLength ]; do { is->read( buf, bufLength ); int size = is->gcount( ); encoder.encode( buf, 1, size ); } while ( !is->eof( ) && !is->fail( ) ); delete[] buf; encoder.finish( ); encodedIn->seekg( 0, ios_base::beg ); encodedIn->clear( ); is.reset( encodedIn ); } vector< string > headers; headers.push_back( string( "Content-Type: " ) + contentType ); if ( !fileName.empty( ) ) headers.push_back( string( "Content-Disposition: attachment; filename=" ) + fileName ); getSession()->httpPutRequest( putUrl, *is, headers ); long httpStatus = getSession( )->getHttpStatus( ); if ( httpStatus < 200 || httpStatus >= 300 ) throw libcmis::Exception( "Document content wasn't set for some reason" ); refresh( ); } catch ( const CurlException& e ) { // SharePoint wants base64 encoded content... let's try to figure out // if we falled in that case. if ( !tryBase64 && e.getHttpStatus() == 400 ) tryBase64 = true; else throw e.getCmisException( ); } } while ( tryBase64 ); } libcmis::DocumentPtr AtomDocument::checkOut( ) throw ( libcmis::Exception ) { if ( ( getAllowableActions( ).get() && !getAllowableActions()->isAllowed( libcmis::ObjectAction::CheckOut ) ) ) throw libcmis::Exception( string( "CanCheckout not allowed on document " ) + getId() ); xmlBufferPtr buf = xmlBufferCreate( ); xmlTextWriterPtr writer = xmlNewTextWriterMemory( buf, 0 ); xmlTextWriterStartDocument( writer, NULL, NULL, NULL ); // Create a document with only the needed properties PropertyPtrMap props; PropertyPtrMap::iterator it = getProperties( ).find( string( "cmis:objectId" ) ); if ( it != getProperties( ).end( ) ) { props.insert( *it ); } boost::shared_ptr< ostream > stream; AtomObject::writeAtomEntry( writer, props, stream, string( ) ); xmlTextWriterEndDocument( writer ); string str( ( const char * )xmlBufferContent( buf ) ); istringstream is( str ); xmlFreeTextWriter( writer ); xmlBufferFree( buf ); libcmis::HttpResponsePtr resp; string urlPattern = getSession()->getAtomRepository( )->getCollectionUrl( Collection::CheckedOut ); if ( urlPattern.find( "?" ) != string::npos ) urlPattern += "&"; else urlPattern += "?"; urlPattern += "objectId={objectId}"; map< string, string > params; params[ "objectId" ] = getId( ); string checkedOutUrl = getSession( )->createUrl( urlPattern, params ); try { resp = getSession( )->httpPostRequest( checkedOutUrl, is, "application/atom+xml;type=entry" ); } catch ( const CurlException& e ) { throw e.getCmisException( ); } string respBuf = resp->getStream( )->str(); xmlDocPtr doc = xmlReadMemory( respBuf.c_str(), respBuf.size(), checkedOutUrl.c_str(), NULL, 0 ); if ( NULL == doc ) throw libcmis::Exception( "Failed to parse object infos" ); libcmis::ObjectPtr created = getSession( )->createObjectFromEntryDoc( doc ); xmlFreeDoc( doc ); libcmis::DocumentPtr pwc = boost::dynamic_pointer_cast< libcmis::Document >( created ); if ( !pwc.get( ) ) throw libcmis::Exception( string( "Created object is not a document: " ) + created->getId( ) ); return pwc; } void AtomDocument::cancelCheckout( ) throw ( libcmis::Exception ) { if ( ( getAllowableActions( ).get() && !getAllowableActions()->isAllowed( libcmis::ObjectAction::CancelCheckOut ) ) ) throw libcmis::Exception( string( "CanCancelCheckout not allowed on document " ) + getId() ); string url = getInfosUrl( ); // Use working-copy link if provided as a workaround // for some non-compliant repositories AtomLink* link = getLink( "working-copy", "application/atom+xml;type=entry" ); if ( link ) url = link->getHref( ); try { getSession( )->httpDeleteRequest( url ); } catch ( CurlException const& e ) { throw e.getCmisException( ); } } libcmis::DocumentPtr AtomDocument::checkIn( bool isMajor, string comment, const PropertyPtrMap& properties, boost::shared_ptr< ostream > stream, string contentType, string ) throw ( libcmis::Exception ) { if ( ( getAllowableActions( ).get() && !getAllowableActions()->isAllowed( libcmis::ObjectAction::CheckIn ) ) ) throw libcmis::Exception( string( "CanCheckIn not allowed on document " ) + getId() ); string urlPattern = getInfosUrl( ); // Use working-copy link if provided as a workaround // for some non-compliant repositories AtomLink* link = getLink( "working-copy", "application/atom+xml;type=entry" ); if ( link ) urlPattern = link->getHref( ); if ( urlPattern.find( "?" ) != string::npos ) urlPattern += "&"; else urlPattern += "?"; urlPattern += "checkin=true&major={major}&checkinComment={checkinComment}"; map< string, string > params; string majorStr = "false"; if ( isMajor ) majorStr = "true"; params[ "major" ] = majorStr; params[ "checkinComment" ] = comment; string checkInUrl = getSession( )->createUrl( urlPattern, params ); xmlBufferPtr buf = xmlBufferCreate( ); xmlTextWriterPtr writer = xmlNewTextWriterMemory( buf, 0 ); xmlTextWriterStartDocument( writer, NULL, NULL, NULL ); AtomObject::writeAtomEntry( writer, properties, stream, contentType ); xmlTextWriterEndDocument( writer ); string str( ( const char * )xmlBufferContent( buf ) ); istringstream is( str ); xmlFreeTextWriter( writer ); xmlBufferFree( buf ); // Run the request libcmis::HttpResponsePtr response; try { vector< string > headers; headers.push_back( string( "Content-Type: application/atom+xml;type=entry" ) ); response = getSession( )->httpPutRequest( checkInUrl, is, headers ); } catch ( const CurlException& e ) { throw e.getCmisException( ); } // Get the returned entry and update using it string respBuf = response->getStream( )->str( ); xmlDocPtr doc = xmlReadMemory( respBuf.c_str(), respBuf.size(), checkInUrl.c_str(), NULL, 0 ); if ( NULL == doc ) throw libcmis::Exception( "Failed to parse object infos" ); libcmis::ObjectPtr newVersion = getSession( )->createObjectFromEntryDoc( doc ); if ( newVersion->getId( ) == getId( ) ) refreshImpl( doc ); xmlFreeDoc( doc ); return boost::dynamic_pointer_cast< libcmis::Document >( newVersion ); } vector< libcmis::DocumentPtr > AtomDocument::getAllVersions( ) throw ( libcmis::Exception ) { if ( getAllowableActions( ).get() && !getAllowableActions()->isAllowed( libcmis::ObjectAction::GetAllVersions ) ) throw libcmis::Exception( string( "GetAllVersions not allowed on node " ) + getId() ); vector< libcmis::DocumentPtr > versions; AtomLink* link = getLink( "version-history", string( ) ); if ( link != NULL ) { string pageUrl = link->getHref( ); string buf; try { buf = getSession()->httpGetRequest( pageUrl )->getStream( )->str( ); } catch ( const CurlException& e ) { throw e.getCmisException( ); } xmlDocPtr doc = xmlReadMemory( buf.c_str(), buf.size(), pageUrl.c_str(), NULL, 0 ); if ( NULL != doc ) { xmlXPathContextPtr xpathCtx = xmlXPathNewContext( doc ); libcmis::registerNamespaces( xpathCtx ); if ( NULL != xpathCtx ) { // Get the entries const string& entriesReq( "//atom:entry" ); xmlXPathObjectPtr xpathObj = xmlXPathEvalExpression( BAD_CAST( entriesReq.c_str() ), xpathCtx ); if ( NULL != xpathObj && NULL != xpathObj->nodesetval ) { int size = xpathObj->nodesetval->nodeNr; for ( int i = 0; i < size; i++ ) { xmlNodePtr node = xpathObj->nodesetval->nodeTab[i]; xmlDocPtr entryDoc = libcmis::wrapInDoc( node ); libcmis::ObjectPtr cmisObject = getSession()->createObjectFromEntryDoc( entryDoc ); libcmis::DocumentPtr cmisDoc = boost::dynamic_pointer_cast< libcmis::Document >( cmisObject ); if ( cmisDoc.get() ) versions.push_back( cmisDoc ); xmlFreeDoc( entryDoc ); } } xmlXPathFreeObject( xpathObj ); } xmlXPathFreeContext( xpathCtx ); } else { throw libcmis::Exception( "Failed to parse versions infos" ); } xmlFreeDoc( doc ); } return versions; } void AtomDocument::extractInfos( xmlDocPtr doc ) { AtomObject::extractInfos( doc ); // Get the content url xmlXPathContextPtr xpathCtx = xmlXPathNewContext( doc ); if ( NULL != doc ) { libcmis::registerNamespaces( xpathCtx ); if ( NULL != xpathCtx ) { xmlXPathObjectPtr xpathObj = xmlXPathEvalExpression( BAD_CAST( "//atom:content" ), xpathCtx ); if ( xpathObj && xpathObj->nodesetval && xpathObj->nodesetval->nodeNr > 0 ) { xmlNodePtr contentNd = xpathObj->nodesetval->nodeTab[0]; xmlChar* src = xmlGetProp( contentNd, BAD_CAST( "src" ) ); m_contentUrl = string( ( char* ) src ); xmlFree( src ); } xmlXPathFreeObject( xpathObj ); } xmlXPathFreeContext( xpathCtx ); } } libcmis-0.4.1/src/libcmis/folder.hxx0000644000175000001440000000536412023641111014267 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2011 SUSE * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #ifndef _FOLDER_HXX_ #define _FOLDER_HXX_ #include #include #include #include "exception.hxx" #include "object.hxx" namespace libcmis { class Document; class Session; struct UnfileObjects { enum Type { Unfile, DeleteSingleFiled, Delete }; }; /** Class representing a CMIS folder. */ class Folder : public virtual Object { public: Folder( Session* session ) : Object( session ) { } virtual ~Folder() { } virtual std::vector< std::string > getPaths( ); virtual ::boost::shared_ptr< Folder > getFolderParent( ) throw ( Exception ); virtual std::vector< ObjectPtr > getChildren( ) throw ( Exception ) = 0; virtual std::string getParentId( ); virtual std::string getPath( ); virtual bool isRootFolder( ); virtual ::boost::shared_ptr< Folder > createFolder( const std::map< std::string, PropertyPtr >& properties ) throw ( libcmis::Exception ) = 0; virtual ::boost::shared_ptr< Document > createDocument( const std::map< std::string, PropertyPtr >& properties, boost::shared_ptr< std::ostream > os, std::string contentType, std::string fileName ) throw ( Exception ) = 0; virtual std::vector< std::string > removeTree( bool allVersion = true, UnfileObjects::Type unfile = UnfileObjects::Delete, bool continueOnError = false ) throw ( Exception ) = 0; virtual std::string toString( ); }; typedef ::boost::shared_ptr< Folder > FolderPtr; } #endif libcmis-0.4.1/src/libcmis/atom-object.hxx0000644000175000001440000000703012177701001015215 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2011 SUSE * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #ifndef _ATOM_OBJECT_HXX_ #define _ATOM_OBJECT_HXX_ #include #include #include "object.hxx" class AtomPubSession; class AtomLink { private: std::string m_rel; std::string m_type; std::string m_id; std::string m_href; std::map< std::string, std::string > m_others; public: AtomLink( xmlNodePtr node ) throw ( libcmis::Exception ); std::string getRel( ) { return m_rel; } std::string getType( ) { return m_type; } std::string getId( ) { return m_id; } bool hasId( ) { return !m_id.empty( ); } std::string getHref( ) { return m_href; } std::map< std::string, std::string >& getOthers( ) { return m_others; } }; class AtomObject : public virtual libcmis::Object { private: std::vector< AtomLink > m_links; public: AtomObject( AtomPubSession* session ) throw ( libcmis::Exception ); AtomObject( const AtomObject& copy ); ~AtomObject( ); AtomObject& operator=( const AtomObject& copy ); // Overridden methods from libcmis::Object virtual libcmis::ObjectPtr updateProperties( const std::map< std::string, libcmis::PropertyPtr >& properties ) throw ( libcmis::Exception ); virtual libcmis::AllowableActionsPtr getAllowableActions( ); /** Reload the data from the server. */ virtual void refresh( ) throw ( libcmis::Exception ) { refreshImpl( NULL ); } virtual void remove( bool allVersion = true ) throw ( libcmis::Exception ); virtual void move( boost::shared_ptr< libcmis::Folder > source, boost::shared_ptr< libcmis::Folder > destination ) throw ( libcmis::Exception ); static void writeAtomEntry( xmlTextWriterPtr writer, const std::map< std::string, libcmis::PropertyPtr >& properties, boost::shared_ptr< std::ostream > os, std::string contentType ); protected: std::string getInfosUrl( ); virtual void refreshImpl( xmlDocPtr doc ) throw ( libcmis::Exception ); virtual void extractInfos( xmlDocPtr doc ); AtomPubSession* getSession( ); /** Get the atom link corresponding to the given relation and type or NULL if no link matched those criteria. \param rel the relation to match \param type the type to match or the empty string to match all types. */ AtomLink* getLink( std::string rel, std::string type ); }; #endif libcmis-0.4.1/src/libcmis/gdrive-property.hxx0000644000175000001440000000336112156277660016176 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2013 Cao Cuong Ngo * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #ifndef _GDRIVE_PROPERTY_HXX_ #define _GDRIVE_PROPERTY_HXX_ #include "json-utils.hxx" #include "property.hxx" class GDriveProperty : public libcmis::Property { public : // Create a GDrive Property from a Json property with its key GDriveProperty( const std::string& key, Json json); ~GDriveProperty( ); GDriveProperty( const GDriveProperty& copy); GDriveProperty& operator=( const GDriveProperty& copy ); // Check if the property is updatable bool checkUpdatable( const std::string& key ); private : // Avoid calling default constructor GDriveProperty( ); }; #endif /* _GDRIVE_PROPERTY_HXX_ */ libcmis-0.4.1/src/libcmis/json-utils.cxx0000644000175000001440000001544212175751364015140 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2013 Cao Cuong Ngo * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #include #include #include #include #include "json-utils.hxx" #include "exception.hxx" #include "xml-utils.hxx" using namespace std; using namespace libcmis; using namespace boost; using boost::property_tree::ptree; using boost::property_tree::json_parser::read_json; using boost::property_tree::json_parser::write_json; Json::Json( ) : m_tJson( ptree( ) ), m_type( json_object ) { } Json::Json( const char *str ) : m_tJson( ptree( ) ), m_type( json_string ) { m_tJson.put_value( str ); m_type = parseType( ); } Json::Json( ptree tJson ) : m_tJson( tJson ), m_type( json_object ) { m_type = parseType( ); } Json::Json( const PropertyPtr& property ): m_tJson( ), m_type( json_object ) { string str = property->toString( ); m_tJson.put("", str ); } Json::Json( const PropertyPtrMap& properties ) : m_tJson( ptree( ) ), m_type( json_array ) { for ( PropertyPtrMap::const_iterator it = properties.begin() ; it != properties.end() ; ++it ) { string key = it->first; string value = it->second->toString( ); m_tJson.put( key, value ); } } Json::Json( const Json& copy ) : m_tJson( copy.m_tJson ), m_type( copy.m_type ) { } Json::Json( const JsonObject& obj ) : m_tJson( ptree( ) ), m_type( json_array ) { for ( JsonObject::const_iterator i = obj.begin() ; i != obj.end() ; ++i ) add( i->first, i->second ) ; } Json::Json( const JsonVector& arr ) : m_tJson( ptree( ) ), m_type( json_array ) { for ( std::vector::const_iterator i = arr.begin(); i != arr.end(); ++i ) add( *i ) ; } Json::~Json( ) { } Json& Json::operator=( const Json& rhs ) { if ( this != &rhs ) { m_tJson = rhs.m_tJson; m_type = rhs.m_type; } return *this ; } void Json::swap( Json& rhs ) { std::swap( m_tJson, rhs.m_tJson ); std::swap( m_type, rhs.m_type ); } Json Json::operator[]( string key ) const throw ( libcmis::Exception ) { ptree tJson; try { tJson = m_tJson.get_child( key ); } catch ( boost::exception const& ) { return Json( "" ); } Json childJson( tJson ); return childJson ; } void Json::add( const std::string& key, const Json& json ) throw ( libcmis::Exception ) { try { m_tJson.add_child( key, json.getTree( ) ); } catch ( boost::exception const& ) { throw libcmis::Exception( "Couldn't add Json object" ); } } Json::JsonVector Json::getList() { JsonVector list; BOOST_FOREACH(boost::property_tree::ptree::value_type &v, m_tJson.get_child("")) { list.push_back( Json( v.second ) ); } return list ; } void Json::add( const Json& json ) throw ( libcmis::Exception ) { try { m_tJson.push_back( ptree::value_type( "", json.getTree( )) ); } catch ( boost::exception const& ) { throw libcmis::Exception( "Couldn't add Json object" ); } } Json Json::parse( const string& str ) throw ( libcmis:: Exception ) { ptree pTree; std::stringstream ss( str ); if ( ss.good( ) ) { try { ::property_tree::json_parser::read_json( ss, pTree ); } catch ( boost::exception const& ) { return Json( str.c_str( ) ); } } return Json( pTree ); } Json::JsonObject Json::getObjects( ) { JsonObject objs; BOOST_FOREACH(boost::property_tree::ptree::value_type &v, m_tJson.get_child("")) { Json jsonValue( v.second ); objs.insert( JsonObject::value_type(v.first, jsonValue ) ); } return objs ; } Json::Type Json::parseType( ) { Type type = json_string; string str = toString( ); boost::posix_time::ptime time = libcmis::parseDateTime( str ); if ( !time.is_not_a_date_time( ) ) type = json_datetime; else { Type backupType = type; type = json_bool; try { parseBool( str ); } catch (...) { type = backupType; } if ( type != json_bool ) { if ( str.find('.') == string::npos ) { backupType = type; type = json_int; try { parseInteger( str ); } catch(...) { type = backupType; } } else { backupType = type; type = json_double; try { parseDouble( str ); } catch(...) { type = backupType; } } } } return type; } Json::Type Json::getDataType( ) const { return m_type; } string Json::getStrType( ) const { switch ( m_type ) { case json_null: return "json_null"; case json_bool: return "json_bool"; case json_int: return "json_int"; case json_double: return "json_double"; case json_string: return "json_string"; case json_datetime: return "json_datetime"; case json_object: return "json_object"; case json_array: return "json_array"; } return "json_string"; } string Json::toString( ) const { string str; try { stringstream ss; write_json( ss, m_tJson ); str = ss.str( ); } catch ( boost::exception const& ) { str = m_tJson.get_value( ); } // empty json if ( str == "{\n}\n" ) str = ""; return str; } libcmis-0.4.1/src/libcmis/gdrive-folder.cxx0000644000175000001440000001307412173212453015546 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2013 Cao Cuong Ngo * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #include "gdrive-folder.hxx" #include "gdrive-session.hxx" #include "gdrive-document.hxx" #include "gdrive-property.hxx" #include "gdrive-utils.hxx" using namespace std; using namespace libcmis; GDriveFolder::GDriveFolder( GDriveSession* session ): libcmis::Object( session ), libcmis::Folder( session ), GDriveObject( session ) { } GDriveFolder::GDriveFolder( GDriveSession* session, Json json ): libcmis::Object( session ), libcmis::Folder( session ), GDriveObject( session, json ) { } GDriveFolder::~GDriveFolder( ) { } vector< libcmis::ObjectPtr > GDriveFolder::getChildren( ) throw ( libcmis::Exception ) { vector< libcmis::ObjectPtr > children; // GDrive doesn't support fetch all the children in one query. // Instead of sending multiple queries for children, // we send a single query to search for objects where parents // include the folderID. string query = getSession( )->getBindingUrl( ) + "/files?q=\"" + getId( ) + "\"+in+parents+and+trashed+=+false"; string res; try { res = getSession( )->httpGetRequest( query )->getStream()->str(); } catch ( const CurlException& e ) { throw e.getCmisException( ); } Json jsonRes = Json::parse( res ); Json::JsonVector objs = jsonRes["items"].getList( ); // Create children objects from Json objects for(unsigned int i = 0; i < objs.size(); i++) { ObjectPtr child; if ( objs[i]["mimeType"].toString( ) == GDRIVE_FOLDER_MIME_TYPE ) child.reset( new GDriveFolder( getSession( ), objs[i] ) ); else child.reset( new GDriveDocument( getSession( ), objs[i] ) ); children.push_back( child ); } return children; } string GDriveFolder::uploadProperties( Json properties ) { // URL for uploading meta data string metaUrl = getSession()->getBindingUrl() + "/files/"; // add parents to the properties properties.add( "parents", GdriveUtils::createJsonFromParentId( getId( ) ) ); //upload metadata std::istringstream is( properties.toString( ) ); string response; try { response = getSession()->httpPostRequest( metaUrl, is, "application/json" ) ->getStream( )->str( ); } catch ( const CurlException& e ) { throw e.getCmisException( ); } return response; } libcmis::FolderPtr GDriveFolder::createFolder( const PropertyPtrMap& properties ) throw( libcmis::Exception ) { Json propsJson = GdriveUtils::toGdriveJson( properties ); // GDrive folder is a file with a different mime type. string mimeType = GDRIVE_FOLDER_MIME_TYPE; // Add mimetype to the propsJson Json jsonMimeType( mimeType.c_str( ) ); propsJson.add( "mimeType", jsonMimeType ); // Upload meta-datas string response = uploadProperties( propsJson ); Json jsonRes = Json::parse( response ); libcmis::FolderPtr folderPtr( new GDriveFolder( getSession( ), jsonRes ) ); return folderPtr; } libcmis::DocumentPtr GDriveFolder::createDocument( const PropertyPtrMap& properties, boost::shared_ptr< ostream > os, string contentType, string fileName ) throw ( libcmis::Exception ) { if ( !os.get( ) ) throw libcmis::Exception( "Missing stream" ); Json propsJson = GdriveUtils::toGdriveJson( properties ); // Add filename to properties Json jsonFilename( fileName.c_str( ) ); propsJson.add( "title", jsonFilename ); // Upload meta-datas string res = uploadProperties( propsJson); // parse the document Json jsonRes = Json::parse( res ); DocumentPtr documentPtr( new GDriveDocument( getSession( ), jsonRes ) ); ::boost::shared_ptr< GDriveDocument > gDocument = boost::dynamic_pointer_cast< GDriveDocument >( documentPtr ); // Upload stream gDocument->uploadStream( os, contentType); return gDocument; } vector< string > GDriveFolder::removeTree( bool /*allVersions*/, libcmis::UnfileObjects::Type /*unfile*/, bool /*continueOnError*/ ) throw ( libcmis::Exception ) { // Object remove doesn't work with folder // Using trash instead try { istringstream is( "" ); getSession( )->httpPostRequest( getUrl( ) + "/trash", is, "" ); } catch ( const CurlException& e ) { throw e.getCmisException( ); } // Nothing to return here return vector< string >( ); } libcmis-0.4.1/src/libcmis/atom-workspace.cxx0000644000175000001440000001656412024562531015760 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2011 Cédric Bosdonnat * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #include "atom-workspace.hxx" #include "xml-utils.hxx" using namespace std; AtomRepository::AtomRepository( xmlNodePtr wsNode ) throw ( libcmis::Exception ): Repository( ), m_collections( ), m_uriTemplates( ) { if ( wsNode != NULL ) { xmlDocPtr doc = libcmis::wrapInDoc( wsNode ); xmlXPathContextPtr xpathCtx = xmlXPathNewContext( doc ); libcmis::registerNamespaces( xpathCtx ); if ( NULL != xpathCtx ) { // Get the collections xmlXPathObjectPtr xpathObj = xmlXPathEvalExpression( BAD_CAST( "//app:collection" ), xpathCtx ); if ( NULL != xpathObj ) readCollections( xpathObj->nodesetval ); xmlXPathFreeObject( xpathObj ); // Get the URI templates xpathObj = xmlXPathEvalExpression( BAD_CAST( "//cmisra:uritemplate" ), xpathCtx ); if ( NULL != xpathObj ) readUriTemplates( xpathObj->nodesetval ); xmlXPathFreeObject( xpathObj ); // Get the repository infos xpathObj = xmlXPathEvalExpression( BAD_CAST( "//cmisra:repositoryInfo" ), xpathCtx ); if ( NULL != xpathObj ) initializeFromNode( xpathObj->nodesetval->nodeTab[0] ); xmlXPathFreeObject( xpathObj ); } xmlXPathFreeContext( xpathCtx ); xmlFreeDoc( doc ); } } AtomRepository::AtomRepository( const AtomRepository& rCopy ) : Repository( rCopy ), m_collections( rCopy.m_collections ), m_uriTemplates( rCopy.m_uriTemplates ) { } AtomRepository::~AtomRepository( ) { m_collections.clear( ); m_uriTemplates.clear( ); } AtomRepository& AtomRepository::operator= ( const AtomRepository& rCopy ) { if ( this != &rCopy ) { m_collections = rCopy.m_collections; m_uriTemplates = rCopy.m_uriTemplates; } return *this; } string AtomRepository::getCollectionUrl( Collection::Type type ) { return m_collections[ type ]; } string AtomRepository::getUriTemplate( UriTemplate::Type type ) { return m_uriTemplates[ type ]; } void AtomRepository::readCollections( xmlNodeSetPtr nodeSet ) { int size = 0; if ( nodeSet ) size = nodeSet->nodeNr; for ( int i = 0; i < size; i++ ) { xmlNodePtr node = nodeSet->nodeTab[i]; // Look for the href property xmlChar* href = xmlGetProp( node, BAD_CAST( "href" ) ); if ( href ) { string collectionRef( ( char* )href ); xmlFree( href ); // Look for the cmisra:collectionType child for ( xmlNodePtr child = node->children; child; child = child->next ) { // SharePoint CMIS implementation doesn't follow the spec: // the cmisra namespace is omitted bool isCollectionType = xmlStrEqual( child->name, BAD_CAST( "collectionType" ) ); if ( isCollectionType ) { xmlChar* content = xmlNodeGetContent( child ); Collection::Type type = Collection::Root; bool typeDefined = false; if ( xmlStrEqual( content, BAD_CAST( "root" ) ) ) { type = Collection::Root; typeDefined = true; } else if ( xmlStrEqual( content, BAD_CAST( "types" ) ) ) { type = Collection::Types; typeDefined = true; } else if ( xmlStrEqual( content, BAD_CAST( "query" ) ) ) { type = Collection::Query; typeDefined = true; } else if ( xmlStrEqual( content, BAD_CAST( "checkedout" ) ) ) { type = Collection::CheckedOut; typeDefined = true; } else if ( xmlStrEqual( content, BAD_CAST( "unfiled" ) ) ) { type = Collection::Unfiled; typeDefined = true; } if ( typeDefined ) m_collections[ type ] = collectionRef; xmlFree( content ); } } } } } void AtomRepository::readUriTemplates( xmlNodeSetPtr nodeSet ) { int size = 0; if ( nodeSet ) size = nodeSet->nodeNr; for ( int i = 0; i < size; i++ ) { xmlNodePtr node = nodeSet->nodeTab[i]; string templateUri; UriTemplate::Type type = UriTemplate::ObjectById; bool typeDefined = false; // Look for the cmisra:template and cmisra:type children for ( xmlNodePtr child = node->children; child; child = child->next ) { bool isTemplate = xmlStrEqual( child->name, BAD_CAST( "template" ) ); bool isType = xmlStrEqual( child->name, BAD_CAST( "type" ) ); if ( isTemplate ) { xmlChar* content = xmlNodeGetContent( child ); if ( content != NULL ) templateUri = string( ( char * )content ); xmlFree( content ); } else if ( isType ) { xmlChar* content = xmlNodeGetContent( child ); if ( xmlStrEqual( content, BAD_CAST( "objectbyid" ) ) ) { type = UriTemplate::ObjectById; typeDefined = true; } else if ( xmlStrEqual( content, BAD_CAST( "objectbypath" ) ) ) { type = UriTemplate::ObjectByPath; typeDefined = true; } else if ( xmlStrEqual( content, BAD_CAST( "query" ) ) ) { type = UriTemplate::Query; typeDefined = true; } else if ( xmlStrEqual( content, BAD_CAST( "typebyid" ) ) ) { type = UriTemplate::TypeById; typeDefined = true; } xmlFree( content ); } } if ( !templateUri.empty() && typeDefined ) m_uriTemplates[ type ] = templateUri; } } libcmis-0.4.1/src/libcmis/gdrive-utils.cxx0000644000175000001440000001625612175751364015453 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2013 Cao Cuong Ngo * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #include "gdrive-utils.hxx" #include "json-utils.hxx" #include "xml-utils.hxx" using namespace std; using libcmis::PropertyPtrMap; string GdriveUtils::toCmisKey( const string& key ) { string convertedKey; if ( key == "id") convertedKey = "cmis:objectId"; else if ( key == "ownerNames" ) convertedKey = "cmis:createdBy"; else if ( key == "description" ) convertedKey = "cmis:description"; else if ( key == "createdDate" ) convertedKey = "cmis:creationDate"; else if ( key == "lastModifyingUserName" ) convertedKey = "cmis:lastModifiedBy"; else if ( key == "modifiedDate" ) convertedKey = "cmis:lastModificationDate"; else if ( key == "title" ) convertedKey = "cmis:contentStreamFileName"; else if ( key == "mimeType" ) convertedKey = "cmis:contentStreamMimeType"; else if ( key == "fileSize" ) convertedKey = "cmis:contentStreamLength"; else if ( key == "editable" ) convertedKey = "cmis:isImmutable"; else if ( key == "parents" ) convertedKey = "cmis:parentId"; else convertedKey = key; return convertedKey; } string GdriveUtils::toGdriveKey( const string& key ) { string convertedKey; if ( key == "cmis:objectId") convertedKey = "id"; else if ( key == "cmis:createdBy" ) convertedKey = "ownerNames"; else if ( key == "cmis:creationDate" ) convertedKey = "createdDate"; else if ( key == "cmis:description" ) convertedKey = "description"; else if ( key == "cmis:lastModifiedBy" ) convertedKey = "lastModifyingUserName"; else if ( key == "cmis:lastModificationDate" ) convertedKey = "modifiedDate"; else if ( key == "cmis:contentStreamFileName" ) convertedKey = "title"; else if ( key == "cmis:name" ) convertedKey = "title"; else if ( key == "cmis:contentStreamMimeType" ) convertedKey = "mimeType"; else if ( key == "cmis:contentStreamLength" ) convertedKey = "fileSize"; else if ( key == "cmis:isImmutable" ) convertedKey = "editable"; else if ( key == "cmis:parentId" ) convertedKey = "parents"; else convertedKey = key; return convertedKey; } Json GdriveUtils::toGdriveJson( const PropertyPtrMap& properties ) { Json propsJson; // check if cmis:name and cmis:contentStreamFileName has been duplicated bool duplicated = false; for ( PropertyPtrMap::const_iterator it = properties.begin() ; it != properties.end() ; ++it ) { string key = it->first; Json value( it->second ); // Convert the key back to the gdrive key // take one of the two: cmis:name and cmis:contentStreamFileName if ( key != "cmis:name" || key != "cmis:contentStreamFleName" || !duplicated ) propsJson.add( toGdriveKey( key ), value ); if ( key == "cmis:name" || key =="cmis:contentStreamFileName" ) duplicated = true; } return propsJson; } bool GdriveUtils::checkUpdatable( const string& key ) { // taken from https://developers.google.com/drive/v2/reference/files bool updatable = ( key == "title" || key == "description" || key == "modifiedDate" || key == "lastViewedByMeDate" ); return updatable; } bool GdriveUtils::checkMultiValued( const string& key ) { bool bMultiValued = ( key == "parents" || key == "exportLinks" || key == "labels" || key == "ownersName" || key == "owners"); return bMultiValued; } Json GdriveUtils::createJsonFromParentId( const string& parentId ) { Json parentValue( parentId.c_str( ) ); // parents is a Json array Json firstParent; firstParent.add( "id", parentValue ); Json::JsonVector parents; parents.insert( parents.begin( ), firstParent ); Json parentsValue( parents ); return parentsValue; } vector< string > GdriveUtils::parseGdriveProperty( string key, Json json ) { vector< string > values; if ( key == "owners" ) { Json::JsonVector owners = json.getList( ); for ( Json::JsonVector::iterator it = owners.begin( ); it != owners.end( ); ++it ) { string ownerName = ( *it )["displayName"].toString( ); values.push_back( ownerName); } } else if ( key == "lastModifyingUser" ) { string ownerName = json["displayName"].toString( ); values.push_back( ownerName); } else if ( key == "userPermission" ) { string ownerName = json["role"].toString( ); values.push_back( ownerName); } else if ( key == "ownerNames" ) { Json::JsonVector owners = json.getList( ); for ( Json::JsonVector::iterator it = owners.begin( ); it != owners.end( ); ++it ) { string ownerName = ( *it )[""].toString( ); values.push_back( ownerName); } } else if ( key == "parents" ) { Json::JsonVector owners = json.getList( ); for ( Json::JsonVector::iterator it = owners.begin( ); it != owners.end( ); ++it ) { string ownerName = ( *it )["id"].toString( ); values.push_back( ownerName); } } else if ( key == "exportLinks" ) { Json::JsonObject exportLinks = json.getObjects( ); for ( Json::JsonObject::iterator it = exportLinks.begin( ); it != exportLinks.end( ); ++it ) { string mimeType = it->first; string link = it->second.toString( ); values.push_back( mimeType + ":\"" + link +"\""); } } else if ( key == "labels" ) { Json::JsonObject labels = json.getObjects( ); for ( Json::JsonObject::iterator it = labels.begin( ); it != labels.end( ); ++it ) { string label = it->first; string isSet = it->second.toString( ); values.push_back( label + ": " + isSet ); } } else values.push_back( json.toString( ) ); return values; } libcmis-0.4.1/src/libcmis/ws-document.cxx0000644000175000001440000001163612156277660015300 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2011 SUSE * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #include "ws-document.hxx" using namespace std; using libcmis::PropertyPtrMap; WSDocument::WSDocument( const WSObject& object ) : libcmis::Object( object ), libcmis::Document( const_cast< WSObject& >( object ).getSession( ) ), WSObject( object ) { } WSDocument::~WSDocument( ) { } vector< libcmis::FolderPtr > WSDocument::getParents( ) throw ( libcmis::Exception ) { string repoId = getSession( )->getRepositoryId( ); return getSession( )->getNavigationService( ).getObjectParents( repoId, getId( ) ); } boost::shared_ptr< istream > WSDocument::getContentStream( std::string /* streamId */ ) throw ( libcmis::Exception ) { string repoId = getSession( )->getRepositoryId( ); return getSession( )->getObjectService( ).getContentStream( repoId, getId( ) ); } void WSDocument::setContentStream( boost::shared_ptr< ostream > os, string contentType, string fileName, bool overwrite ) throw ( libcmis::Exception ) { string repoId = getSession( )->getRepositoryId( ); getSession( )->getObjectService( ).setContentStream( repoId, getId( ), overwrite, getChangeToken( ), os, contentType, fileName ); refresh( ); } libcmis::DocumentPtr WSDocument::checkOut( ) throw ( libcmis::Exception ) { string repoId = getSession( )->getRepositoryId( ); return getSession( )->getVersioningService( ).checkOut( repoId, getId( ) ); } void WSDocument::cancelCheckout( ) throw ( libcmis::Exception ) { string repoId = getSession( )->getRepositoryId( ); getSession( )->getVersioningService( ).cancelCheckOut( repoId, getId( ) ); } libcmis::DocumentPtr WSDocument::checkIn( bool isMajor, string comment, const PropertyPtrMap& properties, boost::shared_ptr< ostream > stream, string contentType, string fileName ) throw ( libcmis::Exception ) { string repoId = getSession( )->getRepositoryId( ); libcmis::DocumentPtr newVersion; // Try the normal request first, but if we have a server error, we may want to resend it // without the stream as SharePoint wants no stream in the request, but gets the one from // the PWC see the following discussion: // http://social.technet.microsoft.com/Forums/eu/sharepoint2010programming/thread/b30e4d82-5b7e-4ceb-b9ad-c6f0d4c59d11 bool tryNoStream = false; try { newVersion = getSession( )->getVersioningService( ).checkIn( repoId, getId( ), isMajor, properties, stream, contentType, fileName, comment ); } catch ( const libcmis::Exception& e ) { string spError( "Object reference not set to an instance of an object" ); if ( string( e.what( ) ).find( spError ) != string::npos ) tryNoStream = true; else throw; } if ( tryNoStream ) { // Set the content stream first setContentStream( stream, contentType, fileName ); // Then check-in boost::shared_ptr< ostream > nostream; newVersion = getSession( )->getVersioningService( ).checkIn( repoId, getId( ), isMajor, properties, nostream, string( ), string( ), comment ); } if ( newVersion->getId( ) == getId( ) ) refresh( ); return newVersion; } vector< libcmis::DocumentPtr > WSDocument::getAllVersions( ) throw ( libcmis::Exception ) { vector< libcmis::DocumentPtr > versions; string repoId = getSession( )->getRepositoryId( ); string versionSeries; PropertyPtrMap::const_iterator it = getProperties( ).find( string( "cmis:versionSeriesId" ) ); if ( it != getProperties( ).end( ) && !it->second->getStrings( ).empty( ) ) { versionSeries = it->second->getStrings( ).front( ); versions = getSession( )->getVersioningService( ).getAllVersions( repoId, versionSeries ); } return versions; } libcmis-0.4.1/src/libcmis/ws-soap.hxx0000644000175000001440000001367412025555356014431 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2011 SUSE * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #ifndef _WS_SOAP_HXX_ #define _WS_SOAP_HXX_ #include #include #include #include #include #include "ws-relatedmultipart.hxx" #include "xmlserializable.hxx" /** Interface for soap sessions to communicate to response objects. \attention It currently doesn't provide anything, but it may later provide all useful methods for SOAP requests low level handling. */ class SoapSession { public: SoapSession( ) { } virtual ~SoapSession( ) { } }; /** Base class for all SOAP response objects. The factory will need to create the response objects using a static creator method in each class. */ class SoapResponse { public: virtual ~SoapResponse( ) { }; }; typedef boost::shared_ptr< SoapResponse > SoapResponsePtr; typedef SoapResponsePtr ( *SoapResponseCreator ) ( xmlNodePtr, RelatedMultipart&, SoapSession* session ); /** Base clas for SoapFault details parsed data. */ class SoapFaultDetail { public: virtual ~SoapFaultDetail() {}; virtual const std::string toString( ) const { return std::string( ); } }; typedef boost::shared_ptr< SoapFaultDetail > SoapFaultDetailPtr; typedef SoapFaultDetailPtr ( *SoapFaultDetailCreator ) ( xmlNodePtr ); class SoapResponseFactory; /** Class representing a SOAP Fault element, to be used as an exception. */ class SoapFault : public std::exception { private: std::string m_faultcode; std::string m_faultstring; std::vector< SoapFaultDetailPtr > m_detail; std::string m_message; public: SoapFault( xmlNodePtr faultNode, SoapResponseFactory* factory ); virtual ~SoapFault( ) throw ( ) { }; const std::string& getFaultcode ( ) const { return m_faultcode; } const std::string& getFaultstring ( ) const { return m_faultstring; } std::vector< SoapFaultDetailPtr > getDetail( ) const { return m_detail; } virtual const char* what() const throw(); }; /** Class parsing the SOAP response message and extracting the SoapResponse objects. */ class SoapResponseFactory { private: std::map< std::string, SoapResponseCreator > m_mapping; std::map< std::string, std::string > m_namespaces; std::map< std::string, SoapFaultDetailCreator > m_detailMapping; SoapSession* m_session; public: SoapResponseFactory( ); SoapResponseFactory( const SoapResponseFactory& copy ); SoapResponseFactory& operator=( const SoapResponseFactory& copy ); void setMapping( std::map< std::string, SoapResponseCreator > mapping ) { m_mapping = mapping; } /** Set the additional namespaces to parse the responses. There is no need to add the soap / wsdl namespaces... they are automatically added. */ void setNamespaces( std::map< std::string, std::string > namespaces ) { m_namespaces = namespaces; } void setDetailMapping( std::map< std::string, SoapFaultDetailCreator > mapping ) { m_detailMapping = mapping; } void setSession( SoapSession* session ) { m_session = session; } /** Get the Soap envelope from the multipart and extract the response objects from it. This method will also read the possible related parts to construct the response. */ std::vector< SoapResponsePtr > parseResponse( RelatedMultipart& multipart ) throw ( SoapFault ); /** Get the Soap envelope from an XML-only file and extract the response objects from it. */ std::vector< SoapResponsePtr > parseResponse( std::string& xml ) throw ( SoapFault ); /** Create a SoapResponse object depending on the node we have. This shouldn't be used directly: only from parseResponse or unit tests. */ SoapResponsePtr createResponse( xmlNodePtr node, RelatedMultipart& multipart ); std::vector< SoapFaultDetailPtr > parseFaultDetail( xmlNodePtr detailNode ); }; /** Base class for all SOAP request objects. The implementer's toXml() method needs to take care of two things: \li generate the XML to put in the Soap envelope body \li add the potential attachement to the multipart. There is no need to add the envelope to the multipart: it will automatically be added as the start part of it by getMultipart(). This also means that adding parts to the multipart will have to be done directly on the m_multipart protected member. The RelatedMultipart object is the final result to be used. */ class SoapRequest : public libcmis::XmlSerializable { protected: RelatedMultipart m_multipart; public: SoapRequest( ) : m_multipart( ) { }; virtual ~SoapRequest( ) { }; RelatedMultipart& getMultipart( std::string& username, std::string& password ); protected: std::string createEnvelope( std::string& username, std::string& password ); }; #endif libcmis-0.4.1/src/libcmis/ws-object-type.cxx0000644000175000001440000000460512064375434015701 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2011 SUSE * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #include "ws-object-type.hxx" using namespace std; WSObjectType::WSObjectType( WSSession* session, xmlNodePtr node ) : libcmis::ObjectType( node ), m_session( session ) { } WSObjectType::WSObjectType( const WSObjectType& copy ) : libcmis::ObjectType( copy ), m_session( copy.m_session ) { } WSObjectType::~WSObjectType( ) { } WSObjectType& WSObjectType::operator=( const WSObjectType& copy ) { if ( this != © ) { libcmis::ObjectType::operator=( copy ); m_session = copy.m_session; } return *this; } void WSObjectType::refresh( ) throw ( libcmis::Exception ) { libcmis::ObjectTypePtr type = m_session->getType( m_id ); WSObjectType* const other = dynamic_cast< WSObjectType* >( type.get( ) ); if ( other != NULL ) *this = *other; } libcmis::ObjectTypePtr WSObjectType::getParentType( ) throw ( libcmis::Exception ) { return m_session->getType( m_parentTypeId ); } libcmis::ObjectTypePtr WSObjectType::getBaseType( ) throw ( libcmis::Exception ) { return m_session->getType( m_baseTypeId ); } vector< libcmis::ObjectTypePtr > WSObjectType::getChildren( ) throw ( libcmis::Exception ) { vector< libcmis::ObjectTypePtr > children; children = m_session->getRepositoryService( ).getTypeChildren( m_session->getRepositoryId( ), m_id ); return children; } libcmis-0.4.1/src/libcmis/atom-workspace.hxx0000644000175000001440000000470112010710171015741 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2011 Cédric Bosdonnat * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #ifndef _ATOM_WORKSPACE_HXX_ #define _ATOM_WORKSPACE_HXX_ #include #include #include #include #include #include "exception.hxx" #include "repository.hxx" #define URI_TEMPLATE_VAR_ID std::string( "id" ) #define URI_TEMPLATE_VAR_PATH std::string( "path" ) struct Collection { enum Type { Root, Types, Query, CheckedOut, Unfiled }; }; struct UriTemplate { enum Type { ObjectById, ObjectByPath, TypeById, Query }; }; class AtomRepository : public libcmis::Repository { private: /// Collections URLs std::map< Collection::Type, std::string > m_collections; /// URI templates std::map< UriTemplate::Type, std::string > m_uriTemplates; public: AtomRepository( xmlNodePtr wsNode = NULL ) throw ( libcmis::Exception ); AtomRepository( const AtomRepository& rCopy ); ~AtomRepository( ); AtomRepository& operator= ( const AtomRepository& rCopy ); std::string getCollectionUrl( Collection::Type ); std::string getUriTemplate( UriTemplate::Type ); private: void readCollections( xmlNodeSetPtr pNodeSet ); void readUriTemplates( xmlNodeSetPtr pNodeSet ); }; typedef boost::shared_ptr< AtomRepository > AtomRepositoryPtr; #endif libcmis-0.4.1/src/libcmis/oauth2-data.cxx0000644000175000001440000000537012156277660015142 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2011 SUSE * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #include "oauth2-data.hxx" using namespace std; namespace libcmis { OAuth2Data::OAuth2Data( ) : m_authUrl( ), m_tokenUrl( ), m_clientId( ), m_clientSecret( ), m_scope( ), m_redirectUri( ) { } OAuth2Data::OAuth2Data( const string& authUrl, const string& tokenUrl, const string& scope, const string& redirectUri, const string& clientId, const string& clientSecret ): m_authUrl( authUrl ), m_tokenUrl( tokenUrl ), m_clientId( clientId ), m_clientSecret( clientSecret ), m_scope( scope ), m_redirectUri( redirectUri ) { } OAuth2Data::OAuth2Data( const OAuth2Data& copy ) : m_authUrl( copy.m_authUrl ), m_tokenUrl( copy.m_tokenUrl ), m_clientId( copy.m_clientId ), m_clientSecret( copy.m_clientSecret ), m_scope( copy.m_scope ), m_redirectUri( copy.m_redirectUri ) { } OAuth2Data::~OAuth2Data( ) { } OAuth2Data& OAuth2Data::operator=( const OAuth2Data& copy ) { if ( this != © ) { m_authUrl = copy.m_authUrl; m_tokenUrl = copy.m_tokenUrl; m_clientId = copy.m_clientId; m_clientSecret = copy.m_clientSecret; m_scope = copy.m_scope; m_redirectUri = copy.m_redirectUri; } return *this; } bool OAuth2Data::isComplete() { return !m_authUrl.empty() && !m_tokenUrl.empty() && !m_clientId.empty() && !m_clientSecret.empty() && !m_scope.empty() && !m_redirectUri.empty(); } } libcmis-0.4.1/src/libcmis/xml-utils.cxx0000644000175000001440000004363512156277660014775 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2011 SUSE * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #include #include #include #include #include #include #include "xml-utils.hxx" using namespace std; namespace { static const char chars64[]= "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; bool lcl_getBufValue( char encoded, int* value ) { bool found = false; const char *i = chars64; while ( !found && *i ) { if ( *i == encoded ) { found = true; *value = ( i - chars64 ); } ++i; } return found; } } namespace libcmis { EncodedData::EncodedData( FILE* stream ) : m_writer( NULL ), m_stream( stream ), m_outStream( NULL ), m_encoding( ), m_decode( false ), m_pendingValue( 0 ), m_pendingRank( 0 ), m_missingBytes( 0 ) { } EncodedData::EncodedData( ostream* stream ) : m_writer( NULL ), m_stream( NULL ), m_outStream( stream ), m_encoding( ), m_decode( false ), m_pendingValue( 0 ), m_pendingRank( 0 ), m_missingBytes( 0 ) { } EncodedData::EncodedData( xmlTextWriterPtr writer ) : m_writer( writer ), m_stream( NULL ), m_outStream( NULL ), m_encoding( ), m_decode( false ), m_pendingValue( 0 ), m_pendingRank( 0 ), m_missingBytes( 0 ) { } EncodedData::EncodedData( const EncodedData& copy ) : m_writer( copy.m_writer ), m_stream( copy.m_stream ), m_outStream( copy.m_outStream ), m_encoding( copy.m_encoding ), m_decode( copy.m_decode ), m_pendingValue( copy.m_pendingValue ), m_pendingRank( copy.m_pendingRank ), m_missingBytes( copy.m_missingBytes ) { } EncodedData& EncodedData::operator=( const EncodedData& copy ) { if ( this != © ) { m_writer = copy.m_writer; m_stream = copy.m_stream; m_outStream = copy.m_outStream; m_encoding = copy.m_encoding; m_decode = copy.m_decode; m_pendingValue = copy.m_pendingValue; m_pendingRank = copy.m_pendingRank; m_missingBytes = copy.m_missingBytes; } return *this; } void EncodedData::write( void* buf, size_t size, size_t nmemb ) { if ( m_writer ) xmlTextWriterWriteRawLen( m_writer, ( xmlChar* )buf, size * nmemb ); else if ( m_stream ) fwrite( buf, size, nmemb, m_stream ); else if ( m_outStream ) m_outStream->write( ( const char* )buf, size * nmemb ); } void EncodedData::decode( void* buf, size_t size, size_t nmemb ) { m_decode = true; if ( 0 == m_encoding.compare( "base64" ) ) { decodeBase64( ( const char* )buf, size * nmemb ); } else write( buf, size, nmemb ); } void EncodedData::encode( void* buf, size_t size, size_t nmemb ) { m_decode = false; if ( 0 == m_encoding.compare( "base64" ) ) { encodeBase64( ( const char* )buf, size * nmemb ); } else write( buf, size, nmemb ); } void EncodedData::finish( ) { // Flushes the last bytes in base64 encoding / decoding if any if ( 0 == m_encoding.compare( "base64" ) ) { if ( m_decode && ( m_pendingValue != 0 || m_pendingRank != 0 || m_missingBytes != 0 ) ) { int missingBytes = m_missingBytes; if ( 0 == m_missingBytes ) missingBytes = 4 - m_pendingRank; char decoded[3]; decoded[0] = ( m_pendingValue & 0xFF0000 ) >> 16; decoded[1] = ( m_pendingValue & 0xFF00 ) >> 8; decoded[2] = ( m_pendingValue & 0xFF ); write( decoded, 1, 3 - missingBytes ); m_pendingRank = 0; m_pendingValue = 0; m_missingBytes = 0; } else if ( !m_decode && ( m_pendingValue != 0 || m_pendingRank != 0 ) ) { // Missing bytes should be zeroed: no need to do it char encoded[4]; encoded[0] = chars64[ ( m_pendingValue & 0xFC0000 ) >> 18 ]; encoded[1] = chars64[ ( m_pendingValue & 0x03F000 ) >> 12 ]; encoded[2] = chars64[ ( m_pendingValue & 0x000FC0 ) >> 6 ]; encoded[3] = chars64[ ( m_pendingValue & 0x00003F ) ]; // Output the padding int nEquals = 3 - m_pendingRank; for ( int i = 0; i < nEquals; ++i ) encoded[ 3 - i ] = '='; write( encoded, 1, 4 ); m_pendingRank = 0; m_pendingValue = 0; } } } void EncodedData::decodeBase64( const char* buf, size_t len ) { unsigned long blockValue = m_pendingValue; int byteRank = m_pendingRank; int missingBytes = m_missingBytes; size_t i = 0; while ( i < len ) { int value = 0; if ( lcl_getBufValue( buf[i], &value ) ) { blockValue += value << ( ( 3 - byteRank ) * 6 ); ++byteRank; } else if ( buf[i] == '=' ) { ++missingBytes; ++byteRank; } // Reached the end of a block, decode it if ( byteRank >= 4 ) { char decoded[3]; decoded[0] = ( blockValue & 0xFF0000 ) >> 16; decoded[1] = ( blockValue & 0xFF00 ) >> 8; decoded[2] = ( blockValue & 0xFF ); write( decoded, 1, 3 - missingBytes ); byteRank = 0; blockValue = 0; missingBytes = 0; } ++i; } // Store the values if the last block is incomplete: they may come later m_pendingValue = blockValue; m_pendingRank = byteRank; m_missingBytes = missingBytes; } void EncodedData::encodeBase64( const char* buf, size_t len ) { unsigned long blockValue = m_pendingValue; int byteRank = m_pendingRank; size_t i = 0; while ( i < len ) { // Cast the char to an unsigned char or we'll shift negative values blockValue += static_cast< unsigned char >( buf[i] ) << ( 2 - byteRank ) * 8; ++byteRank; // Reached the end of a block, encode it if ( byteRank >= 3 ) { char encoded[4]; encoded[0] = chars64[ ( blockValue & 0xFC0000 ) >> 18 ]; encoded[1] = chars64[ ( blockValue & 0x03F000 ) >> 12 ]; encoded[2] = chars64[ ( blockValue & 0x000FC0 ) >> 6 ]; encoded[3] = chars64[ ( blockValue & 0x00003F ) ]; write( encoded, 1, 4 ); byteRank = 0; blockValue = 0; } ++i; } // Store the values if the last block is incomplete: they may come later m_pendingValue = blockValue; m_pendingRank = byteRank; } HttpResponse::HttpResponse( ) : m_headers( ), m_stream( ), m_data( ) { m_stream.reset( new stringstream( ) ); m_data.reset( new EncodedData( m_stream.get( ) ) ); } void registerNamespaces( xmlXPathContextPtr xpathCtx ) { if ( xpathCtx != NULL ) { xmlXPathRegisterNs( xpathCtx, BAD_CAST( "app" ), BAD_CAST( NS_APP_URL ) ); xmlXPathRegisterNs( xpathCtx, BAD_CAST( "atom" ), BAD_CAST( NS_ATOM_URL ) ); xmlXPathRegisterNs( xpathCtx, BAD_CAST( "cmis" ), BAD_CAST( NS_CMIS_URL ) ); xmlXPathRegisterNs( xpathCtx, BAD_CAST( "cmisra" ), BAD_CAST( NS_CMISRA_URL ) ); xmlXPathRegisterNs( xpathCtx, BAD_CAST( "cmism" ), BAD_CAST( NS_CMISM_URL ) ); xmlXPathRegisterNs( xpathCtx, BAD_CAST( "xsi" ), BAD_CAST( "http://www.w3.org/2001/XMLSchema-instance" ) ); xmlXPathRegisterNs( xpathCtx, BAD_CAST( "type" ), BAD_CAST( "cmis:cmisTypeDocumentDefinitionType" ) ); } } void registerCmisWSNamespaces( xmlXPathContextPtr xpathCtx ) { if ( xpathCtx != NULL ) { xmlXPathRegisterNs( xpathCtx, BAD_CAST( "cmisw" ), BAD_CAST( NS_CMISW_URL ) ); xmlXPathRegisterNs( xpathCtx, BAD_CAST( "cmis" ), BAD_CAST( NS_CMIS_URL ) ); xmlXPathRegisterNs( xpathCtx, BAD_CAST( "cmisra" ), BAD_CAST( NS_CMISRA_URL ) ); xmlXPathRegisterNs( xpathCtx, BAD_CAST( "cmism" ), BAD_CAST( NS_CMISM_URL ) ); registerSoapNamespaces( xpathCtx ); } } void registerSoapNamespaces( xmlXPathContextPtr xpathCtx ) { if ( xpathCtx != NULL ) { xmlXPathRegisterNs( xpathCtx, BAD_CAST( "soap" ), BAD_CAST( NS_SOAP_URL ) ); xmlXPathRegisterNs( xpathCtx, BAD_CAST( "soap-env" ), BAD_CAST( NS_SOAP_ENV_URL ) ); xmlXPathRegisterNs( xpathCtx, BAD_CAST( "wsdl" ), BAD_CAST ( "http://schemas.xmlsoap.org/wsdl/" ) ); xmlXPathRegisterNs( xpathCtx, BAD_CAST( "ns" ), BAD_CAST ( "http://schemas.xmlsoap.org/soap/encoding/" ) ); xmlXPathRegisterNs( xpathCtx, BAD_CAST( "jaxws" ), BAD_CAST( "http://java.sun.com/xml/ns/jaxws" ) ); xmlXPathRegisterNs( xpathCtx, BAD_CAST( "xsd" ), BAD_CAST ( "http://www.w3.org/2001/XMLSchema" ) ); } } string getXPathValue( xmlXPathContextPtr xpathCtx, string req ) { string value; if ( xpathCtx != NULL ) { xmlXPathObjectPtr xpathObj = xmlXPathEvalExpression( BAD_CAST( req.c_str() ), xpathCtx ); if ( xpathObj && xpathObj->nodesetval && xpathObj->nodesetval->nodeNr > 0 ) { xmlChar* pContent = xmlNodeGetContent( xpathObj->nodesetval->nodeTab[0] ); value = string( ( char* )pContent ); xmlFree( pContent ); } xmlXPathFreeObject( xpathObj ); } return value; } xmlDocPtr wrapInDoc( xmlNodePtr entryNd ) { xmlDocPtr doc = xmlNewDoc(BAD_CAST "1.0"); if ( entryNd != NULL ) { xmlNodePtr entryCopy = xmlCopyNode( entryNd, 1 ); xmlDocSetRootElement( doc, entryCopy ); } return doc; } string getXmlNodeAttributeValue( xmlNodePtr node, const char* attributeName ) throw ( Exception ) { xmlChar* xmlStr = xmlGetProp( node, BAD_CAST( attributeName ) ); if ( xmlStr == NULL ) throw Exception( "Missing attribute" ); string value( ( char * ) xmlStr ); xmlFree( xmlStr ); return value; } boost::posix_time::ptime parseDateTime( string dateTimeStr ) { boost::posix_time::ptime t( boost::date_time::not_a_date_time ); // Get the time zone offset boost::posix_time::time_duration tzOffset( boost::posix_time::duration_from_string( "+00:00" ) ); size_t teePos = dateTimeStr.find( 'T' ); string noTzStr = dateTimeStr.substr( 0, teePos + 1 ); string timeStr = dateTimeStr.substr( teePos + 1 ); // Get the TZ if any if ( timeStr[ timeStr.size() - 1] == 'Z' ) { noTzStr += timeStr.substr( 0, timeStr.size() - 1 ); } else { size_t tzPos = timeStr.find( '+' ); if ( tzPos == string::npos ) tzPos = timeStr.find( '-' ); if ( tzPos != string::npos ) { noTzStr += timeStr.substr( 0, tzPos ); // Check the validity of the TZ value string tzStr = timeStr.substr( tzPos ); try { tzOffset = boost::posix_time::time_duration( boost::posix_time::duration_from_string( tzStr.c_str() ) ); } catch ( const std::exception& ) { // Error converting, not a datetime return t; } } else noTzStr += timeStr; } // Remove all the '-' and ':' size_t pos = noTzStr.find_first_of( ":-" ); while ( pos != string::npos ) { noTzStr.erase( pos, 1 ); pos = noTzStr.find_first_of( ":-" ); } try { t = boost::posix_time::from_iso_string( noTzStr.c_str( ) ); t = t + tzOffset; } catch ( const std::exception& ) { // Ignore boost parsing errors: will result in not_a_date_time } return t; } string writeDateTime( boost::posix_time::ptime time ) { string str; if ( !time.is_special( ) ) { str = boost::posix_time::to_iso_extended_string( time ); str += "Z"; } return str; } bool parseBool( string boolStr ) throw ( Exception ) { bool value = false; if ( boolStr == "true" || boolStr == "1" ) value = true; else if ( boolStr == "false" || boolStr == "0" ) value = false; else throw Exception( string( "Invalid xsd:boolean input: " ) + boolStr ); return value; } long parseInteger( string intStr ) throw ( Exception ) { char* end; errno = 0; long value = strtol( intStr.c_str(), &end, 0 ); if ( ( ERANGE == errno && ( LONG_MAX == value || LONG_MIN == value ) ) || ( errno != 0 && value == 0 ) ) { throw Exception( string( "xsd:integer input can't fit to long: " ) + intStr ); } else if ( !string( end ).empty( ) ) { throw Exception( string( "Invalid xsd:integer input: " ) + intStr ); } return value; } double parseDouble( string doubleStr ) throw ( Exception ) { char* end; errno = 0; double value = strtod( doubleStr.c_str(), &end ); if ( ( ERANGE == errno ) || ( errno != 0 && value == 0 ) ) { throw Exception( string( "xsd:decimal input can't fit to double: " ) + doubleStr ); } else if ( !string( end ).empty( ) ) { throw Exception( string( "Invalid xsd:decimal input: " ) + doubleStr ); } return value; } string trim( const string& str ) { string spaces = " \t\r\n"; string result( str ); result = result.erase (0, str.find_first_not_of ( spaces ) ); string::size_type pos ( result.find_last_not_of ( spaces ) ); if ( pos == string::npos ) return ""; else return result.erase( result.find_last_not_of( spaces ) + 1 ); } std::string base64encode( const std::string& str ) { stringstream stream; EncodedData data( &stream ); data.setEncoding( "base64" ); data.encode( ( void * )str.c_str( ), size_t( 1 ), str.size() ); data.finish( ); return stream.str(); } std::string sha1( const std::string& str ) { boost::uuids::detail::sha1 sha1; sha1.process_bytes( str.c_str(), str.size() ); unsigned int digest[5]; sha1.get_digest( digest ); stringstream out; // Setup writing mode. Every number must produce eight // hexadecimal digits, including possible leading 0s, or we get // less than 40 digits as result. out << hex << setfill('0') << right; for ( int i = 0; i < 5; ++i ) out << setw(8) << digest[i]; return out.str(); } string tolower( string sText ) { string lower( sText ); for ( size_t i = 0; i < sText.size(); ++i ) { lower[i] = ::tolower( sText[i] ); } return lower; } int stringstream_write_callback( void * context, const char * s, int len ) { stringstream * ss=static_cast< stringstream * >( context ); if ( ss ) { ss->write( s, len ); return len; } return 0; } string escape( string str ) { #if LIBCURL_VERSION_VALUE >= 0x070F04 char* escaped = curl_easy_escape( NULL, str.c_str(), str.length() ); #else char* escaped = curl_escape( str.c_str(), str.length() ); #endif string result = escaped; curl_free( escaped ); return result; } string unescape( string str ) { #if LIBCURL_VERSION_VALUE >= 0x070F04 char* unescaped = curl_easy_unescape( NULL, str.c_str(), str.length(), NULL ); #else char* unescaped = curl_unescape( str.c_str(), str.length() ); #endif string result = unescaped; curl_free( unescaped ); return result; } } libcmis-0.4.1/src/libcmis/atom-object-type.cxx0000644000175000001440000001435412156277660016216 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2011 SUSE * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #include #include "atom-object-type.hxx" #include "xml-utils.hxx" using namespace std; using namespace boost; AtomObjectType::AtomObjectType( AtomPubSession* session, string id ) throw ( libcmis::Exception ) : libcmis::ObjectType( ), m_session( session ), m_selfUrl( ), m_childrenUrl( ) { m_id = id; refresh( ); } AtomObjectType::AtomObjectType( AtomPubSession* session, xmlNodePtr entryNd ) throw ( libcmis::Exception ) : libcmis::ObjectType( ), m_session( session ), m_selfUrl( ), m_childrenUrl( ) { xmlDocPtr doc = libcmis::wrapInDoc( entryNd ); refreshImpl( doc ); xmlFreeDoc( doc ); } AtomObjectType::AtomObjectType( const AtomObjectType& copy ) : libcmis::ObjectType( copy ), m_session( copy.m_session ), m_selfUrl( copy.m_selfUrl ), m_childrenUrl( copy.m_childrenUrl ) { } AtomObjectType::~AtomObjectType( ) { } AtomObjectType& AtomObjectType::operator=( const AtomObjectType& copy ) { if ( this != © ) { libcmis::ObjectType::operator=( copy ); m_session = copy.m_session; m_selfUrl = copy.m_selfUrl; m_childrenUrl = copy.m_childrenUrl; } return *this; } libcmis::ObjectTypePtr AtomObjectType::getParentType( ) throw ( libcmis::Exception ) { return m_session->getType( m_parentTypeId ); } libcmis::ObjectTypePtr AtomObjectType::getBaseType( ) throw ( libcmis::Exception ) { return m_session->getType( m_baseTypeId ); } vector< libcmis::ObjectTypePtr > AtomObjectType::getChildren( ) throw ( libcmis::Exception ) { vector< libcmis::ObjectTypePtr > children; string buf; try { buf = m_session->httpGetRequest( m_childrenUrl )->getStream( )->str( ); } catch ( const CurlException& e ) { throw e.getCmisException( ); } xmlDocPtr doc = xmlReadMemory( buf.c_str(), buf.size(), m_childrenUrl.c_str(), NULL, 0 ); if ( NULL != doc ) { xmlXPathContextPtr xpathCtx = xmlXPathNewContext( doc ); libcmis::registerNamespaces( xpathCtx ); if ( NULL != xpathCtx ) { const string& entriesReq( "//atom:entry" ); xmlXPathObjectPtr xpathObj = xmlXPathEvalExpression( BAD_CAST( entriesReq.c_str() ), xpathCtx ); if ( NULL != xpathObj && NULL != xpathObj->nodesetval ) { int size = xpathObj->nodesetval->nodeNr; for ( int i = 0; i < size; i++ ) { xmlNodePtr node = xpathObj->nodesetval->nodeTab[i]; libcmis::ObjectTypePtr type( new AtomObjectType( m_session, node ) ); children.push_back( type ); } } xmlXPathFreeObject( xpathObj ); } xmlXPathFreeContext( xpathCtx ); } else { throw libcmis::Exception( "Failed to parse type children infos" ); } xmlFreeDoc( doc ); return children; } void AtomObjectType::refreshImpl( xmlDocPtr doc ) throw ( libcmis::Exception ) { bool createdDoc = ( NULL == doc ); if ( createdDoc ) { string pattern = m_session->getAtomRepository()->getUriTemplate( UriTemplate::TypeById ); map< string, string > vars; vars[URI_TEMPLATE_VAR_ID] = getId( ); string url = m_session->createUrl( pattern, vars ); string buf; try { buf = m_session->httpGetRequest( url )->getStream()->str(); } catch ( const CurlException& e ) { if ( ( e.getErrorCode( ) == CURLE_HTTP_RETURNED_ERROR ) && ( e.getHttpStatus( ) == 404 ) ) { string msg = "No such type: "; msg += getId( ); throw libcmis::Exception( msg, "objectNotFound" ); } else throw e.getCmisException( ); } doc = xmlReadMemory( buf.c_str(), buf.size(), m_selfUrl.c_str(), NULL, 0 ); if ( NULL == doc ) throw libcmis::Exception( "Failed to parse object infos" ); } extractInfos( doc ); if ( createdDoc ) xmlFreeDoc( doc ); } void AtomObjectType::extractInfos( xmlDocPtr doc ) throw ( libcmis::Exception ) { xmlXPathContextPtr xpathCtx = xmlXPathNewContext( doc ); // Register the Service Document namespaces libcmis::registerNamespaces( xpathCtx ); if ( NULL != xpathCtx ) { // Get the self URL string selfUrlReq( "//atom:link[@rel='self']/attribute::href" ); m_selfUrl = libcmis::getXPathValue( xpathCtx, selfUrlReq ); // Get the children URL string childrenUrlReq( "//atom:link[@rel='down' and @type='application/atom+xml;type=feed']/attribute::href" ); m_childrenUrl = libcmis::getXPathValue( xpathCtx, childrenUrlReq ); // Get the cmisra:type node xmlXPathObjectPtr xpathObj = xmlXPathEvalExpression( BAD_CAST( "//cmisra:type" ), xpathCtx ); if ( NULL != xpathObj && NULL != xpathObj->nodesetval && xpathObj->nodesetval->nodeNr ) { xmlNodePtr typeNode = xpathObj->nodesetval->nodeTab[0]; initializeFromNode( typeNode ); } xmlXPathFreeObject( xpathObj ); } xmlXPathFreeContext( xpathCtx ); } libcmis-0.4.1/src/libcmis/allowable-actions.cxx0000644000175000001440000002362712156277660016436 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2011 SUSE * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #include "allowable-actions.hxx" #include "object.hxx" #include "xml-utils.hxx" using namespace std; namespace libcmis { ObjectAction::ObjectAction( xmlNodePtr node ) : m_type( ObjectAction::DeleteObject ), m_enabled( false ), m_valid( false ) { try { m_type = parseType( string( ( char* ) node->name ) ); m_valid = true; } catch ( const Exception& ) { m_valid = false; } // Invalid xsd:bool will be mean false... not sure what the spec says try { xmlChar* content = xmlNodeGetContent( node ); m_enabled = parseBool( string( ( char* )content ) ); xmlFree( content ); } catch ( const Exception& ) { m_enabled = false; } } ObjectAction::Type ObjectAction::parseType( string type ) throw ( Exception ) { Type value = DeleteObject; if ( type == "canDeleteObject" ) value = DeleteObject; else if ( type == "canUpdateProperties" ) value = UpdateProperties; else if ( type == "canGetFolderTree" ) value = GetFolderTree; else if ( type == "canGetProperties" ) value = GetProperties; else if ( type == "canGetObjectRelationships" ) value = GetObjectRelationships; else if ( type == "canGetObjectParents" ) value = GetObjectParents; else if ( type == "canGetFolderParent" ) value = GetFolderParent; else if ( type == "canGetDescendants" ) value = GetDescendants; else if ( type == "canMoveObject" ) value = MoveObject; else if ( type == "canDeleteContentStream" ) value = DeleteContentStream; else if ( type == "canCheckOut" ) value = CheckOut; else if ( type == "canCancelCheckOut" ) value = CancelCheckOut; else if ( type == "canCheckIn" ) value = CheckIn; else if ( type == "canSetContentStream" ) value = SetContentStream; else if ( type == "canGetAllVersions" ) value = GetAllVersions; else if ( type == "canAddObjectToFolder" ) value = AddObjectToFolder; else if ( type == "canRemoveObjectFromFolder" ) value = RemoveObjectFromFolder; else if ( type == "canGetContentStream" ) value = GetContentStream; else if ( type == "canApplyPolicy" ) value = ApplyPolicy; else if ( type == "canGetAppliedPolicies" ) value = GetAppliedPolicies; else if ( type == "canRemovePolicy" ) value = RemovePolicy; else if ( type == "canGetChildren" ) value = GetChildren; else if ( type == "canCreateDocument" ) value = CreateDocument; else if ( type == "canCreateFolder" ) value = CreateFolder; else if ( type == "canCreateRelationship" ) value = CreateRelationship; else if ( type == "canDeleteTree" ) value = DeleteTree; else if ( type == "canGetRenditions" ) value = GetRenditions; else if ( type == "canGetACL" ) value = GetACL; else if ( type == "canApplyACL" ) value = ApplyACL; else throw Exception( "Invalid AllowableAction type: " + type ); return value; } AllowableActions::AllowableActions( ) : m_states( ) { } AllowableActions::AllowableActions( xmlNodePtr node ) : m_states( ) { for ( xmlNodePtr child = node->children; child; child = child->next ) { // Check for non text children... "\n" is also a node ;) if ( !xmlNodeIsText( child ) ) { ObjectAction action( child ); if ( action.isValid( ) ) m_states.insert( pair< libcmis::ObjectAction::Type, bool >( action.getType( ), action.isEnabled() ) ); } } } AllowableActions::AllowableActions( const AllowableActions& copy ) : m_states( copy.m_states ) { } AllowableActions::~AllowableActions( ) { m_states.clear(); } AllowableActions& AllowableActions::operator=( const AllowableActions& copy ) { if ( this != © ) m_states = copy.m_states; return *this; } bool AllowableActions::isAllowed( ObjectAction::Type action ) { bool allowed = false; map< ObjectAction::Type, bool>::iterator it = m_states.find( action ); if ( it != m_states.end() ) allowed = it->second; return allowed; } bool AllowableActions::isDefined( ObjectAction::Type action ) { map< ObjectAction::Type, bool>::iterator it = m_states.find( action ); return it != m_states.end(); } string AllowableActions::toString( ) { stringstream buf; for ( map< ObjectAction::Type, bool >::iterator it = m_states.begin( ); it != m_states.end( ); ++it ) { switch ( it->first ) { case ObjectAction::DeleteObject: buf << "canDeleteObject"; break; case ObjectAction::UpdateProperties: buf << "canUpdateProperties"; break; case ObjectAction::GetFolderTree: buf << "canGetFolderTree"; break; case ObjectAction::GetProperties: buf << "canGetProperties"; break; case ObjectAction::GetObjectRelationships: buf << "canGetObjectRelationships"; break; case ObjectAction::GetObjectParents: buf << "canGetObjectParents"; break; case ObjectAction::GetFolderParent: buf << "canGetFolderParent"; break; case ObjectAction::GetDescendants: buf << "canGetDescendants"; break; case ObjectAction::MoveObject: buf << "canMoveObject"; break; case ObjectAction::DeleteContentStream: buf << "canDeleteContentStream"; break; case ObjectAction::CheckOut: buf << "canCheckOut"; break; case ObjectAction::CancelCheckOut: buf << "canCancelCheckOut"; break; case ObjectAction::CheckIn: buf << "canCheckIn"; break; case ObjectAction::SetContentStream: buf << "canSetContentStream"; break; case ObjectAction::GetAllVersions: buf << "canGetAllVersions"; break; case ObjectAction::AddObjectToFolder: buf << "canAddObjectToFolder"; break; case ObjectAction::RemoveObjectFromFolder: buf << "canRemoveObjectFromFolder"; break; case ObjectAction::GetContentStream: buf << "canGetContentStream"; break; case ObjectAction::ApplyPolicy: buf << "canApplyPolicy"; break; case ObjectAction::GetAppliedPolicies: buf << "canGetAppliedPolicies"; break; case ObjectAction::RemovePolicy: buf << "canRemovePolicy"; break; case ObjectAction::GetChildren: buf << "canGetChildren"; break; case ObjectAction::CreateDocument: buf << "canCreateDocument"; break; case ObjectAction::CreateFolder: buf << "canCreateFolder"; break; case ObjectAction::CreateRelationship: buf << "canCreateRelationship"; break; case ObjectAction::DeleteTree: buf << "canDeleteTree"; break; case ObjectAction::GetRenditions: buf << "canGetRenditions"; break; case ObjectAction::GetACL: buf << "canGetACL"; break; case ObjectAction::ApplyACL: buf << "canApplyACL"; break; } buf << ": " << it->second << endl; } return buf.str( ); } } libcmis-0.4.1/src/libcmis/gdrive-object-type.hxx0000644000175000001440000000310612156277660016534 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2013 Cao Cuong Ngo * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #ifndef _GDRIVE_OBJECT_TYPE_HXX_ #define _GDRIVE_OBJECT_TYPE_HXX_ #include "object-type.hxx" #include "json-utils.hxx" class GdriveObjectType: public libcmis::ObjectType { public: GdriveObjectType( const std::string& id ); virtual libcmis::ObjectTypePtr getParentType( ) throw( libcmis::Exception ); virtual libcmis::ObjectTypePtr getBaseType( ) throw( libcmis::Exception ); }; #endif libcmis-0.4.1/src/libcmis/property.cxx0000644000175000001440000001474312156277660014721 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2011 SUSE * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #include "object-type.hxx" #include "property.hxx" #include "xml-utils.hxx" using namespace std; namespace libcmis { Property::Property( ): m_propertyType( ), m_strValues( ), m_boolValues( ), m_longValues( ), m_doubleValues( ), m_dateTimeValues( ) { } Property::Property( PropertyTypePtr propertyType, std::vector< std::string > strValues ) : m_propertyType( propertyType ), m_strValues( ), m_boolValues( ), m_longValues( ), m_doubleValues( ), m_dateTimeValues( ) { setValues( strValues ); } void Property::setValues( vector< string > strValues ) { m_strValues = strValues; m_boolValues.clear( ); m_longValues.clear( ); m_doubleValues.clear( ); m_dateTimeValues.clear( ); for ( vector< string >::iterator it = strValues.begin(); it != strValues.end( ); ++it ) { try { // If no PropertyType was provided at construction time, use String PropertyType::Type type = PropertyType::String; if ( getPropertyType( ) != NULL ) type = getPropertyType( )->getType( ); switch ( type ) { case PropertyType::Integer: m_longValues.push_back( parseInteger( *it ) ); break; case PropertyType::Decimal: m_doubleValues.push_back( parseDouble( *it ) ); break; case PropertyType::Bool: m_boolValues.push_back( parseBool( *it ) ); break; case PropertyType::DateTime: { boost::posix_time::ptime time = parseDateTime( *it ); if ( !time.is_not_a_date_time( ) ) m_dateTimeValues.push_back( time ); } break; default: case PropertyType::String: // Nothing to convert for strings break; } } catch( const Exception& ) { // Just ignore the unparsable values } } } void Property::setPropertyType( PropertyTypePtr propertyType) { m_propertyType = propertyType; } void Property::toXml( xmlTextWriterPtr writer ) { // Don't write the property if we have no type for it. if ( getPropertyType( ) != NULL ) { string xmlType = string( "cmis:property" ) + getPropertyType()->getXmlType( ); xmlTextWriterStartElement( writer, BAD_CAST( xmlType.c_str( ) ) ); // Write the attributes xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "propertyDefinitionId" ), "%s", BAD_CAST( getPropertyType()->getId( ).c_str( ) ) ); xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "localName" ), "%s", BAD_CAST( getPropertyType()->getLocalName( ).c_str( ) ) ); xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "displayName" ), "%s", BAD_CAST( getPropertyType()->getDisplayName( ).c_str( ) ) ); xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "queryName" ), "%s", BAD_CAST( getPropertyType()->getQueryName( ).c_str( ) ) ); // Write the values for ( vector< string >::iterator it = m_strValues.begin( ); it != m_strValues.end( ); ++it ) { xmlTextWriterWriteElement( writer, BAD_CAST( "cmis:value" ), BAD_CAST( it->c_str( ) ) ); } xmlTextWriterEndElement( writer ); } } string Property::toString( ) { string res; if ( getPropertyType( ) != NULL ) { for ( vector< string >::iterator it = m_strValues.begin( ); it != m_strValues.end( ); ++it ) { res.append( *it ); } } return res; } PropertyPtr parseProperty( xmlNodePtr node, ObjectTypePtr objectType ) { PropertyPtr property; if ( node != NULL && objectType != NULL ) { try { string id = getXmlNodeAttributeValue( node, "propertyDefinitionId" ); // Find the value nodes vector< string > values; for ( xmlNodePtr child = node->children; child; child = child->next ) { if ( xmlStrEqual( child->name, BAD_CAST( "value" ) ) ) { xmlChar* content = xmlNodeGetContent( child ); values.push_back( string( ( char * ) content ) ); xmlFree( content ); } } map< string, PropertyTypePtr >::iterator it = objectType->getPropertiesTypes( ).find( id ); if ( it != objectType->getPropertiesTypes().end( ) ) { property.reset( new Property( it->second, values ) ); } } catch ( const Exception& ) { // Ignore that non-property node } } return property; } } libcmis-0.4.1/src/libcmis/ws-session.cxx0000644000175000001440000003175512177714610015143 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2011 SUSE * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #include #include #include #include #include #include "ws-requests.hxx" #include "ws-session.hxx" #include "xml-utils.hxx" using namespace std; WSSession::WSSession( string bindingUrl, string repositoryId, string username, string password, bool noSslCheck, libcmis::OAuth2DataPtr oauth2, bool verbose ) throw ( libcmis::Exception ) : BaseSession( bindingUrl, repositoryId, username, password, noSslCheck, oauth2, verbose ), m_servicesUrls( ), m_navigationService( NULL ), m_objectService( NULL ), m_repositoryService( NULL ), m_versioningService( NULL ), m_responseFactory( ) { // We don't want to have the HTTP exceptions as the errors are coming // back as SoapFault elements. setNoHttpErrors( true ); initialize( ); } WSSession::WSSession( const WSSession& copy ) : BaseSession( copy ), m_servicesUrls( copy.m_servicesUrls ), m_navigationService( NULL ), m_objectService( NULL ), m_repositoryService( NULL ), m_versioningService( NULL ), m_responseFactory( copy.m_responseFactory ) { } WSSession& WSSession::operator=( const WSSession& copy ) { if ( this != © ) { BaseSession::operator=( copy ); m_servicesUrls = copy.m_servicesUrls; m_navigationService = NULL; m_objectService = NULL; m_repositoryService = NULL; m_versioningService = NULL; m_responseFactory = copy.m_responseFactory; } return *this; } WSSession::~WSSession( ) { delete m_navigationService; delete m_objectService; delete m_repositoryService; delete m_versioningService; } string WSSession::getWsdl( string url ) throw ( CurlException ) { string buf = httpGetRequest( url )->getStream( )->str( ); // Do we have a wsdl file? bool isWsdl = false; xmlDocPtr doc = xmlReadMemory( buf.c_str(), buf.size(), m_bindingUrl.c_str(), NULL, 0 ); if ( NULL != doc ) { xmlXPathContextPtr xpathCtx = xmlXPathNewContext( doc ); libcmis::registerCmisWSNamespaces( xpathCtx ); if ( NULL != xpathCtx ) { string definitionsXPath( "/wsdl:definitions" ); xmlXPathObjectPtr xpathObj = xmlXPathEvalExpression( BAD_CAST( definitionsXPath.c_str() ), xpathCtx ); isWsdl = ( xpathObj != NULL ) && ( xpathObj->nodesetval != NULL ) && ( xpathObj->nodesetval->nodeNr > 0 ); } xmlXPathFreeContext( xpathCtx ); } // If we don't have a wsdl file we may have received an HTML explanation for it, // try to add ?wsdl to the URL (last chance to get something) if ( !isWsdl ) { if ( url.find( "?" ) == string::npos ) url += "?"; else url += "&"; url += "wsdl"; buf = httpGetRequest( url )->getStream( )->str( ); } return buf; } vector< SoapResponsePtr > WSSession::soapRequest( string& url, SoapRequest& request ) throw ( libcmis::Exception ) { vector< SoapResponsePtr > responses; try { // Place the request in an envelope RelatedMultipart& multipart = request.getMultipart( getUsername( ), getPassword( ) ); libcmis::HttpResponsePtr response = httpPostRequest( url, *multipart.toStream( ).get( ), multipart.getContentType( ) ); string responseType; map< string, string >::iterator it = response->getHeaders( ).find( "Content-Type" ); if ( it != response->getHeaders( ).end( ) ) { responseType = it->second; if ( string::npos != responseType.find( "multipart/related" ) ) { RelatedMultipart answer( response->getStream( )->str( ), responseType ); responses = getResponseFactory( ).parseResponse( answer ); } else if ( string::npos != responseType.find( "text/xml" ) ) { // Parse the envelope string xml = response->getStream( )->str( ); responses = getResponseFactory( ).parseResponse( xml ); } } } catch ( const SoapFault& fault ) { boost::shared_ptr< libcmis::Exception > cmisException = getCmisException( fault ); if ( !cmisException.get( ) ) { cmisException.reset( new libcmis::Exception( fault.what( ), "runtime" ) ); } throw *cmisException.get( ); } catch ( const CurlException& e ) { throw e.getCmisException( ); } return responses; } void WSSession::initialize( ) throw ( libcmis::Exception ) { if ( m_repositories.empty() ) { // Get the wsdl file string buf; try { buf = getWsdl( m_bindingUrl ); } catch ( const CurlException& e ) { throw e.getCmisException( ); } // parse the content xmlDocPtr doc = xmlReadMemory( buf.c_str(), buf.size(), m_bindingUrl.c_str(), NULL, 0 ); if ( NULL != doc ) { // Check that we have a WSDL document xmlNodePtr root = xmlDocGetRootElement( doc ); if ( !xmlStrEqual( root->name, BAD_CAST( "definitions" ) ) ) throw libcmis::Exception( "Not a WSDL document" ); // Get all the services soap URLs m_servicesUrls.clear( ); xmlXPathContextPtr xpathCtx = xmlXPathNewContext( doc ); libcmis::registerCmisWSNamespaces( xpathCtx ); if ( NULL != xpathCtx ) { string serviceXPath( "//wsdl:service" ); xmlXPathObjectPtr xpathObj = xmlXPathEvalExpression( BAD_CAST( serviceXPath.c_str() ), xpathCtx ); if ( xpathObj != NULL ) { int nbServices = 0; if ( xpathObj->nodesetval ) nbServices = xpathObj->nodesetval->nodeNr; for ( int i = 0; i < nbServices; i++ ) { // What service do we have here? xmlNodePtr node = xpathObj->nodesetval->nodeTab[i]; string name = libcmis::getXmlNodeAttributeValue( node, "name" ); // Gimme you soap:address location attribute string locationXPath = serviceXPath + "[@name='" + name + "']/wsdl:port/soap:address/attribute::location"; string location = libcmis::getXPathValue( xpathCtx, locationXPath ); m_servicesUrls[name] = location; } } } xmlXPathFreeContext( xpathCtx ); } else throw libcmis::Exception( "Failed to parse service document" ); xmlFreeDoc( doc ); // Initialize the response factory map< string, string > ns; ns[ "wsssecurity" ] = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"; ns[ NS_SOAP_ENV_PREFIX ] = NS_SOAP_ENV_URL; ns[ "cmism" ] = NS_CMISM_URL; ns[ "cmisw" ] = NS_CMISW_URL; ns[ "cmis" ] = NS_CMIS_URL; m_responseFactory.setNamespaces( ns ); m_responseFactory.setMapping( getResponseMapping() ); m_responseFactory.setDetailMapping( getDetailMapping( ) ); m_responseFactory.setSession( this ); // Get all repositories map< string, string > repositories = getRepositoryService( ).getRepositories( ); for ( map< string, string >::iterator it = repositories.begin( ); it != repositories.end( ); ++it ) { string repoId = it->first; m_repositories.push_back( getRepositoryService( ).getRepositoryInfo( repoId ) ); } } } map< string, SoapResponseCreator > WSSession::getResponseMapping( ) { map< string, SoapResponseCreator > mapping; mapping[ "{" + string( NS_CMISM_URL ) + "}getRepositoriesResponse" ] = &GetRepositoriesResponse::create; mapping[ "{" + string( NS_CMISM_URL ) + "}getRepositoryInfoResponse" ] = &GetRepositoryInfoResponse::create; mapping[ "{" + string( NS_CMISM_URL ) + "}getTypeDefinitionResponse" ] = &GetTypeDefinitionResponse::create; mapping[ "{" + string( NS_CMISM_URL ) + "}getTypeChildrenResponse" ] = &GetTypeChildrenResponse::create; mapping[ "{" + string( NS_CMISM_URL ) + "}getObjectResponse" ] = &GetObjectResponse::create; // No need to create a GetObjectByPathResponse as it would do the same than GetObjectResponse mapping[ "{" + string( NS_CMISM_URL ) + "}getObjectByPathResponse" ] = &GetObjectResponse::create; mapping[ "{" + string( NS_CMISM_URL ) + "}updatePropertiesResponse" ] = &UpdatePropertiesResponse::create; mapping[ "{" + string( NS_CMISM_URL ) + "}deleteTreeResponse" ] = &DeleteTreeResponse::create; mapping[ "{" + string( NS_CMISM_URL ) + "}getContentStreamResponse" ] = &GetContentStreamResponse::create; mapping[ "{" + string( NS_CMISM_URL ) + "}getObjectParentsResponse" ] = &GetObjectParentsResponse::create; mapping[ "{" + string( NS_CMISM_URL ) + "}getChildrenResponse" ] = &GetChildrenResponse::create; mapping[ "{" + string( NS_CMISM_URL ) + "}createFolderResponse" ] = &CreateFolderResponse::create; // Use the same response object than folders as it contains the same elements mapping[ "{" + string( NS_CMISM_URL ) + "}createDocumentResponse" ] = &CreateFolderResponse::create; mapping[ "{" + string( NS_CMISM_URL ) + "}checkOutResponse" ] = &CheckOutResponse::create; mapping[ "{" + string( NS_CMISM_URL ) + "}checkInResponse" ] = &CheckInResponse::create; mapping[ "{" + string( NS_CMISM_URL ) + "}getAllVersionsResponse" ] = &GetAllVersionsResponse::create; mapping[ "{" + string( NS_CMISM_URL ) + "}getRenditionsResponse" ] = &GetRenditionsResponse::create; return mapping; } map< string, SoapFaultDetailCreator > WSSession::getDetailMapping( ) { map< string, SoapFaultDetailCreator > mapping; mapping[ "{" + string( NS_CMISM_URL ) + "}cmisFault" ] = &CmisSoapFaultDetail::create; return mapping; } string WSSession::getServiceUrl( string name ) { string url; map< string, string >::iterator it = m_servicesUrls.find( name ); if ( it != m_servicesUrls.end( ) ) url = it->second; return url; } RepositoryService& WSSession::getRepositoryService( ) { if ( m_repositoryService == NULL ) m_repositoryService = new RepositoryService( this ); return *m_repositoryService; } ObjectService& WSSession::getObjectService( ) { if ( m_objectService == NULL ) m_objectService = new ObjectService( this ); return *m_objectService; } NavigationService& WSSession::getNavigationService( ) { if ( m_navigationService == NULL ) m_navigationService = new NavigationService( this ); return *m_navigationService; } VersioningService& WSSession::getVersioningService( ) { if ( m_versioningService == NULL ) m_versioningService = new VersioningService( this ); return *m_versioningService; } libcmis::RepositoryPtr WSSession::getRepository( ) throw ( libcmis::Exception ) { return getRepositoryService( ).getRepositoryInfo( m_repositoryId ); } bool WSSession::setRepository( string repositoryId ) { bool success = false; try { libcmis::RepositoryPtr repo = getRepositoryService( ).getRepositoryInfo( repositoryId ); if (repo && repo->getId( ) == repositoryId ) m_repositoryId = repositoryId; success = true; } catch ( const libcmis::Exception& ) { } return success; } libcmis::ObjectPtr WSSession::getObject( string id ) throw ( libcmis::Exception ) { return getObjectService( ).getObject( getRepositoryId( ), id ); } libcmis::ObjectPtr WSSession::getObjectByPath( string path ) throw ( libcmis::Exception ) { return getObjectService( ).getObjectByPath( getRepositoryId( ), path ); } libcmis::ObjectTypePtr WSSession::getType( string id ) throw ( libcmis::Exception ) { return getRepositoryService( ).getTypeDefinition( m_repositoryId, id ); } libcmis-0.4.1/src/libcmis/oauth2-providers.cxx0000644000175000001440000002022212156277660016237 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2013 Cao Cuong Ngo * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #include #include #include "oauth2-providers.hxx" #include "base-session.hxx" using namespace std; string OAuth2Providers::OAuth2Gdrive( BaseSession* session, const string& authUrl, const string& username, const string& password ) { static const string CONTENT_TYPE( "application/x-www-form-urlencoded" ); // STEP 1: Log in string res; try { res = session->httpGetRequest( authUrl )->getStream( )->str( ); } catch ( const CurlException& e ) { return string( ); } string loginPost, loginLink; if ( !parseResponse( res.c_str( ), loginPost, loginLink ) ) return string( ); loginPost += "Email="; loginPost += string( username ); loginPost += "&Passwd="; loginPost += string( password ); istringstream loginIs( loginPost ); string loginRes; try { loginRes = session->httpPostRequest ( loginLink, loginIs, CONTENT_TYPE ) ->getStream( )->str( ); } catch ( const CurlException& e ) { return string( ); } // STEP 2: allow libcmis to access google drive string approvalPost, approvalLink; if ( !parseResponse( loginRes. c_str( ), approvalPost, approvalLink) ) return string( ); approvalPost += "submit_access=true"; istringstream approvalIs( approvalPost ); string approvalRes; try { approvalRes = session->httpPostRequest ( approvalLink, approvalIs, CONTENT_TYPE) ->getStream( )->str( ); } catch ( const CurlException& e ) { throw e.getCmisException( ); } // STEP 3: Take the authentication code from the text bar string code = parseCode( approvalRes.c_str( ) ); return code; } string OAuth2Providers::OAuth2Alfresco( BaseSession* session, const string& authUrl, const string& username, const string& password ) { static const string CONTENT_TYPE( "application/x-www-form-urlencoded" ); // Log in string res; try { res = session->httpGetRequest( authUrl )->getStream( )->str( ); } catch ( const CurlException& e ) { return string( ); } string loginPost, loginLink; if ( !parseResponse( res.c_str( ), loginPost, loginLink ) ) return string( ); loginPost += "username="; loginPost += string( username ); loginPost += "&password="; loginPost += string( password ); loginPost += "&action=Grant"; istringstream loginIs( loginPost ); libcmis::HttpResponsePtr resp; // Get the code try { // Alfresco code is in the redirect link resp = session->httpPostRequest( loginLink, loginIs, CONTENT_TYPE, false ); } catch ( const CurlException& e ) { return string( ); } string header = resp->getHeaders()["Location"]; string code; int start = header.find("code="); int notFound = ( int ) ( string::npos ); if ( start != notFound ) { start += 5; int end = header.find("&"); if ( end != notFound ) code = header.substr( start, end - start ); else code = header.substr( start ); } return code; } OAuth2Parser OAuth2Providers::getOAuth2Parser( const std::string& bindingUrl ) { if ( bindingUrl.find( "https://api.alfresco.com/" ) == 0 ) // For Alfresco in the cloud, only match the hostname as there can be several // binding URLs created with it. return OAuth2Alfresco; else if ( bindingUrl == "https://www.googleapis.com/drive/v2" ) return OAuth2Gdrive; return OAuth2Gdrive; } int OAuth2Providers::parseResponse ( const char* response, string& post, string& link ) { xmlDoc *doc = htmlReadDoc ( BAD_CAST( response ), NULL, 0, HTML_PARSE_NOWARNING | HTML_PARSE_RECOVER | HTML_PARSE_NOERROR ); if ( doc == NULL ) return 0; xmlTextReaderPtr reader = xmlReaderWalker( doc ); if ( reader == NULL ) return 0; while ( true ) { // Go to the next node, quit if not found if ( xmlTextReaderRead ( reader ) != 1) break; xmlChar* nodeName = xmlTextReaderName ( reader ); if ( nodeName == NULL ) continue; // Find the redirect link if ( xmlStrEqual( nodeName, BAD_CAST( "form" ) ) ) { xmlChar* action = xmlTextReaderGetAttribute( reader, BAD_CAST( "action" )); if ( action != NULL ) { if ( xmlStrlen(action) > 0) link = string ( (char*) action); xmlFree (action); } } // Find input values if ( !xmlStrcmp( nodeName, BAD_CAST( "input" ) ) ) { xmlChar* name = xmlTextReaderGetAttribute( reader, BAD_CAST( "name" )); xmlChar* value = xmlTextReaderGetAttribute( reader, BAD_CAST( "value" )); if ( ( name != NULL ) && ( value!= NULL ) ) { if ( ( xmlStrlen( name ) > 0) && ( xmlStrlen( value ) > 0) ) { post += libcmis::escape( ( char * ) name ); post += string ( "=" ); post += libcmis::escape( ( char * ) value ); post += string ( "&" ); } } xmlFree( name ); xmlFree( value ); } xmlFree( nodeName ); } xmlFreeTextReader( reader ); xmlFreeDoc( doc ); if ( link.empty( ) || post.empty () ) return 0; return 1; } string OAuth2Providers::parseCode( const char* response ) { string authCode; xmlDoc *doc = htmlReadDoc ( BAD_CAST( response ), NULL, 0, HTML_PARSE_NOWARNING | HTML_PARSE_RECOVER | HTML_PARSE_NOERROR ); if ( doc == NULL ) return authCode; xmlTextReaderPtr reader = xmlReaderWalker( doc ); if ( reader == NULL ) return authCode; while ( true ) { // Go to the next node, quit if not found if ( xmlTextReaderRead ( reader ) != 1) break; xmlChar* nodeName = xmlTextReaderName ( reader ); if ( nodeName == NULL ) continue; // Find the code if ( xmlStrEqual( nodeName, BAD_CAST ( "input" ) ) ) { xmlChar* id = xmlTextReaderGetAttribute( reader, BAD_CAST( "id" )); if ( id != NULL ) { if ( xmlStrEqual( id, BAD_CAST ( "code" ) ) ) { xmlChar* code = xmlTextReaderGetAttribute( reader, BAD_CAST("value") ); if ( code!= NULL ) { authCode = string ( (char*) code ); xmlFree( code ); } } xmlFree ( id ); } } xmlFree( nodeName ); } xmlFreeTextReader( reader ); xmlFreeDoc( doc ); return authCode; } libcmis-0.4.1/src/libcmis/object-type.hxx0000644000175000001440000001200012156277660015247 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2011 SUSE * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #ifndef _OBJECT_TYPE_HXX_ #define _OBJECT_TYPE_HXX_ #include #include #include #include #include "exception.hxx" #include "property-type.hxx" namespace libcmis { /** Class representing a CMIS object type definition. */ class ObjectType { public: enum ContentStreamAllowed { NotAllowed, Allowed, Required }; protected: time_t m_refreshTimestamp; std::string m_id; std::string m_localName; std::string m_localNamespace; std::string m_displayName; std::string m_queryName; std::string m_description; std::string m_parentTypeId; std::string m_baseTypeId; bool m_creatable; bool m_fileable; bool m_queryable; bool m_fulltextIndexed; bool m_includedInSupertypeQuery; bool m_controllablePolicy; bool m_controllableAcl; bool m_versionable; libcmis::ObjectType::ContentStreamAllowed m_contentStreamAllowed; std::map< std::string, libcmis::PropertyTypePtr > m_propertiesTypes; ObjectType( ); void initializeFromNode( xmlNodePtr node ); public: ObjectType( xmlNodePtr node ); ObjectType( const ObjectType& copy ); virtual ~ObjectType() { } ObjectType& operator=( const ObjectType& copy ); /** Reload the data from the server. \attention This method needs to be implemented in subclasses or it will do nothing */ virtual void refresh( ) throw ( Exception ); virtual time_t getRefreshTimestamp( ) { return m_refreshTimestamp; } std::string getId( ) { return m_id; } std::string getLocalName( ) { return m_localName; } std::string getLocalNamespace( ) { return m_localNamespace; } std::string getDisplayName( ) { return m_displayName; } std::string getQueryName( ) { return m_queryName; } std::string getDescription( ) { return m_description; } virtual boost::shared_ptr< ObjectType > getParentType( ) throw ( Exception ); virtual boost::shared_ptr< ObjectType > getBaseType( ) throw ( Exception ); virtual std::vector< boost::shared_ptr< ObjectType > > getChildren( ) throw ( Exception ); /** Get the parent type id without extracting the complete parent type from the repository. This is mainly provided for performance reasons. \since libcmis 0.4 */ std::string getParentTypeId( ) { return m_parentTypeId; } /** Get the base type id without extracting the complete base type from the repository. This is mainly provided for performance reasons. \since libcmis 0.4 */ std::string getBaseTypeId( ) { return m_baseTypeId; } bool isCreatable( ) { return m_creatable; } bool isFileable( ) { return m_fileable; } bool isQueryable( ) { return m_queryable; } bool isFulltextIndexed( ) { return m_fulltextIndexed; } bool isIncludedInSupertypeQuery( ) { return m_includedInSupertypeQuery; } bool isControllablePolicy( ) { return m_controllablePolicy; } bool isControllableACL( ) { return m_controllableAcl; } bool isVersionable( ) { return m_versionable; } ContentStreamAllowed getContentStreamAllowed( ) { return m_contentStreamAllowed; } std::map< std::string, PropertyTypePtr >& getPropertiesTypes( ) { return m_propertiesTypes; } virtual std::string toString( ); }; typedef ::boost::shared_ptr< ObjectType > ObjectTypePtr; } #endif libcmis-0.4.1/src/libcmis/gdrive-property.cxx0000644000175000001440000000447512173212453016164 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2013 Cao Cuong Ngo * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #include "gdrive-property.hxx" #include "property-type.hxx" #include "gdrive-utils.hxx" using namespace std; using namespace libcmis; GDriveProperty::GDriveProperty( ) { } GDriveProperty::~GDriveProperty( ) { } GDriveProperty::GDriveProperty( const string& key, Json json ): Property( ) { PropertyTypePtr propertyType( new PropertyType( ) ); string convertedKey = GdriveUtils::toCmisKey( key ); propertyType->setId( convertedKey ); propertyType->setLocalName( convertedKey ); propertyType->setLocalNamespace( convertedKey ); propertyType->setQueryName( convertedKey ); propertyType->setDisplayName( key ); propertyType->setTypeFromJsonType( json.getStrType( ) ); propertyType->setUpdatable( GdriveUtils::checkUpdatable( key ) ); propertyType->setMultiValued( GdriveUtils::checkMultiValued( key ) ); setPropertyType( propertyType ); vector< string > values = GdriveUtils::parseGdriveProperty( key, json ); setValues( values ); } GDriveProperty::GDriveProperty( const GDriveProperty& copy ) : libcmis::Property( copy ) { } GDriveProperty& GDriveProperty::operator=( const GDriveProperty& copy ) { if ( this != © ) { libcmis::Property::operator=( copy ); } return *this; } libcmis-0.4.1/src/libcmis/session-factory.hxx0000644000175000001440000001371412176735672016173 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2011 SUSE * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #ifndef _SESSION_FACTORY_HXX_ #define _SESSION_FACTORY_HXX_ #include #include #include #include "exception.hxx" #include "oauth2-data.hxx" #include "repository.hxx" #include "session.hxx" namespace libcmis { /** This callback provides the OAuth2 code or NULL. The resulting char* will be freed later. */ typedef char* ( *OAuth2AuthCodeProvider )( const char* authUrl, const char* username, const char* password ); class AuthProvider { public: virtual ~AuthProvider() { }; /** The function implementing it needs to fill the username and password parameters and return true. Returning false means that the user cancelled the authentication and will fail the query. */ virtual bool authenticationQuery( std::string& username, std::string& password ) = 0; }; typedef ::boost::shared_ptr< AuthProvider > AuthProviderPtr; /** Handler class used to request user input when an invalid SSL certificate is encountered. */ class CertValidationHandler { public: virtual ~CertValidationHandler( ){ }; /** This function is provided a vector of X509 certificates encoded in base64, with the first certificate being the one to validate, and the others are the issuers chain. The result will be stored in the session object to avoid asking several times to validate the same certificate. \result true if the certificate should be ignored, false to fail the request. */ virtual bool validateCertificate( std::vector< std::string > certificatesChain ) = 0; }; typedef ::boost::shared_ptr< CertValidationHandler > CertValidationHandlerPtr; class SessionFactory { private: static AuthProviderPtr s_authProvider; static std::string s_proxy; static std::string s_noProxy; static std::string s_proxyUser; static std::string s_proxyPass; static OAuth2AuthCodeProvider s_oauth2AuthCodeProvider; static CertValidationHandlerPtr s_certValidationHandler; public: static void setAuthenticationProvider( AuthProviderPtr provider ) { s_authProvider = provider; } static AuthProviderPtr getAuthenticationProvider( ) { return s_authProvider; } static void setOAuth2AuthCodeProvider( OAuth2AuthCodeProvider provider ) { s_oauth2AuthCodeProvider = provider; } static OAuth2AuthCodeProvider getOAuth2AuthCodeProvider( ) { return s_oauth2AuthCodeProvider; } /** Set the handler to ask the user what to do with invalid SSL certificates. If not set, every invalid certificate will raise an exception. */ static void setCertificateValidationHandler( CertValidationHandlerPtr handler ) { s_certValidationHandler = handler; } static CertValidationHandlerPtr getCertificateValidationHandler( ) { return s_certValidationHandler; } static void setProxySettings( std::string proxy, std::string noProxy, std::string proxyUser, std::string proxyPass ); static const std::string& getProxy() { return s_proxy; } static const std::string& getNoProxy() { return s_noProxy; } static const std::string& getProxyUser() { return s_proxyUser; } static const std::string& getProxyPass() { return s_proxyPass; } /** Create a session from the given parameters. The binding type is automatically detected based on the provided URL. The resulting pointer should be deleted by the caller. */ static Session* createSession( std::string bindingUrl, std::string username = std::string( ), std::string password = std::string( ), std::string repositoryId = std::string( ), bool noSslCheck = false, OAuth2DataPtr oauth2 = OAuth2DataPtr(), bool verbose = false ) throw ( Exception ); /** Gets the informations of the repositories on the server. \deprecated Since libcmis 0.4.0, this helper function simply creates a session using the createSession function with no repository and then calls getRepositories on the resulting session. Kept only for backward API compatibility. */ static std::vector< RepositoryPtr > getRepositories( std::string bindingUrl, std::string username = std::string( ), std::string password = std::string( ), bool verbose = false ) throw ( Exception ); }; } #endif libcmis-0.4.1/src/libcmis/gdrive-document.hxx0000644000175000001440000000732512173212453016120 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2013 Cao Cuong Ngo * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #ifndef _GDRIVE_DOCUMENT_HXX_ #define _GDRIVE_DOCUMENT_HXX_ #include "document.hxx" #include "folder.hxx" #include "gdrive-object.hxx" #include "json-utils.hxx" #include "rendition.hxx" class GDriveDocument : public libcmis::Document, public GDriveObject { public: GDriveDocument( GDriveSession* session ); // Create a GDrive document from Json properties. // In case it's a revision, keep the ID and the name of the original file. GDriveDocument( GDriveSession* session, Json json, std::string id = std::string( ), std::string name = std::string( ) ); ~GDriveDocument( ); std::string getType( ) { return std::string( "cmis:document" );} std::string getBaseType( ) { return std::string( "cmis:document" );} bool isGoogleDoc( ) { return m_isGoogleDoc; } /* Get the download Url associated to streamId, automatically find ODF then MS format if no streamId is specified. */ std::string getDownloadUrl( std::string streamId = std::string( ) ); void uploadStream( boost::shared_ptr< std::ostream > os, std::string contentType ) throw ( libcmis::Exception ); virtual std::vector< libcmis::FolderPtr > getParents( ) throw (libcmis::Exception ); virtual boost::shared_ptr< std::istream > getContentStream( std::string streamId = std::string( ) ) throw (libcmis::Exception ); virtual void setContentStream( boost::shared_ptr< std::ostream > os, std::string contentType, std::string fileName, bool overwrite = true ) throw ( libcmis::Exception ); virtual libcmis::DocumentPtr checkOut( ) throw ( libcmis::Exception ); virtual void cancelCheckout( ) throw ( libcmis::Exception ); virtual libcmis::DocumentPtr checkIn( bool isMajor, std::string comment, const std::map< std::string,libcmis::PropertyPtr >& properties, boost::shared_ptr< std::ostream > stream, std::string contentType, std::string fileName ) throw ( libcmis::Exception ); virtual std::vector< libcmis::DocumentPtr > getAllVersions( ) throw (libcmis::Exception ); private: bool m_isGoogleDoc; }; #endif libcmis-0.4.1/src/libcmis/rendition.cxx0000644000175000001440000000776312177744303015030 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2013 Cao Cuong Ngo * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #include #include "rendition.hxx" #include "xml-utils.hxx" using namespace std; namespace libcmis{ Rendition::Rendition( ): m_streamId( ), m_mimeType( ), m_kind( ), m_href( ), m_title( ), m_length( -1 ), m_width ( -1 ), m_height( -1 ), m_renditionDocumentId( ) { } Rendition::Rendition( string streamId, string mimeType, string kind, string href, string title, long length, long width, long height, string renditionDocumentId ): m_streamId( streamId ), m_mimeType( mimeType ), m_kind( kind ), m_href( href ), m_title( title ), m_length( length ), m_width ( width ), m_height( height ), m_renditionDocumentId( renditionDocumentId ) { } Rendition::Rendition( xmlNodePtr node ): m_streamId( ), m_mimeType( ), m_kind( ), m_href( ), m_title( ), m_length( -1 ), m_width ( -1 ), m_height( -1 ), m_renditionDocumentId( ) { for ( xmlNodePtr child = node->children; child; child = child->next ) { xmlChar* content = xmlNodeGetContent( child ); string value( ( char * ) content ); xmlFree( content ); if ( xmlStrEqual( child->name, BAD_CAST( "streamId" ) ) ) m_streamId = value; else if ( xmlStrEqual( child->name, BAD_CAST( "mimetype" ) ) ) m_mimeType = value; else if ( xmlStrEqual( child->name, BAD_CAST( "length" ) ) ) m_length = libcmis::parseInteger( value ); else if ( xmlStrEqual( child->name, BAD_CAST( "kind" ) ) ) m_kind = value; else if ( xmlStrEqual( child->name, BAD_CAST( "title" ) ) ) m_title = value; else if ( xmlStrEqual( child->name, BAD_CAST( "height" ) ) ) m_height = libcmis::parseInteger( value ); else if ( xmlStrEqual( child->name, BAD_CAST( "width" ) ) ) m_width = libcmis::parseInteger( value ); else if ( xmlStrEqual( child->name, BAD_CAST( "renditionDocumentId" ) ) ) m_renditionDocumentId = value; } } Rendition::~Rendition( ) { } string Rendition::toString( ) { stringstream buf; if ( !getStreamId( ).empty( ) ) buf << " ID: " << getStreamId( ) << endl; if ( !getKind().empty() ) buf << " Kind: " << getKind( ) << endl; if ( !getMimeType( ).empty() ) buf << " MimeType: " << getMimeType( ) << endl; if ( !getUrl().empty( ) ) buf << " URL: " << getUrl( ) << endl; if ( !getTitle().empty( ) ) buf << " Title: " << getTitle( ) << endl; if ( getLength( ) >= 0 ) buf << " Length: " << getLength( ) << endl; if ( getWidth( ) >= 0 ) buf << " Width: " << getWidth( ) << endl; if ( getHeight( ) >= 0 ) buf << " Height: " << getHeight( ) << endl; if ( !getRenditionDocumentId().empty( ) ) buf << " Rendition Document ID: " << getRenditionDocumentId( ) << endl; return buf.str( ); } } libcmis-0.4.1/src/libcmis/ws-session.hxx0000644000175000001440000000733512173212453015137 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2011 SUSE * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #ifndef _WS_SESSION_HXX_ #define _WS_SESSION_HXX_ #include #include #include "base-session.hxx" #include "ws-navigationservice.hxx" #include "ws-objectservice.hxx" #include "ws-repositoryservice.hxx" #include "ws-soap.hxx" #include "ws-versioningservice.hxx" class WSSession : public BaseSession, public SoapSession { private: std::map< std::string, std::string > m_servicesUrls; NavigationService* m_navigationService; ObjectService* m_objectService; RepositoryService* m_repositoryService; VersioningService* m_versioningService; SoapResponseFactory m_responseFactory; public: WSSession( std::string bindingUrl, std::string repositoryId, std::string username, std::string password, bool noSslCheck = false, libcmis::OAuth2DataPtr oauth2 = libcmis::OAuth2DataPtr(), bool verbose = false ) throw ( libcmis::Exception ); WSSession( const WSSession& copy ); ~WSSession( ); WSSession& operator=( const WSSession& copy ); // Utility methods /** Get an instance of the SoapResponseFactory, setup with all the CMIS namespaces and function pointers. */ SoapResponseFactory& getResponseFactory( ) { return m_responseFactory; } /** Try hard to get a WSDL file at the given URL (tries to add ?wsdl if needed) */ std::string getWsdl( std::string url ) throw ( CurlException ); std::vector< SoapResponsePtr > soapRequest( std::string& url, SoapRequest& request ) throw ( libcmis::Exception ); /** Get the service location URL given its name. */ std::string getServiceUrl( std::string name ); RepositoryService& getRepositoryService( ); ObjectService& getObjectService( ); NavigationService& getNavigationService( ); VersioningService& getVersioningService( ); // Override session methods virtual libcmis::RepositoryPtr getRepository( ) throw ( libcmis::Exception ); virtual bool setRepository( std::string repositoryId ); virtual libcmis::ObjectPtr getObject( std::string id ) throw ( libcmis::Exception ); virtual libcmis::ObjectPtr getObjectByPath( std::string path ) throw ( libcmis::Exception ); virtual libcmis::ObjectTypePtr getType( std::string id ) throw ( libcmis::Exception ); private: void initialize( ) throw ( libcmis::Exception ); std::map< std::string, SoapResponseCreator > getResponseMapping( ); std::map< std::string, SoapFaultDetailCreator > getDetailMapping( ); }; #endif libcmis-0.4.1/src/libcmis/oauth2-handler.cxx0000644000175000001440000001160012156277660015637 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2013 Cao Cuong Ngo * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #include "session-factory.hxx" #include "oauth2-handler.hxx" #include "json-utils.hxx" #include "xml-utils.hxx" #include "oauth2-providers.hxx" using namespace std; OAuth2Handler::OAuth2Handler(BaseSession* session, libcmis::OAuth2DataPtr data) throw ( libcmis::Exception ) : m_session( session ), m_data( data ), m_access( ), m_refresh( ), m_oauth2Parser( ) { m_oauth2Parser = OAuth2Providers::getOAuth2Parser( m_session->getBindingUrl( ) ); if ( !m_data ) m_data.reset( new libcmis::OAuth2Data() ); } OAuth2Handler::OAuth2Handler( const OAuth2Handler& copy ) : m_session( copy.m_session ), m_data( copy.m_data ), m_access( copy.m_access ), m_refresh( copy.m_refresh ), m_oauth2Parser( copy.m_oauth2Parser ) { } OAuth2Handler::OAuth2Handler( ): m_session( NULL ), m_data( ), m_access( ), m_refresh( ), m_oauth2Parser( ) { m_data.reset( new libcmis::OAuth2Data() ); } OAuth2Handler& OAuth2Handler::operator=( const OAuth2Handler& copy ) { if ( this != © ) { m_session = copy.m_session; m_data = copy.m_data; m_access = copy.m_access; m_refresh = copy.m_refresh; } return *this; } OAuth2Handler::~OAuth2Handler( ) { } void OAuth2Handler::fetchTokens( string authCode ) throw ( libcmis::Exception ) { string post = "code=" + authCode + "&client_id=" + m_data->getClientId() + "&client_secret=" + m_data->getClientSecret() + "&redirect_uri=" + m_data->getRedirectUri() + "&grant_type=authorization_code" ; istringstream is( post ); libcmis::HttpResponsePtr resp; try { resp = m_session->httpPostRequest ( m_data->getTokenUrl(), is, "application/x-www-form-urlencoded" ); } catch ( const CurlException& e ) { throw libcmis::Exception( "Couldn't get tokens from the authorization code "); } Json jresp = Json::parse( resp->getStream( )->str( ) ); m_access = jresp[ "access_token" ].toString( ); m_refresh = jresp[ "refresh_token" ].toString( ); } void OAuth2Handler::refresh( ) throw ( libcmis::Exception ) { m_access = string( ); string post = "refresh_token=" + m_refresh + "&client_id=" + m_data->getClientId() + "&client_secret=" + m_data->getClientSecret() + "&grant_type=refresh_token" ; istringstream is( post ); libcmis::HttpResponsePtr resp; try { resp = m_session->httpPostRequest( m_data->getTokenUrl( ), is, "application/x-www-form-urlencoded" ); } catch (const CurlException& e ) { throw libcmis::Exception( "Couldn't refresh token "); } Json jresp = Json::parse( resp->getStream( )->str( ) ); m_access = jresp[ "access_token" ].toString(); } string OAuth2Handler::getAuthURL( ) { return m_data->getAuthUrl() + "?scope=" + libcmis::escape( m_data->getScope( ) ) + "&redirect_uri="+ m_data->getRedirectUri( ) + "&response_type=code" + "&client_id=" + m_data->getClientId( ); } string OAuth2Handler::getAccessToken( ) throw ( libcmis::Exception ) { return m_access; } string OAuth2Handler::getRefreshToken( ) throw ( libcmis::Exception ) { return m_refresh; } string OAuth2Handler::getHttpHeader( ) throw ( libcmis::Exception ) { string header; if ( !m_access.empty() ) header = "Authorization: Bearer " + m_access ; return header; } string OAuth2Handler::oauth2Authenticate( ) { return m_oauth2Parser( m_session, getAuthURL( ), m_session->getUsername( ), m_session->getPassword( ) ); } libcmis-0.4.1/src/libcmis/ws-object-type.hxx0000644000175000001440000000347412013215344015674 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2011 SUSE * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #ifndef _WS_OBJECT_TYPE_HXX_ #define _WS_OBJECT_TYPE_HXX_ #include "ws-session.hxx" #include "object-type.hxx" class WSObjectType : public libcmis::ObjectType { private: WSSession* m_session; public: WSObjectType( WSSession* session, xmlNodePtr node ); WSObjectType( const WSObjectType& copy ); virtual ~WSObjectType( ); WSObjectType& operator=( const WSObjectType& copy ); virtual void refresh( ) throw ( libcmis::Exception ); virtual libcmis::ObjectTypePtr getParentType( ) throw ( libcmis::Exception ); virtual libcmis::ObjectTypePtr getBaseType( ) throw ( libcmis::Exception ); virtual std::vector< libcmis::ObjectTypePtr > getChildren( ) throw ( libcmis::Exception ); }; #endif libcmis-0.4.1/src/libcmis/atom-folder.hxx0000644000175000001440000000427412023641131015226 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2011 SUSE * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #ifndef _ATOM_FOLDER_HXX_ #define _ATOM_FOLDER_HXX_ #include #include "document.hxx" #include "folder.hxx" #include "atom-object.hxx" class AtomFolder : public libcmis::Folder, public AtomObject { public: AtomFolder( AtomPubSession* session, xmlNodePtr entryNd ); ~AtomFolder( ); // virtual pure methods from Folder virtual std::vector< libcmis::ObjectPtr > getChildren( ) throw ( libcmis::Exception ); virtual libcmis::FolderPtr createFolder( const std::map< std::string, libcmis::PropertyPtr >& properties ) throw ( libcmis::Exception ); virtual libcmis::DocumentPtr createDocument( const std::map< std::string, libcmis::PropertyPtr >& properties, boost::shared_ptr< std::ostream > os, std::string contentType, std::string fileName ) throw ( libcmis::Exception ); virtual std::vector< std::string > removeTree( bool allVersion = true, libcmis::UnfileObjects::Type unfile = libcmis::UnfileObjects::Delete, bool continueOnError = false ) throw ( libcmis::Exception ); }; #endif libcmis-0.4.1/src/libcmis/atom-document.hxx0000644000175000001440000000511612156277660015610 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2011 SUSE * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #ifndef _ATOM_DOCUMENT_HXX_ #define _ATOM_DOCUMENT_HXX_ #include "document.hxx" #include "folder.hxx" #include "atom-object.hxx" class AtomDocument : public libcmis::Document, public AtomObject { private: std::string m_contentUrl; public: AtomDocument( AtomPubSession* session ); AtomDocument( AtomPubSession* session, xmlNodePtr entryNd ); ~AtomDocument( ); virtual std::vector< libcmis::FolderPtr > getParents( ) throw ( libcmis::Exception ); virtual boost::shared_ptr< std::istream > getContentStream( std::string streamId = std::string( ) ) throw ( libcmis::Exception ); virtual void setContentStream( boost::shared_ptr< std::ostream > os, std::string contentType, std::string fileName, bool overwrite = true ) throw ( libcmis::Exception ); virtual libcmis::DocumentPtr checkOut( ) throw ( libcmis::Exception ); virtual void cancelCheckout( ) throw ( libcmis::Exception ); virtual libcmis::DocumentPtr checkIn( bool isMajor, std::string comment, const std::map< std::string, libcmis::PropertyPtr >& properties, boost::shared_ptr< std::ostream > stream, std::string contentType, std::string fileName ) throw ( libcmis::Exception ); virtual std::vector< libcmis::DocumentPtr > getAllVersions( ) throw ( libcmis::Exception ); protected: virtual void extractInfos( xmlDocPtr doc ); }; #endif libcmis-0.4.1/src/libcmis/dummy.cxx0000644000175000001440000000000012156277660014145 00000000000000libcmis-0.4.1/src/libcmis/ws-navigationservice.hxx0000644000175000001440000000343212021406117017160 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2011 SUSE * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #ifndef _WS_NAVIGATIONSERVICE_HXX_ #define _WS_NAVIGATIONSERVICE_HXX_ #include #include #include "folder.hxx" class WSSession; class NavigationService { private: WSSession* m_session; std::string m_url; public: NavigationService( WSSession* session ); NavigationService( const NavigationService& copy ); ~NavigationService( ); NavigationService& operator=( const NavigationService& copy ); std::vector< libcmis::FolderPtr > getObjectParents( std::string repoId, std::string objectId ) throw ( libcmis::Exception ); std::vector< libcmis::ObjectPtr > getChildren( std::string repoId, std::string folderId ) throw ( libcmis::Exception ); }; #endif libcmis-0.4.1/src/libcmis/ws-objectservice.hxx0000644000175000001440000000711712177714233016310 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2011 SUSE * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #ifndef _WS_OBJECTSERVICE_HXX_ #define _WS_OBJECTSERVICE_HXX_ #include #include #include #include "base-session.hxx" #include "document.hxx" #include "folder.hxx" #include "object.hxx" #include "ws-soap.hxx" class WSSession; class ObjectService { private: WSSession* m_session; std::string m_url; public: ObjectService( WSSession* session ); ObjectService( const ObjectService& copy ); ~ObjectService( ); ObjectService& operator=( const ObjectService& copy ); libcmis::ObjectPtr getObject( std::string repoId, std::string id ) throw ( libcmis::Exception ); libcmis::ObjectPtr getObjectByPath( std::string repoId, std::string path ) throw ( libcmis::Exception ); std::vector< libcmis::RenditionPtr > getRenditions( std::string repoId, std::string objectId, std::string filter ) throw ( libcmis::Exception ); libcmis::ObjectPtr updateProperties( std::string repoId, std::string objectId, const std::map< std::string, libcmis::PropertyPtr > & properties, std::string changeToken ) throw ( libcmis::Exception ); void deleteObject( std::string repoId, std::string id, bool allVersions ) throw ( libcmis::Exception ); std::vector< std::string > deleteTree( std::string repoId, std::string folderId, bool allVersions, libcmis::UnfileObjects::Type unfile, bool continueOnFailure ) throw ( libcmis::Exception ); void move( std::string repoId, std::string objectId, std::string destId, std::string srcId ) throw ( libcmis::Exception ); boost::shared_ptr< std::istream > getContentStream( std::string repoId, std::string objectId ) throw ( libcmis::Exception ); void setContentStream( std::string repoId, std::string objectId, bool overwrite, std::string changeToken, boost::shared_ptr< std::ostream > stream, std::string contentType, std::string fileName ) throw ( libcmis::Exception ); libcmis::FolderPtr createFolder( std::string repoId, const std::map< std::string, libcmis::PropertyPtr >& properties, std::string folderId ) throw ( libcmis::Exception ); libcmis::DocumentPtr createDocument( std::string repoId, const std::map< std::string, libcmis::PropertyPtr >& properties, std::string folderId, boost::shared_ptr< std::ostream > stream, std::string contentType, std::string fileName ) throw ( libcmis::Exception ); }; #endif libcmis-0.4.1/src/libcmis/gdrive-object-type.cxx0000644000175000001440000001305512200143447016514 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2013 Cao Cuong Ngo * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #include "gdrive-object-type.hxx" GdriveObjectType::GdriveObjectType( const std::string& id ): ObjectType( ) { m_id = id; m_localName = "GoogleDrive Object Type"; m_localNamespace = "GoogleDrive Object Type"; m_displayName = "GoogleDrive Object Type"; m_queryName = "GoogleDrive Object Type"; m_description = "GoogleDrive Object Type"; m_parentTypeId = id; m_baseTypeId = id; m_creatable = true; m_versionable = true; m_fulltextIndexed = true; libcmis::PropertyTypePtr idType(new libcmis::PropertyType( ) ); idType->setId( "cmis:objectTypeId" ); idType->setType( libcmis::PropertyType::String ); m_propertiesTypes[ idType->getId( ) ] = idType; // create PropertyTypes which are updatable. // title libcmis::PropertyTypePtr nameType( new libcmis::PropertyType( ) ); nameType->setId( "cmis:name" ); nameType->setType( libcmis::PropertyType::String ); nameType->setUpdatable( true ); m_propertiesTypes[ nameType->getId( ) ] = nameType; // mimeType libcmis::PropertyTypePtr mimeType( new libcmis::PropertyType( ) ); mimeType->setId( "cmis:contentStreamMimeType" ); mimeType->setType( libcmis::PropertyType::String ); mimeType->setUpdatable( false ); m_propertiesTypes[ mimeType->getId( ) ] = mimeType; // parents libcmis::PropertyTypePtr parentsType( new libcmis::PropertyType( ) ); parentsType->setId( "cmis:parentId" ); parentsType->setType( libcmis::PropertyType::String ); parentsType->setUpdatable( false ); parentsType->setMultiValued( true ); m_propertiesTypes[ parentsType->getId( ) ] = parentsType; // labels libcmis::PropertyTypePtr labelsType( new libcmis::PropertyType( ) ); labelsType->setId( "labels" ); labelsType->setType( libcmis::PropertyType::String ); labelsType->setUpdatable( false ); labelsType->setMultiValued( true ); m_propertiesTypes[ labelsType->getId( ) ] = labelsType; // ownerNames libcmis::PropertyTypePtr ownerNamesType( new libcmis::PropertyType( ) ); ownerNamesType->setId( "ownerNames" ); ownerNamesType->setType( libcmis::PropertyType::String ); ownerNamesType->setUpdatable( false ); ownerNamesType->setMultiValued( true ); m_propertiesTypes[ ownerNamesType->getId( ) ] = ownerNamesType; // owners libcmis::PropertyTypePtr ownersType( new libcmis::PropertyType( ) ); ownersType->setId( "owners" ); ownersType->setType( libcmis::PropertyType::String ); ownersType->setUpdatable( false ); ownersType->setMultiValued( true ); m_propertiesTypes[ ownersType->getId( ) ] = ownersType; // export links libcmis::PropertyTypePtr exportLinksType( new libcmis::PropertyType( ) ); exportLinksType->setId( "exportLinks" ); exportLinksType->setType( libcmis::PropertyType::String ); exportLinksType->setUpdatable( false ); exportLinksType->setMultiValued( true ); m_propertiesTypes[ exportLinksType->getId( ) ] = exportLinksType; // description libcmis::PropertyTypePtr descriptionType( new libcmis::PropertyType( ) ); descriptionType->setId( "cmis:description" ); descriptionType->setType( libcmis::PropertyType::String ); descriptionType->setUpdatable( true ); m_propertiesTypes[ descriptionType->getId( ) ] = descriptionType; // modifiedDate libcmis::PropertyTypePtr modifiedDateType( new libcmis::PropertyType( ) ); modifiedDateType->setId( "cmis:lastModificationDate" ); modifiedDateType->setType( libcmis::PropertyType::DateTime ); modifiedDateType->setUpdatable( true ); m_propertiesTypes[ modifiedDateType->getId( ) ] = modifiedDateType; // lastViewedByMeDate libcmis::PropertyTypePtr lastViewedByMeDateType( new libcmis::PropertyType( ) ); lastViewedByMeDateType->setId( "lastViewedByMeDate" ); lastViewedByMeDateType->setType( libcmis::PropertyType::DateTime ); lastViewedByMeDateType->setUpdatable( true ); m_propertiesTypes[ lastViewedByMeDateType->getId( ) ] = lastViewedByMeDateType; } libcmis::ObjectTypePtr GdriveObjectType::getParentType( ) throw( libcmis::Exception ) { libcmis::ObjectTypePtr parentTypePtr( new GdriveObjectType( m_parentTypeId ) ); return parentTypePtr; } libcmis::ObjectTypePtr GdriveObjectType::getBaseType( ) throw( libcmis::Exception ) { libcmis::ObjectTypePtr baseTypePtr( new GdriveObjectType( m_baseTypeId ) ); return baseTypePtr; } libcmis-0.4.1/src/libcmis/property-type.cxx0000644000175000001440000001505012173212453015654 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2011 SUSE * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #include "property-type.hxx" #include "xml-utils.hxx" using namespace std; namespace libcmis { PropertyType::PropertyType( ) : m_id( ), m_localName( ), m_localNamespace( ), m_displayName( ), m_queryName( ), m_type( String ), m_xmlType( "String" ), m_multiValued( false ), m_updatable( false ), m_inherited( false ), m_required( false ), m_queryable( false ), m_orderable( false ), m_openChoice( false ) { } PropertyType::PropertyType( xmlNodePtr node ) : m_id( ), m_localName( ), m_localNamespace( ), m_displayName( ), m_queryName( ), m_type( String ), m_xmlType( "String" ), m_multiValued( false ), m_updatable( false ), m_inherited( false ), m_required( false ), m_queryable( false ), m_orderable( false ), m_openChoice( false ) { for ( xmlNodePtr child = node->children; child; child = child->next ) { xmlChar* content = xmlNodeGetContent( child ); string value( ( const char * ) content ); if ( xmlStrEqual( child->name, BAD_CAST( "id" ) ) ) setId( value ); else if ( xmlStrEqual( child->name, BAD_CAST( "localName" ) ) ) setLocalName( value ); else if ( xmlStrEqual( child->name, BAD_CAST( "localNamespace" ) ) ) setLocalNamespace( value ); else if ( xmlStrEqual( child->name, BAD_CAST( "displayName" ) ) ) setDisplayName( value ); else if ( xmlStrEqual( child->name, BAD_CAST( "queryName" ) ) ) setQueryName( value ); else if ( xmlStrEqual( child->name, BAD_CAST( "propertyType" ) ) ) setTypeFromXml( value ); else if ( xmlStrEqual( child->name, BAD_CAST( "cardinality" ) ) ) setMultiValued( value == "multi" ); else if ( xmlStrEqual( child->name, BAD_CAST( "updatability" ) ) ) setUpdatable( value == "readwrite" ); else if ( xmlStrEqual( child->name, BAD_CAST( "inherited" ) ) ) setInherited( libcmis::parseBool( value ) ); else if ( xmlStrEqual( child->name, BAD_CAST( "required" ) ) ) setRequired( libcmis::parseBool( value ) ); else if ( xmlStrEqual( child->name, BAD_CAST( "queryable" ) ) ) setQueryable( libcmis::parseBool( value ) ); else if ( xmlStrEqual( child->name, BAD_CAST( "orderable" ) ) ) setOrderable( libcmis::parseBool( value ) ); else if ( xmlStrEqual( child->name, BAD_CAST( "openChoice" ) ) ) setOpenChoice( libcmis::parseBool( value ) ); } } PropertyType::PropertyType( const PropertyType& copy ) : m_id ( copy.m_id ), m_localName ( copy.m_localName ), m_localNamespace ( copy.m_localNamespace ), m_displayName ( copy.m_displayName ), m_queryName ( copy.m_queryName ), m_type ( copy.m_type ), m_xmlType( copy.m_xmlType ), m_multiValued ( copy.m_multiValued ), m_updatable ( copy.m_updatable ), m_inherited ( copy.m_inherited ), m_required ( copy.m_required ), m_queryable ( copy.m_queryable ), m_orderable ( copy.m_orderable ), m_openChoice ( copy.m_openChoice ) { } PropertyType& PropertyType::operator=( const PropertyType& copy ) { if ( this != © ) { m_id = copy.m_id; m_localName = copy.m_localName; m_localNamespace = copy.m_localNamespace; m_displayName = copy.m_displayName; m_queryName = copy.m_queryName; m_type = copy.m_type; m_xmlType = copy.m_xmlType; m_multiValued = copy.m_multiValued; m_updatable = copy.m_updatable; m_inherited = copy.m_inherited; m_required = copy.m_required; m_queryable = copy.m_queryable; m_orderable = copy.m_orderable; m_openChoice = copy.m_openChoice; } return *this; } void PropertyType::setTypeFromJsonType( string jsonType ) { if ( jsonType == "json_bool" ) m_type = Bool; else if ( jsonType == "json_double" ) m_type = Decimal; else if ( jsonType == "json_int" ) m_type = Integer; else if ( jsonType == "json_datetime" ) m_type = DateTime; else m_type = String; } void PropertyType::setTypeFromXml( string typeStr ) { // Default to string m_xmlType = string( "String" ); m_type = String; if ( typeStr == "datetime" ) { m_xmlType = string( "DateTime" ); m_type = DateTime; } else if ( typeStr == "integer" ) { m_xmlType = string( "Integer" ); m_type = Integer; } else if ( typeStr == "decimal" ) { m_xmlType = string( "Decimal" ); m_type = Decimal; } else if ( typeStr == "boolean" ) { m_xmlType = string( "Boolean" ); m_type = Bool; } // Special kinds of String else if ( typeStr == "html" ) m_xmlType = string( "Html" ); else if ( typeStr == "id" ) m_xmlType = string( "Id" ); else if ( typeStr == "uri" ) m_xmlType = string( "Uri" ); } } libcmis-0.4.1/src/libcmis/ws-relatedmultipart.hxx0000644000175000001440000001051612021363530017024 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2011 SUSE * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #ifndef _WS_RELATEDMULTIPART_HXX_ #define _WS_RELATEDMULTIPART_HXX_ #include #include #include #include #include #include #include class RelatedPart { private: std::string m_name; std::string m_contentType; std::string m_content; public: RelatedPart( std::string& name, std::string& type, std::string& content ); ~RelatedPart( ) { }; std::string getName( ) { return m_name; } std::string getContentType( ) { return m_contentType; } std::string getContent( ) { return m_content; } /** Create the string to place between the boundaries in the multipart. \param cid the content Id to output */ std::string toString( std::string cid ); }; typedef boost::shared_ptr< RelatedPart > RelatedPartPtr; /** Represents a multipart/related content as specified by RFC-2387. */ class RelatedMultipart { private: std::string m_startId; std::string m_startInfo; std::map< std::string, RelatedPartPtr > m_parts; std::string m_boundary; public: /** Create a multipart/related from scratch (most probably to output it later). */ RelatedMultipart( ); /** Parse a multipart body to extract the entries from it. */ RelatedMultipart( const std::string& body, const std::string& contentType ); /** Get the Content ids of all the parts; */ std::vector< std::string > getIds( ); /** Get the entry corresponding to the given ID. */ RelatedPartPtr getPart( std::string& cid ); /** Get the id of the multipart start entry. */ std::string& getStartId( ) { return m_startId; } std::string& getStartInfo( ) { return m_startInfo; } /** Add an entry to the multipart and returns the content ID that was created for it. */ std::string addPart( RelatedPartPtr part ); /** Define the start of the multipart. That method needs to be called before running toString(): the output order of the entries is not guaranteed. \param cid the Content-Id of the start entry \param startInfo the type to use as start-info in the Content-Type */ void setStart( std::string& cid, std::string& startInfo ); /** Compute the content type for the multipart object to set as the Content-Type HTTP header. */ std::string getContentType( ); /** Dump the multipart to an input stream: this can be provided as is as an HTTP post request body. */ boost::shared_ptr< std::istringstream > toStream( ); /** Provide an access to the boundary token for the unit tests. */ std::string getBoundary( ) { return m_boundary; } private: /** Generate a content id, using an entry name and some random uuid. */ std::string createPartId( const std::string& name ); }; /** Extract stream from xs:base64Binary node using either xop:Include or base64 encoded data. */ boost::shared_ptr< std::istream > getStreamFromNode( xmlNodePtr node, RelatedMultipart& multipart ); #endif libcmis-0.4.1/src/libcmis/gdrive-repository.cxx0000644000175000001440000000372312200226144016503 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2013 Cao Cuong Ngo * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #include "gdrive-repository.hxx" GdriveRepository::GdriveRepository( ) : Repository( ) { m_id = "GoogleDrive"; m_name = "Google Drive"; m_description = "Google Drive repository"; m_productName = "Google Drive"; m_productVersion = "v2"; m_rootId = "root"; m_capabilities[ ACL ] = "discover"; m_capabilities[ AllVersionsSearchable ] = "true"; m_capabilities[ Changes ] = "all"; m_capabilities[ GetDescendants ] = "true"; m_capabilities[ GetFolderTree ] = "true"; m_capabilities[ OrderBy ] = "custom"; m_capabilities[ Multifiling ] = "true"; m_capabilities[ PWCSearchable ] = "true"; m_capabilities[ PWCUpdatable ] = "true"; m_capabilities[ Query ] = "bothcombined"; m_capabilities[ Renditions ] = "read"; m_capabilities[ Unfiling ] = "false"; m_capabilities[ VersionSpecificFiling ] = "false"; m_capabilities[ Join ] = "none"; } libcmis-0.4.1/src/libcmis/folder.cxx0000644000175000001440000000532612156277660014305 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2011 SUSE * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #include "folder.hxx" #include "session.hxx" using namespace std; namespace libcmis { vector< string > Folder::getPaths( ) { vector< string > paths; paths.push_back( getPath( ) ); return paths; } libcmis::FolderPtr Folder::getFolderParent( ) throw ( libcmis::Exception ) { if ( getAllowableActions( ).get() && !getAllowableActions()->isAllowed( libcmis::ObjectAction::GetFolderParent ) ) throw libcmis::Exception( string( "GetFolderParent not allowed on node " ) + getId() ); if ( m_session == NULL ) throw libcmis::Exception( string( "Session not defined on the object... weird!" ) ); return m_session->getFolder( getParentId( ) ); } string Folder::getParentId( ) { return getStringProperty( "cmis:parentId" ); } string Folder::getPath( ) { return getStringProperty( "cmis:path" ); } bool Folder::isRootFolder( ) { return getParentId( ).empty( ); } string Folder::toString( ) { stringstream buf; buf << "Folder Object:" << endl << endl; buf << Object::toString(); buf << "Path: " << getPath() << endl; buf << "Folder Parent Id: " << getParentId( ) << endl; buf << "Children [Name (Id)]:" << endl; vector< libcmis::ObjectPtr > children = getChildren( ); for ( vector< libcmis::ObjectPtr >::iterator it = children.begin( ); it != children.end(); ++it ) { libcmis::ObjectPtr child = *it; buf << " " << child->getName() << " (" << child->getId() << ")" << endl; } return buf.str(); } } libcmis-0.4.1/src/libcmis/ws-repositoryservice.hxx0000644000175000001440000000417112013441751017245 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2011 SUSE * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #ifndef _WS_REPOSITORYSERVICE_HXX_ #define _WS_REPOSITORYSERVICE_HXX_ #include #include #include #include "base-session.hxx" #include "repository.hxx" #include "ws-soap.hxx" class WSSession; class RepositoryService { private: WSSession* m_session; std::string m_url; public: RepositoryService( WSSession* session ); RepositoryService( const RepositoryService& copy ); ~RepositoryService( ); RepositoryService& operator=( const RepositoryService& copy ); std::map< std::string, std::string > getRepositories( ) throw ( libcmis::Exception ); /** Get the repository information based on its identifier. */ libcmis::RepositoryPtr getRepositoryInfo( std::string id ) throw ( libcmis::Exception ); libcmis::ObjectTypePtr getTypeDefinition( std::string repoId, std::string typeId ) throw ( libcmis::Exception ); std::vector< libcmis::ObjectTypePtr > getTypeChildren( std::string repoId, std::string typeId ) throw ( libcmis::Exception ); }; #endif libcmis-0.4.1/src/libcmis/repository.cxx0000644000175000001440000001757612200143447015244 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2011 Cédric Bosdonnat * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #include #include "repository.hxx" #include "xml-utils.hxx" using namespace std; namespace libcmis { Repository::Repository( ) : m_id( ), m_name( ), m_description( ), m_vendorName( ), m_productName( ), m_productVersion( ), m_rootId( ), m_cmisVersionSupported( ), m_thinClientUri( ), m_principalAnonymous( ), m_principalAnyone( ), m_capabilities( ) { } Repository::Repository( xmlNodePtr node ) : m_id( ), m_name( ), m_description( ), m_vendorName( ), m_productName( ), m_productVersion( ), m_rootId( ), m_cmisVersionSupported( ), m_thinClientUri( ), m_principalAnonymous( ), m_principalAnyone( ), m_capabilities( ) { initializeFromNode( node ); } void Repository::initializeFromNode( xmlNodePtr node ) { for ( xmlNodePtr child = node->children; child; child = child->next ) { string localName( ( char* ) child->name ); xmlChar* content = xmlNodeGetContent( child ); string value( ( char* )content ); xmlFree( content ); if ( localName == "repositoryId" ) m_id = value; else if ( localName == "repositoryName" ) m_name = value; else if ( localName == "repositoryDescription" ) m_description = value; else if ( localName == "vendorName" ) m_vendorName = value; else if ( localName == "productName" ) m_productName = value; else if ( localName == "productVersion" ) m_productVersion = value; else if ( localName == "rootFolderId" ) m_rootId = value; else if ( localName == "cmisVersionSupported" ) m_cmisVersionSupported = value; else if ( localName == "thinClientURI" ) m_thinClientUri.reset( new string( value ) ); else if ( localName == "principalAnonymous" ) m_principalAnonymous.reset( new string( value ) ); else if ( localName == "principalAnyone" ) m_principalAnyone.reset( new string( value ) ); else if ( localName == "capabilities" ) { m_capabilities = parseCapabilities( child ); } } } string Repository::getCapability( Capability capability ) const { string result; map< Capability, string >::const_iterator it = m_capabilities.find( capability ); if ( it != m_capabilities.end() ) result = it->second; return result; } bool Repository::getCapabilityAsBool( Capability capability ) const { string value = getCapability( capability ); bool result = false; try { result = libcmis::parseBool( value ); } catch ( Exception ) { } return result; } string Repository::toString( ) const { stringstream buf; buf << "Id: " << getId( ) << endl; buf << "Name: " << getName( ) << endl; buf << "Description: " << getDescription( ) << endl; buf << "Vendor: " << getVendorName( ) << endl; buf << "Product: " << getProductName( ) << " - version " << getProductVersion( ) << endl; buf << "Root Id: " << getRootId( ) << endl; buf << "Supported CMIS Version: " << getCmisVersionSupported( ) << endl; if ( getThinClientUri( ) ) buf << "Thin Client URI: " << *getThinClientUri( ) << endl; if ( getPrincipalAnonymous( ) ) buf << "Anonymous user: " << *getPrincipalAnonymous( ) << endl; if ( getPrincipalAnyone( ) ) buf << "Anyone user: " << *getPrincipalAnyone( ) << endl; buf << endl; buf << "Capabilities:" << endl; static string capabilitiesNames[] = { "ACL", "AllVersionsSearchable", "Changes", "ContentStreamUpdatability", "GetDescendants", "GetFolderTree", "OrderBy", "Multifiling", "PWCSearchable", "PWCUpdatable", "Query", "Renditions", "Unfiling", "VersionSpecificFiling", "Join" }; for ( int i = ACL; i < Join; ++i ) { buf << "\t" << capabilitiesNames[i] << ": " << getCapability( ( Capability )i ) << endl; } return buf.str(); } map< Repository::Capability, string > Repository::parseCapabilities( xmlNodePtr node ) { map< Capability, string > capabilities; for ( xmlNodePtr child = node->children; child; child = child->next ) { string localName( ( char* ) child->name ); xmlChar* content = xmlNodeGetContent( child ); string value( ( char* )content ); xmlFree( content ); Capability capability = ACL; bool ignore = false; if ( localName == "capabilityACL" ) capability = ACL; else if ( localName == "capabilityAllVersionsSearchable" ) capability = AllVersionsSearchable; else if ( localName == "capabilityChanges" ) capability = Changes; else if ( localName == "capabilityContentStreamUpdatability" ) capability = ContentStreamUpdatability; else if ( localName == "capabilityGetDescendants" ) capability = GetDescendants; else if ( localName == "capabilityGetFolderTree" ) capability = GetFolderTree; else if ( localName == "capabilityOrderBy" ) capability = OrderBy; else if ( localName == "capabilityMultifiling" ) capability = Multifiling; else if ( localName == "capabilityPWCSearchable" ) capability = PWCSearchable; else if ( localName == "capabilityPWCUpdatable" ) capability = PWCUpdatable; else if ( localName == "capabilityQuery" ) capability = Query; else if ( localName == "capabilityRenditions" ) capability = Renditions; else if ( localName == "capabilityUnfiling" ) capability = Unfiling; else if ( localName == "capabilityVersionSpecificFiling" ) capability = VersionSpecificFiling; else if ( localName == "capabilityJoin" ) capability = Join; else ignore = true; if ( !ignore ) capabilities[capability] = value; } return capabilities; } } libcmis-0.4.1/src/libcmis/gdrive-folder.hxx0000644000175000001440000000467512173212453015562 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2013 Cao Cuong Ngo * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #ifndef _GDRIVE_FOLDER_HXX_ #define _GDRIVE_FOLDER_HXX_ #include "document.hxx" #include "folder.hxx" #include "gdrive-object.hxx" #include "json-utils.hxx" class GDriveFolder : public libcmis::Folder, public GDriveObject { public: GDriveFolder( GDriveSession* session ); GDriveFolder( GDriveSession* session, Json json ); ~GDriveFolder( ); std::string getType( ) { return std::string( "cmis:folder" );} std::string getBaseType( ) { return std::string( "cmis:folder" );} virtual std::vector< libcmis::ObjectPtr > getChildren( ) throw ( libcmis::Exception ); virtual libcmis::FolderPtr createFolder( const libcmis::PropertyPtrMap& properties ) throw ( libcmis::Exception ); virtual libcmis::DocumentPtr createDocument( const libcmis::PropertyPtrMap& properties, boost::shared_ptr< std::ostream > os, std::string contentType, std::string fileName ) throw ( libcmis::Exception ); virtual std::vector< std::string > removeTree( bool allVersion = true, libcmis::UnfileObjects::Type unfile = libcmis::UnfileObjects::Delete, bool continueOnError = false ) throw ( libcmis::Exception ); std::string uploadProperties( Json properties ); }; #endif libcmis-0.4.1/src/libcmis/atom-object.cxx0000644000175000001440000003644312177746612015243 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2011 SUSE * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #include #include #include #include #include "atom-document.hxx" #include "atom-folder.hxx" #include "atom-object.hxx" #include "atom-object-type.hxx" #include "atom-session.hxx" #include "xml-utils.hxx" using namespace std; using libcmis::PropertyPtrMap; namespace { class MatchLink { private: string m_rel; string m_type; public: MatchLink( string rel, string type ) : m_rel( rel ), m_type( type ) { } bool operator() ( AtomLink link ) { bool matchesRel = link.getRel( ) == m_rel; // Some implementations (xcmis) put extra spaces into the type attribute // (e.g. "application/atom+xml; type=feed" instead of "application/atom+xml;type=feed") string linkType = link.getType( ); linkType.erase( remove_if( linkType.begin(), linkType.end(), ::isspace ), linkType.end() ); // Some implementation (SharePoint) are omitting the type attribute bool matchesType = m_type.empty( ) || linkType.empty() || ( linkType == m_type ); return matchesRel && matchesType; } }; } AtomObject::AtomObject( AtomPubSession* session ) throw ( libcmis::Exception ) : libcmis::Object( session ), m_links( ) { } AtomObject::AtomObject( const AtomObject& copy ) : libcmis::Object( copy ), m_links( copy.m_links ) { } AtomObject& AtomObject::operator=( const AtomObject& copy ) { if ( this != © ) { libcmis::Object::operator=( copy ); m_links = copy.m_links; } return *this; } AtomObject::~AtomObject( ) { } libcmis::ObjectPtr AtomObject::updateProperties( const PropertyPtrMap& properties ) throw ( libcmis::Exception ) { if ( getAllowableActions().get() && !getAllowableActions()->isAllowed( libcmis::ObjectAction::UpdateProperties ) ) throw libcmis::Exception( string( "UpdateProperties is not allowed on object " ) + getId() ); xmlBufferPtr buf = xmlBufferCreate( ); xmlTextWriterPtr writer = xmlNewTextWriterMemory( buf, 0 ); xmlTextWriterStartDocument( writer, NULL, NULL, NULL ); // Copy and remove the readonly properties before serializing boost::shared_ptr< ostream > stream; AtomObject::writeAtomEntry( writer, properties, stream, string( ) ); xmlTextWriterEndDocument( writer ); string str( ( const char * )xmlBufferContent( buf ) ); istringstream is( str ); xmlFreeTextWriter( writer ); xmlBufferFree( buf ); libcmis::HttpResponsePtr response; try { vector< string > headers; headers.push_back( "Content-Type: application/atom+xml;type=entry" ); response = getSession( )->httpPutRequest( getInfosUrl( ), is, headers ); } catch ( const CurlException& e ) { throw e.getCmisException( ); } string respBuf = response->getStream( )->str( ); xmlDocPtr doc = xmlReadMemory( respBuf.c_str(), respBuf.size(), getInfosUrl().c_str(), NULL, 0 ); if ( NULL == doc ) throw libcmis::Exception( "Failed to parse object infos" ); libcmis::ObjectPtr updated = getSession( )->createObjectFromEntryDoc( doc ); if ( updated->getId( ) == getId( ) ) refreshImpl( doc ); xmlFreeDoc( doc ); return updated; } libcmis::AllowableActionsPtr AtomObject::getAllowableActions( ) { if ( !m_allowableActions ) { // For some reason we had no allowable actions before, get them now. AtomLink* link = getLink( "http://docs.oasis-open.org/ns/cmis/link/200908/allowableactions", "application/cmisallowableactions+xml" ); if ( link ) { try { libcmis::HttpResponsePtr response = getSession()->httpGetRequest( link->getHref() ); string buf = response->getStream()->str(); xmlDocPtr doc = xmlReadMemory( buf.c_str(), buf.size(), link->getHref().c_str(), NULL, 0 ); xmlNodePtr actionsNode = xmlDocGetRootElement( doc ); if ( actionsNode ) m_allowableActions.reset( new libcmis::AllowableActions( actionsNode ) ); xmlFreeDoc( doc ); } catch ( CurlException& ) { } } } return libcmis::Object::getAllowableActions(); } void AtomObject::refreshImpl( xmlDocPtr doc ) throw ( libcmis::Exception ) { bool createdDoc = ( NULL == doc ); if ( createdDoc ) { string buf; try { buf = getSession()->httpGetRequest( getInfosUrl() )->getStream( )->str( ); } catch ( const CurlException& e ) { throw e.getCmisException( ); } doc = xmlReadMemory( buf.c_str(), buf.size(), getInfosUrl().c_str(), NULL, 0 ); if ( NULL == doc ) throw libcmis::Exception( "Failed to parse object infos" ); } // Cleanup the structures before setting them again m_typeDescription.reset( ); m_properties.clear( ); m_allowableActions.reset( ); m_links.clear( ); m_renditions.clear( ); extractInfos( doc ); if ( createdDoc ) xmlFreeDoc( doc ); } void AtomObject::remove( bool allVersions ) throw ( libcmis::Exception ) { if ( getAllowableActions( ).get() && !getAllowableActions()->isAllowed( libcmis::ObjectAction::DeleteObject ) ) throw libcmis::Exception( string( "DeleteObject not allowed on object " ) + getId() ); try { string deleteUrl = getInfosUrl( ); if ( deleteUrl.find( '?' ) != string::npos ) deleteUrl += "&"; else deleteUrl += "?"; string allVersionsStr = "TRUE"; if ( !allVersions ) allVersionsStr = "FALSE"; deleteUrl += "allVersions=" + allVersionsStr; getSession( )->httpDeleteRequest( deleteUrl ); } catch ( const CurlException& e ) { throw e.getCmisException( ); } } void AtomObject::move( boost::shared_ptr< libcmis::Folder > source, boost::shared_ptr< libcmis::Folder > destination ) throw ( libcmis::Exception ) { AtomFolder* atomDestination = dynamic_cast< AtomFolder* > ( destination.get() ); if ( NULL == atomDestination ) throw libcmis::Exception( string( "Destination is not an AtomFolder" ) ); AtomLink* destChildrenLink = atomDestination->getLink( "down", "application/atom+xml;type=feed" ); if ( ( NULL == destChildrenLink ) || ( getAllowableActions().get() && !getAllowableActions()->isAllowed( libcmis::ObjectAction::MoveObject ) ) ) throw libcmis::Exception( string( "MoveObject not allowed on object " ) + getId() ); // create object xml xmlBufferPtr buf = xmlBufferCreate( ); xmlTextWriterPtr writer = xmlNewTextWriterMemory( buf, 0 ); xmlTextWriterStartDocument( writer, NULL, NULL, NULL ); boost::shared_ptr< ostream > stream; AtomObject::writeAtomEntry( writer, getProperties( ), stream, string( ) ); xmlTextWriterEndDocument( writer ); string str( ( const char * )xmlBufferContent( buf ) ); istringstream is( str ); xmlFreeTextWriter( writer ); xmlBufferFree( buf ); // create post url string postUrl = destChildrenLink->getHref(); if ( postUrl.find( '?' ) != string::npos ) postUrl += "&"; else postUrl += "?"; postUrl += "sourceFolderId={sourceFolderId}"; // Session::CreateUrl is used to properly escape the id map< string, string > params; params[ "sourceFolderId" ] = source->getId(); postUrl = getSession( )->createUrl( postUrl, params ); // post it libcmis::HttpResponsePtr response; try { response = getSession( )->httpPostRequest( postUrl, is, "application/atom+xml;type=entry" ); } catch ( const CurlException& e ) { throw e.getCmisException( ); } // refresh self from response string respBuf = response->getStream( )->str( ); xmlDocPtr doc = xmlReadMemory( respBuf.c_str(), respBuf.size(), getInfosUrl().c_str(), NULL, 0 ); if ( NULL == doc ) throw libcmis::Exception( "Failed to parse object infos" ); refreshImpl( doc ); xmlFreeDoc( doc ); } string AtomObject::getInfosUrl( ) { AtomLink* selfLink = getLink( "self", "application/atom+xml;type=entry" ); if ( NULL != selfLink ) return selfLink->getHref( ); return string( ); } void AtomObject::extractInfos( xmlDocPtr doc ) { xmlXPathContextPtr xpathCtx = xmlXPathNewContext( doc ); libcmis::registerNamespaces( xpathCtx ); if ( NULL != xpathCtx ) { m_links.clear( ); // Get all the atom links string linksReq( "//atom:link" ); xmlXPathObjectPtr xpathObj = xmlXPathEvalExpression( BAD_CAST( linksReq.c_str() ), xpathCtx ); if ( NULL != xpathObj && NULL != xpathObj->nodesetval ) { int size = xpathObj->nodesetval->nodeNr; for ( int i = 0; i < size; i++ ) { xmlNodePtr node = xpathObj->nodesetval->nodeTab[i]; try { AtomLink link( node ); // Add to renditions if alternate link if ( link.getRel( ) == "alternate" ) { string kind; map< string, string >::iterator it = link.getOthers().find( "renditionKind" ); if ( it != link.getOthers( ).end() ) kind = it->second; string title; it = link.getOthers().find( "title" ); if ( it != link.getOthers( ).end( ) ) title = it->second; long length = -1; it = link.getOthers( ).find( "length" ); if ( it != link.getOthers( ).end( ) ) length = libcmis::parseInteger( it->second ); libcmis::RenditionPtr rendition( new libcmis::Rendition( string(), link.getType(), kind, link.getHref( ), title, length ) ); m_renditions.push_back( rendition ); } else m_links.push_back( node ); } catch ( const libcmis::Exception& ) { // Broken or incomplete link... don't add it } } } xmlXPathFreeObject( xpathObj ); xpathObj = xmlXPathEvalExpression( BAD_CAST( "//cmisra:object" ), xpathCtx ); if ( xpathObj && xpathObj->nodesetval && xpathObj->nodesetval->nodeNr > 0 ) { xmlNodePtr node = xpathObj->nodesetval->nodeTab[0]; initializeFromNode( node ); } xmlXPathFreeObject( xpathObj ); } xmlXPathFreeContext( xpathCtx ); } AtomPubSession* AtomObject::getSession( ) { return dynamic_cast< AtomPubSession* >( m_session ); } void AtomObject::writeAtomEntry( xmlTextWriterPtr writer, const PropertyPtrMap& properties, boost::shared_ptr< ostream > os, string contentType ) { AtomObject tmp( NULL ); PropertyPtrMap propertiesCopy( properties ); tmp.m_properties.swap( propertiesCopy ); xmlTextWriterStartElement( writer, BAD_CAST( "atom:entry" ) ); xmlTextWriterWriteAttribute( writer, BAD_CAST( "xmlns:atom" ), BAD_CAST( NS_ATOM_URL ) ); xmlTextWriterWriteAttribute( writer, BAD_CAST( "xmlns:cmis" ), BAD_CAST( NS_CMIS_URL ) ); xmlTextWriterWriteAttribute( writer, BAD_CAST( "xmlns:cmisra" ), BAD_CAST( NS_CMISRA_URL ) ); if ( !tmp.getCreatedBy( ).empty( ) ) { xmlTextWriterStartElement( writer, BAD_CAST( "atom:author" ) ); xmlTextWriterWriteElement( writer, BAD_CAST( "atom:name" ), BAD_CAST( tmp.getCreatedBy( ).c_str( ) ) ); xmlTextWriterEndElement( writer ); } xmlTextWriterWriteElement( writer, BAD_CAST( "atom:title" ), BAD_CAST( tmp.getName( ).c_str( ) ) ); boost::posix_time::ptime now( boost::posix_time::second_clock::universal_time( ) ); xmlTextWriterWriteElement( writer, BAD_CAST( "atom:updated" ), BAD_CAST( libcmis::writeDateTime( now ).c_str( ) ) ); if ( os.get( ) ) { xmlTextWriterStartElement( writer, BAD_CAST( "cmisra:content" ) ); xmlTextWriterWriteElement( writer, BAD_CAST( "cmisra:mediatype" ), BAD_CAST( contentType.c_str() ) ); xmlTextWriterStartElement(writer, BAD_CAST( "cmisra:base64" ) ); libcmis::EncodedData encoder( writer ); encoder.setEncoding( "base64" ); istream is( os->rdbuf( ) ); int bufLength = 1000; char* buf = new char[ bufLength ]; do { is.read( buf, bufLength ); int size = is.gcount( ); encoder.encode( buf, 1, size ); } while ( !is.eof( ) && !is.fail( ) ); delete[] buf; encoder.finish( ); xmlTextWriterEndElement( writer ); // "cmisra:base64" xmlTextWriterEndElement( writer ); } xmlTextWriterStartElement( writer, BAD_CAST( "cmisra:object" ) ); tmp.toXml( writer ); xmlTextWriterEndElement( writer ); // cmisra:object xmlTextWriterEndElement( writer ); // atom:entry } AtomLink* AtomObject::getLink( std::string rel, std::string type ) { AtomLink* link = NULL; vector< AtomLink >::iterator it = find_if( m_links.begin(), m_links.end(), MatchLink( rel, type ) ); if ( it != m_links.end() ) link = &( *it ); return link; } AtomLink::AtomLink( xmlNodePtr node ) throw ( libcmis::Exception ): m_rel( ), m_type( ), m_id( ), m_href( ), m_others( ) { xmlAttrPtr prop = node->properties; while ( prop != NULL ) { xmlChar* xmlStr = xmlGetProp( node, prop->name ); string value( ( char * ) xmlStr ); if ( xmlStrEqual( prop->name, BAD_CAST( "id" ) ) ) m_id = value; else if ( xmlStrEqual( prop->name, BAD_CAST( "type" ) ) ) m_type = value; else if ( xmlStrEqual( prop->name, BAD_CAST( "rel" ) ) ) m_rel = value; else if ( xmlStrEqual( prop->name, BAD_CAST( "href" ) ) ) m_href = value; else m_others[ string( ( char * ) prop->name ) ] = value; free( xmlStr ); prop = prop->next; } } libcmis-0.4.1/src/libcmis/property.hxx0000644000175000001440000000570612156277660014725 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2011 SUSE * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #ifndef _PROPERTY_HXX_ #define _PROPERTY_HXX_ #include #include #include #include #include #include #include "property-type.hxx" #include "xmlserializable.hxx" namespace libcmis { class ObjectType; class Property : public XmlSerializable { private: PropertyTypePtr m_propertyType; std::vector< std::string > m_strValues; std::vector< bool > m_boolValues; std::vector< long > m_longValues; std::vector< double > m_doubleValues; std::vector< boost::posix_time::ptime > m_dateTimeValues; protected: Property( ); public: /** Property constructor allowing to use different values for the id and names. */ Property( PropertyTypePtr propertyType, std::vector< std::string > strValues ); ~Property( ){ } PropertyTypePtr getPropertyType( ) { return m_propertyType; } std::vector< boost::posix_time::ptime > getDateTimes( ) { return m_dateTimeValues; } std::vector< bool > getBools( ) { return m_boolValues; } std::vector< std::string > getStrings( ) { return m_strValues; } std::vector< long > getLongs( ) { return m_longValues; } std::vector< double > getDoubles( ) { return m_doubleValues; } void setPropertyType( PropertyTypePtr propertyType); void setValues( std::vector< std::string > strValues ); void toXml( xmlTextWriterPtr writer ); std::string toString( ); }; typedef ::boost::shared_ptr< Property > PropertyPtr; typedef std::map< std::string, libcmis::PropertyPtr > PropertyPtrMap; PropertyPtr parseProperty( xmlNodePtr node, boost::shared_ptr< ObjectType > objectType ); } #endif libcmis-0.4.1/src/libcmis/oauth2-data.hxx0000644000175000001440000000501712156277660015145 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2011 SUSE * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #ifndef _LIBCMIS_OAUTH2_DATA_HXX_ #define _LIBCMIS_OAUTH2_DATA_HXX_ #include #include namespace libcmis { /** Class storing the data needed for OAuth2 authentication. */ class OAuth2Data { private: std::string m_authUrl; std::string m_tokenUrl; std::string m_clientId; std::string m_clientSecret; std::string m_scope; std::string m_redirectUri; public: OAuth2Data( ); OAuth2Data( const std::string& authUrl, const std::string& tokenUrl, const std::string& scope, const std::string& redirectUri, const std::string& clientId, const std::string& clientSecret ); OAuth2Data( const OAuth2Data& copy ); ~OAuth2Data( ); OAuth2Data& operator=( const OAuth2Data& copy ); bool isComplete(); std::string getAuthUrl() { return m_authUrl; } std::string getTokenUrl() { return m_tokenUrl; } std::string getClientId() { return m_clientId; } std::string getClientSecret() { return m_clientSecret; } std::string getScope() { return m_scope; } std::string getRedirectUri() { return m_redirectUri; } }; typedef ::boost::shared_ptr< OAuth2Data > OAuth2DataPtr; } #endif //_LIBCMIS_OAUTH2_DATA_HXX_ libcmis-0.4.1/src/libcmis/session.hxx0000644000175000001440000000645012173212453014505 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2011 SUSE * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #ifndef _SESSION_HXX_ #define _SESSION_HXX_ #include #include #include #include "object-type.hxx" #include "object.hxx" #include "folder.hxx" #include "repository.hxx" namespace libcmis { class Session { public: virtual ~Session() { }; /** Get the current repository. */ virtual RepositoryPtr getRepository( ) throw ( Exception ) = 0; virtual std::vector< RepositoryPtr > getRepositories( ) = 0; /** Change the current repository. \return false if no repository with the provided id can be found on the server, true otherwise */ virtual bool setRepository( std::string repositoryId ) = 0; /** Get the Root folder of the repository */ virtual FolderPtr getRootFolder() throw ( Exception )= 0; /** Get a CMIS object from its ID. */ virtual ObjectPtr getObject( std::string id ) throw ( Exception ) = 0; /** Get a CMIS object from one of its path. */ virtual ObjectPtr getObjectByPath( std::string path ) throw ( Exception ) = 0; /** Get a CMIS folder from its ID. */ virtual libcmis::FolderPtr getFolder( std::string id ) throw ( Exception ) = 0; /** Get a CMIS object type from its ID. */ virtual ObjectTypePtr getType( std::string id ) throw ( Exception ) = 0; /** Enable or disable the SSL certificate verification. By default, SSL certificates are verified and errors are thrown in case of one is invalid. The user may decide to ignore the checks for this CMIS session to workaround self-signed certificates or other similar problems. As each session only handles the connection to one CMIS server, it should concern only one SSL certificate and should provide the same feature as the certificate exception feature available on common web browser. */ virtual void setNoSSLCertificateCheck( bool noCheck ) = 0; }; } #endif libcmis-0.4.1/src/libcmis/atom-session.hxx0000644000175000001440000000522212173212453015437 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2011 SUSE * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #ifndef _ATOM_SESSION_HXX_ #define _ATOM_SESSION_HXX_ #include "base-session.hxx" #include "atom-workspace.hxx" class AtomPubSession : public BaseSession { private: AtomRepositoryPtr m_repository; public: AtomPubSession( std::string sAtomPubUrl, std::string repositoryId, std::string username, std::string password, bool noSslCheck = false, libcmis::OAuth2DataPtr oauth2 = libcmis::OAuth2DataPtr(), bool verbose =false ) throw ( libcmis::Exception ); AtomPubSession( const AtomPubSession& copy ); ~AtomPubSession( ); AtomPubSession& operator=( const AtomPubSession& copy ); AtomRepositoryPtr getAtomRepository( ) throw ( libcmis::Exception ); // Utility methods libcmis::ObjectPtr createObjectFromEntryDoc( xmlDocPtr doc ); // Override session methods virtual libcmis::RepositoryPtr getRepository( ) throw ( libcmis::Exception ); virtual bool setRepository( std::string repositoryId ); virtual libcmis::ObjectPtr getObject( std::string id ) throw ( libcmis::Exception ); virtual libcmis::ObjectPtr getObjectByPath( std::string path ) throw ( libcmis::Exception ); virtual libcmis::ObjectTypePtr getType( std::string id ) throw ( libcmis::Exception ); protected: /** Defaults constructor shouldn't be used */ AtomPubSession( ); void parseServiceDocument( const std::string& buf ) throw ( libcmis::Exception ); void initialize( ) throw ( libcmis::Exception ); }; #endif libcmis-0.4.1/src/libcmis/gdrive-session.cxx0000644000175000001440000001015312173212453015751 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2013 Cao Cuong Ngo * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #include "oauth2-handler.hxx" #include "gdrive-session.hxx" #include "gdrive-document.hxx" #include "gdrive-folder.hxx" #include "object-type.hxx" #include "gdrive-repository.hxx" #include "gdrive-object-type.hxx" #include "gdrive-utils.hxx" using std::string; using std::istringstream; GDriveSession::GDriveSession ( string baseUrl, string username, string password, libcmis::OAuth2DataPtr oauth2, bool verbose ) throw ( libcmis::Exception ) : BaseSession( baseUrl, string(), username, password, false, libcmis::OAuth2DataPtr(), verbose ) { // Add the dummy repository, even if we don't have OAuth2 m_repositories.push_back( getRepository( ) ); if ( oauth2 && oauth2->isComplete( ) ){ setOAuth2Data( oauth2 ); } } GDriveSession::GDriveSession( const GDriveSession& copy ) : BaseSession( copy ) { } GDriveSession::GDriveSession() : BaseSession() { } GDriveSession::~GDriveSession() { } libcmis::RepositoryPtr GDriveSession::getRepository( ) throw ( libcmis::Exception ) { // Return a dummy repository since GDrive doesn't have that notion libcmis::RepositoryPtr repo( new GdriveRepository( ) ); return repo; } libcmis::ObjectPtr GDriveSession::getObject( string objectId ) throw ( libcmis::Exception ) { // Run the http request to get the properties definition string res; string objectLink = m_bindingUrl + "/files/" + objectId; try { res = httpGetRequest( objectLink )->getStream()->str(); } catch ( const CurlException& e ) { throw e.getCmisException( ); } Json jsonRes = Json::parse( res ); // If we have a folder, then convert the object // into a GDriveFolder otherwise, convert it // into a GDriveDocument libcmis::ObjectPtr object; string kind = jsonRes["kind"].toString( ); if ( kind == "drive#file" ) { string mimeType = jsonRes["mimeType"].toString( ); // Folder is a file with a special mimeType if ( mimeType == GDRIVE_FOLDER_MIME_TYPE ) object.reset( new GDriveFolder( this, jsonRes ) ); else object.reset( new GDriveDocument( this, jsonRes ) ); } else if ( kind == "drive#revision" ) // A revision is a document too { object.reset( new GDriveDocument( this, jsonRes ) ); } else // not a folder nor file, maybe a permission or changes,... object.reset( new GDriveObject( this, jsonRes ) ); return object; } libcmis::ObjectPtr GDriveSession::getObjectByPath( string path ) throw ( libcmis::Exception ) { // Google Drive doesn't support get Object by path. // The path here serve as an object ID. if ( path == "/" ) path = "root"; return getObject( path ); } libcmis::ObjectTypePtr GDriveSession::getType( string id ) throw ( libcmis::Exception ) { libcmis::ObjectTypePtr type( new GdriveObjectType( id ) ); return type; } libcmis-0.4.1/src/libcmis/repository.hxx0000644000175000001440000001002712200143447015231 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2011 Cédric Bosdonnat * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #ifndef _REPOSITORY_HXX_ #define _REPOSITORY_HXX_ #include #include #include #include namespace libcmis { /** Class representing a repository and its infos. \sa 2.2.2.2 section of the CMIS specifications */ class Repository { public: enum Capability { ACL, AllVersionsSearchable, Changes, ContentStreamUpdatability, GetDescendants, GetFolderTree, OrderBy, Multifiling, PWCSearchable, PWCUpdatable, Query, Renditions, Unfiling, VersionSpecificFiling, Join }; protected: std::string m_id; std::string m_name; std::string m_description; std::string m_vendorName; std::string m_productName; std::string m_productVersion; std::string m_rootId; std::string m_cmisVersionSupported; boost::shared_ptr< std::string > m_thinClientUri; boost::shared_ptr< std::string > m_principalAnonymous; boost::shared_ptr< std::string > m_principalAnyone; std::map< Capability, std::string > m_capabilities ; Repository( ); void initializeFromNode( xmlNodePtr node ); public: Repository( xmlNodePtr node ); virtual ~Repository( ) { }; std::string getId( ) const { return m_id; } std::string getName( ) const { return m_name; } std::string getDescription( ) const { return m_description; } std::string getVendorName( ) const { return m_vendorName; } std::string getProductName( ) const { return m_productName; } std::string getProductVersion( ) const { return m_productVersion; } std::string getRootId( ) const { return m_rootId; } std::string getCmisVersionSupported( ) const { return m_cmisVersionSupported; } boost::shared_ptr< std::string > getThinClientUri( ) const { return m_thinClientUri; } boost::shared_ptr< std::string > getPrincipalAnonymous( ) const { return m_principalAnonymous; } boost::shared_ptr< std::string > getPrincipalAnyone( ) const { return m_principalAnyone; } std::string getCapability( Capability capability ) const; /** Wrapper function providing the capability as a boolean value. If the capability value is not a boolean, returns false. */ bool getCapabilityAsBool( Capability capability ) const; std::string toString( ) const; private: static std::map< Capability, std::string > parseCapabilities( xmlNodePtr node ); }; typedef ::boost::shared_ptr< Repository > RepositoryPtr; } #endif libcmis-0.4.1/src/libcmis/xmlserializable.hxx0000644000175000001440000000257611770553722016227 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2011 SUSE * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #ifndef _XMLSERIALIZABLE_HXX_ #define _XMLSERIALIZABLE_HXX_ #include namespace libcmis { /// Interface for objects dumpable as XML class XmlSerializable { public: virtual ~XmlSerializable( ) { } virtual void toXml( xmlTextWriterPtr writer ) = 0; }; } #endif libcmis-0.4.1/src/libcmis/json-utils.hxx0000644000175000001440000000531212173212453015125 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2013 Cao Cuong Ngo * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #ifndef _JSON_UTILS_HXX_ #define _JSON_UTILS_HXX_ #include #include #include #include #include "property.hxx" #include "exception.hxx" class Json { public : typedef std::map< std::string, Json > JsonObject ; typedef std::vector< Json > JsonVector ; enum Type { json_null, json_bool, json_double, json_int, json_object, json_array, json_string, json_datetime } ; Json( ); Json( const Json& copy ); Json( const char *str ); Json( const libcmis::PropertyPtr& property ); Json( const libcmis::PropertyPtrMap& properties ); Json( const JsonVector& arr ); Json( const JsonObject& obj ); ~Json( ) ; Json operator[]( std::string key ) const throw( libcmis::Exception ); Json& operator=( const Json& rhs ) ; void swap( Json& other ) ; void add( const Json& json) throw( libcmis::Exception ); void add( const std::string& key, const Json& json) throw( libcmis::Exception ); static Json parse( const std::string& str ) throw( libcmis::Exception ); std::string toString( ) const; Type getDataType( ) const ; std::string getStrType( ) const ; JsonObject getObjects(); JsonVector getList(); boost::property_tree::ptree getTree( ) const{ return m_tJson; } private : Json( boost::property_tree::ptree tJson ) ; boost::property_tree::ptree m_tJson ; Type m_type; Type parseType( ); } ; #endif /* _JSON_UTILS_HXX_ */ libcmis-0.4.1/src/libcmis/ws-repositoryservice.cxx0000644000175000001440000000770112025555356017254 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2011 SUSE * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #include "ws-repositoryservice.hxx" #include "ws-requests.hxx" #include "ws-session.hxx" using namespace std; RepositoryService::RepositoryService( WSSession* session ) : m_session( session ), m_url( session->getServiceUrl( "RepositoryService" ) ) { } RepositoryService::RepositoryService( const RepositoryService& copy ) : m_session( copy.m_session ), m_url( copy.m_url ) { } RepositoryService::~RepositoryService( ) { } RepositoryService& RepositoryService::operator=( const RepositoryService& copy ) { if ( this != © ) { m_session = copy.m_session; m_url = copy.m_url; } return *this; } map< string, string > RepositoryService::getRepositories( ) throw ( libcmis::Exception ) { map< string, string > repositories; GetRepositories request; vector< SoapResponsePtr > responses = m_session->soapRequest( m_url, request ); if ( responses.size() == 1 ) { GetRepositoriesResponse* response = dynamic_cast< GetRepositoriesResponse* >( responses.front( ).get( ) ); if ( response != NULL ) { repositories = response->getRepositories(); } } return repositories; } libcmis::RepositoryPtr RepositoryService::getRepositoryInfo( string id ) throw ( libcmis::Exception ) { libcmis::RepositoryPtr repository; GetRepositoryInfo request( id ); vector< SoapResponsePtr > responses = m_session->soapRequest( m_url, request ); if ( responses.size( ) == 1 ) { SoapResponse* resp = responses.front( ).get( ); GetRepositoryInfoResponse* response = dynamic_cast< GetRepositoryInfoResponse* >( resp ); if ( response != NULL ) repository = response->getRepository( ); } return repository; } libcmis::ObjectTypePtr RepositoryService::getTypeDefinition( string repoId, string typeId ) throw ( libcmis::Exception ) { libcmis::ObjectTypePtr type; GetTypeDefinition request( repoId, typeId ); vector< SoapResponsePtr > responses = m_session->soapRequest( m_url, request ); if ( responses.size( ) == 1 ) { SoapResponse* resp = responses.front( ).get( ); GetTypeDefinitionResponse* response = dynamic_cast< GetTypeDefinitionResponse* >( resp ); if ( response != NULL ) type = response->getType( ); } return type; } vector< libcmis::ObjectTypePtr > RepositoryService::getTypeChildren( string repoId, string typeId ) throw ( libcmis::Exception ) { vector< libcmis::ObjectTypePtr > children; GetTypeChildren request( repoId, typeId ); vector< SoapResponsePtr > responses = m_session->soapRequest( m_url, request ); if ( responses.size( ) == 1 ) { SoapResponse* resp = responses.front( ).get( ); GetTypeChildrenResponse* response = dynamic_cast< GetTypeChildrenResponse* >( resp ); if ( response != NULL ) children = response->getChildren( ); } return children; } libcmis-0.4.1/src/libcmis/ws-versioningservice.hxx0000644000175000001440000000430312024122657017211 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2011 SUSE * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #ifndef _WS_VERSIONINGSERVICE_HXX_ #define _WS_VERSIONINGSERVICE_HXX_ #include #include "document.hxx" class WSSession; class VersioningService { private: WSSession* m_session; std::string m_url; public: VersioningService( WSSession* session ); VersioningService( const VersioningService& copy ); ~VersioningService( ); VersioningService& operator=( const VersioningService& copy ); libcmis::DocumentPtr checkOut( std::string repoId, std::string documentId ) throw ( libcmis::Exception ); void cancelCheckOut( std::string repoId, std::string documentId ) throw ( libcmis::Exception ); libcmis::DocumentPtr checkIn( std::string repoId, std::string objectId, bool isMajor, const std::map< std::string, libcmis::PropertyPtr >& properties, boost::shared_ptr< std::ostream > stream, std::string contentType, std::string fileName, std::string comment ) throw ( libcmis::Exception ); std::vector< libcmis::DocumentPtr > getAllVersions( std::string repoId, std::string objectId ) throw ( libcmis::Exception ); }; #endif libcmis-0.4.1/src/libcmis/gdrive-allowable-actions.hxx0000644000175000001440000001353312156277660017714 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2013 Cao Cuong Ngo * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #ifndef _GDRIVE_ALLOWABLE_ACTIONS_HXX_ #define _GDRIVE_ALLOWABLE_ACTIONS_HXX_ #include class GdriveAllowableActions: public libcmis::AllowableActions { public: GdriveAllowableActions( bool isFolder ) : AllowableActions( ) { m_states.clear( ); m_states.insert( std::pair< libcmis::ObjectAction::Type, bool> ( libcmis::ObjectAction::DeleteObject, true ) ); m_states.insert( std::pair< libcmis::ObjectAction::Type, bool> ( libcmis::ObjectAction::UpdateProperties, true ) ); m_states.insert( std::pair< libcmis::ObjectAction::Type, bool> ( libcmis::ObjectAction::GetProperties, true ) ); m_states.insert( std::pair< libcmis::ObjectAction::Type, bool> ( libcmis::ObjectAction::GetObjectRelationships, false ) ); m_states.insert( std::pair< libcmis::ObjectAction::Type, bool> ( libcmis::ObjectAction::GetObjectParents, true ) ); m_states.insert( std::pair< libcmis::ObjectAction::Type, bool> ( libcmis::ObjectAction::MoveObject, true ) ); m_states.insert( std::pair< libcmis::ObjectAction::Type, bool> ( libcmis::ObjectAction::CreateRelationship, false ) ); m_states.insert( std::pair< libcmis::ObjectAction::Type, bool> ( libcmis::ObjectAction::ApplyPolicy, false ) ); m_states.insert( std::pair< libcmis::ObjectAction::Type, bool> ( libcmis::ObjectAction::GetAppliedPolicies, false ) ); m_states.insert( std::pair< libcmis::ObjectAction::Type, bool> ( libcmis::ObjectAction::RemovePolicy, false ) ); m_states.insert( std::pair< libcmis::ObjectAction::Type, bool> ( libcmis::ObjectAction::GetACL, true ) ); m_states.insert( std::pair< libcmis::ObjectAction::Type, bool> ( libcmis::ObjectAction::ApplyACL, true ) ); m_states.insert( std::pair< libcmis::ObjectAction::Type, bool> ( libcmis::ObjectAction::GetFolderTree, isFolder ) ); m_states.insert( std::pair< libcmis::ObjectAction::Type, bool> ( libcmis::ObjectAction::GetFolderParent, isFolder) ); m_states.insert( std::pair< libcmis::ObjectAction::Type, bool> ( libcmis::ObjectAction::GetDescendants, isFolder ) ); m_states.insert( std::pair< libcmis::ObjectAction::Type, bool> ( libcmis::ObjectAction::DeleteContentStream, !isFolder ) ); m_states.insert( std::pair< libcmis::ObjectAction::Type, bool> ( libcmis::ObjectAction::CheckOut, !isFolder ) ); m_states.insert( std::pair< libcmis::ObjectAction::Type, bool> ( libcmis::ObjectAction::CancelCheckOut, !isFolder ) ); m_states.insert( std::pair< libcmis::ObjectAction::Type, bool> ( libcmis::ObjectAction::CheckIn, !isFolder ) ); m_states.insert( std::pair< libcmis::ObjectAction::Type, bool> ( libcmis::ObjectAction::GetContentStream, !isFolder ) ); m_states.insert( std::pair< libcmis::ObjectAction::Type, bool> ( libcmis::ObjectAction::SetContentStream, !isFolder ) ); m_states.insert( std::pair< libcmis::ObjectAction::Type, bool> ( libcmis::ObjectAction::GetAllVersions, !isFolder ) ); m_states.insert( std::pair< libcmis::ObjectAction::Type, bool> ( libcmis::ObjectAction::AddObjectToFolder, !isFolder ) ); m_states.insert( std::pair< libcmis::ObjectAction::Type, bool> ( libcmis::ObjectAction::RemoveObjectFromFolder, !isFolder ) ); m_states.insert( std::pair< libcmis::ObjectAction::Type, bool> ( libcmis::ObjectAction::GetRenditions, !isFolder ) ); m_states.insert( std::pair< libcmis::ObjectAction::Type, bool> ( libcmis::ObjectAction::GetChildren, isFolder ) ); m_states.insert( std::pair< libcmis::ObjectAction::Type, bool> ( libcmis::ObjectAction::CreateDocument, isFolder ) ); m_states.insert( std::pair< libcmis::ObjectAction::Type, bool> ( libcmis::ObjectAction::CreateFolder, isFolder ) ); m_states.insert( std::pair< libcmis::ObjectAction::Type, bool> ( libcmis::ObjectAction::DeleteTree, isFolder ) ); } }; #endif libcmis-0.4.1/src/libcmis/gdrive-object.cxx0000644000175000001440000002241112177712470015544 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2013 SUSE * 2013 Cao Cuong Ngo * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #include "gdrive-object.hxx" #include "gdrive-property.hxx" #include "gdrive-allowable-actions.hxx" #include "gdrive-repository.hxx" #include "gdrive-utils.hxx" using namespace std; using namespace libcmis; GDriveObject::GDriveObject( GDriveSession* session ) : libcmis::Object( session ) { } GDriveObject::GDriveObject( GDriveSession* session, Json json, string id, string name ) : libcmis::Object( session ) { initializeFromJson( json, id, name ); } GDriveObject::GDriveObject( const GDriveObject& copy ) : libcmis::Object( copy ) { } GDriveObject& GDriveObject::operator=( const GDriveObject& copy ) { if ( this != © ) { libcmis::Object::operator=( copy ); } return *this; } void GDriveObject::initializeFromJson ( Json json, string id, string name ) { Json::JsonObject objs = json.getObjects( ); Json::JsonObject::iterator it; for ( it = objs.begin( ); it != objs.end( ); ++it) { PropertyPtr property; // in case of a revision, get the ID and name of the original file if ( !id.empty( ) && it->first == "id" ) { Json idJson( id.c_str( ) ); property.reset( new GDriveProperty( "id", idJson ) ); m_properties[ property->getPropertyType( )->getId()] = property; property.reset( new GDriveProperty( "revisionId", it->second ) ); m_properties[ property->getPropertyType( )->getId()] = property; Json nameJson( name.c_str( ) ); property.reset( new GDriveProperty( "cmis:name", nameJson) ); m_properties[ property->getPropertyType( )->getId()] = property; property.reset( new GDriveProperty( "cmis:contentStreamFileName", nameJson) ); m_properties[ property->getPropertyType( )->getId()] = property; } else { property.reset( new GDriveProperty( it->first, it->second ) ); m_properties[ property->getPropertyType( )->getId()] = property; // we map "title" to both "cmis:name" and "cmis:getContentStreamFileName" if ( it->first == "title" ) { property.reset( new GDriveProperty( "cmis:name", it->second) ); m_properties[ property->getPropertyType( )->getId()] = property; } // some revision keep the original file name. if ( it->first == "originalFilename" ) { property.reset( new GDriveProperty( "cmis:name", it->second ) ); m_properties[ property->getPropertyType( )->getId()] = property; property.reset( new GDriveProperty( "cmis:contentStreamFileName", it->second) ); m_properties[ property->getPropertyType( )->getId()] = property; } // In case of a revision, get the modified date as creation date if ( it->first == "modifiedDate" && !id.empty( ) ) { property.reset( new GDriveProperty( "cmis:creationDate", it->second) ); m_properties[ property->getPropertyType( )->getId()] = property; } // In case of a revision, get the last modifying user and the creator if ( it->first == "lastModifyingUserName" && !id.empty( ) ) { property.reset( new GDriveProperty( "cmis:createdBy", it->second) ); m_properties[ property->getPropertyType( )->getId()] = property; } } } m_refreshTimestamp = time( NULL ); // Create AllowableActions bool isFolder = json["mimeType"].toString( ) == GDRIVE_FOLDER_MIME_TYPE; m_allowableActions.reset( new GdriveAllowableActions( isFolder ) ); } GDriveSession* GDriveObject::getSession( ) { return dynamic_cast< GDriveSession* > ( m_session ); } void GDriveObject::refreshImpl( Json json ) { m_typeDescription.reset( ); m_properties.clear( ); initializeFromJson( json ); } vector< RenditionPtr> GDriveObject::getRenditions( string /* filter */ ) throw ( libcmis::Exception ) { if ( m_renditions.empty( ) ) { string downloadUrl = getStringProperty( "downloadUrl" ); if ( !downloadUrl.empty( ) ) { string mimeType = getStringProperty( "cmis:contentStreamMimeType" ); if ( !mimeType.empty( ) ) { RenditionPtr rendition( new Rendition( mimeType, mimeType, mimeType, downloadUrl )); m_renditions.push_back( rendition ); } } vector< string > exportLinks = getMultiStringProperty( "exportLinks" ); for ( vector::iterator it = exportLinks.begin( ); it != exportLinks.end( ); ++it) { int pos = (*it).find(":\""); if ( pos == -1 ) continue; string mimeType = (*it).substr( 0, pos ); string url = (*it).substr( pos + 2, (*it).length( ) - pos - 3 ); RenditionPtr rendition( new Rendition( mimeType, mimeType, mimeType, url ) ); m_renditions.push_back( rendition ); } // thumbnail link string thumbnailLink = getStringProperty( "thumbnailLink" ); if ( !thumbnailLink.empty( ) ) { string mimeType = "cmis:thumbnail"; RenditionPtr rendition( new Rendition( mimeType, mimeType, mimeType, thumbnailLink )); m_renditions.push_back( rendition ); } } return m_renditions; } libcmis::ObjectPtr GDriveObject::updateProperties( const PropertyPtrMap& properties ) throw ( libcmis::Exception ) { // Make Json object from properties Json json = GdriveUtils::toGdriveJson( properties ); istringstream is( json.toString( )); libcmis::HttpResponsePtr response; try { vector< string > headers; headers.push_back( "Content-Type: application/json" ); response = getSession( )->httpPutRequest( getUrl( ), is, headers ); } catch ( const CurlException& e ) { throw e.getCmisException( ); } string res = response->getStream( )->str( ); Json jsonRes = Json::parse( res ); libcmis::ObjectPtr updated( new GDriveObject ( getSession( ), jsonRes ) ); if ( updated->getId( ) == getId( ) ) refreshImpl( jsonRes ); return updated; } void GDriveObject::refresh( ) throw ( libcmis::Exception ) { string res; try { res = getSession()->httpGetRequest( getUrl( ) )->getStream( )->str( ); } catch ( const CurlException& e ) { throw e.getCmisException( ); } Json json = Json::parse( res ); refreshImpl( json ); } void GDriveObject::remove( bool /*allVersions*/ ) throw ( libcmis::Exception ) { try { getSession( )->httpDeleteRequest( getUrl( ) ); } catch ( const CurlException& e ) { throw e.getCmisException( ); } } void GDriveObject::move( FolderPtr /*source*/, FolderPtr destination ) throw ( libcmis::Exception ) { Json parentsJson; Json parentsValue = GdriveUtils::createJsonFromParentId( destination->getId( ) ); parentsJson.add( "parents", parentsValue ); istringstream is( parentsJson.toString( ) ); libcmis::HttpResponsePtr response; try { vector< string > headers; headers.push_back( "Content-Type: application/json" ); response = getSession( )->httpPutRequest( getUrl( ), is, headers ); } catch ( const CurlException& e ) { throw e.getCmisException( ); } string res = response->getStream( )->str( ); Json jsonRes = Json::parse( res ); refreshImpl( jsonRes ); } string GDriveObject::getUrl( ) { return getSession( )->getBindingUrl( ) + "/files/" + getId( ); } string GDriveObject::getUploadUrl( ) { return GDRIVE_UPLOAD_LINKS; } vector< string> GDriveObject::getMultiStringProperty( const string& propertyName ) { vector< string > values; PropertyPtrMap::const_iterator it = getProperties( ).find( string( propertyName ) ); if ( it != getProperties( ).end( ) && it->second != NULL && !it->second->getStrings( ).empty( ) ) values = it->second->getStrings( ); return values; } libcmis-0.4.1/src/libcmis/gdrive-session.hxx0000644000175000001440000000424312173212453015761 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2013 Cao Cuong Ngo * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #ifndef _GDRIVE_SESSION_HXX_ #define _GDRIVE_SESSION_HXX_ #include "base-session.hxx" #include "repository.hxx" class GDriveSession : public BaseSession { public: GDriveSession( std::string baseUrl, std::string username, std::string password, libcmis::OAuth2DataPtr oauth2, bool verbose = false ) throw ( libcmis::Exception ); GDriveSession( const GDriveSession& copy ); ~GDriveSession ( ); virtual libcmis::RepositoryPtr getRepository( ) throw ( libcmis::Exception ); virtual bool setRepository( std::string ) { return true; } virtual libcmis::ObjectPtr getObject( std::string id ) throw ( libcmis::Exception ); virtual libcmis::ObjectPtr getObjectByPath( std::string path ) throw ( libcmis::Exception ); virtual libcmis::ObjectTypePtr getType( std::string id ) throw ( libcmis::Exception ); private: GDriveSession( ); }; #endif /* _GDRIVE_SESSION_HXX_ */ libcmis-0.4.1/src/libcmis/ws-folder.cxx0000644000175000001440000000477612156277660014744 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2011 SUSE * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #include "ws-folder.hxx" using namespace std; using libcmis::PropertyPtrMap; WSFolder::WSFolder( const WSObject& object ) : libcmis::Object( object ), libcmis::Folder( const_cast< WSObject& >( object ).getSession( ) ), WSObject( object ) { } WSFolder::~WSFolder( ) { } vector< libcmis::ObjectPtr > WSFolder::getChildren( ) throw ( libcmis::Exception ) { string repoId = getSession( )->getRepositoryId( ); return getSession( )->getNavigationService( ).getChildren( repoId, getId( ) ); } libcmis::FolderPtr WSFolder::createFolder( const PropertyPtrMap& properties ) throw ( libcmis::Exception ) { string repoId = getSession( )->getRepositoryId( ); return getSession( )->getObjectService( ).createFolder( repoId, properties, getId( ) ); } libcmis::DocumentPtr WSFolder::createDocument( const PropertyPtrMap& properties, boost::shared_ptr< ostream > os, string contentType, string fileName ) throw ( libcmis::Exception ) { string repoId = getSession( )->getRepositoryId( ); return getSession( )->getObjectService( ).createDocument( repoId, properties, getId( ), os, contentType, fileName ); } vector< string > WSFolder::removeTree( bool allVersion, libcmis::UnfileObjects::Type unfile, bool continueOnError ) throw ( libcmis::Exception ) { string repoId = getSession( )->getRepositoryId( ); return getSession( )->getObjectService( ).deleteTree( repoId, getId( ), allVersion, unfile, continueOnError ); } libcmis-0.4.1/src/libcmis/ws-objectservice.cxx0000644000175000001440000001746012177734761016315 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2011 SUSE * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #include "ws-objectservice.hxx" #include "ws-requests.hxx" #include "ws-session.hxx" using namespace std; using libcmis::PropertyPtrMap; ObjectService::ObjectService( WSSession* session ) : m_session( session ), m_url( session->getServiceUrl( "ObjectService" ) ) { } ObjectService::ObjectService( const ObjectService& copy ) : m_session( copy.m_session ), m_url( copy.m_url ) { } ObjectService::~ObjectService( ) { } ObjectService& ObjectService::operator=( const ObjectService& copy ) { if ( this != © ) { m_session = copy.m_session; m_url = copy.m_url; } return *this; } libcmis::ObjectPtr ObjectService::getObject( string repoId, string id ) throw ( libcmis::Exception ) { libcmis::ObjectPtr object; class GetObject request( repoId, id ); vector< SoapResponsePtr > responses = m_session->soapRequest( m_url, request ); if ( responses.size( ) == 1 ) { SoapResponse* resp = responses.front( ).get( ); GetObjectResponse* response = dynamic_cast< GetObjectResponse* >( resp ); if ( response != NULL ) object = response->getObject( ); } return object; } libcmis::ObjectPtr ObjectService::getObjectByPath( string repoId, string path ) throw ( libcmis::Exception ) { libcmis::ObjectPtr object; GetObjectByPath request( repoId, path ); vector< SoapResponsePtr > responses = m_session->soapRequest( m_url, request ); if ( responses.size( ) == 1 ) { SoapResponse* resp = responses.front( ).get( ); GetObjectResponse* response = dynamic_cast< GetObjectResponse* >( resp ); if ( response != NULL ) object = response->getObject( ); } return object; } vector< libcmis::RenditionPtr > ObjectService::getRenditions( string repoId, string objectId, string filter ) throw ( libcmis::Exception ) { vector< libcmis::RenditionPtr > renditions; GetRenditions request( repoId, objectId, filter ); vector< SoapResponsePtr > responses = m_session->soapRequest( m_url, request ); if ( responses.size( ) == 1 ) { SoapResponse* resp = responses.front( ).get( ); GetRenditionsResponse* response = dynamic_cast< GetRenditionsResponse* >( resp ); if ( response != NULL ) { renditions = response->getRenditions( ); } } return renditions; } libcmis::ObjectPtr ObjectService::updateProperties( string repoId, string objectId, const PropertyPtrMap& properties, string changeToken ) throw ( libcmis::Exception ) { libcmis::ObjectPtr object; UpdateProperties request( repoId, objectId, properties, changeToken ); vector< SoapResponsePtr > responses = m_session->soapRequest( m_url, request ); if ( responses.size( ) == 1 ) { SoapResponse* resp = responses.front( ).get( ); UpdatePropertiesResponse* response = dynamic_cast< UpdatePropertiesResponse* >( resp ); if ( response != NULL ) { string id = response->getObjectId( ); object = getObject( repoId, id ); } } return object; } void ObjectService::deleteObject( string repoId, string id, bool allVersions ) throw ( libcmis::Exception ) { class DeleteObject request( repoId, id, allVersions ); m_session->soapRequest( m_url, request ); } vector< string > ObjectService::deleteTree( std::string repoId, std::string folderId, bool allVersions, libcmis::UnfileObjects::Type unfile, bool continueOnFailure ) throw ( libcmis::Exception ) { vector< string > failedIds; DeleteTree request( repoId, folderId, allVersions, unfile, continueOnFailure ); vector< SoapResponsePtr > responses = m_session->soapRequest( m_url, request ); if ( responses.size( ) == 1 ) { SoapResponse* resp = responses.front( ).get( ); DeleteTreeResponse* response = dynamic_cast< DeleteTreeResponse* >( resp ); if ( response != NULL ) failedIds = response->getFailedIds( ); } return failedIds; } void ObjectService::move( string repoId, string objectId, string destId, string srcId ) throw ( libcmis::Exception ) { MoveObject request( repoId, objectId, destId, srcId ); m_session->soapRequest( m_url, request ); } boost::shared_ptr< istream > ObjectService::getContentStream( string repoId, string objectId ) throw ( libcmis::Exception ) { boost::shared_ptr< istream > stream; GetContentStream request( repoId, objectId ); vector< SoapResponsePtr > responses = m_session->soapRequest( m_url, request ); if ( responses.size( ) == 1 ) { SoapResponse* resp = responses.front( ).get( ); GetContentStreamResponse* response = dynamic_cast< GetContentStreamResponse* >( resp ); if ( response != NULL ) stream = response->getStream( ); } return stream; } void ObjectService::setContentStream( std::string repoId, std::string objectId, bool overwrite, std::string changeToken, boost::shared_ptr< std::ostream > stream, std::string contentType, std::string fileName ) throw ( libcmis::Exception ) { SetContentStream request( repoId, objectId, overwrite, changeToken, stream, contentType, fileName ); m_session->soapRequest( m_url, request ); } libcmis::FolderPtr ObjectService::createFolder( string repoId, const PropertyPtrMap& properties, string folderId ) throw ( libcmis::Exception ) { libcmis::FolderPtr folder; CreateFolder request( repoId, properties, folderId ); vector< SoapResponsePtr > responses = m_session->soapRequest( m_url, request ); if ( responses.size( ) == 1 ) { SoapResponse* resp = responses.front( ).get( ); CreateFolderResponse* response = dynamic_cast< CreateFolderResponse* >( resp ); if ( response != NULL ) { string id = response->getObjectId( ); folder = m_session->getFolder( id ); } } return folder; } libcmis::DocumentPtr ObjectService::createDocument( string repoId, const PropertyPtrMap& properties, string folderId, boost::shared_ptr< ostream > stream, string contentType, string fileName ) throw ( libcmis::Exception ) { libcmis::DocumentPtr document; CreateDocument request( repoId, properties, folderId, stream, contentType, fileName ); vector< SoapResponsePtr > responses = m_session->soapRequest( m_url, request ); if ( responses.size( ) == 1 ) { SoapResponse* resp = responses.front( ).get( ); CreateFolderResponse* response = dynamic_cast< CreateFolderResponse* >( resp ); if ( response != NULL ) { string id = response->getObjectId( ); libcmis::ObjectPtr object = m_session->getObject( id ); document = boost::dynamic_pointer_cast< libcmis::Document >( object ); } } return document; } libcmis-0.4.1/src/cmis-client.cxx0000644000175000001440000013425512200225743013604 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2011 SUSE * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #include #include #include #include #include #include #include #include using namespace std; using namespace ::boost::program_options; using libcmis::PropertyPtrMap; namespace { char* lcl_queryAuthCode( const char* url, const char* /*username*/, const char* /*password*/ ) { string code; cout << "Copy the following link to your browser and take the code: " << endl << endl << url << endl << endl; cout << "Enter the code:" << endl; cin >> code; return strdup( code.c_str() ); } class CinAuthProvider : public libcmis::AuthProvider { private: string m_user; string m_pass; public: CinAuthProvider( ) : m_user( ), m_pass( ) { } ~CinAuthProvider( ) { } virtual bool authenticationQuery( string& username, string& password ); }; bool CinAuthProvider::authenticationQuery( string& username, string& password ) { bool cancelled = true; bool askUsername = username.empty(); if ( askUsername ) { if ( m_user.empty() ) { cout << "Username (empty to cancel): "; getline( cin, username ); cancelled = username.empty(); m_user = username; } else { cancelled = false; username = m_user; } } if ( !cancelled && ( askUsername || password.empty( ) ) ) { if ( m_pass.empty() ) { cout << "Password (empty to cancel): "; getline( cin, password ); cancelled = password.empty(); m_pass = password; } else { password = m_pass; cancelled = false; } } return !cancelled; } class CinCertValidationHandler : public libcmis::CertValidationHandler { private: map< string, bool > m_answers; public: CinCertValidationHandler( ) : m_answers( ) { } ~CinCertValidationHandler( ) { } virtual bool validateCertificate( vector< string > certificates ) { if ( certificates.empty( ) ) return false; // Should never happen // Show the first certificate (even base64-encoded) string cert = certificates.front(); map< string, bool >::iterator it = m_answers.find( cert ); if ( it != m_answers.end( ) ) return it->second; cout << "Invalid SSL certificate:" << endl << cert << endl; cout << "'openssl x509 -noout -text' can show you the details of this certificate." << endl << endl; // Ask whether to validate cout << "Do you want to ignore this problem and go on? yes/no [default: no]: "; string answer; getline( cin, answer ); m_answers[cert] = answer == "yes"; return answer == "yes"; } }; } class CommandException : public exception { private: string m_msg; public: CommandException( string msg ) : m_msg( msg ) { } ~CommandException( ) throw( ) { } CommandException( const CommandException& copy ) : m_msg( copy.m_msg ) { } CommandException& operator=( const CommandException& copy ) { if ( this != © ) m_msg = copy.m_msg; return *this; } virtual const char* what() const throw() { return m_msg.c_str(); } }; class CmisClient { private: variables_map& m_vm; public: CmisClient( variables_map& vm ) : m_vm( vm ) { } libcmis::Session* getSession( bool inGetRepositories = false ) throw ( CommandException, libcmis::Exception ); void execute( ) throw ( exception ); void printHelp( ); static options_description getOptionsDescription( ); private: map< int, string > getSessionParams(); map< string, string > getObjectProperties( ); }; map< string, string > CmisClient::getObjectProperties( ) { map< string, string > result; if ( m_vm.count( "object-property" ) > 0 ) { vector< string > params = m_vm["object-property"].as< vector< string > >( ); for ( vector< string >::iterator it = params.begin( ); it != params.end( ); ++it ) { size_t pos = it->find( "=" ); if ( pos != string::npos ) { string name = it->substr( 0, pos ); string value = it->substr( pos + 1 ); result.insert( pair< string, string >( name, value ) ); } } } return result; } libcmis::Session* CmisClient::getSession( bool inGetRepositories ) throw ( CommandException, libcmis::Exception ) { if ( m_vm.count( "url" ) == 0 ) throw CommandException( "Missing binding URL" ); // Setup the authentication provider in case we have missing credentials libcmis::AuthProviderPtr provider( new CinAuthProvider( ) ); libcmis::SessionFactory::setAuthenticationProvider( provider ); libcmis::CertValidationHandlerPtr certValidator( new CinCertValidationHandler( ) ); libcmis::SessionFactory::setCertificateValidationHandler( certValidator ); string url = m_vm["url"].as(); // Look for the credentials string username; string password; if ( m_vm.count( "username" ) > 0 ) { username = m_vm["username"].as< string >(); if ( m_vm.count( "password" ) > 0 ) password = m_vm["password"].as< string >(); } // Look for proxy settings string proxyUrl; string proxyUser; string proxyPass; string noproxy; if ( m_vm.count( "proxy" ) > 0 ) { proxyUrl = m_vm["proxy"].as< string >(); if ( m_vm.count( "proxy-user" ) > 0 ) proxyUser = m_vm["proxy-user"].as< string >(); if ( m_vm.count( "proxy-password" ) > 0 ) proxyPass = m_vm["proxy-password"].as< string >(); if ( m_vm.count( "noproxy" ) > 0 ) noproxy = m_vm["noproxy"].as< string >(); libcmis::SessionFactory::setProxySettings( proxyUrl, noproxy, proxyUser, proxyPass ); } bool verbose = m_vm.count( "verbose" ) > 0; libcmis::Session* session = NULL; string repoId; // The repository ID is needed to initiate a session if ( m_vm.count( "repository" ) == 0 && !inGetRepositories ) { // Do we have a single repository on the server? session = getSession( true ); if ( session != NULL ) { vector< libcmis::RepositoryPtr > repos = session->getRepositories(); if ( repos.size() == 1 ) { repoId = repos.front( )->getId( ); session->setRepository( repoId ); } } // We couldn't auto-guess the repository, then throw an error if ( repoId.empty( ) ) { delete session; throw CommandException( "Missing repository ID" ); } } else if ( m_vm.count( "repository" ) > 0 ) { repoId = m_vm["repository"].as< string >(); } if ( session == NULL ) { bool noSslCheck = m_vm.count( "no-ssl-check" ) > 0; // Should we use OAuth2? string oauth2ClientId; string oauth2ClientSecret; string oauth2AuthUrl; string oauth2TokenUrl; string oauth2RedirectUri; string oauth2Scope; if ( m_vm.count( "oauth2-client-id" ) > 0 ) oauth2ClientId = m_vm["oauth2-client-id"].as< string >(); if ( m_vm.count( "oauth2-client-secret" ) > 0 ) oauth2ClientSecret = m_vm["oauth2-client-secret"].as< string >(); if ( m_vm.count( "oauth2-auth-url" ) > 0 ) oauth2AuthUrl = m_vm["oauth2-auth-url"].as< string >(); if ( m_vm.count( "oauth2-token-url" ) > 0 ) oauth2TokenUrl = m_vm["oauth2-token-url"].as< string >(); if ( m_vm.count( "oauth2-redirect-uri" ) > 0 ) oauth2RedirectUri = m_vm["oauth2-redirect-uri"].as< string >(); if ( m_vm.count( "oauth2-scope" ) > 0 ) oauth2Scope = m_vm["oauth2-scope"].as< string >(); libcmis::OAuth2DataPtr oauth2Data( new libcmis::OAuth2Data( oauth2AuthUrl, oauth2TokenUrl, oauth2Scope, oauth2RedirectUri, oauth2ClientId, oauth2ClientSecret) ); if ( oauth2Data->isComplete( ) ) { // Set the fallback AuthCode provider libcmis::SessionFactory::setOAuth2AuthCodeProvider( lcl_queryAuthCode ); } else { oauth2Data.reset( ); } session = libcmis::SessionFactory::createSession( url, username, password, repoId, noSslCheck, oauth2Data, verbose ); } return session; } void CmisClient::execute( ) throw ( exception ) { if ( ( m_vm.count( "help" ) > 0 ) || m_vm.count( "command" ) != 1 ) { printHelp(); return; } if ( m_vm.count( "command" ) == 1 ) { string command = m_vm["command"].as(); if ( "list-repos" == command ) { libcmis::Session* session = getSession( true ); if ( session != NULL ) { vector< libcmis::RepositoryPtr > repos = session->getRepositories(); cout << "Repositories: name (id)" << endl; for ( vector< libcmis::RepositoryPtr >::iterator it = repos.begin(); it != repos.end(); ++it ) cout << "\t" << ( *it )->getName( ) << " (" << ( *it )->getId( ) << ")" << endl; } else { cerr << "Couldn't create a session for some reason" << endl; } } else if ( "show-root" == command ) { libcmis::Session* session = getSession( ); libcmis::FolderPtr root = session->getRootFolder(); if ( root.get() ) { cout << "------------------------------------------------" << endl; cout << root->toString() << endl; } delete session; } else if ( "repo-infos" == command ) { libcmis::Session* session = getSession( ); libcmis::RepositoryPtr repo = session->getRepository( ); if ( repo ) { cout << "------------------------------------------------" << endl; cout << repo->toString() << endl; } else throw CommandException( "Please select a repository" ); delete session; } else if ( "type-by-id" == command ) { libcmis::Session* session = getSession( ); // Get the ids of the types to fetch if ( m_vm.count( "args" ) == 0 ) throw CommandException( "Please provide the node ids to show as command args" ); vector< string > ids = m_vm["args"].as< vector< string > >( ); for ( vector< string >::iterator it = ids.begin(); it != ids.end(); ++it ) { cout << "------------------------------------------------" << endl; try { libcmis::ObjectTypePtr type = session->getType( *it ); cout << type->toString() << endl; } catch ( const libcmis::Exception& e ) { cout << e.what() << endl; } } delete session; } else if ( "show-by-id" == command ) { libcmis::Session* session = getSession( ); // Get the ids of the objects to fetch if ( m_vm.count( "args" ) == 0 ) throw CommandException( "Please provide the node ids to show as command args" ); vector< string > objIds = m_vm["args"].as< vector< string > >( ); for ( vector< string >::iterator it = objIds.begin(); it != objIds.end(); ++it ) { libcmis::ObjectPtr cmisObj = session->getObject( *it ); cout << "------------------------------------------------" << endl; if ( cmisObj.get() ) cout << cmisObj->toString() << endl; else cout << "No such node: " << *it << endl; } delete session; } else if ( "show-by-path" == command ) { libcmis::Session* session = getSession( ); // Get the paths of the objects to fetch if ( m_vm.count( "args" ) == 0 ) throw CommandException( "Please provide the node paths to show as command args" ); vector< string > objPaths = m_vm["args"].as< vector< string > >( ); for ( vector< string >::iterator it = objPaths.begin(); it != objPaths.end(); ++it ) { libcmis::ObjectPtr cmisObj = session->getObjectByPath( *it ); cout << "------------------------------------------------" << endl; if ( cmisObj.get() ) cout << cmisObj->toString() << endl; else cout << "No such node: " << *it << endl; } delete session; } else if ( "get-content" == command ) { libcmis::Session* session = getSession( ); vector< string > objIds = m_vm["args"].as< vector< string > >( ); if ( objIds.empty( ) ) throw CommandException( "Please provide a content object Id" ); libcmis::ObjectPtr cmisObj = session->getObject( objIds.front() ); libcmis::Document* document = dynamic_cast< libcmis::Document* >( cmisObj.get() ); if ( NULL != document ) { // TODO Handle name clashes string streamId; if ( m_vm.count( "stream-id" ) > 0 ) streamId = m_vm["stream-id"].as(); boost::shared_ptr< istream > in = document->getContentStream( streamId ); ofstream out( document->getContentFilename().c_str() ); out << in->rdbuf(); out.close(); } else throw CommandException( string( "Not a document object id: " ) + objIds.front() ); delete session; } else if ( "set-content" == command ) { libcmis::Session* session = getSession( ); vector< string > objIds = m_vm["args"].as< vector< string > >( ); if ( objIds.empty( ) ) throw CommandException( "Please provide a content object Id" ); libcmis::ObjectPtr cmisObj = session->getObject( objIds.front() ); libcmis::Document* document = dynamic_cast< libcmis::Document* >( cmisObj.get() ); if ( NULL != document ) { if ( m_vm.count( "input-file" ) == 0 ) throw CommandException( "Missing --input-file" ); if ( m_vm.count( "input-type" ) == 0 ) throw CommandException( "Missing --input-type" ); string type = m_vm["input-type"].as(); string filename; if ( m_vm.count( "input-name" ) > 0 ) filename = m_vm["input-name"].as(); string file = m_vm["input-file"].as(); ifstream is( file.c_str(), ifstream::in ); boost::shared_ptr< ostream > os ( new ostream ( is.rdbuf( ) ) ); if ( is.fail( ) ) throw CommandException( string( "Unable to open file " ) + file ); document->setContentStream( os, type, filename ); is.close( ); } else throw CommandException( string( "Not a document object id: " ) + objIds.front() ); delete session; } else if ( "create-folder" == command ) { libcmis::Session* session = getSession( ); vector< string > args = m_vm["args"].as< vector< string > >( ); if ( args.size() < 2 ) throw CommandException( "Please provide a parent Id and folder name" ); libcmis::FolderPtr parent = session->getFolder( args[0] ); // Get the folder type to create string folderType( "cmis:folder" ); if ( m_vm.count( "object-type" ) != 0 ) folderType = m_vm["object-type"].as( ); libcmis::ObjectTypePtr type = session->getType( folderType ); if ( "cmis:folder" != type->getBaseType( )->getId( ) ) throw CommandException( string( "Not a folder type: " ) + folderType ); PropertyPtrMap properties; map< string, libcmis::PropertyTypePtr >& propertiesTypes = type->getPropertiesTypes( ); // Set the name map< string, libcmis::PropertyTypePtr >::iterator typeIt = propertiesTypes.find( string( "cmis:name" ) ); if ( typeIt == propertiesTypes.end( ) ) throw CommandException( string( "No cmis:name on the object type... weird" ) ); vector< string > nameValues; nameValues.push_back( args[1] ); libcmis::PropertyPtr nameProperty( new libcmis::Property( typeIt->second, nameValues ) ); properties.insert( pair< string, libcmis::PropertyPtr >( string( "cmis:name" ), nameProperty ) ); // Set the objectTypeId typeIt = propertiesTypes.find( string( "cmis:objectTypeId" ) ); if ( typeIt == propertiesTypes.end( ) ) throw CommandException( string( "No cmis:objectTypeId on the object type... weird" ) ); vector< string > typeIdValues; typeIdValues.push_back( folderType ); libcmis::PropertyPtr typeIdProperty( new libcmis::Property( typeIt->second, typeIdValues ) ); properties.insert( pair< string, libcmis::PropertyPtr >( string( "cmis:objectTypeId" ), typeIdProperty ) ); // Checks for the properties to set if any map< string, string > propsToSet = getObjectProperties( ); for ( map< string, string >::iterator it = propsToSet.begin(); it != propsToSet.end(); ++it ) { // Create the CMIS property if it exists typeIt = propertiesTypes.find( it->first ); if ( typeIt != propertiesTypes.end( ) ) { vector< string > values; values.push_back( it->second ); libcmis::PropertyPtr cmisProperty( new libcmis::Property( typeIt->second, values ) ); properties.insert( pair< string, libcmis::PropertyPtr >( it->first, cmisProperty ) ); } } libcmis::FolderPtr created = parent->createFolder( properties ); cout << "------------------------------------------------" << endl; cout << created->toString() << endl; delete session; } else if ( "create-document" == command ) { libcmis::Session* session = getSession( ); vector< string > args = m_vm["args"].as< vector< string > >( ); if ( args.size() < 2 ) throw CommandException( "Please provide a parent Id and document name" ); libcmis::FolderPtr parent = session->getFolder( args[0] ); // Get the document type to create string documentType( "cmis:document" ); if ( m_vm.count( "object-type" ) != 0 ) documentType = m_vm["object-type"].as( ); libcmis::ObjectTypePtr type = session->getType( documentType ); if ( "cmis:document" != type->getBaseType( )->getId( ) ) throw CommandException( string( "Not a document type: " ) + documentType ); PropertyPtrMap properties; map< string, libcmis::PropertyTypePtr >& propertiesTypes = type->getPropertiesTypes( ); // Set the name map< string, libcmis::PropertyTypePtr >::iterator typeIt = propertiesTypes.find( string( "cmis:name" ) ); if ( typeIt == propertiesTypes.end( ) ) throw CommandException( string( "No cmis:name on the object type... weird" ) ); vector< string > nameValues; nameValues.push_back( args[1] ); libcmis::PropertyPtr nameProperty( new libcmis::Property( typeIt->second, nameValues ) ); properties.insert( pair< string, libcmis::PropertyPtr >( string( "cmis:name" ), nameProperty ) ); // Set the objectTypeId typeIt = propertiesTypes.find( string( "cmis:objectTypeId" ) ); if ( typeIt == propertiesTypes.end( ) ) throw CommandException( string( "No cmis:objectTypeId on the object type... weird" ) ); vector< string > typeIdValues; typeIdValues.push_back( documentType ); libcmis::PropertyPtr typeIdProperty( new libcmis::Property( typeIt->second, typeIdValues ) ); properties.insert( pair< string, libcmis::PropertyPtr >( string( "cmis:objectTypeId" ), typeIdProperty ) ); // Checks for the properties to set if any map< string, string > propsToSet = getObjectProperties( ); for ( map< string, string >::iterator it = propsToSet.begin(); it != propsToSet.end(); ++it ) { // Create the CMIS property if it exists typeIt = propertiesTypes.find( it->first ); if ( typeIt != propertiesTypes.end( ) ) { vector< string > values; values.push_back( it->second ); libcmis::PropertyPtr cmisProperty( new libcmis::Property( typeIt->second, values ) ); properties.insert( pair< string, libcmis::PropertyPtr >( it->first, cmisProperty ) ); } } // Get the content type and stream boost::shared_ptr< ostream > contentStream; string contentType; string filename; bool hasInputFile = m_vm.count( "input-file" ) != 0; bool hasInputType = m_vm.count( "input-type" ) != 0; bool hasInputName = m_vm.count( "input-name" ) != 0; if ( hasInputType && !hasInputFile ) throw CommandException( "Missing --input-file" ); if ( hasInputFile && !hasInputType ) throw CommandException( "Missing --input-type" ); if ( hasInputFile && hasInputType ) { contentType = m_vm["input-type"].as(); string file = m_vm["input-file"].as(); fstream is( file.c_str() ); if ( is.fail( ) ) throw CommandException( string( "Unable to open file " ) + file ); contentStream.reset( new ostringstream( ios_base::out | ios_base::in ) ); *contentStream << is.rdbuf(); } if ( hasInputName ) filename = m_vm[ "input-name" ].as< string >( ); // Actually create the document libcmis::DocumentPtr created = parent->createDocument( properties, contentStream, contentType, filename ); cout << "------------------------------------------------" << endl; cout << created->toString() << endl; delete session; } else if ( "update-object" == command ) { libcmis::Session* session = getSession( ); vector< string > args = m_vm["args"].as< vector< string > >( ); if ( args.size() != 1 ) throw CommandException( "Please provide an object id" ); libcmis::ObjectPtr object = session->getObject( args[0] ); libcmis::ObjectTypePtr type = session->getType( object->getType( ) ); map< string, libcmis::PropertyTypePtr >& propertiesTypes = type->getPropertiesTypes( ); PropertyPtrMap properties; // Checks for the properties to set if any map< string, string > propsToSet = getObjectProperties( ); for ( map< string, string >::iterator it = propsToSet.begin(); it != propsToSet.end(); ++it ) { // Create the CMIS property if it exists map< string, libcmis::PropertyTypePtr >::iterator typeIt = propertiesTypes.find( it->first ); if ( typeIt != propertiesTypes.end( ) && typeIt->second->isUpdatable( ) ) { vector< string > values; values.push_back( it->second ); libcmis::PropertyPtr property( new libcmis::Property( typeIt->second, values ) ); properties[ it->first ] = property; } } libcmis::ObjectPtr updated = object->updateProperties( properties ); cout << "------------------------------------------------" << endl; // Output updated instead of object as it may be different depending on the server cout << updated->toString() << endl; delete session; } else if ( "move-object" == command ) { libcmis::Session* session = getSession( ); vector< string > args = m_vm["args"].as< vector< string > > ( ); if ( args.size() != 3 ) throw CommandException( "Please provide an object id and source and destination folder ids" ); string& objId = args[0]; string& srcId = args[1]; string& dstId = args[2]; try { libcmis::ObjectPtr obj = session->getObject( objId ); libcmis::ObjectPtr src = session->getObject( srcId ); libcmis::FolderPtr srcFolder = boost::dynamic_pointer_cast< libcmis::Folder > ( src ); if ( !srcFolder ) throw CommandException( "Source object is not a folder" ); libcmis::ObjectPtr dst = session->getObject( dstId ); libcmis::FolderPtr dstFolder = boost::dynamic_pointer_cast< libcmis::Folder > ( dst ); if ( !dstFolder ) throw CommandException( "Destinaton object is not a folder" ); obj->move( srcFolder, dstFolder ); cout << "------------------------------------------------" << endl; cout << obj->toString( ) << endl; } catch ( const std::exception& e ) { delete session; throw; } delete session; } else if ( "delete" == command ) { libcmis::Session* session = getSession( ); // Get the ids of the objects to fetch if ( m_vm.count( "args" ) == 0 ) throw CommandException( "Please provide the node ids to delete as command args" ); vector< string > objIds = m_vm["args"].as< vector< string > >( ); vector< string > errors; for ( vector< string >::iterator it = objIds.begin(); it != objIds.end(); ++it ) { libcmis::ObjectPtr cmisObj = session->getObject( *it ); libcmis::Folder* folder = dynamic_cast< libcmis::Folder* >( cmisObj.get() ); if ( NULL != folder ) { try { vector< string > failed = folder->removeTree( ); string error; for ( vector< string >::iterator dumpIt = failed.begin( ); dumpIt != failed.end( ); ++dumpIt ) { if ( dumpIt == failed.begin( ) ) error += "Failed to remove children nodes: "; else error += ", "; error = *dumpIt; } if ( !error.empty( ) ) errors.push_back( error ); } catch ( const libcmis::Exception& e ) { string msg = *it + ": " + e.what( ); errors.push_back( msg ); } } else if ( cmisObj.get() ) { try { cmisObj->remove( ); } catch ( const libcmis::Exception& e ) { string msg = *it + ": " + e.what( ); errors.push_back( msg ); } } else { string msg = "No such node: " + *it; errors.push_back( msg ); } } // Show the errors if ( !errors.empty( ) ) { cout << "Errors:" << endl; for ( vector< string >::iterator it = errors.begin( ); it != errors.end( ); ++it ) { cout << "\t" << *it << endl; } } else { cout << "All nodes have been removed" << endl; } delete session; } else if ( "checkout" == command ) { libcmis::Session* session = getSession( ); // Get the ids of the objects to fetch if ( m_vm.count( "args" ) == 0 ) throw CommandException( "Please provide the node id to checkout as command args" ); vector< string > objIds = m_vm["args"].as< vector< string > >( ); libcmis::ObjectPtr cmisObj = session->getObject( objIds.front() ); if ( cmisObj.get() ) { libcmis::Document* doc = dynamic_cast< libcmis::Document* >( cmisObj.get() ); if ( NULL != doc ) { libcmis::DocumentPtr pwc = doc->checkOut( ); if ( pwc.get( ) ) { cout << "------------------------------------------------" << endl; cout << pwc->toString() << endl; } else cout << "No Private Working Copy returned?" << endl; } else throw CommandException( string( "Not a document object id: " ) + objIds.front() ); } else cout << "No such node: " << objIds.front() << endl; delete session; } else if ( "cancel-checkout" == command ) { libcmis::Session* session = getSession( ); // Get the ids of the objects to fetch if ( m_vm.count( "args" ) == 0 ) throw CommandException( "Please provide the private working copy object id to cancel as command args" ); vector< string > objIds = m_vm["args"].as< vector< string > >( ); libcmis::ObjectPtr cmisObj = session->getObject( objIds.front() ); cout << "------------------------------------------------" << endl; if ( cmisObj.get() ) { libcmis::Document* doc = dynamic_cast< libcmis::Document* >( cmisObj.get() ); if ( NULL != doc ) { doc->cancelCheckout( ); cout << "Checkout cancelled" << endl; } else throw CommandException( string( "Not a document object id: " ) + objIds.front() ); } else cout << "No such node: " << objIds.front() << endl; delete session; } else if ( "checkin" == command ) { libcmis::Session* session = getSession( ); // Get the ids of the objects to fetch if ( m_vm.count( "args" ) == 0 ) throw CommandException( "Please provide the node id to checkin as command args" ); vector< string > objIds = m_vm["args"].as< vector< string > >( ); libcmis::ObjectPtr object = session->getObject( objIds.front() ); if ( object.get() ) { // Create the properties map PropertyPtrMap properties; map< string, string > propsToSet = getObjectProperties( ); libcmis::ObjectTypePtr type = session->getType( object->getType( ) ); map< string, libcmis::PropertyTypePtr > propertyTypes = type->getPropertiesTypes( ); for ( map< string, string >::iterator propIt = propsToSet.begin(); propIt != propsToSet.end(); ++propIt ) { string name = propIt->first; map< string, libcmis::PropertyTypePtr >::iterator typeIt = propertyTypes.find( name ); if ( typeIt != propertyTypes.end( ) ) { vector< string > values; values.push_back( propIt->second ); libcmis::PropertyPtr prop( new libcmis::Property( typeIt->second, values ) ); properties.insert( pair< string, libcmis::PropertyPtr >( name, prop ) ); } } // Get the content stream if any string contentType; string filename; boost::shared_ptr< ostream > stream; if ( m_vm.count( "input-file" ) > 0 ) { string file = m_vm["input-file"].as(); ifstream is( file.c_str(), ios_base::in ); stringstream os; os << is.rdbuf( ); if ( is.fail( ) ) throw CommandException( string( "Unable to open file " ) + file ); string content = os.str( ); stream.reset( new stringstream( content ) ); is.close( ); if ( m_vm.count( "input-type" ) > 0 ) { contentType = m_vm["input-type"].as(); } if ( m_vm.count( "input-name" ) > 0 ) { filename = m_vm["input-name"].as(); } } bool major = false; if ( m_vm.count( "major" ) > 0 ) major = "yes"; string comment; if ( m_vm.count( "message" ) > 0 ) comment = m_vm["message"].as< string >( ); libcmis::Document* doc = dynamic_cast< libcmis::Document* >( object.get() ); if ( NULL != doc ) { libcmis::DocumentPtr newDoc = doc->checkIn( major, comment, properties, stream, contentType, filename ); cout << "------------------------------------------------" << endl; cout << newDoc->toString() << endl; } else throw CommandException( string( "Not a document object id: " ) + objIds.front() ); } else cout << "No such node: " << objIds.front() << endl; delete session; } else if ( "get-versions" == command ) { libcmis::Session* session = getSession( ); // Get the ids of the objects to fetch if ( m_vm.count( "args" ) == 0 ) throw CommandException( "Please provide the node id to get versions from as command args" ); vector< string > objIds = m_vm["args"].as< vector< string > >( ); libcmis::ObjectPtr object = session->getObject( objIds.front() ); if ( object.get() ) { libcmis::Document* doc = dynamic_cast< libcmis::Document* >( object.get() ); if ( NULL != doc ) { vector< libcmis::DocumentPtr > versions = doc->getAllVersions( ); for ( vector< libcmis::DocumentPtr >::iterator it = versions.begin( ); it != versions.end( ); ++it ) { cout << "------------------------------------------------" << endl; cout << ( *it )->toString() << endl; } } else throw CommandException( string( "Not a document object id: " ) + objIds.front() ); } else cout << "No such node: " << objIds.front() << endl; delete session; } else if ( "help" == command ) { printHelp(); } else { cerr << "------------------------------------------------" << endl; cerr << "ERROR: Unknown command: " << command << endl; cerr << "------------------------------------------------" << endl; printHelp( ); } // TODO Add some more useful commands here } } options_description CmisClient::getOptionsDescription( ) { options_description desc( "Allowed options" ); desc.add_options( ) ( "help", "Produce help message and exists" ) ( "verbose,v", "Show loads of useful messages for debugging" ) ( "url", value< string >(), "URL of the binding of the server" ) ( "repository,r", value< string >(), "Name of the repository to use" ) ( "username,u", value< string >(), "Username used to authenticate to the repository" ) ( "password,p", value< string >(), "Password used to authenticate to the repository" ) ( "no-ssl-check", "Disable the verification of SSL certificates. This may come handy" "for self-signed certificates for example, though it lowers the security" ) ( "proxy", value< string >(), "HTTP proxy url to override the system settings" ) ( "noproxy", value< string >(), "Coma separated list if host and domain names not going" "through the proxy" ) ( "proxy-username", value< string >(), "Username to authenticate on the proxy" ) ( "proxy-password", value< string >(), "Password to authenticate on the proxy" ) ( "oauth2-client-id", value< string >(), "OAuth2 application client_id" ) ( "oauth2-client-secret", value< string >(), "OAuth2 application client_secret" ) ( "oauth2-auth-url", value< string >(), "URL to authenticate in the OAuth2 flow" ) ( "oauth2-token-url", value< string >(), "URL to convert code to tokens in the OAuth2 flow" ) ( "oauth2-redirect-uri", value< string >(), "redirect URI indicating that the authentication is finished in OAuth2 flow" ) ( "oauth2-scope", value< string >(), "The authentication scope in OAuth2" ) ; options_description setcontentOpts( "modification operations options" ); setcontentOpts.add_options( ) ( "input-file", value< string >(), "File to push to the repository" ) ( "input-type", value< string >(), "Mime type of the file to push to the repository" ) ( "input-name", value< string >(), "Name of the file to push to the repository" "(may be different from the local name)" ) ( "object-type", value< string >(), "CMIS type of the object to create" ) ( "object-property", value< vector< string > >(), "under the form prop-id=prop-value, defines a property" "to be set on the object" ) ( "message,m", value< string >(), "Check in message" ) ( "major", "The version to create during the check in will be a major version." ) ( "stream-id", value< string >(), "streamId of the rendition to get content." ) ; desc.add( setcontentOpts ); return desc; } void CmisClient::printHelp( ) { cerr << "cmis-client [options] [command] arguments" << endl; cerr << endl << "Commands" << endl; cerr << " list-repos\n" " Lists the repositories available on the server" << endl; cerr << " repo-infos\n" " Show the informations and capabilities of the selected repository" << endl; cerr << " show-root\n" " Dump the root node of the repository." << endl; cerr << " type-by-id [... ]\n" " Dumps the type informations for all the ids." << endl; cerr << " show-by-id [... ]\n" " Dumps the objects informations for all the ids." << endl; cerr << " show-by-path [... ]\n" " Dumps the objects informations for all the paths." << endl; cerr << " get-content \n" " Saves the stream of the content object in the\n" " current folder. Any existing file is overwritten.\n" " streamId can be used to get the desired rendition with --stream-id"<< endl; cerr << " set-content \n" " Replaces the stream of the content object by the\n" " file selected with --input-file." << endl; cerr << " create-folder \n" " Creates a new folder inside the folder named ." << endl; cerr << " create-document \n" " Creates a new document inside the folder \n" " named .\n" " Note that --input-file and --input-type may be requested if\n" " the server requires a content stream." << endl; cerr << " update-object \n" " Update the object matching id with the properties\n" " defined with --object-property." << endl; cerr << " move-object \n" " Move the object matching id from the\n" " folder to the folder ." << endl; cerr << " delete [... ]\n" " Delete the objects corresponding to the ids. If the node\n" " is a folder, its content will be removed as well." << endl; cerr << " checkout \n" " Check out the document corresponding to the id and shows the\n" " Private Working Copy document infos." << endl; cerr << " cancel-checkout \n" " Cancel the Private Working Copy corresponding to the id" << endl; cerr << " checkin \n" " Check in the Private Working copy corresponding to the id.\n" " Use the --message and --major parameters to give more\n" " details about the new version.\n" " The modification options may be needed to set the new\n" " version properties and content stream if the repository\n" " doesn't allow to change the private working copies." << endl; cerr << " get-versions \n" " Show all the versions of a document." << endl; cerr << " help\n" " Prints this help message and exits (like --help option)." << endl; cerr << endl << getOptionsDescription() << endl; } int main ( int argc, char* argv[] ) { options_description hidden( "Hidden options" ); hidden.add_options( ) ( "command", value< string >(), "Command" ) ( "args", value< vector< string > >(), "Arguments for the command" ) ; options_description allOptions = CmisClient::getOptionsDescription( ); allOptions.add( hidden ); positional_options_description pd; pd.add( "command", 1 ); pd.add( "args", -1 ); variables_map vm; store( command_line_parser( argc, argv ).options( allOptions ).positional( pd ).run( ), vm ); notify( vm ); CmisClient client( vm ); try { client.execute( ); } catch ( const CommandException& e ) { cerr << "------------------------------------------------" << endl; cerr << "ERROR: " << e.what() << endl; cerr << "------------------------------------------------" << endl; client.printHelp(); return 1; } catch ( const libcmis::Exception& e ) { cerr << "------------------------------------------------" << endl; cerr << "ERROR: " << e.what() << endl; cerr << "------------------------------------------------" << endl; return 1; } catch ( const exception& e ) { cerr << "------------------------------------------------" << endl; cerr << "ERROR: " << e.what() << endl; cerr << "------------------------------------------------" << endl; return 1; } return 0; } libcmis-0.4.1/src/libcmis-c/0000755000175000001440000000000012200457455012570 500000000000000libcmis-0.4.1/src/libcmis-c/allowable-actions.h0000644000175000001440000000306412013417765016266 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2011 SUSE * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #ifndef _LIBCMIS_ALLOWABLE_ACTIONS_H_ #define _LIBCMIS_ALLOWABLE_ACTIONS_H_ #ifdef __cplusplus extern "C" { #endif #include "types.h" void libcmis_allowable_actions_free( libcmis_AllowableActionsPtr allowable ); bool libcmis_allowable_actions_isAllowed( libcmis_AllowableActionsPtr allowable, libcmis_allowable_actions_Type action ); bool libcmis_allowable_actions_isDefined( libcmis_AllowableActionsPtr allowable, libcmis_allowable_actions_Type action ); #ifdef __cplusplus } #endif #endif libcmis-0.4.1/src/libcmis-c/error.h0000644000175000001440000000264112131003111013770 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2011 SUSE * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #ifndef _LIBCMIS_ERROR_H_ #define _LIBCMIS_ERROR_H_ #ifdef __cplusplus extern "C" { #endif #include "types.h" libcmis_ErrorPtr libcmis_error_create( ); void libcmis_error_free( libcmis_ErrorPtr e ); const char* libcmis_error_getMessage( libcmis_ErrorPtr e ); const char* libcmis_error_getType( libcmis_ErrorPtr e ); #ifdef __cplusplus } #endif #endif libcmis-0.4.1/src/libcmis-c/object-type.cxx0000644000175000001440000002432012156277657015500 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2011 SUSE * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #include "internals.hxx" #include "object-type.h" using namespace std; void libcmis_vector_object_type_free( libcmis_vector_object_type_Ptr vector ) { delete vector; } size_t libcmis_vector_object_type_size( libcmis_vector_object_type_Ptr vector ) { size_t size = 0; if ( vector != NULL ) size = vector->handle.size( ); return size; } libcmis_ObjectTypePtr libcmis_vector_object_type_get( libcmis_vector_object_type_Ptr vector, size_t i ) { libcmis_ObjectTypePtr item = NULL; if ( vector != NULL && i < vector->handle.size( ) ) { libcmis::ObjectTypePtr type = vector->handle[i]; item = new ( nothrow ) libcmis_object_type( ); if ( item ) item->handle = type; } return item; } void libcmis_object_type_free( libcmis_ObjectTypePtr type ) { delete type; } char* libcmis_object_type_getId( libcmis_ObjectTypePtr type ) { if ( type != NULL && type->handle.get( ) != NULL ) return strdup( type->handle->getId( ).c_str( ) ); else return NULL; } char* libcmis_object_type_getLocalName( libcmis_ObjectTypePtr type ) { if ( type != NULL && type->handle.get( ) != NULL ) return strdup( type->handle->getLocalName( ).c_str( ) ); else return NULL; } char* libcmis_object_type_getLocalNamespace( libcmis_ObjectTypePtr type ) { if ( type != NULL && type->handle.get( ) != NULL ) return strdup( type->handle->getLocalNamespace( ).c_str( ) ); else return NULL; } char* libcmis_object_type_getQueryName( libcmis_ObjectTypePtr type ) { if ( type != NULL && type->handle.get( ) != NULL ) return strdup( type->handle->getQueryName( ).c_str( ) ); else return NULL; } char* libcmis_object_type_getDisplayName( libcmis_ObjectTypePtr type ) { if ( type != NULL && type->handle.get( ) != NULL ) return strdup( type->handle->getDisplayName( ).c_str( ) ); else return NULL; } char* libcmis_object_type_getDescription( libcmis_ObjectTypePtr type ) { if ( type != NULL && type->handle.get( ) != NULL ) return strdup( type->handle->getDescription( ).c_str( ) ); else return NULL; } libcmis_ObjectTypePtr libcmis_object_type_getParentType( libcmis_ObjectTypePtr type, libcmis_ErrorPtr error ) { libcmis_ObjectTypePtr result = NULL; if ( type != NULL && type->handle.get( ) != NULL ) { try { libcmis::ObjectTypePtr handle = type->handle->getParentType( ); if ( handle.get ( ) ) { result = new libcmis_object_type( ); result->handle = handle; } } catch( const libcmis::Exception& e ) { if ( error != NULL ) { error->message = strdup( e.what() ); error->type = strdup( e.getType().c_str() ); } } catch ( const bad_alloc& e ) { if ( error != NULL ) { error->message = strdup( e.what() ); error->badAlloc = true; } } } return result; } libcmis_ObjectTypePtr libcmis_object_type_getBaseType( libcmis_ObjectTypePtr type, libcmis_ErrorPtr error ) { libcmis_ObjectTypePtr result = NULL; if ( type != NULL && type->handle.get( ) != NULL ) { try { libcmis::ObjectTypePtr handle = type->handle->getBaseType( ); result = new libcmis_object_type( ); result->handle = handle; } catch( const libcmis::Exception& e ) { if ( error != NULL ) { error->message = strdup( e.what() ); error->type = strdup( e.getType().c_str() ); } } catch ( const bad_alloc& e ) { if ( error != NULL ) { error->message = strdup( e.what() ); error->badAlloc = true; } } } return result; } char* libcmis_object_type_getParentTypeId( libcmis_ObjectTypePtr type ) { char* result = NULL; if ( type != NULL && type->handle.get( ) != NULL ) { result = strdup( type->handle->getParentTypeId( ).c_str() ); } return result; } char* libcmis_object_type_getBaseTypeId( libcmis_ObjectTypePtr type ) { char* result = NULL; if ( type != NULL && type->handle.get( ) != NULL ) { result = strdup( type->handle->getBaseTypeId( ).c_str() ); } return result; } libcmis_vector_object_type_Ptr libcmis_object_type_getChildren( libcmis_ObjectTypePtr type, libcmis_ErrorPtr error ) { libcmis_vector_object_type_Ptr children = NULL; if ( type != NULL && type->handle.get( ) != NULL ) { try { std::vector< libcmis::ObjectTypePtr > types = type->handle->getChildren( ); children = new libcmis_vector_object_type( ); children->handle = types; } catch( const libcmis::Exception& e ) { if ( error != NULL ) { error->message = strdup( e.what() ); error->type = strdup( e.getType().c_str() ); } } catch ( const bad_alloc& e ) { if ( error != NULL ) { error->message = strdup( e.what() ); error->badAlloc = true; } } } return children; } bool libcmis_object_type_isCreatable( libcmis_ObjectTypePtr type ) { bool value = false; if ( type != NULL && type->handle.get( ) != NULL ) value = type->handle->isCreatable( ); return value; } bool libcmis_object_type_isFileable( libcmis_ObjectTypePtr type ) { bool value = false; if ( type != NULL && type->handle.get( ) != NULL ) value = type->handle->isFileable( ); return value; } bool libcmis_object_type_isQueryable( libcmis_ObjectTypePtr type ) { bool value = false; if ( type != NULL && type->handle.get( ) != NULL ) value = type->handle->isQueryable( ); return value; } bool libcmis_object_type_isFulltextIndexed( libcmis_ObjectTypePtr type ) { bool value = false; if ( type != NULL && type->handle.get( ) != NULL ) value = type->handle->isFulltextIndexed( ); return value; } bool libcmis_object_type_isIncludedInSupertypeQuery( libcmis_ObjectTypePtr type ) { bool value = false; if ( type != NULL && type->handle.get( ) != NULL ) value = type->handle->isIncludedInSupertypeQuery( ); return value; } bool libcmis_object_type_isControllablePolicy( libcmis_ObjectTypePtr type ) { bool value = false; if ( type != NULL && type->handle.get( ) != NULL ) value = type->handle->isControllablePolicy( ); return value; } bool libcmis_object_type_isControllableACL( libcmis_ObjectTypePtr type ) { bool value = false; if ( type != NULL && type->handle.get( ) != NULL ) value = type->handle->isControllableACL( ); return value; } bool libcmis_object_type_isVersionable( libcmis_ObjectTypePtr type ) { bool value = false; if ( type != NULL && type->handle.get( ) != NULL ) value = type->handle->isVersionable( ); return value; } libcmis_object_type_ContentStreamAllowed libcmis_object_type_getContentStreamAllowed( libcmis_ObjectTypePtr type ) { libcmis_object_type_ContentStreamAllowed result = libcmis_NotAllowed; if ( type != NULL && type->handle.get( ) != NULL ) { libcmis::ObjectType::ContentStreamAllowed value = type->handle->getContentStreamAllowed( ); result = libcmis_object_type_ContentStreamAllowed( value ); } return result; } libcmis_vector_property_type_Ptr libcmis_object_type_getPropertiesTypes( libcmis_ObjectTypePtr type ) { libcmis_vector_property_type_Ptr propertyTypes = NULL; if ( type != NULL && type->handle != NULL ) { map< string, libcmis::PropertyTypePtr >& handles = type->handle->getPropertiesTypes( ); propertyTypes = new ( nothrow ) libcmis_vector_property_type( ); if ( propertyTypes ) { int i = 0; for ( map< string, libcmis::PropertyTypePtr >::iterator it = handles.begin( ); it != handles.end( ); ++it, ++i ) { propertyTypes->handle.push_back( it->second ); } } } return propertyTypes; } libcmis_PropertyTypePtr libcmis_object_type_getPropertyType( libcmis_ObjectTypePtr type, const char* id ) { libcmis_PropertyTypePtr propertyType = NULL; if ( type != NULL && type->handle != NULL ) { map< string, libcmis::PropertyTypePtr >& handles = type->handle->getPropertiesTypes( ); map< string, libcmis::PropertyTypePtr >::iterator it = handles.find( string( id ) ); if ( it != handles.end( ) ) { propertyType = new ( nothrow ) libcmis_property_type( ); if ( propertyType ) propertyType->handle = it->second; } } return propertyType; } char* libcmis_object_type_toString( libcmis_ObjectTypePtr type ) { if ( type != NULL && type->handle.get( ) != NULL ) return strdup( type->handle->toString( ).c_str( ) ); else return NULL; } libcmis-0.4.1/src/libcmis-c/session-factory.cxx0000644000175000001440000001620712176734543016402 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2011 SUSE * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #include #include #include #include #include "internals.hxx" #include "session.h" #include "session-factory.h" #include "vectors.h" using namespace std; namespace { size_t const CRED_MAX_LEN = 1024; class WrapperAuthProvider : public libcmis::AuthProvider { private: libcmis_authenticationCallback m_callback; public: WrapperAuthProvider( libcmis_authenticationCallback callback ) : m_callback( callback ) { } virtual ~WrapperAuthProvider( ) { }; virtual bool authenticationQuery( string& username, string& password ); }; bool WrapperAuthProvider::authenticationQuery( string& username, string& password ) { /* NOTE: As I understand this, the callback is responsible for * filling the correct username and password (possibly using * the passed values as defaults in some dialog or so). But then * there is no guarantee that the new username/password will * not be longer than the present one, in which case it will * not fit into the available space! For now, use a buffer size * big enough for practical purposes. * * It might be a better idea to change the callback's signature * to bool ( * )( char** username, char** password ) * and make it the callee's responsibility to reallocate the * strings if it needs to. */ char user[CRED_MAX_LEN]; strncpy(user, username.c_str( ), sizeof( user ) ); user[min( username.size( ), CRED_MAX_LEN )] = '\0'; char pass[CRED_MAX_LEN]; strncpy(pass, password.c_str( ), sizeof( pass ) ); pass[min( password.size( ), CRED_MAX_LEN )] = '\0'; bool result = m_callback( user, pass ); // Update the username and password with the input string newUser( user ); username.swap( newUser ); string newPass( pass ); password.swap( newPass ); return result; } class WrapperCertHandler : public libcmis::CertValidationHandler { private: libcmis_certValidationCallback m_callback; public: WrapperCertHandler( libcmis_certValidationCallback callback ) : m_callback( callback ) { } virtual ~WrapperCertHandler( ) { }; virtual bool validateCertificate( vector< string > certificatesChain ); }; bool WrapperCertHandler::validateCertificate( vector< string > certificatesChain ) { libcmis_vector_string_Ptr chain = new ( nothrow ) libcmis_vector_string( ); if ( chain ) chain->handle = certificatesChain; bool result = m_callback( chain ); libcmis_vector_string_free( chain ); return result; } } std::string createString( char* str ) { if ( str ) return string( str ); else return string( ); } void libcmis_setAuthenticationCallback( libcmis_authenticationCallback callback ) { libcmis::AuthProviderPtr provider( new ( nothrow ) WrapperAuthProvider( callback ) ); if ( provider ) libcmis::SessionFactory::setAuthenticationProvider( provider ); } void libcmis_setCertValidationCallback( libcmis_certValidationCallback callback ) { libcmis::CertValidationHandlerPtr handler( new ( nothrow )WrapperCertHandler( callback ) ); if ( handler ) libcmis::SessionFactory::setCertificateValidationHandler( handler ); } void libcmis_setOAuth2AuthCodeProvider( libcmis_oauth2AuthCodeProvider callback ) { libcmis::SessionFactory::setOAuth2AuthCodeProvider( callback ); } libcmis_oauth2AuthCodeProvider libcmis_getOAuth2AuthCodeProvider( ) { return libcmis::SessionFactory::getOAuth2AuthCodeProvider( ); } void libcmis_setProxySettings( char* proxy, char* noProxy, char* proxyUser, char* proxyPass ) { libcmis::SessionFactory::setProxySettings( string( proxy ), string( noProxy ), string( proxyUser ), string( proxyPass ) ); } const char* libcmis_getProxy( ) { return libcmis::SessionFactory::getProxy( ).c_str(); } const char* libcmis_getNoProxy( ) { return libcmis::SessionFactory::getNoProxy( ).c_str(); } const char* libcmis_getProxyUser( ) { return libcmis::SessionFactory::getProxyUser( ).c_str(); } const char* libcmis_getProxyPass( ) { return libcmis::SessionFactory::getProxyPass( ).c_str(); } libcmis_SessionPtr libcmis_createSession( char* bindingUrl, char* repositoryId, char* username, char* password, bool noSslCheck, libcmis_OAuth2DataPtr oauth2, bool verbose, libcmis_ErrorPtr error ) { libcmis_SessionPtr session = NULL; try { libcmis::OAuth2DataPtr oauth2Handle; if ( oauth2 != NULL ) oauth2Handle = oauth2->handle; libcmis::Session* handle = libcmis::SessionFactory::createSession( createString( bindingUrl ), createString( username ), createString( password ), createString( repositoryId ), noSslCheck, oauth2Handle, verbose ); session = new libcmis_session( ); session->handle = handle; } catch ( const libcmis::Exception& e ) { if ( error != NULL ) { error->message = strdup( e.what() ); error->type = strdup( e.getType().c_str() ); } } catch ( const bad_alloc& e ) { if ( error != NULL ) { error->message = strdup( e.what() ); error->badAlloc = true; } } return session; } libcmis_vector_Repository_Ptr libcmis_getRepositories( char* bindingUrl, char* username, char* password, bool verbose, libcmis_ErrorPtr error ) { libcmis_SessionPtr session = libcmis_createSession( bindingUrl, NULL, username, password, false, NULL, verbose, error ); libcmis_vector_Repository_Ptr repositories = libcmis_session_getRepositories( session ); libcmis_session_free( session ); return repositories; } libcmis-0.4.1/src/libcmis-c/property.h0000644000175000001440000000471312013426420014540 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2011 SUSE * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #ifndef _LIBCMIS_PROPERTY_HXX_ #define _LIBCMIS_PROPERTY_HXX_ #ifdef __cplusplus extern "C" { #endif #include "types.h" libcmis_vector_property_Ptr libcmis_vector_property_create( ); void libcmis_vector_property_free( libcmis_vector_property_Ptr vector ); size_t libcmis_vector_property_size( libcmis_vector_property_Ptr vector ); libcmis_PropertyPtr libcmis_vector_property_get( libcmis_vector_property_Ptr vector, size_t i ); /** The item object can be deleted after this call safely. */ void libcmis_vector_property_append( libcmis_vector_property_Ptr vector, libcmis_PropertyPtr item ); libcmis_PropertyPtr libcmis_property_create( libcmis_PropertyTypePtr type, const char** strValues, size_t size ); void libcmis_property_free( libcmis_PropertyPtr property ); libcmis_PropertyTypePtr libcmis_property_getPropertyType( libcmis_PropertyPtr property ); libcmis_vector_time_Ptr libcmis_property_getDateTimes( libcmis_PropertyPtr property ); libcmis_vector_bool_Ptr libcmis_property_getBools( libcmis_PropertyPtr property ); libcmis_vector_string_Ptr libcmis_property_getStrings( libcmis_PropertyPtr property ); libcmis_vector_long_Ptr libcmis_property_getLongs( libcmis_PropertyPtr property ); libcmis_vector_double_Ptr libcmis_property_getDoubles( libcmis_PropertyPtr property ); void libcmis_property_setValues( libcmis_PropertyPtr property, const char** strValues, size_t size ); #ifdef __cplusplus } #endif #endif libcmis-0.4.1/src/libcmis-c/Makefile.in0000644000175000001440000012507312200457433014561 00000000000000# Makefile.in generated by automake 1.13.4 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/libcmis-c DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/depcomp \ $(libcmis_c_@LIBCMIS_API_VERSION@_la_include_HEADERS) ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/boost.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(libdir)" \ "$(DESTDIR)$(libcmis_c_@LIBCMIS_API_VERSION@_la_includedir)" LTLIBRARIES = $(lib_LTLIBRARIES) am__DEPENDENCIES_1 = libcmis_c_@LIBCMIS_API_VERSION@_la_DEPENDENCIES = \ ../libcmis/libcmis-@LIBCMIS_API_VERSION@.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) am_libcmis_c_@LIBCMIS_API_VERSION@_la_OBJECTS = \ libcmis_c_@LIBCMIS_API_VERSION@_la-allowable-actions.lo \ libcmis_c_@LIBCMIS_API_VERSION@_la-document.lo \ libcmis_c_@LIBCMIS_API_VERSION@_la-error.lo \ libcmis_c_@LIBCMIS_API_VERSION@_la-folder.lo \ libcmis_c_@LIBCMIS_API_VERSION@_la-object.lo \ libcmis_c_@LIBCMIS_API_VERSION@_la-object-type.lo \ libcmis_c_@LIBCMIS_API_VERSION@_la-property.lo \ libcmis_c_@LIBCMIS_API_VERSION@_la-property-type.lo \ libcmis_c_@LIBCMIS_API_VERSION@_la-repository.lo \ libcmis_c_@LIBCMIS_API_VERSION@_la-session.lo \ libcmis_c_@LIBCMIS_API_VERSION@_la-session-factory.lo \ libcmis_c_@LIBCMIS_API_VERSION@_la-vectors.lo \ libcmis_c_@LIBCMIS_API_VERSION@_la-oauth2-data.lo \ libcmis_c_@LIBCMIS_API_VERSION@_la-rendition.lo libcmis_c_@LIBCMIS_API_VERSION@_la_OBJECTS = \ $(am_libcmis_c_@LIBCMIS_API_VERSION@_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = libcmis_c_@LIBCMIS_API_VERSION@_la_LINK = $(LIBTOOL) $(AM_V_lt) \ --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link \ $(CXXLD) $(libcmis_c_@LIBCMIS_API_VERSION@_la_CXXFLAGS) \ $(CXXFLAGS) $(libcmis_c_@LIBCMIS_API_VERSION@_la_LDFLAGS) \ $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CXXFLAGS) $(CXXFLAGS) AM_V_CXX = $(am__v_CXX_@AM_V@) am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) am__v_CXX_0 = @echo " CXX " $@; am__v_CXX_1 = CXXLD = $(CXX) CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) am__v_CXXLD_0 = @echo " CXXLD " $@; am__v_CXXLD_1 = COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libcmis_c_@LIBCMIS_API_VERSION@_la_SOURCES) DIST_SOURCES = $(libcmis_c_@LIBCMIS_API_VERSION@_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac HEADERS = $(libcmis_c_@LIBCMIS_API_VERSION@_la_include_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BOOST_CPPFLAGS = @BOOST_CPPFLAGS@ BOOST_DATE_TIME_LDFLAGS = @BOOST_DATE_TIME_LDFLAGS@ BOOST_DATE_TIME_LIBS = @BOOST_DATE_TIME_LIBS@ BOOST_PROGRAM_OPTIONS_LDFLAGS = @BOOST_PROGRAM_OPTIONS_LDFLAGS@ BOOST_PROGRAM_OPTIONS_LIBS = @BOOST_PROGRAM_OPTIONS_LIBS@ BOOST_ROOT = @BOOST_ROOT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPCHECK = @CPPCHECK@ CPPFLAGS = @CPPFLAGS@ CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ CPPUNIT_LIBS = @CPPUNIT_LIBS@ CURL_CFLAGS = @CURL_CFLAGS@ CURL_LIBS = @CURL_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISTCHECK_CONFIGURE_FLAGS = @DISTCHECK_CONFIGURE_FLAGS@ DLLTOOL = @DLLTOOL@ DOCBOOK2MAN = @DOCBOOK2MAN@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBCMIS_API_VERSION = @LIBCMIS_API_VERSION@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SRCDIR = @SRCDIR@ STRIP = @STRIP@ VERSION = @VERSION@ XML2_CFLAGS = @XML2_CFLAGS@ XML2_LIBS = @XML2_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ libcmis_c_@LIBCMIS_API_VERSION@_la_CXXFLAGS = -I$(top_srcdir)/src/ $(XML2_CFLAGS) $(BOOST_CPPFLAGS) libcmis_c_@LIBCMIS_API_VERSION@_la_include_HEADERS = \ allowable-actions.h \ document.h \ error.h \ folder.h \ object.h \ object-type.h \ property.h \ property-type.h \ oauth2-data.h \ rendition.h \ repository.h \ types.h \ session.h \ session-factory.h \ vectors.h \ libcmis-c.h lib_LTLIBRARIES = libcmis-c-@LIBCMIS_API_VERSION@.la libcmis_c_@LIBCMIS_API_VERSION@_la_SOURCES = \ allowable-actions.cxx \ document.cxx \ error.cxx \ folder.cxx \ internals.hxx \ object.cxx \ object-type.cxx \ property.cxx \ property-type.cxx \ repository.cxx \ session.cxx \ session-factory.cxx \ vectors.cxx \ oauth2-data.cxx \ rendition.cxx libcmis_c_@LIBCMIS_API_VERSION@_la_LDFLAGS = -export-dynamic -no-undefined -version-info 4:1:0 libcmis_c_@LIBCMIS_API_VERSION@_la_LIBADD = \ ../libcmis/libcmis-@LIBCMIS_API_VERSION@.la \ $(XML2_LIBS) \ $(CURL_LIBS) \ $(BOOST_SMART_PTR_LIBS) \ $(BOOST_DATE_TIME_LIBS) libcmis_c_@LIBCMIS_API_VERSION@_la_includedir = $(includedir)/libcmis-c-@LIBCMIS_API_VERSION@/libcmis-c all: all-am .SUFFIXES: .SUFFIXES: .cxx .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/libcmis-c/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign src/libcmis-c/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libcmis-c-@LIBCMIS_API_VERSION@.la: $(libcmis_c_@LIBCMIS_API_VERSION@_la_OBJECTS) $(libcmis_c_@LIBCMIS_API_VERSION@_la_DEPENDENCIES) $(EXTRA_libcmis_c_@LIBCMIS_API_VERSION@_la_DEPENDENCIES) $(AM_V_CXXLD)$(libcmis_c_@LIBCMIS_API_VERSION@_la_LINK) -rpath $(libdir) $(libcmis_c_@LIBCMIS_API_VERSION@_la_OBJECTS) $(libcmis_c_@LIBCMIS_API_VERSION@_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcmis_c_@LIBCMIS_API_VERSION@_la-allowable-actions.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcmis_c_@LIBCMIS_API_VERSION@_la-document.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcmis_c_@LIBCMIS_API_VERSION@_la-error.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcmis_c_@LIBCMIS_API_VERSION@_la-folder.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcmis_c_@LIBCMIS_API_VERSION@_la-oauth2-data.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcmis_c_@LIBCMIS_API_VERSION@_la-object-type.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcmis_c_@LIBCMIS_API_VERSION@_la-object.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcmis_c_@LIBCMIS_API_VERSION@_la-property-type.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcmis_c_@LIBCMIS_API_VERSION@_la-property.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcmis_c_@LIBCMIS_API_VERSION@_la-rendition.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcmis_c_@LIBCMIS_API_VERSION@_la-repository.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcmis_c_@LIBCMIS_API_VERSION@_la-session-factory.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcmis_c_@LIBCMIS_API_VERSION@_la-session.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcmis_c_@LIBCMIS_API_VERSION@_la-vectors.Plo@am__quote@ .cxx.o: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< .cxx.obj: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cxx.lo: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $< libcmis_c_@LIBCMIS_API_VERSION@_la-allowable-actions.lo: allowable-actions.cxx @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcmis_c_@LIBCMIS_API_VERSION@_la_CXXFLAGS) $(CXXFLAGS) -MT libcmis_c_@LIBCMIS_API_VERSION@_la-allowable-actions.lo -MD -MP -MF $(DEPDIR)/libcmis_c_@LIBCMIS_API_VERSION@_la-allowable-actions.Tpo -c -o libcmis_c_@LIBCMIS_API_VERSION@_la-allowable-actions.lo `test -f 'allowable-actions.cxx' || echo '$(srcdir)/'`allowable-actions.cxx @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcmis_c_@LIBCMIS_API_VERSION@_la-allowable-actions.Tpo $(DEPDIR)/libcmis_c_@LIBCMIS_API_VERSION@_la-allowable-actions.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='allowable-actions.cxx' object='libcmis_c_@LIBCMIS_API_VERSION@_la-allowable-actions.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcmis_c_@LIBCMIS_API_VERSION@_la_CXXFLAGS) $(CXXFLAGS) -c -o libcmis_c_@LIBCMIS_API_VERSION@_la-allowable-actions.lo `test -f 'allowable-actions.cxx' || echo '$(srcdir)/'`allowable-actions.cxx libcmis_c_@LIBCMIS_API_VERSION@_la-document.lo: document.cxx @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcmis_c_@LIBCMIS_API_VERSION@_la_CXXFLAGS) $(CXXFLAGS) -MT libcmis_c_@LIBCMIS_API_VERSION@_la-document.lo -MD -MP -MF $(DEPDIR)/libcmis_c_@LIBCMIS_API_VERSION@_la-document.Tpo -c -o libcmis_c_@LIBCMIS_API_VERSION@_la-document.lo `test -f 'document.cxx' || echo '$(srcdir)/'`document.cxx @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcmis_c_@LIBCMIS_API_VERSION@_la-document.Tpo $(DEPDIR)/libcmis_c_@LIBCMIS_API_VERSION@_la-document.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='document.cxx' object='libcmis_c_@LIBCMIS_API_VERSION@_la-document.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcmis_c_@LIBCMIS_API_VERSION@_la_CXXFLAGS) $(CXXFLAGS) -c -o libcmis_c_@LIBCMIS_API_VERSION@_la-document.lo `test -f 'document.cxx' || echo '$(srcdir)/'`document.cxx libcmis_c_@LIBCMIS_API_VERSION@_la-error.lo: error.cxx @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcmis_c_@LIBCMIS_API_VERSION@_la_CXXFLAGS) $(CXXFLAGS) -MT libcmis_c_@LIBCMIS_API_VERSION@_la-error.lo -MD -MP -MF $(DEPDIR)/libcmis_c_@LIBCMIS_API_VERSION@_la-error.Tpo -c -o libcmis_c_@LIBCMIS_API_VERSION@_la-error.lo `test -f 'error.cxx' || echo '$(srcdir)/'`error.cxx @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcmis_c_@LIBCMIS_API_VERSION@_la-error.Tpo $(DEPDIR)/libcmis_c_@LIBCMIS_API_VERSION@_la-error.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='error.cxx' object='libcmis_c_@LIBCMIS_API_VERSION@_la-error.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcmis_c_@LIBCMIS_API_VERSION@_la_CXXFLAGS) $(CXXFLAGS) -c -o libcmis_c_@LIBCMIS_API_VERSION@_la-error.lo `test -f 'error.cxx' || echo '$(srcdir)/'`error.cxx libcmis_c_@LIBCMIS_API_VERSION@_la-folder.lo: folder.cxx @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcmis_c_@LIBCMIS_API_VERSION@_la_CXXFLAGS) $(CXXFLAGS) -MT libcmis_c_@LIBCMIS_API_VERSION@_la-folder.lo -MD -MP -MF $(DEPDIR)/libcmis_c_@LIBCMIS_API_VERSION@_la-folder.Tpo -c -o libcmis_c_@LIBCMIS_API_VERSION@_la-folder.lo `test -f 'folder.cxx' || echo '$(srcdir)/'`folder.cxx @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcmis_c_@LIBCMIS_API_VERSION@_la-folder.Tpo $(DEPDIR)/libcmis_c_@LIBCMIS_API_VERSION@_la-folder.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='folder.cxx' object='libcmis_c_@LIBCMIS_API_VERSION@_la-folder.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcmis_c_@LIBCMIS_API_VERSION@_la_CXXFLAGS) $(CXXFLAGS) -c -o libcmis_c_@LIBCMIS_API_VERSION@_la-folder.lo `test -f 'folder.cxx' || echo '$(srcdir)/'`folder.cxx libcmis_c_@LIBCMIS_API_VERSION@_la-object.lo: object.cxx @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcmis_c_@LIBCMIS_API_VERSION@_la_CXXFLAGS) $(CXXFLAGS) -MT libcmis_c_@LIBCMIS_API_VERSION@_la-object.lo -MD -MP -MF $(DEPDIR)/libcmis_c_@LIBCMIS_API_VERSION@_la-object.Tpo -c -o libcmis_c_@LIBCMIS_API_VERSION@_la-object.lo `test -f 'object.cxx' || echo '$(srcdir)/'`object.cxx @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcmis_c_@LIBCMIS_API_VERSION@_la-object.Tpo $(DEPDIR)/libcmis_c_@LIBCMIS_API_VERSION@_la-object.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='object.cxx' object='libcmis_c_@LIBCMIS_API_VERSION@_la-object.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcmis_c_@LIBCMIS_API_VERSION@_la_CXXFLAGS) $(CXXFLAGS) -c -o libcmis_c_@LIBCMIS_API_VERSION@_la-object.lo `test -f 'object.cxx' || echo '$(srcdir)/'`object.cxx libcmis_c_@LIBCMIS_API_VERSION@_la-object-type.lo: object-type.cxx @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcmis_c_@LIBCMIS_API_VERSION@_la_CXXFLAGS) $(CXXFLAGS) -MT libcmis_c_@LIBCMIS_API_VERSION@_la-object-type.lo -MD -MP -MF $(DEPDIR)/libcmis_c_@LIBCMIS_API_VERSION@_la-object-type.Tpo -c -o libcmis_c_@LIBCMIS_API_VERSION@_la-object-type.lo `test -f 'object-type.cxx' || echo '$(srcdir)/'`object-type.cxx @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcmis_c_@LIBCMIS_API_VERSION@_la-object-type.Tpo $(DEPDIR)/libcmis_c_@LIBCMIS_API_VERSION@_la-object-type.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='object-type.cxx' object='libcmis_c_@LIBCMIS_API_VERSION@_la-object-type.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcmis_c_@LIBCMIS_API_VERSION@_la_CXXFLAGS) $(CXXFLAGS) -c -o libcmis_c_@LIBCMIS_API_VERSION@_la-object-type.lo `test -f 'object-type.cxx' || echo '$(srcdir)/'`object-type.cxx libcmis_c_@LIBCMIS_API_VERSION@_la-property.lo: property.cxx @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcmis_c_@LIBCMIS_API_VERSION@_la_CXXFLAGS) $(CXXFLAGS) -MT libcmis_c_@LIBCMIS_API_VERSION@_la-property.lo -MD -MP -MF $(DEPDIR)/libcmis_c_@LIBCMIS_API_VERSION@_la-property.Tpo -c -o libcmis_c_@LIBCMIS_API_VERSION@_la-property.lo `test -f 'property.cxx' || echo '$(srcdir)/'`property.cxx @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcmis_c_@LIBCMIS_API_VERSION@_la-property.Tpo $(DEPDIR)/libcmis_c_@LIBCMIS_API_VERSION@_la-property.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='property.cxx' object='libcmis_c_@LIBCMIS_API_VERSION@_la-property.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcmis_c_@LIBCMIS_API_VERSION@_la_CXXFLAGS) $(CXXFLAGS) -c -o libcmis_c_@LIBCMIS_API_VERSION@_la-property.lo `test -f 'property.cxx' || echo '$(srcdir)/'`property.cxx libcmis_c_@LIBCMIS_API_VERSION@_la-property-type.lo: property-type.cxx @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcmis_c_@LIBCMIS_API_VERSION@_la_CXXFLAGS) $(CXXFLAGS) -MT libcmis_c_@LIBCMIS_API_VERSION@_la-property-type.lo -MD -MP -MF $(DEPDIR)/libcmis_c_@LIBCMIS_API_VERSION@_la-property-type.Tpo -c -o libcmis_c_@LIBCMIS_API_VERSION@_la-property-type.lo `test -f 'property-type.cxx' || echo '$(srcdir)/'`property-type.cxx @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcmis_c_@LIBCMIS_API_VERSION@_la-property-type.Tpo $(DEPDIR)/libcmis_c_@LIBCMIS_API_VERSION@_la-property-type.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='property-type.cxx' object='libcmis_c_@LIBCMIS_API_VERSION@_la-property-type.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcmis_c_@LIBCMIS_API_VERSION@_la_CXXFLAGS) $(CXXFLAGS) -c -o libcmis_c_@LIBCMIS_API_VERSION@_la-property-type.lo `test -f 'property-type.cxx' || echo '$(srcdir)/'`property-type.cxx libcmis_c_@LIBCMIS_API_VERSION@_la-repository.lo: repository.cxx @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcmis_c_@LIBCMIS_API_VERSION@_la_CXXFLAGS) $(CXXFLAGS) -MT libcmis_c_@LIBCMIS_API_VERSION@_la-repository.lo -MD -MP -MF $(DEPDIR)/libcmis_c_@LIBCMIS_API_VERSION@_la-repository.Tpo -c -o libcmis_c_@LIBCMIS_API_VERSION@_la-repository.lo `test -f 'repository.cxx' || echo '$(srcdir)/'`repository.cxx @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcmis_c_@LIBCMIS_API_VERSION@_la-repository.Tpo $(DEPDIR)/libcmis_c_@LIBCMIS_API_VERSION@_la-repository.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='repository.cxx' object='libcmis_c_@LIBCMIS_API_VERSION@_la-repository.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcmis_c_@LIBCMIS_API_VERSION@_la_CXXFLAGS) $(CXXFLAGS) -c -o libcmis_c_@LIBCMIS_API_VERSION@_la-repository.lo `test -f 'repository.cxx' || echo '$(srcdir)/'`repository.cxx libcmis_c_@LIBCMIS_API_VERSION@_la-session.lo: session.cxx @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcmis_c_@LIBCMIS_API_VERSION@_la_CXXFLAGS) $(CXXFLAGS) -MT libcmis_c_@LIBCMIS_API_VERSION@_la-session.lo -MD -MP -MF $(DEPDIR)/libcmis_c_@LIBCMIS_API_VERSION@_la-session.Tpo -c -o libcmis_c_@LIBCMIS_API_VERSION@_la-session.lo `test -f 'session.cxx' || echo '$(srcdir)/'`session.cxx @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcmis_c_@LIBCMIS_API_VERSION@_la-session.Tpo $(DEPDIR)/libcmis_c_@LIBCMIS_API_VERSION@_la-session.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='session.cxx' object='libcmis_c_@LIBCMIS_API_VERSION@_la-session.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcmis_c_@LIBCMIS_API_VERSION@_la_CXXFLAGS) $(CXXFLAGS) -c -o libcmis_c_@LIBCMIS_API_VERSION@_la-session.lo `test -f 'session.cxx' || echo '$(srcdir)/'`session.cxx libcmis_c_@LIBCMIS_API_VERSION@_la-session-factory.lo: session-factory.cxx @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcmis_c_@LIBCMIS_API_VERSION@_la_CXXFLAGS) $(CXXFLAGS) -MT libcmis_c_@LIBCMIS_API_VERSION@_la-session-factory.lo -MD -MP -MF $(DEPDIR)/libcmis_c_@LIBCMIS_API_VERSION@_la-session-factory.Tpo -c -o libcmis_c_@LIBCMIS_API_VERSION@_la-session-factory.lo `test -f 'session-factory.cxx' || echo '$(srcdir)/'`session-factory.cxx @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcmis_c_@LIBCMIS_API_VERSION@_la-session-factory.Tpo $(DEPDIR)/libcmis_c_@LIBCMIS_API_VERSION@_la-session-factory.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='session-factory.cxx' object='libcmis_c_@LIBCMIS_API_VERSION@_la-session-factory.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcmis_c_@LIBCMIS_API_VERSION@_la_CXXFLAGS) $(CXXFLAGS) -c -o libcmis_c_@LIBCMIS_API_VERSION@_la-session-factory.lo `test -f 'session-factory.cxx' || echo '$(srcdir)/'`session-factory.cxx libcmis_c_@LIBCMIS_API_VERSION@_la-vectors.lo: vectors.cxx @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcmis_c_@LIBCMIS_API_VERSION@_la_CXXFLAGS) $(CXXFLAGS) -MT libcmis_c_@LIBCMIS_API_VERSION@_la-vectors.lo -MD -MP -MF $(DEPDIR)/libcmis_c_@LIBCMIS_API_VERSION@_la-vectors.Tpo -c -o libcmis_c_@LIBCMIS_API_VERSION@_la-vectors.lo `test -f 'vectors.cxx' || echo '$(srcdir)/'`vectors.cxx @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcmis_c_@LIBCMIS_API_VERSION@_la-vectors.Tpo $(DEPDIR)/libcmis_c_@LIBCMIS_API_VERSION@_la-vectors.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='vectors.cxx' object='libcmis_c_@LIBCMIS_API_VERSION@_la-vectors.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcmis_c_@LIBCMIS_API_VERSION@_la_CXXFLAGS) $(CXXFLAGS) -c -o libcmis_c_@LIBCMIS_API_VERSION@_la-vectors.lo `test -f 'vectors.cxx' || echo '$(srcdir)/'`vectors.cxx libcmis_c_@LIBCMIS_API_VERSION@_la-oauth2-data.lo: oauth2-data.cxx @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcmis_c_@LIBCMIS_API_VERSION@_la_CXXFLAGS) $(CXXFLAGS) -MT libcmis_c_@LIBCMIS_API_VERSION@_la-oauth2-data.lo -MD -MP -MF $(DEPDIR)/libcmis_c_@LIBCMIS_API_VERSION@_la-oauth2-data.Tpo -c -o libcmis_c_@LIBCMIS_API_VERSION@_la-oauth2-data.lo `test -f 'oauth2-data.cxx' || echo '$(srcdir)/'`oauth2-data.cxx @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcmis_c_@LIBCMIS_API_VERSION@_la-oauth2-data.Tpo $(DEPDIR)/libcmis_c_@LIBCMIS_API_VERSION@_la-oauth2-data.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='oauth2-data.cxx' object='libcmis_c_@LIBCMIS_API_VERSION@_la-oauth2-data.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcmis_c_@LIBCMIS_API_VERSION@_la_CXXFLAGS) $(CXXFLAGS) -c -o libcmis_c_@LIBCMIS_API_VERSION@_la-oauth2-data.lo `test -f 'oauth2-data.cxx' || echo '$(srcdir)/'`oauth2-data.cxx libcmis_c_@LIBCMIS_API_VERSION@_la-rendition.lo: rendition.cxx @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcmis_c_@LIBCMIS_API_VERSION@_la_CXXFLAGS) $(CXXFLAGS) -MT libcmis_c_@LIBCMIS_API_VERSION@_la-rendition.lo -MD -MP -MF $(DEPDIR)/libcmis_c_@LIBCMIS_API_VERSION@_la-rendition.Tpo -c -o libcmis_c_@LIBCMIS_API_VERSION@_la-rendition.lo `test -f 'rendition.cxx' || echo '$(srcdir)/'`rendition.cxx @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcmis_c_@LIBCMIS_API_VERSION@_la-rendition.Tpo $(DEPDIR)/libcmis_c_@LIBCMIS_API_VERSION@_la-rendition.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='rendition.cxx' object='libcmis_c_@LIBCMIS_API_VERSION@_la-rendition.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcmis_c_@LIBCMIS_API_VERSION@_la_CXXFLAGS) $(CXXFLAGS) -c -o libcmis_c_@LIBCMIS_API_VERSION@_la-rendition.lo `test -f 'rendition.cxx' || echo '$(srcdir)/'`rendition.cxx mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-libcmis_c_@LIBCMIS_API_VERSION@_la_includeHEADERS: $(libcmis_c_@LIBCMIS_API_VERSION@_la_include_HEADERS) @$(NORMAL_INSTALL) @list='$(libcmis_c_@LIBCMIS_API_VERSION@_la_include_HEADERS)'; test -n "$(libcmis_c_@LIBCMIS_API_VERSION@_la_includedir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(libcmis_c_@LIBCMIS_API_VERSION@_la_includedir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libcmis_c_@LIBCMIS_API_VERSION@_la_includedir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(libcmis_c_@LIBCMIS_API_VERSION@_la_includedir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(libcmis_c_@LIBCMIS_API_VERSION@_la_includedir)" || exit $$?; \ done uninstall-libcmis_c_@LIBCMIS_API_VERSION@_la_includeHEADERS: @$(NORMAL_UNINSTALL) @list='$(libcmis_c_@LIBCMIS_API_VERSION@_la_include_HEADERS)'; test -n "$(libcmis_c_@LIBCMIS_API_VERSION@_la_includedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(libcmis_c_@LIBCMIS_API_VERSION@_la_includedir)'; $(am__uninstall_files_from_dir) tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(libcmis_c_@LIBCMIS_API_VERSION@_la_includedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: \ install-libcmis_c_@LIBCMIS_API_VERSION@_la_includeHEADERS install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-libLTLIBRARIES install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-libLTLIBRARIES \ uninstall-libcmis_c_@LIBCMIS_API_VERSION@_la_includeHEADERS .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool cscopelist-am ctags-am \ distclean distclean-compile distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am \ install-libLTLIBRARIES \ install-libcmis_c_@LIBCMIS_API_VERSION@_la_includeHEADERS \ install-man install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \ uninstall-am uninstall-libLTLIBRARIES \ uninstall-libcmis_c_@LIBCMIS_API_VERSION@_la_includeHEADERS # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: libcmis-0.4.1/src/libcmis-c/rendition.h0000644000175000001440000000377712177747130014677 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2013 Cao Cuong Ngo * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #ifndef _LIBCMIS_RENDITION_H_ #define _LIBCMIS_RENDITION_H_ #ifdef __cplusplus extern "C" { #endif #include "types.h" void libcmis_rendition_free( libcmis_RenditionPtr rendition ); bool libcmis_rendition_isThumbnail( libcmis_RenditionPtr rendition ); const char* libcmis_rendition_getStreamId( libcmis_RenditionPtr rendition ); const char* libcmis_rendition_getMimeType( libcmis_RenditionPtr rendition ); const char* libcmis_rendition_getKind( libcmis_RenditionPtr rendition ); const char* libcmis_rendition_getUrl( libcmis_RenditionPtr rendition ); const char* libcmis_rendition_getTitle( libcmis_RenditionPtr rendition ); long libcmis_rendition_getLength( libcmis_RenditionPtr rendition ); long libcmis_rendition_getWidth( libcmis_RenditionPtr rendition ); long libcmis_rendition_getHeight( libcmis_RenditionPtr rendition ); const char* libcmis_rendition_getRenditionDocumentId( libcmis_RenditionPtr rendition ); #ifdef __cplusplus } #endif #endif libcmis-0.4.1/src/libcmis-c/property-type.h0000644000175000001440000000555612013417725015535 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2011 SUSE * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #ifndef _LIBCMIS_PROPERTY_TYPE_H_ #define _LIBCMIS_PROPERTY_TYPE_H_ #ifdef __cplusplus extern "C" { #endif #include "types.h" void libcmis_vector_property_type_free( libcmis_vector_property_type_Ptr vector ); size_t libcmis_vector_property_type_size( libcmis_vector_property_type_Ptr vector ); libcmis_PropertyTypePtr libcmis_vector_property_type_get( libcmis_vector_property_type_Ptr vector, size_t i ); void libcmis_property_type_free( libcmis_PropertyTypePtr type ); /** The resulting value needs to be free'd. */ char* libcmis_property_type_getId( libcmis_PropertyTypePtr type ); /** The resulting value needs to be free'd. */ char* libcmis_property_type_getLocalName( libcmis_PropertyTypePtr type ); /** The resulting value needs to be free'd. */ char* libcmis_property_type_getLocalNamespace( libcmis_PropertyTypePtr type ); /** The resulting value needs to be free'd. */ char* libcmis_property_type_getDisplayName( libcmis_PropertyTypePtr type ); /** The resulting value needs to be free'd. */ char* libcmis_property_type_getQueryName( libcmis_PropertyTypePtr type ); libcmis_property_type_Type libcmis_property_type_getType( libcmis_PropertyTypePtr type ); /** The resulting value needs to be free'd. */ char* libcmis_property_type_getXmlType( libcmis_PropertyTypePtr type ); bool libcmis_property_type_isMultiValued( libcmis_PropertyTypePtr type ); bool libcmis_property_type_isUpdatable( libcmis_PropertyTypePtr type ); bool libcmis_property_type_isInherited( libcmis_PropertyTypePtr type ); bool libcmis_property_type_isRequired( libcmis_PropertyTypePtr type ); bool libcmis_property_type_isQueryable( libcmis_PropertyTypePtr type ); bool libcmis_property_type_isOrderable( libcmis_PropertyTypePtr type ); bool libcmis_property_type_isOpenChoice( libcmis_PropertyTypePtr type ); #ifdef __cplusplus } #endif #endif libcmis-0.4.1/src/libcmis-c/object.h0000644000175000001440000000756612156277657014163 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2011 SUSE * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #ifndef _LIBCMIS_OBJECT_H_ #define _LIBCMIS_OBJECT_H_ #include #include "types.h" #ifdef __cplusplus extern "C" { #endif void libcmis_vector_object_free( libcmis_vector_object_Ptr vector ); size_t libcmis_vector_object_size( libcmis_vector_object_Ptr vector ); libcmis_ObjectPtr libcmis_vector_object_get( libcmis_vector_object_Ptr vector, size_t i ); void libcmis_object_free( libcmis_ObjectPtr object ); /** The resulting value needs to be free'd. */ char* libcmis_object_getId( libcmis_ObjectPtr object ); /** The resulting value needs to be free'd. */ char* libcmis_object_getName( libcmis_ObjectPtr object ); libcmis_vector_string_Ptr libcmis_object_getPaths( libcmis_ObjectPtr object ); /** The resulting value needs to be free'd. */ char* libcmis_object_getBaseType( libcmis_ObjectPtr object ); /** The resulting value needs to be free'd. */ char* libcmis_object_getType( libcmis_ObjectPtr object ); /** The resulting value needs to be free'd. */ char* libcmis_object_getCreatedBy( libcmis_ObjectPtr object ); time_t libcmis_object_getCreationDate( libcmis_ObjectPtr object ); /** The resulting value needs to be free'd. */ char* libcmis_object_getLastModifiedBy( libcmis_ObjectPtr object ); time_t libcmis_object_getLastModificationDate( libcmis_ObjectPtr object ); /** The resulting value needs to be free'd. */ char* libcmis_object_getChangeToken( libcmis_ObjectPtr object ); bool libcmis_object_isImmutable( libcmis_ObjectPtr object ); /** The resulting value needs to be free'd. */ char* libcmis_object_getThumbnailUrl( libcmis_ObjectPtr object ); libcmis_vector_rendition_Ptr libcmis_object_getRenditions( libcmis_ObjectPtr object, libcmis_ErrorPtr error ); libcmis_vector_property_Ptr libcmis_object_getProperties( libcmis_ObjectPtr object ); libcmis_PropertyPtr libcmis_object_getProperty( libcmis_ObjectPtr object, const char* name ); void libcmis_object_setProperty( libcmis_ObjectPtr object, libcmis_PropertyPtr property ); libcmis_ObjectPtr libcmis_object_updateProperties( libcmis_ObjectPtr object, libcmis_vector_property_Ptr properties, libcmis_ErrorPtr error ); libcmis_ObjectTypePtr libcmis_object_getTypeDescription( libcmis_ObjectPtr object ); libcmis_AllowableActionsPtr libcmis_object_getAllowableActions( libcmis_ObjectPtr object ); void libcmis_object_refresh( libcmis_ObjectPtr object, libcmis_ErrorPtr error ); time_t libcmis_object_getRefreshTimestamp( libcmis_ObjectPtr object ); void libcmis_object_remove( libcmis_ObjectPtr object, bool allVersions, libcmis_ErrorPtr error ); void libcmis_object_move( libcmis_ObjectPtr object, libcmis_FolderPtr source, libcmis_FolderPtr dest, libcmis_ErrorPtr error ); /** The resulting value needs to be free'd. */ char* libcmis_object_toString( libcmis_ObjectPtr object ); #ifdef __cplusplus } #endif #endif libcmis-0.4.1/src/libcmis-c/Makefile.am0000644000175000001440000000216212200457205014536 00000000000000 libcmis_c_@LIBCMIS_API_VERSION@_la_CXXFLAGS = -I$(top_srcdir)/src/ $(XML2_CFLAGS) $(BOOST_CPPFLAGS) libcmis_c_@LIBCMIS_API_VERSION@_la_include_HEADERS = \ allowable-actions.h \ document.h \ error.h \ folder.h \ object.h \ object-type.h \ property.h \ property-type.h \ oauth2-data.h \ rendition.h \ repository.h \ types.h \ session.h \ session-factory.h \ vectors.h \ libcmis-c.h lib_LTLIBRARIES = libcmis-c-@LIBCMIS_API_VERSION@.la libcmis_c_@LIBCMIS_API_VERSION@_la_SOURCES = \ allowable-actions.cxx \ document.cxx \ error.cxx \ folder.cxx \ internals.hxx \ object.cxx \ object-type.cxx \ property.cxx \ property-type.cxx \ repository.cxx \ session.cxx \ session-factory.cxx \ vectors.cxx \ oauth2-data.cxx \ rendition.cxx libcmis_c_@LIBCMIS_API_VERSION@_la_LDFLAGS = -export-dynamic -no-undefined -version-info 4:1:0 libcmis_c_@LIBCMIS_API_VERSION@_la_LIBADD = \ ../libcmis/libcmis-@LIBCMIS_API_VERSION@.la \ $(XML2_LIBS) \ $(CURL_LIBS) \ $(BOOST_SMART_PTR_LIBS) \ $(BOOST_DATE_TIME_LIBS) libcmis_c_@LIBCMIS_API_VERSION@_la_includedir = $(includedir)/libcmis-c-@LIBCMIS_API_VERSION@/libcmis-c libcmis-0.4.1/src/libcmis-c/repository.h0000644000175000001440000000644212200145206015072 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2011 SUSE * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #ifndef _REPOSITORY_H_ #define _REPOSITORY_H_ #ifdef __cplusplus extern "C" { #endif #include #include "types.h" void libcmis_vector_repository_free( libcmis_vector_Repository_Ptr vector ); size_t libcmis_vector_repository_size( libcmis_vector_Repository_Ptr vector ); libcmis_RepositoryPtr libcmis_vector_repository_get( libcmis_vector_Repository_Ptr vector, size_t i ); libcmis_RepositoryPtr libcmis_repository_create( xmlNodePtr node ); void libcmis_repository_free( libcmis_RepositoryPtr repository ); /** The resulting value needs to be freed. */ char* libcmis_repository_getId( libcmis_RepositoryPtr repository ); /** The resulting value needs to be freed. */ char* libcmis_repository_getName( libcmis_RepositoryPtr repository ); /** The resulting value needs to be freed. */ char* libcmis_repository_getDescription( libcmis_RepositoryPtr repository ); /** The resulting value needs to be freed. */ char* libcmis_repository_getVendorName( libcmis_RepositoryPtr repository ); /** The resulting value needs to be freed. */ char* libcmis_repository_getProductName( libcmis_RepositoryPtr repository ); /** The resulting value needs to be freed. */ char* libcmis_repository_getProductVersion( libcmis_RepositoryPtr repository ); /** The resulting value needs to be freed. */ char* libcmis_repository_getRootId( libcmis_RepositoryPtr repository ); /** The resulting value needs to be freed. */ char* libcmis_repository_getCmisVersionSupported( libcmis_RepositoryPtr repository ); /** The resulting value needs to be freed. */ char* libcmis_repository_getThinClientUri( libcmis_RepositoryPtr repository ); /** The resulting value needs to be freed. */ char* libcmis_repository_getPrincipalAnonymous( libcmis_RepositoryPtr repository ); /** The resulting value needs to be freed. */ char* libcmis_repository_getPrincipalAnyone( libcmis_RepositoryPtr repository ); /** The resulting value needs to be freed. */ char* libcmis_repository_getCapability( libcmis_RepositoryPtr repository, libcmis_repository_capability_Type capability ); bool libcmis_repository_getCapabilityAsBool( libcmis_RepositoryPtr repository, libcmis_repository_capability_Type capability ); #ifdef __cplusplus } #endif #endif libcmis-0.4.1/src/libcmis-c/document.cxx0000644000175000001440000002676112156277657015104 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2011 SUSE * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #include "document.h" #include "internals.hxx" using namespace std; using libcmis::PropertyPtrMap; void libcmis_vector_document_free( libcmis_vector_document_Ptr vector ) { delete vector; } size_t libcmis_vector_document_size( libcmis_vector_document_Ptr vector ) { size_t size = 0; if ( vector != NULL ) size = vector->handle.size( ); return size; } libcmis_DocumentPtr libcmis_vector_document_get( libcmis_vector_document_Ptr vector, size_t i ) { libcmis_DocumentPtr item = NULL; if ( vector != NULL && i < vector->handle.size( ) ) { libcmis::DocumentPtr handle = vector->handle[i]; item = new( nothrow ) libcmis_document( ); item->setHandle( handle ); } return item; } bool libcmis_is_document( libcmis_ObjectPtr object ) { bool isDocument = false; if ( object != NULL && object->handle.get( ) != NULL ) { libcmis::DocumentPtr document = boost::dynamic_pointer_cast< libcmis::Document >( object->handle ); isDocument = document.get( ) != NULL; } return isDocument; } libcmis_DocumentPtr libcmis_document_cast( libcmis_ObjectPtr object ) { libcmis_DocumentPtr document = NULL; if ( object != NULL && object->handle.get( ) != NULL ) { libcmis::DocumentPtr handle = boost::dynamic_pointer_cast< libcmis::Document >( object->handle ); if ( handle.get( ) != NULL ) { document = new ( nothrow ) libcmis_document( ); document->setHandle( handle ); } } return document; } void libcmis_document_free( libcmis_DocumentPtr document ) { delete document; } libcmis_vector_folder_Ptr libcmis_document_getParents( libcmis_DocumentPtr document, libcmis_ErrorPtr error ) { libcmis_vector_folder_Ptr parents = NULL; if ( document != NULL && document->handle.get( ) != NULL ) { try { vector< libcmis::FolderPtr > handles = document->handle->getParents( ); parents = new libcmis_vector_folder( ); parents->handle = handles; } catch ( const libcmis::Exception& e ) { if ( error != NULL ) { error->message = strdup( e.what() ); error->type = strdup( e.getType().c_str() ); } } catch ( const bad_alloc& e ) { if ( error != NULL ) { error->message = strdup( e.what() ); error->badAlloc = true; } } } return parents; } void libcmis_document_getContentStream( libcmis_DocumentPtr document, libcmis_writeFn writeFn, void* userData, libcmis_ErrorPtr error ) { if ( document != NULL && document->handle.get( ) != NULL ) { try { boost::shared_ptr< istream > stream = document->handle->getContentStream( ); stream->seekg( 0 ); int bufSize = 2048; char* buf = new char[ bufSize ]; while ( !stream->eof( ) ) { stream->read( buf, bufSize ); size_t read = stream->gcount( ); writeFn( ( const void * )buf, size_t( 1 ), read, userData ); } delete[] buf; } catch ( const libcmis::Exception& e ) { if ( error != NULL ) { error->message = strdup( e.what() ); error->type = strdup( e.getType().c_str() ); } } catch ( const bad_alloc& e ) { if ( error != NULL ) { error->message = strdup( e.what() ); error->badAlloc = true; } } catch ( const exception& e ) { if ( error != NULL ) error->message = strdup( e.what() ); } catch ( ... ) { } } } void libcmis_document_setContentStream( libcmis_DocumentPtr document, libcmis_readFn readFn, void* userData, const char* contentType, const char* fileName, bool overwrite, libcmis_ErrorPtr error ) { if ( document != NULL && document->handle.get( ) != NULL ) { try { boost::shared_ptr< std::ostream > stream( new stringstream( ) ); size_t bufSize = 2048; char* buf = new char[ bufSize ]; size_t read = 0; do { read = readFn( ( void * )buf, size_t( 1 ), bufSize, userData ); stream->write( buf, read ); } while ( read == bufSize ); delete[] buf; document->handle->setContentStream( stream, contentType, fileName, overwrite ); } catch ( const libcmis::Exception& e ) { if ( error != NULL ) { error->message = strdup( e.what() ); error->type = strdup( e.getType().c_str() ); } } catch ( const bad_alloc& e ) { if ( error != NULL ) { error->message = strdup( e.what() ); error->badAlloc = true; } } catch ( const exception& e ) { if ( error != NULL ) error->message = strdup( e.what() ); } } } char* libcmis_document_getContentType( libcmis_DocumentPtr document ) { char* value = NULL; if ( document != NULL && document->handle.get( ) != NULL ) value = strdup( document->handle->getContentType( ).c_str( ) ); return value; } char* libcmis_document_getContentFilename( libcmis_DocumentPtr document ) { char* value = NULL; if ( document != NULL && document->handle.get( ) != NULL ) value = strdup( document->handle->getContentFilename( ).c_str( ) ); return value; } long libcmis_document_getContentLength( libcmis_DocumentPtr document ) { long value = 0; if ( document != NULL && document->handle.get( ) != NULL ) value = document->handle->getContentLength( ); return value; } libcmis_DocumentPtr libcmis_document_checkOut( libcmis_DocumentPtr document, libcmis_ErrorPtr error ) { libcmis_DocumentPtr pwc = NULL; if ( document != NULL && document->handle.get( ) != NULL ) { try { libcmis::DocumentPtr handle = document->handle->checkOut( ); pwc= new libcmis_document( ); pwc->handle = handle; } catch ( const bad_alloc& e ) { if ( error != NULL ) error->badAlloc = true; } catch ( const libcmis::Exception& e ) { if ( error != NULL ) { error->message = strdup( e.what() ); error->type = strdup( e.getType().c_str() ); } } } return pwc; } void libcmis_document_cancelCheckout( libcmis_DocumentPtr document, libcmis_ErrorPtr error ) { if ( document != NULL && document->handle.get( ) != NULL ) { try { document->handle->cancelCheckout( ); } catch ( const libcmis::Exception& e ) { if ( error != NULL ) { error->message = strdup( e.what() ); error->type = strdup( e.getType().c_str() ); } } } } libcmis_DocumentPtr libcmis_document_checkIn( libcmis_DocumentPtr document, bool isMajor, const char* comment, libcmis_vector_property_Ptr properties, libcmis_readFn readFn, void* userData, const char* contentType, const char* filename, libcmis_ErrorPtr error ) { libcmis_DocumentPtr newVersion = NULL; if ( document != NULL && document->handle.get( ) != NULL ) { try { // Create the ostream boost::shared_ptr< std::ostream > stream( new stringstream( ) ); size_t bufSize = 2048; char * buf = new char[ bufSize ]; size_t read = 0; do { read = readFn( ( void * )buf, size_t( 1 ), bufSize, userData ); stream->write( buf, read ); } while ( read == bufSize ); delete[] buf; // Create the property map PropertyPtrMap propertiesMap; if ( properties != NULL ) { for ( vector< libcmis::PropertyPtr >::iterator it = properties->handle.begin( ); it != properties->handle.end( ); ++it ) { string id = ( *it )->getPropertyType( )->getId( ); propertiesMap.insert( pair< string, libcmis::PropertyPtr >( id, *it ) ); } } libcmis::DocumentPtr handle = document->handle->checkIn( isMajor, comment, propertiesMap, stream, contentType, filename ); newVersion = new libcmis_document( ); newVersion->handle = handle; } catch ( const libcmis::Exception& e ) { if ( error != NULL ) { error->message = strdup( e.what() ); error->type = strdup( e.getType().c_str() ); } } catch ( const bad_alloc& e ) { if ( error != NULL ) { error->message = strdup( e.what() ); error->badAlloc = true; } } catch ( const exception& e ) { if ( error != NULL ) error->message = strdup( e.what() ); } } return newVersion; } libcmis_vector_document_Ptr libcmis_document_getAllVersions( libcmis_DocumentPtr document, libcmis_ErrorPtr error ) { libcmis_vector_document_Ptr result = NULL; if ( document != NULL && document->handle.get( ) != NULL ) { try { std::vector< libcmis::DocumentPtr > handles = document->handle->getAllVersions( ); result = new libcmis_vector_document( ); result->handle = handles; } catch ( const libcmis::Exception& e ) { if ( error != NULL ) { error->message = strdup( e.what() ); error->type = strdup( e.getType().c_str() ); } } catch ( const bad_alloc& e ) { if ( error != NULL ) { error->message = strdup( e.what() ); error->badAlloc = true; } } } return result; } libcmis-0.4.1/src/libcmis-c/object-type.h0000644000175000001440000000760612156277657015135 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2011 SUSE * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #ifndef _LIBCMIS_OBJECT_TYPE_H_ #define _LIBCMIS_OBJECT_TYPE_H_ #ifdef __cplusplus extern "C" { #endif #include "types.h" void libcmis_vector_object_type_free( libcmis_vector_object_type_Ptr vector ); size_t libcmis_vector_object_type_size( libcmis_vector_object_type_Ptr vector ); libcmis_ObjectTypePtr libcmis_vector_object_type_get( libcmis_vector_object_type_Ptr vector, size_t i ); void libcmis_object_type_free( libcmis_ObjectTypePtr type ); /** The resulting value needs to be freed */ char* libcmis_object_type_getId( libcmis_ObjectTypePtr type ); /** The resulting value needs to be freed */ char* libcmis_object_type_getLocalName( libcmis_ObjectTypePtr type ); /** The resulting value needs to be freed */ char* libcmis_object_type_getLocalNamespace( libcmis_ObjectTypePtr type ); /** The resulting value needs to be freed */ char* libcmis_object_type_getQueryName( libcmis_ObjectTypePtr type ); /** The resulting value needs to be freed */ char* libcmis_object_type_getDisplayName( libcmis_ObjectTypePtr type ); /** The resulting value needs to be freed */ char* libcmis_object_type_getDescription( libcmis_ObjectTypePtr type ); libcmis_ObjectTypePtr libcmis_object_type_getParentType( libcmis_ObjectTypePtr type, libcmis_ErrorPtr error ); libcmis_ObjectTypePtr libcmis_object_type_getBaseType( libcmis_ObjectTypePtr type, libcmis_ErrorPtr error ); libcmis_vector_object_type_Ptr libcmis_object_type_getChildren( libcmis_ObjectTypePtr type, libcmis_ErrorPtr error ); /** The resulting value needs to be freed \since libcmis 0.4 */ char* libcmis_object_type_getParentTypeId( libcmis_ObjectTypePtr type ); /** The resulting value needs to be freed \since libcmis 0.4 */ char* libcmis_object_type_getBaseTypeId( libcmis_ObjectTypePtr type ); bool libcmis_object_type_isCreatable( libcmis_ObjectTypePtr type ); bool libcmis_object_type_isFileable( libcmis_ObjectTypePtr type ); bool libcmis_object_type_isQueryable( libcmis_ObjectTypePtr type ); bool libcmis_object_type_isFulltextIndexed( libcmis_ObjectTypePtr type ); bool libcmis_object_type_isIncludedInSupertypeQuery( libcmis_ObjectTypePtr type ); bool libcmis_object_type_isControllablePolicy( libcmis_ObjectTypePtr type ); bool libcmis_object_type_isControllableACL( libcmis_ObjectTypePtr type ); bool libcmis_object_type_isVersionable( libcmis_ObjectTypePtr type ); libcmis_object_type_ContentStreamAllowed libcmis_object_type_getContentStreamAllowed( libcmis_ObjectTypePtr type ); libcmis_vector_property_type_Ptr libcmis_object_type_getPropertiesTypes( libcmis_ObjectTypePtr type ); libcmis_PropertyTypePtr libcmis_object_type_getPropertyType( libcmis_ObjectTypePtr type, const char* id ); /** The resulting value needs to be freed */ char* libcmis_object_type_toString( libcmis_ObjectTypePtr type ); #ifdef __cplusplus } #endif #endif libcmis-0.4.1/src/libcmis-c/error.cxx0000644000175000001440000000352212156277657014405 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2011 SUSE * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #include #include "error.h" #include "internals.hxx" using namespace std; libcmis_ErrorPtr libcmis_error_create( ) { libcmis_ErrorPtr error = new( nothrow ) libcmis_error( ); return error; } void libcmis_error_free( libcmis_ErrorPtr error ) { if ( error != NULL ) { delete[] error->message; delete[] error->type; delete error; } } const char* libcmis_error_getMessage( libcmis_ErrorPtr error ) { if ( error != NULL ) { if ( error->badAlloc ) return "Failed to allocate memory"; else return error->message; } else return ""; } const char* libcmis_error_getType( libcmis_ErrorPtr error ) { if ( error != NULL ) return error->type; else return NULL; } libcmis-0.4.1/src/libcmis-c/document.h0000644000175000001440000000615212024304051014466 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2011 SUSE * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #ifndef _LIBCMIS_DOCUMENT_H_ #define _LIBCMIS_DOCUMENT_H_ #ifdef __cplusplus extern "C" { #endif #include "types.h" void libcmis_vector_document_free( libcmis_vector_document_Ptr vector ); size_t libcmis_vector_document_size( libcmis_vector_document_Ptr vector ); libcmis_DocumentPtr libcmis_vector_document_get( libcmis_vector_document_Ptr vector, size_t i ); bool libcmis_is_document( libcmis_ObjectPtr object ); libcmis_DocumentPtr libcmis_document_cast( libcmis_ObjectPtr object ); void libcmis_document_free( libcmis_DocumentPtr document ); libcmis_vector_folder_Ptr libcmis_document_getParents( libcmis_DocumentPtr document, libcmis_ErrorPtr error ); void libcmis_document_getContentStream( libcmis_DocumentPtr document, libcmis_writeFn writeFn, void* userData, libcmis_ErrorPtr error ); void libcmis_document_setContentStream( libcmis_DocumentPtr document, libcmis_readFn readFn, void* userData, const char* contentType, const char* filename, bool overwrite, libcmis_ErrorPtr ); /** The resulting value needs to be free'd */ char* libcmis_document_getContentType( libcmis_DocumentPtr document ); /** The resulting value needs to be free'd */ char* libcmis_document_getContentFilename( libcmis_DocumentPtr document ); long libcmis_document_getContentLength( libcmis_DocumentPtr document ); libcmis_DocumentPtr libcmis_document_checkOut( libcmis_DocumentPtr document, libcmis_ErrorPtr error ); void libcmis_document_cancelCheckout( libcmis_DocumentPtr document, libcmis_ErrorPtr error ); libcmis_DocumentPtr libcmis_document_checkIn( libcmis_DocumentPtr document, bool isMajor, const char* comment, libcmis_vector_property_Ptr properties, libcmis_readFn readFn, void* userData, const char* contentType, const char* filename, libcmis_ErrorPtr error ); libcmis_vector_document_Ptr libcmis_document_getAllVersions( libcmis_DocumentPtr document, libcmis_ErrorPtr error ); #ifdef __cplusplus } #endif #endif libcmis-0.4.1/src/libcmis-c/folder.h0000644000175000001440000000521212024130175014123 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2011 SUSE * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #ifndef _LIBCMIS_FOLDER_H_ #define _LIBCMIS_FOLDER_H_ #ifdef __cplusplus extern "C" { #endif #include "types.h" void libcmis_vector_folder_free( libcmis_vector_folder_Ptr vector ); size_t libcmis_vector_folder_size( libcmis_vector_folder_Ptr vector ); libcmis_FolderPtr libcmis_vector_folder_get( libcmis_vector_folder_Ptr vector, size_t i ); bool libcmis_is_folder( libcmis_ObjectPtr object ); libcmis_FolderPtr libcmis_folder_cast( libcmis_ObjectPtr object ); void libcmis_folder_free( libcmis_FolderPtr folder ); libcmis_FolderPtr libcmis_folder_getParent( libcmis_FolderPtr folder, libcmis_ErrorPtr error ); libcmis_vector_object_Ptr libcmis_folder_getChildren( libcmis_FolderPtr folder, libcmis_ErrorPtr error ); /** Get the path of the folder. The returned string needs to be freed. */ char* libcmis_folder_getPath( libcmis_FolderPtr folder ); bool libcmis_folder_isRootFolder( libcmis_FolderPtr folder ); libcmis_FolderPtr libcmis_folder_createFolder( libcmis_FolderPtr folder, libcmis_vector_property_Ptr properties, libcmis_ErrorPtr error ); libcmis_DocumentPtr libcmis_folder_createDocument( libcmis_FolderPtr folder, libcmis_vector_property_Ptr properties, libcmis_readFn readFn, void* userData, const char* contentType, const char* filename, libcmis_ErrorPtr error ); libcmis_vector_string_Ptr libcmis_folder_removeTree( libcmis_FolderPtr folder, bool allVersion, libcmis_folder_UnfileObjects unfile, bool continueOnError, libcmis_ErrorPtr error ); #ifdef __cplusplus } #endif #endif libcmis-0.4.1/src/libcmis-c/object.cxx0000644000175000001440000002550212156277657014524 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2011 SUSE * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #include "folder.h" #include "internals.hxx" #include "object.h" using namespace std; using libcmis::PropertyPtrMap; void libcmis_vector_object_free( libcmis_vector_object_Ptr vector ) { delete vector; } size_t libcmis_vector_object_size( libcmis_vector_object_Ptr vector ) { size_t size = 0; if ( vector != NULL ) size = vector->handle.size( ); return size; } libcmis_ObjectPtr libcmis_vector_object_get( libcmis_vector_object_Ptr vector, size_t i ) { libcmis_ObjectPtr item = NULL; if ( vector != NULL && i < vector->handle.size( ) ) { libcmis::ObjectPtr type = vector->handle[i]; item = new ( nothrow ) libcmis_object( ); if ( item ) item->handle = type; } return item; } void libcmis_object_free( libcmis_ObjectPtr object ) { delete object; } char* libcmis_object_getId( libcmis_ObjectPtr object ) { if ( object != NULL && object->handle != NULL ) return strdup( object->handle->getId( ).c_str( ) ); else return NULL; } char* libcmis_object_getName( libcmis_ObjectPtr object ) { if ( object != NULL && object->handle != NULL ) return strdup( object->handle->getName( ).c_str( ) ); else return NULL; } libcmis_vector_string_Ptr libcmis_object_getPaths( libcmis_ObjectPtr object ) { libcmis_vector_string_Ptr c_paths = NULL; if ( object != NULL && object->handle != NULL ) { std::vector< std::string > paths = object->handle->getPaths( ); c_paths = new ( nothrow ) libcmis_vector_string( ); if ( c_paths ) c_paths->handle = paths; } return c_paths; } char* libcmis_object_getBaseType( libcmis_ObjectPtr object ) { if ( object != NULL && object->handle != NULL ) return strdup( object->handle->getBaseType( ).c_str( ) ); else return NULL; } char* libcmis_object_getType( libcmis_ObjectPtr object ) { if ( object != NULL && object->handle != NULL ) return strdup( object->handle->getType( ).c_str( ) ); else return NULL; } char* libcmis_object_getCreatedBy( libcmis_ObjectPtr object ) { if ( object != NULL && object->handle != NULL ) return strdup( object->handle->getCreatedBy( ).c_str( ) ); else return NULL; } time_t libcmis_object_getCreationDate( libcmis_ObjectPtr object ) { if ( object != NULL && object->handle != NULL ) { tm time = boost::posix_time::to_tm( object->handle->getCreationDate( ) ); return mktime( &time ); } else return 0; } char* libcmis_object_getLastModifiedBy( libcmis_ObjectPtr object ) { if ( object != NULL && object->handle != NULL ) return strdup( object->handle->getLastModifiedBy( ).c_str( ) ); else return NULL; } time_t libcmis_object_getLastModificationDate( libcmis_ObjectPtr object ) { if ( object != NULL && object->handle != NULL ) { tm time = boost::posix_time::to_tm( object->handle->getLastModificationDate( ) ); return mktime( &time ); } else return 0; } char* libcmis_object_getChangeToken( libcmis_ObjectPtr object ) { if ( object != NULL && object->handle != NULL ) return strdup( object->handle->getChangeToken( ).c_str( ) ); else return NULL; } char* libcmis_object_getThumbnailUrl( libcmis_ObjectPtr object ) { if ( object != NULL && object->handle != NULL ) return strdup( object->handle->getThumbnailUrl( ).c_str( ) ); else return NULL; } libcmis_vector_rendition_Ptr libcmis_object_getRenditions( libcmis_ObjectPtr object, libcmis_ErrorPtr error ) { libcmis_vector_rendition_Ptr result = NULL; if ( object != NULL && object->handle.get( ) != NULL ) { try { std::vector< libcmis::RenditionPtr > handles = object->handle->getRenditions( ); result = new libcmis_vector_rendition( ); result->handle = handles; } catch ( const bad_alloc& e ) { if ( error != NULL ) { error->message = strdup( e.what() ); error->badAlloc = true; } } } return result; } bool libcmis_object_isImmutable( libcmis_ObjectPtr object ) { if ( object != NULL && object->handle != NULL ) return object->handle->isImmutable( ); else return true; } libcmis_vector_property_Ptr libcmis_object_getProperties( libcmis_ObjectPtr object ) { libcmis_vector_property_Ptr properties = NULL; if ( object != NULL && object->handle.get( ) != NULL ) { PropertyPtrMap& handles = object->handle->getProperties( ); properties = new ( nothrow ) libcmis_vector_property( ); if ( properties ) { int i = 0; for ( PropertyPtrMap::iterator it = handles.begin( ); it != handles.end( ); ++it, ++i ) { properties->handle.push_back( it->second ); } } } return properties; } libcmis_PropertyPtr libcmis_object_getProperty( libcmis_ObjectPtr object, const char* name ) { libcmis_PropertyPtr property = NULL; if ( object != NULL && object->handle.get( ) != NULL ) { PropertyPtrMap& handles = object->handle->getProperties( ); PropertyPtrMap::iterator it = handles.find( string( name ) ); if ( it != handles.end( ) ) { property = new ( nothrow ) libcmis_property( ); if ( property ) property->handle = it->second; } } return property; } libcmis_ObjectPtr libcmis_object_updateProperties( libcmis_ObjectPtr object, libcmis_vector_property_Ptr properties, libcmis_ErrorPtr error ) { libcmis_ObjectPtr result = NULL; if ( object != NULL && object->handle != NULL && properties != NULL ) { try { // Build the map of changed properties PropertyPtrMap propertiesMap; for ( vector< libcmis::PropertyPtr >::iterator it = properties->handle.begin( ); it != properties->handle.end( ); ++it ) { libcmis::PropertyPtr propHandle = *it; propertiesMap[ propHandle->getPropertyType()->getId( ) ] = propHandle; } libcmis::ObjectPtr handle = object->handle->updateProperties( propertiesMap ); result = new libcmis_object( ); result->handle = handle; } catch ( const libcmis::Exception& e ) { if ( error != NULL ) { error->message = strdup( e.what() ); error->type = strdup( e.getType().c_str() ); } } catch ( const bad_alloc& e ) { if ( error != NULL ) { error->message = strdup( e.what() ); error->badAlloc = true; } } } return result; } libcmis_ObjectTypePtr libcmis_object_getTypeDescription( libcmis_ObjectPtr object ) { libcmis_ObjectTypePtr result = NULL; if ( object != NULL && object->handle.get( ) != NULL ) { result = new ( nothrow ) libcmis_object_type( ); if ( result ) result->handle = object->handle->getTypeDescription( ); } return result; } libcmis_AllowableActionsPtr libcmis_object_getAllowableActions( libcmis_ObjectPtr object ) { libcmis_AllowableActionsPtr result = NULL; if ( object != NULL && object->handle.get( ) != NULL ) { result = new ( nothrow ) libcmis_allowable_actions( ); if ( result ) result->handle = object->handle->getAllowableActions( ); } return result; } void libcmis_object_refresh( libcmis_ObjectPtr object, libcmis_ErrorPtr error ) { if ( object != NULL && object->handle != NULL ) { try { object->handle->refresh( ); } catch ( const libcmis::Exception& e ) { if ( error != NULL ) { error->message = strdup( e.what() ); error->type = strdup( e.getType().c_str() ); } } } } time_t libcmis_object_getRefreshTimestamp( libcmis_ObjectPtr object ) { if ( object != NULL && object->handle != NULL ) return object->handle->getRefreshTimestamp( ); else return 0; } void libcmis_object_remove( libcmis_ObjectPtr object, bool allVersions, libcmis_ErrorPtr error ) { if ( object != NULL && object->handle != NULL ) { try { object->handle->remove( allVersions ); } catch ( const libcmis::Exception& e ) { if ( error != NULL ) { error->message = strdup( e.what() ); error->type = strdup( e.getType().c_str() ); } } } } void libcmis_object_move( libcmis_ObjectPtr object, libcmis_FolderPtr source, libcmis_FolderPtr dest, libcmis_ErrorPtr error ) { if ( object != NULL && object->handle != NULL ) { try { libcmis::FolderPtr sourceHandle; if ( source != NULL ) sourceHandle = source->handle; libcmis::FolderPtr destHandle; if ( dest != NULL ) destHandle = dest->handle; object->handle->move( sourceHandle, destHandle ); } catch ( const libcmis::Exception& e ) { if ( error != NULL ) { error->message = strdup( e.what() ); error->type = strdup( e.getType().c_str() ); } } } } char* libcmis_object_toString( libcmis_ObjectPtr object ) { if ( object != NULL && object->handle != NULL ) return strdup( object->handle->toString( ).c_str( ) ); else return NULL; } libcmis-0.4.1/src/libcmis-c/session.cxx0000644000175000001440000001634712156277657014750 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2011 SUSE * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #include #include "internals.hxx" #include "session.h" using namespace std; void libcmis_session_free( libcmis_SessionPtr session ) { if ( session != NULL ) { delete session->handle; delete session; } } libcmis_RepositoryPtr libcmis_session_getRepository( libcmis_SessionPtr session, libcmis_ErrorPtr error ) { libcmis_RepositoryPtr repository = NULL; if ( session != NULL && session->handle != NULL ) { try { libcmis::RepositoryPtr handle = session->handle->getRepository( ); if ( handle ) { repository = new ( nothrow ) libcmis_repository( ); if ( repository ) repository->handle = handle; } } catch ( const libcmis::Exception& e ) { if ( error != NULL ) { error->message = strdup( e.what() ); error->type = strdup( e.getType().c_str() ); } } } return repository; } libcmis_vector_Repository_Ptr libcmis_session_getRepositories( libcmis_SessionPtr session ) { libcmis_vector_Repository_Ptr result = NULL; if ( session != NULL && session->handle != NULL ) { vector< libcmis::RepositoryPtr > handles = session->handle->getRepositories(); result = new ( nothrow ) libcmis_vector_repository( ); if ( result ) result->handle = handles; } return result; } bool libcmis_session_setRepository( libcmis_SessionPtr session, const char* id ) { bool success = false; if ( session && session->handle && id ) { success = session->handle->setRepository( id ); } return success; } libcmis_FolderPtr libcmis_session_getRootFolder( libcmis_SessionPtr session, libcmis_ErrorPtr error ) { libcmis_FolderPtr folder = NULL; if ( session != NULL && session->handle != NULL ) { try { libcmis::FolderPtr handle = session->handle->getRootFolder( ); folder = new libcmis_folder( ); folder->setHandle( handle ); } catch ( const libcmis::Exception& e ) { if ( error != NULL ) { error->message = strdup( e.what() ); error->type = strdup( e.getType().c_str() ); } } catch ( const bad_alloc& e ) { if ( error != NULL ) { error->message = strdup( e.what() ); error->badAlloc = true; } } } return folder; } libcmis_ObjectPtr libcmis_session_getObject( libcmis_SessionPtr session, const char* id, libcmis_ErrorPtr error ) { libcmis_ObjectPtr object = NULL; if ( session != NULL && session->handle != NULL ) { try { libcmis::ObjectPtr handle = session->handle->getObject( string( id ) ); object = new libcmis_object( ); object->handle = handle; } catch ( const libcmis::Exception& e ) { if ( error != NULL ) { error->message = strdup( e.what() ); error->type = strdup( e.getType().c_str() ); } } catch ( const bad_alloc& e ) { if ( error != NULL ) { error->message = strdup( e.what() ); error->badAlloc = true; } } } return object; } libcmis_ObjectPtr libcmis_session_getObjectByPath( libcmis_SessionPtr session, const char* path, libcmis_ErrorPtr error ) { libcmis_ObjectPtr object = NULL; if ( session != NULL && session->handle != NULL ) { try { libcmis::ObjectPtr handle = session->handle->getObjectByPath( string( path ) ); object = new libcmis_object( ); object->handle = handle; } catch ( const libcmis::Exception& e ) { if ( error != NULL ) { error->message = strdup( e.what() ); error->type = strdup( e.getType().c_str() ); } } catch ( const bad_alloc& e ) { if ( error != NULL ) { error->message = strdup( e.what() ); error->badAlloc = true; } } } return object; } libcmis_FolderPtr libcmis_session_getFolder( libcmis_SessionPtr session, const char* id, libcmis_ErrorPtr error ) { libcmis_FolderPtr folder = NULL; if ( session != NULL && session->handle != NULL ) { try { libcmis::FolderPtr handle = session->handle->getFolder( string( id ) ); folder = new libcmis_folder( ); folder->setHandle( handle ); } catch ( const libcmis::Exception& e ) { if ( error != NULL ) { error->message = strdup( e.what() ); error->type = strdup( e.getType().c_str() ); } } catch ( const bad_alloc& e ) { if ( error != NULL ) { error->message = strdup( e.what() ); error->badAlloc = true; } } } return folder; } libcmis_ObjectTypePtr libcmis_session_getType( libcmis_SessionPtr session, const char* id, libcmis_ErrorPtr error ) { libcmis_ObjectTypePtr type = NULL; if ( session != NULL && session->handle != NULL ) { try { libcmis::ObjectTypePtr handle = session->handle->getType( string( id ) ); type = new libcmis_object_type( ); type->handle = handle; } catch ( const libcmis::Exception& e ) { if ( error != NULL ) { error->message = strdup( e.what() ); error->type = strdup( e.getType().c_str() ); } } catch ( const bad_alloc& e ) { if ( error != NULL ) { error->message = strdup( e.what() ); error->badAlloc = true; } } } return type; } libcmis-0.4.1/src/libcmis-c/vectors.cxx0000644000175000001440000000700712010754121014712 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2011 SUSE * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #include "internals.hxx" #include "vectors.h" void libcmis_vector_bool_free( libcmis_vector_bool_Ptr vector ) { delete vector; } size_t libcmis_vector_bool_size( libcmis_vector_bool_Ptr vector ) { size_t size = 0; if ( vector != NULL ) size = vector->handle.size( ); return size; } bool libcmis_vector_bool_get( libcmis_vector_bool_Ptr vector, size_t i ) { bool item = false; if ( vector != NULL && i < vector->handle.size( ) ) item = vector->handle[i]; return item; } void libcmis_vector_string_free( libcmis_vector_string_Ptr vector ) { delete vector; } size_t libcmis_vector_string_size( libcmis_vector_string_Ptr vector ) { size_t size = 0; if ( vector != NULL ) size = vector->handle.size( ); return size; } const char* libcmis_vector_string_get( libcmis_vector_string_Ptr vector, size_t i ) { const char* item = NULL; if ( vector != NULL && i < vector->handle.size( ) ) item = vector->handle[i].c_str( ); return item; } void libcmis_vector_long_free( libcmis_vector_long_Ptr vector ) { delete vector; } size_t libcmis_vector_long_size( libcmis_vector_long_Ptr vector ) { size_t size = 0; if ( vector != NULL ) size = vector->handle.size( ); return size; } long libcmis_vector_long_get( libcmis_vector_long_Ptr vector, size_t i ) { long item = 0; if ( vector != NULL && i < vector->handle.size( ) ) item = vector->handle[i]; return item; } void libcmis_vector_double_free( libcmis_vector_double_Ptr vector ) { delete vector; } size_t libcmis_vector_double_size( libcmis_vector_double_Ptr vector ) { size_t size = 0; if ( vector != NULL ) size = vector->handle.size( ); return size; } double libcmis_vector_double_get( libcmis_vector_double_Ptr vector, size_t i ) { double item = 0.0; if ( vector != NULL && i < vector->handle.size( ) ) item = vector->handle[i]; return item; } void libcmis_vector_time_free( libcmis_vector_time_Ptr vector ) { delete vector; } size_t libcmis_vector_time_size( libcmis_vector_time_Ptr vector ) { size_t size = 0; if ( vector != NULL ) size = vector->handle.size( ); return size; } time_t libcmis_vector_time_get( libcmis_vector_time_Ptr vector, size_t i ) { time_t item = 0; if ( vector != NULL && i < vector->handle.size( ) ) { tm time = boost::posix_time::to_tm( vector->handle[i] ); item = mktime( &time ); } return item; } libcmis-0.4.1/src/libcmis-c/libcmis-c.h0000644000175000001440000000272712167544732014542 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2011 SUSE * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #ifndef _LIBCMIS_C_H_ #define _LIBCMIS_C_H_ #include "types.h" #include "allowable-actions.h" #include "document.h" #include "error.h" #include "folder.h" #include "object.h" #include "object-type.h" #include "property.h" #include "property-type.h" #include "oauth2-data.h" #include "rendition.h" #include "repository.h" #include "types.h" #include "session.h" #include "session-factory.h" #include "vectors.h" #endif libcmis-0.4.1/src/libcmis-c/session.h0000644000175000001440000000440612156277657014366 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2011 SUSE * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #ifndef _LIBCMIS_SESSION_H_ #define _LIBCMIS_SESSION_H_ #ifdef __cplusplus extern "C" { #endif #include "types.h" void libcmis_session_free( libcmis_SessionPtr session ); libcmis_RepositoryPtr libcmis_session_getRepository( libcmis_SessionPtr session, libcmis_ErrorPtr error ); libcmis_vector_Repository_Ptr libcmis_session_getRepositories( libcmis_SessionPtr session ); bool libcmis_session_setRepository( libcmis_SessionPtr session, const char* repositoryId ); libcmis_FolderPtr libcmis_session_getRootFolder( libcmis_SessionPtr session, libcmis_ErrorPtr error ); libcmis_ObjectPtr libcmis_session_getObject( libcmis_SessionPtr session, const char* id, libcmis_ErrorPtr error ); libcmis_ObjectPtr libcmis_session_getObjectByPath( libcmis_SessionPtr session, const char* path, libcmis_ErrorPtr error ); libcmis_FolderPtr libcmis_session_getFolder( libcmis_SessionPtr session, const char* id, libcmis_ErrorPtr error ); libcmis_ObjectTypePtr libcmis_session_getType( libcmis_SessionPtr session, const char* id, libcmis_ErrorPtr error ); #ifdef __cplusplus } #endif #endif libcmis-0.4.1/src/libcmis-c/oauth2-data.cxx0000644000175000001440000000606112156277657015366 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2011 SUSE * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #include "oauth2-data.h" #include "internals.hxx" using namespace std; libcmis_OAuth2DataPtr libcmis_oauth2data_create( char* authUrl, char* tokenUrl, char* scope, char* redirectUri, char* clientId, char* clientSecret ) { libcmis_OAuth2DataPtr data = new( nothrow ) libcmis_oauth2data( ); if ( NULL != data ) data->handle.reset( new libcmis::OAuth2Data( authUrl, tokenUrl, scope, redirectUri, clientId, clientSecret ) ); return data; } void libcmis_oauth2data_free( libcmis_OAuth2DataPtr oauth2 ) { delete oauth2; } bool libcmis_oauth2data_isComplete( libcmis_OAuth2DataPtr oauth2 ) { bool result = false; if ( oauth2 != NULL && oauth2->handle != NULL ) result = oauth2->handle->isComplete(); return result; } const char* libcmis_oauth2data_getAuthUrl( libcmis_OAuth2DataPtr oauth2 ) { if ( oauth2 != NULL && oauth2->handle != NULL ) return oauth2->handle->getAuthUrl().c_str(); return NULL; } const char* libcmis_oauth2data_getTokenUrl( libcmis_OAuth2DataPtr oauth2 ) { if ( oauth2 != NULL && oauth2->handle != NULL ) return oauth2->handle->getTokenUrl().c_str(); return NULL; } const char* libcmis_oauth2data_getClientId( libcmis_OAuth2DataPtr oauth2 ) { if ( oauth2 != NULL && oauth2->handle != NULL ) return oauth2->handle->getClientId().c_str(); return NULL; } const char* libcmis_oauth2data_getClientSecret( libcmis_OAuth2DataPtr oauth2 ) { if ( oauth2 != NULL && oauth2->handle != NULL ) return oauth2->handle->getClientSecret().c_str(); return NULL; } const char* libcmis_oauth2data_getScope( libcmis_OAuth2DataPtr oauth2 ) { if ( oauth2 != NULL && oauth2->handle != NULL ) return oauth2->handle->getScope().c_str(); return NULL; } const char* libcmis_oauth2data_getRedirectUri( libcmis_OAuth2DataPtr oauth2 ) { if ( oauth2 != NULL && oauth2->handle != NULL ) return oauth2->handle->getRedirectUri().c_str(); return NULL; } libcmis-0.4.1/src/libcmis-c/allowable-actions.cxx0000644000175000001440000000355312010710170016623 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2011 SUSE * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #include "allowable-actions.h" #include "internals.hxx" void libcmis_allowable_actions_free( libcmis_AllowableActionsPtr allowable ) { delete allowable; } bool libcmis_allowable_actions_isAllowed( libcmis_AllowableActionsPtr allowable, libcmis_allowable_actions_Type action ) { bool result = false; if ( allowable != NULL && allowable->handle.get( ) != NULL ) result = allowable->handle->isAllowed( libcmis::ObjectAction::Type( action ) ); return result; } bool libcmis_allowable_actions_isDefined( libcmis_AllowableActionsPtr allowable, libcmis_allowable_actions_Type action ) { bool result = false; if ( allowable != NULL && allowable->handle.get( ) != NULL ) result = allowable->handle->isDefined( libcmis::ObjectAction::Type( action ) ); return result; } libcmis-0.4.1/src/libcmis-c/property.cxx0000644000175000001440000001320012156277657015132 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2011 SUSE * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #include "internals.hxx" #include "property.h" using namespace std; libcmis_vector_property_Ptr libcmis_vector_property_create( ) { return new ( nothrow ) libcmis_vector_property( ); } void libcmis_vector_property_free( libcmis_vector_property_Ptr vector ) { delete vector; } size_t libcmis_vector_property_size( libcmis_vector_property_Ptr vector ) { size_t size = 0; if ( vector != NULL ) size = vector->handle.size( ); return size; } libcmis_PropertyPtr libcmis_vector_property_get( libcmis_vector_property_Ptr vector, size_t i ) { libcmis_PropertyPtr item = NULL; if ( vector != NULL && i < vector->handle.size( ) ) { libcmis::PropertyPtr type = vector->handle[i]; item = new ( nothrow ) libcmis_property( ); if ( item ) item->handle = type; } return item; } void libcmis_vector_property_append( libcmis_vector_property_Ptr vector, libcmis_PropertyPtr item ) { if ( vector != NULL && item != NULL && item->handle.get( ) != NULL ) { vector->handle.push_back( item->handle ); } } libcmis_PropertyPtr libcmis_property_create( libcmis_PropertyTypePtr type, const char** strValues, size_t size ) { libcmis_PropertyPtr property = NULL; if ( type != NULL && type->handle.get( ) != NULL ) { property = new ( nothrow ) libcmis_property( ); if ( property ) { vector< string > values; for ( size_t i = 0; i < size; ++i ) values.push_back( string( strValues[i] ) ); libcmis::PropertyPtr prop( new ( nothrow ) libcmis::Property( type->handle, values ) ); property->handle = prop; } } return property; } void libcmis_property_free( libcmis_PropertyPtr property ) { delete property; } libcmis_PropertyTypePtr libcmis_property_getPropertyType( libcmis_PropertyPtr property ) { libcmis_PropertyTypePtr type = NULL; if ( property != NULL && property->handle.get( ) != NULL ) { libcmis::PropertyTypePtr handle = property->handle->getPropertyType( ); type = new ( nothrow ) libcmis_property_type( ); if ( type ) type->handle = handle; } return type; } libcmis_vector_time_Ptr libcmis_property_getDateTimes( libcmis_PropertyPtr property ) { libcmis_vector_time_Ptr times = NULL; if ( property != NULL && property->handle.get( ) != NULL ) { vector< boost::posix_time::ptime > handles = property->handle->getDateTimes( ); times = new ( nothrow ) libcmis_vector_time( ); if ( times ) times->handle = handles; } return times; } libcmis_vector_bool_Ptr libcmis_property_getBools( libcmis_PropertyPtr property ) { libcmis_vector_bool_Ptr values = NULL; if ( property != NULL && property->handle.get( ) != NULL ) { vector< bool > handles = property->handle->getBools( ); values = new ( nothrow ) libcmis_vector_bool( ); if ( values ) values->handle = handles; } return values; } libcmis_vector_string_Ptr libcmis_property_getStrings( libcmis_PropertyPtr property ) { libcmis_vector_string_Ptr values = NULL; if ( property != NULL && property->handle.get( ) != NULL ) { vector< string > handles = property->handle->getStrings( ); values = new ( nothrow ) libcmis_vector_string( ); if ( values ) values->handle = handles; } return values; } libcmis_vector_long_Ptr libcmis_property_getLongs( libcmis_PropertyPtr property ) { libcmis_vector_long_Ptr values = NULL; if ( property != NULL && property->handle.get( ) != NULL ) { vector< long > handles = property->handle->getLongs( ); values = new ( nothrow ) libcmis_vector_long( ); if ( values ) values->handle = handles; } return values; } libcmis_vector_double_Ptr libcmis_property_getDoubles( libcmis_PropertyPtr property ) { libcmis_vector_double_Ptr values = NULL; if ( property != NULL && property->handle.get( ) != NULL ) { vector< double > handles = property->handle->getDoubles( ); values = new ( nothrow ) libcmis_vector_double( ); if ( values ) values->handle = handles; } return values; } void libcmis_property_setValues( libcmis_PropertyPtr property, const char** strValues, size_t size ) { if ( property != NULL && property->handle.get() != NULL ) { vector< string > values; for ( size_t i = 0; i < size; ++i ) values.push_back( string( strValues[i] ) ); property->handle->setValues( values ); } } libcmis-0.4.1/src/libcmis-c/oauth2-data.h0000644000175000001440000000371412156277657015015 00000000000000 /* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2011 SUSE * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #ifndef _LIBCMIS_OAUTH2_DATA_H_ #define _LIBCMIS_OAUTH2_DATA_H_ #ifdef __cplusplus extern "C" { #endif #include "types.h" libcmis_OAuth2DataPtr libcmis_oauth2data_create( char* authUrl, char* tokenUrl, char* scopes, char* redirectUri, char* clientId, char* clientSecret ); void libcmis_oauth2data_free( libcmis_OAuth2DataPtr oauth2 ); bool libcmis_oauth2data_isComplete( libcmis_OAuth2DataPtr oauth2 ); const char* libcmis_oauth2data_getAuthUrl( libcmis_OAuth2DataPtr oauth2 ); const char* libcmis_oauth2data_getTokenUrl( libcmis_OAuth2DataPtr oauth2 ); const char* libcmis_oauth2data_getClientId( libcmis_OAuth2DataPtr oauth2 ); const char* libcmis_oauth2data_getClientSecret( libcmis_OAuth2DataPtr oauth2 ); const char* libcmis_oauth2data_getScope( libcmis_OAuth2DataPtr oauth2 ); const char* libcmis_oauth2data_getRedirectUri( libcmis_OAuth2DataPtr oauth2 ); #ifdef __cplusplus } #endif #endif libcmis-0.4.1/src/libcmis-c/internals.hxx0000644000175000001440000001234612156277657015264 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2011 SUSE * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #ifndef _LIBCMIS_INTERNALS_H_ #define _LIBCMIS_INTERNALS_H_ #include #include #include #include #include #include #include #include #include #include std::string createString( char* str ); struct libcmis_error { char* message; char* type; bool badAlloc; libcmis_error( ) : message( NULL ), type( NULL ), badAlloc( false ) { } }; struct libcmis_session { libcmis::Session* handle; libcmis::AuthProviderPtr provider; // Constructors libcmis_session( ) : handle( NULL ), provider( ) { } libcmis_session( const libcmis_session& copy ) : handle( copy.handle ), provider( copy.provider ) { } libcmis_session& operator=( const libcmis_session& copy ) { if ( this != © ) { handle = copy.handle; provider = copy.provider; } return *this; } }; struct libcmis_repository { libcmis::RepositoryPtr handle; libcmis_repository( ) : handle( ) { } }; struct libcmis_object { libcmis::ObjectPtr handle; libcmis_object( ) : handle( ) { } virtual ~libcmis_object( ) { } }; struct libcmis_object_type { libcmis::ObjectTypePtr handle; libcmis_object_type( ) : handle( ) { } }; struct libcmis_allowable_actions { libcmis::AllowableActionsPtr handle; libcmis_allowable_actions( ) : handle ( ) { } }; struct libcmis_property_type { libcmis::PropertyTypePtr handle; libcmis_property_type( ) : handle( ) { } }; struct libcmis_property { libcmis::PropertyPtr handle; libcmis_property( ) : handle( ) { } }; struct libcmis_folder : public libcmis_object { libcmis::FolderPtr handle; libcmis_folder( ) : libcmis_object( ), handle( ) { } void setHandle( libcmis::FolderPtr folder ) { handle = folder; libcmis_object::handle = folder; } }; struct libcmis_document : public libcmis_object { libcmis::DocumentPtr handle; libcmis_document( ) : libcmis_object( ), handle( ) { } void setHandle( libcmis::DocumentPtr document ) { handle = document; libcmis_object::handle = document; } }; struct libcmis_oauth2data { libcmis::OAuth2DataPtr handle; libcmis_oauth2data( ) : handle( ) { } }; struct libcmis_rendition { libcmis::RenditionPtr handle; libcmis_rendition( ) : handle( ) { } }; struct libcmis_vector_bool { std::vector< bool > handle; libcmis_vector_bool( ) : handle( ) { } }; struct libcmis_vector_string { std::vector< std::string > handle; libcmis_vector_string( ) : handle( ) { } }; struct libcmis_vector_long { std::vector< long > handle; libcmis_vector_long( ) : handle( ) { } }; struct libcmis_vector_double { std::vector< double > handle; libcmis_vector_double( ) : handle( ) { } }; struct libcmis_vector_time { std::vector< boost::posix_time::ptime > handle; libcmis_vector_time( ) : handle( ) { } }; struct libcmis_vector_object_type { std::vector< libcmis::ObjectTypePtr > handle; libcmis_vector_object_type( ) : handle( ) { } }; struct libcmis_vector_property_type { std::vector< libcmis::PropertyTypePtr > handle; libcmis_vector_property_type( ) : handle( ) { } }; struct libcmis_vector_property { std::vector< libcmis::PropertyPtr > handle; libcmis_vector_property( ) : handle( ) { } }; struct libcmis_vector_object { std::vector< libcmis::ObjectPtr > handle; libcmis_vector_object( ) : handle( ) { } }; struct libcmis_vector_folder { std::vector< libcmis::FolderPtr > handle; libcmis_vector_folder( ) : handle( ) { } }; struct libcmis_vector_document { std::vector< libcmis::DocumentPtr > handle; libcmis_vector_document( ) : handle( ) { } }; struct libcmis_vector_repository { std::vector< libcmis::RepositoryPtr > handle; libcmis_vector_repository( ) : handle( ) { } }; struct libcmis_vector_rendition { std::vector< libcmis::RenditionPtr > handle; libcmis_vector_rendition( ) : handle( ) { } }; #endif libcmis-0.4.1/src/libcmis-c/vectors.h0000644000175000001440000000440112013426514014337 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2011 SUSE * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #ifndef _LIBCMIS_VECTORS_HXX_ #define _LIBCMIS_VECTORS_HXX_ #ifdef __cplusplus extern "C" { #endif #include "types.h" void libcmis_vector_bool_free( libcmis_vector_bool_Ptr vector ); size_t libcmis_vector_bool_size( libcmis_vector_bool_Ptr vector ); bool libcmis_vector_bool_get( libcmis_vector_bool_Ptr vector, size_t i ); void libcmis_vector_string_free( libcmis_vector_string_Ptr vector ); size_t libcmis_vector_string_size( libcmis_vector_string_Ptr vector ); const char* libcmis_vector_string_get( libcmis_vector_string_Ptr vector, size_t i ); void libcmis_vector_long_free( libcmis_vector_long_Ptr vector ); size_t libcmis_vector_long_size( libcmis_vector_long_Ptr vector ); long libcmis_vector_long_get( libcmis_vector_long_Ptr vector, size_t i ); void libcmis_vector_double_free( libcmis_vector_double_Ptr vector ); size_t libcmis_vector_double_size( libcmis_vector_double_Ptr vector ); double libcmis_vector_double_get( libcmis_vector_double_Ptr vector, size_t i ); void libcmis_vector_time_free( libcmis_vector_time_Ptr vector ); size_t libcmis_vector_time_size( libcmis_vector_time_Ptr vector ); time_t libcmis_vector_time_get( libcmis_vector_time_Ptr vector, size_t i ); #ifdef __cplusplus } #endif #endif libcmis-0.4.1/src/libcmis-c/rendition.cxx0000644000175000001440000000637512177747326015256 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2013 Cao Cuong Ngo * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #include "rendition.h" #include "internals.hxx" using namespace std; void libcmis_rendition_free( libcmis_RenditionPtr rendition ) { delete rendition; } bool libcmis_rendition_isThumbnail( libcmis_RenditionPtr rendition ) { bool result = false; if ( rendition != NULL && rendition->handle != NULL ) result = rendition->handle->isThumbnail(); return result; } const char* libcmis_rendition_getStreamId( libcmis_RenditionPtr rendition ) { if ( rendition != NULL && rendition->handle != NULL ) return rendition->handle->getStreamId().c_str(); return NULL; } const char* libcmis_rendition_getMimeType( libcmis_RenditionPtr rendition ) { if ( rendition != NULL && rendition->handle != NULL ) return rendition->handle->getMimeType().c_str(); return NULL; } const char* libcmis_rendition_getKind( libcmis_RenditionPtr rendition ) { if ( rendition != NULL && rendition->handle != NULL ) return rendition->handle->getKind().c_str(); return NULL; } const char* libcmis_rendition_getUrl( libcmis_RenditionPtr rendition ) { if ( rendition != NULL && rendition->handle != NULL ) return rendition->handle->getUrl().c_str(); return NULL; } const char* libcmis_rendition_getTitle( libcmis_RenditionPtr rendition ) { if ( rendition != NULL && rendition->handle != NULL ) return rendition->handle->getTitle().c_str(); return NULL; } long libcmis_rendition_getLength( libcmis_RenditionPtr rendition ) { if ( rendition != NULL && rendition->handle != NULL ) return rendition->handle->getLength(); return -1; } long libcmis_rendition_getWidth( libcmis_RenditionPtr rendition ) { if ( rendition != NULL && rendition->handle != NULL ) return rendition->handle->getWidth(); return -1; } long libcmis_rendition_getHeight( libcmis_RenditionPtr rendition ) { if ( rendition != NULL && rendition->handle != NULL ) return rendition->handle->getHeight(); return -1; } const char* libcmis_rendition_getRenditionDocumentId( libcmis_RenditionPtr rendition ) { if ( rendition != NULL && rendition->handle != NULL ) return rendition->handle->getRenditionDocumentId().c_str(); return NULL; } libcmis-0.4.1/src/libcmis-c/property-type.cxx0000644000175000001440000001174712156277657016127 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2011 SUSE * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #include "internals.hxx" #include "property-type.h" void libcmis_vector_property_type_free( libcmis_vector_property_type* vector ) { delete vector; } size_t libcmis_vector_property_type_size( libcmis_vector_property_type* vector ) { size_t size = 0; if ( vector != NULL ) size = vector->handle.size( ); return size; } libcmis_PropertyTypePtr libcmis_vector_property_type_get( libcmis_vector_property_type* vector, size_t i ) { libcmis_PropertyTypePtr item = NULL; if ( vector != NULL && i < vector->handle.size( ) ) { libcmis::PropertyTypePtr type = vector->handle[i]; item = new ( std::nothrow ) libcmis_property_type( ); if ( item ) item->handle = type; } return item; } void libcmis_property_type_free( libcmis_PropertyTypePtr type ) { delete type; } char* libcmis_property_type_getId( libcmis_PropertyTypePtr type ) { if ( type != NULL && type->handle.get( ) != NULL ) return strdup( type->handle->getId( ).c_str( ) ); else return NULL; } char* libcmis_property_type_getLocalName( libcmis_PropertyTypePtr type ) { if ( type != NULL && type->handle.get( ) != NULL ) return strdup( type->handle->getLocalName( ).c_str( ) ); else return NULL; } char* libcmis_property_type_getLocalNamespace( libcmis_PropertyTypePtr type ) { if ( type != NULL && type->handle.get( ) != NULL ) return strdup( type->handle->getLocalNamespace( ).c_str( ) ); else return NULL; } char* libcmis_property_type_getDisplayName( libcmis_PropertyTypePtr type ) { if ( type != NULL && type->handle.get( ) != NULL ) return strdup( type->handle->getDisplayName( ).c_str( ) ); else return NULL; } char* libcmis_property_type_getQueryName( libcmis_PropertyTypePtr type ) { if ( type != NULL && type->handle.get( ) != NULL ) return strdup( type->handle->getQueryName( ).c_str( ) ); else return NULL; } libcmis_property_type_Type libcmis_property_type_getType( libcmis_PropertyTypePtr type ) { if ( type != NULL && type->handle.get( ) != NULL ) return libcmis_property_type_Type( type->handle->getType( ) ); else return libcmis_String; } char* libcmis_property_type_getXmlType( libcmis_PropertyTypePtr type ) { if ( type != NULL && type->handle.get( ) != NULL ) return strdup( type->handle->getXmlType( ).c_str( ) ); else return NULL; } bool libcmis_property_type_isMultiValued( libcmis_PropertyTypePtr type ) { bool value = false; if ( type != NULL && type->handle.get( ) != NULL ) value = type->handle->isMultiValued( ); return value; } bool libcmis_property_type_isUpdatable( libcmis_PropertyTypePtr type ) { bool value = false; if ( type != NULL && type->handle.get( ) != NULL ) value = type->handle->isUpdatable( ); return value; } bool libcmis_property_type_isInherited( libcmis_PropertyTypePtr type ) { bool value = false; if ( type != NULL && type->handle.get( ) != NULL ) value = type->handle->isInherited( ); return value; } bool libcmis_property_type_isRequired( libcmis_PropertyTypePtr type ) { bool value = false; if ( type != NULL && type->handle.get( ) != NULL ) value = type->handle->isRequired( ); return value; } bool libcmis_property_type_isQueryable( libcmis_PropertyTypePtr type ) { bool value = false; if ( type != NULL && type->handle.get( ) != NULL ) value = type->handle->isQueryable( ); return value; } bool libcmis_property_type_isOrderable( libcmis_PropertyTypePtr type ) { bool value = false; if ( type != NULL && type->handle.get( ) != NULL ) value = type->handle->isOrderable( ); return value; } bool libcmis_property_type_isOpenChoice( libcmis_PropertyTypePtr type ) { bool value = false; if ( type != NULL && type->handle.get( ) != NULL ) value = type->handle->isOpenChoice( ); return value; } libcmis-0.4.1/src/libcmis-c/folder.cxx0000644000175000001440000002312012156277657014523 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2011 SUSE * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #include "folder.h" #include "internals.hxx" using namespace std; using libcmis::PropertyPtrMap; void libcmis_vector_folder_free( libcmis_vector_folder_Ptr vector ) { delete vector; } size_t libcmis_vector_folder_size( libcmis_vector_folder_Ptr vector ) { size_t size = 0; if ( vector != NULL ) size = vector->handle.size( ); return size; } libcmis_FolderPtr libcmis_vector_folder_get( libcmis_vector_folder_Ptr vector, size_t i ) { libcmis_FolderPtr item = NULL; if ( vector != NULL && i < vector->handle.size( ) ) { libcmis::FolderPtr handle = vector->handle[i]; item = new ( nothrow ) libcmis_folder( ); if ( item ) item->setHandle( handle ); } return item; } bool libcmis_is_folder( libcmis_ObjectPtr object ) { bool isFolder = false; if ( object != NULL && object->handle.get( ) != NULL ) { libcmis::FolderPtr folder = boost::dynamic_pointer_cast< libcmis::Folder >( object->handle ); isFolder = folder.get( ) != NULL; } return isFolder; } libcmis_FolderPtr libcmis_folder_cast( libcmis_ObjectPtr object ) { libcmis_FolderPtr folder = NULL; if ( object != NULL && object->handle.get( ) != NULL ) { libcmis::FolderPtr handle = boost::dynamic_pointer_cast< libcmis::Folder >( object->handle ); if ( handle.get( ) != NULL ) { folder = new ( nothrow ) libcmis_folder( ); if ( folder ) folder->setHandle( handle ); } } return folder; } void libcmis_folder_free( libcmis_FolderPtr folder ) { delete folder; } libcmis_FolderPtr libcmis_folder_getParent( libcmis_FolderPtr folder, libcmis_ErrorPtr error ) { libcmis_FolderPtr parent = NULL; if ( folder != NULL && folder->handle.get( ) != NULL ) { try { libcmis::FolderPtr handle = folder->handle->getFolderParent( ); if ( handle.get( ) != NULL ) { parent = new libcmis_folder( ); parent->setHandle( handle ); } } catch ( const libcmis::Exception& e ) { if ( error != NULL ) { error->message = strdup( e.what() ); error->type = strdup( e.getType().c_str() ); } } catch ( const bad_alloc& e ) { if ( error != NULL ) { error->message = strdup( e.what() ); error->badAlloc = true; } } } return parent; } libcmis_vector_object_Ptr libcmis_folder_getChildren( libcmis_FolderPtr folder, libcmis_ErrorPtr error ) { libcmis_vector_object_Ptr result = NULL; if ( folder != NULL && folder->handle.get( ) != NULL ) { try { std::vector< libcmis::ObjectPtr > handles = folder->handle->getChildren( ); result = new libcmis_vector_object( ); result->handle = handles; } catch ( const libcmis::Exception& e ) { if ( error != NULL ) { error->message = strdup( e.what() ); error->type = strdup( e.getType().c_str() ); } } catch ( const bad_alloc& e ) { if ( error != NULL ) { error->message = strdup( e.what() ); error->badAlloc = true; } } } return result; } char* libcmis_folder_getPath( libcmis_FolderPtr folder ) { char* path = NULL; if ( folder != NULL && folder->handle.get( ) != NULL ) path = strdup( folder->handle->getPath( ).c_str( ) ); return path; } bool libcmis_folder_isRootFolder( libcmis_FolderPtr folder ) { bool isRoot = false; if ( folder != NULL && folder->handle.get( ) != NULL ) isRoot = folder->handle->isRootFolder( ); return isRoot; } libcmis_FolderPtr libcmis_folder_createFolder( libcmis_FolderPtr folder, libcmis_vector_property_Ptr properties, libcmis_ErrorPtr error ) { libcmis_FolderPtr result = NULL; if ( folder != NULL && folder->handle.get( ) != NULL ) { try { PropertyPtrMap mappedProperties; if ( properties != NULL ) { size_t size = properties->handle.size( ); for ( size_t i = 0; i < size; ++i ) { libcmis::PropertyPtr property = properties->handle[i]; if ( property.get( ) != NULL ) { string id = property->getPropertyType( )->getId( ); mappedProperties.insert( pair< string, libcmis::PropertyPtr >( id, property ) ); } } } libcmis::FolderPtr handle = folder->handle->createFolder( mappedProperties ); result = new libcmis_folder( ); result->setHandle( handle ); } catch ( const libcmis::Exception& e ) { if ( error != NULL ) { error->message = strdup( e.what() ); error->type = strdup( e.getType().c_str() ); } } catch ( const bad_alloc& e ) { if ( error != NULL ) { error->message = strdup( e.what() ); error->badAlloc = true; } } } return result; } libcmis_DocumentPtr libcmis_folder_createDocument( libcmis_FolderPtr folder, libcmis_vector_property_Ptr properties, libcmis_readFn readFn, void* userData, const char* contentType, const char* filename, libcmis_ErrorPtr error ) { libcmis_DocumentPtr created = NULL; if ( folder != NULL && folder->handle.get( ) != NULL ) { try { // Create the ostream boost::shared_ptr< std::ostream > stream( new stringstream( ) ); size_t bufSize = 2048; char* buf = new char[ bufSize ]; size_t read = 0; do { read = readFn( ( void * )buf, size_t( 1 ), bufSize, userData ); stream->write( buf, read ); } while ( read == bufSize ); delete[] buf; // Create the property map PropertyPtrMap propertiesMap; if ( properties != NULL ) { for ( vector< libcmis::PropertyPtr >::iterator it = properties->handle.begin( ); it != properties->handle.end( ); ++it ) { string id = ( *it )->getPropertyType( )->getId( ); propertiesMap.insert( pair< string, libcmis::PropertyPtr >( id, *it ) ); } } libcmis::DocumentPtr handle = folder->handle->createDocument( propertiesMap, stream, contentType, filename ); created = new libcmis_document( ); created->setHandle( handle ); } catch ( const libcmis::Exception& e ) { if ( error != NULL ) { error->message = strdup( e.what() ); error->type = strdup( e.getType().c_str() ); } } catch ( const bad_alloc& e ) { if ( error != NULL ) { error->message = strdup( e.what() ); error->badAlloc = true; } } catch ( const exception& e ) { if ( error != NULL ) error->message = strdup( e.what() ); } } return created; } libcmis_vector_string_Ptr libcmis_folder_removeTree( libcmis_FolderPtr folder, bool allVersion, libcmis_folder_UnfileObjects unfile, bool continueOnError, libcmis_ErrorPtr error ) { libcmis_vector_string_Ptr failed = NULL; try { failed = new libcmis_vector_string( ); if ( folder != NULL && folder->handle.get( ) != NULL ) { vector< string > handle = folder->handle->removeTree( allVersion, libcmis::UnfileObjects::Type( unfile ), continueOnError ); failed->handle = handle; } } catch ( const libcmis::Exception& e ) { if ( error != NULL ) { error->message = strdup( e.what() ); error->type = strdup( e.getType().c_str() ); } } catch ( const bad_alloc& e ) { if ( error != NULL ) { error->message = strdup( e.what() ); error->badAlloc = true; } } return failed; } libcmis-0.4.1/src/libcmis-c/repository.cxx0000644000175000001440000001345412200146700015446 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2011 SUSE * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #include "internals.hxx" #include "repository.h" using std::nothrow; void libcmis_vector_repository_free( libcmis_vector_Repository_Ptr vector ) { delete vector; } size_t libcmis_vector_repository_size( libcmis_vector_Repository_Ptr vector ) { size_t size = 0; if ( vector != NULL ) size = vector->handle.size( ); return size; } libcmis_RepositoryPtr libcmis_vector_repository_get( libcmis_vector_Repository_Ptr vector, size_t i ) { libcmis_RepositoryPtr item = NULL; if ( vector != NULL && i < vector->handle.size( ) ) { libcmis::RepositoryPtr type = vector->handle[i]; item = new ( nothrow ) libcmis_repository( ); if ( item ) item->handle = type; } return item; } libcmis_RepositoryPtr libcmis_repository_create( xmlNodePtr node ) { libcmis_RepositoryPtr repository = new ( nothrow ) libcmis_repository( ); if ( repository ) { libcmis::RepositoryPtr handle( new ( nothrow ) libcmis::Repository( node ) ); repository->handle = handle; } return repository; } void libcmis_repository_free( libcmis_RepositoryPtr repository ) { delete repository; } char* libcmis_repository_getId( libcmis_RepositoryPtr repository ) { if ( repository != NULL && repository->handle != NULL ) return strdup( repository->handle->getId( ).c_str( ) ); else return NULL; } char* libcmis_repository_getName( libcmis_RepositoryPtr repository ) { if ( repository != NULL && repository->handle != NULL ) return strdup( repository->handle->getName( ).c_str( ) ); else return NULL; } char* libcmis_repository_getDescription( libcmis_RepositoryPtr repository ) { if ( repository != NULL && repository->handle != NULL ) return strdup( repository->handle->getDescription( ).c_str( ) ); else return NULL; } char* libcmis_repository_getVendorName( libcmis_RepositoryPtr repository ) { if ( repository != NULL && repository->handle != NULL ) return strdup( repository->handle->getVendorName( ).c_str( ) ); else return NULL; } char* libcmis_repository_getProductName( libcmis_RepositoryPtr repository ) { if ( repository != NULL && repository->handle != NULL ) return strdup( repository->handle->getProductName( ).c_str( ) ); else return NULL; } char* libcmis_repository_getProductVersion( libcmis_RepositoryPtr repository ) { if ( repository != NULL && repository->handle != NULL ) return strdup( repository->handle->getProductVersion( ).c_str( ) ); else return NULL; } char* libcmis_repository_getRootId( libcmis_RepositoryPtr repository ) { if ( repository != NULL && repository->handle != NULL ) return strdup( repository->handle->getRootId( ).c_str( ) ); else return NULL; } char* libcmis_repository_getCmisVersionSupported( libcmis_RepositoryPtr repository ) { if ( repository != NULL && repository->handle != NULL ) return strdup( repository->handle->getCmisVersionSupported( ).c_str( ) ); else return NULL; } char* libcmis_repository_getThinClientUri( libcmis_RepositoryPtr repository ) { if ( repository != NULL && repository->handle != NULL && repository->handle->getThinClientUri( ).get( ) != NULL ) return strdup( repository->handle->getThinClientUri( )->c_str( ) ); else return NULL; } char* libcmis_repository_getPrincipalAnonymous( libcmis_RepositoryPtr repository ) { if ( repository != NULL && repository->handle != NULL && repository->handle->getPrincipalAnonymous( ).get( ) != NULL ) return strdup( repository->handle->getPrincipalAnonymous( )->c_str( ) ); else return NULL; } char* libcmis_repository_getPrincipalAnyone( libcmis_RepositoryPtr repository ) { if ( repository != NULL && repository->handle != NULL && repository->handle->getPrincipalAnyone( ).get( ) != NULL ) return strdup( repository->handle->getPrincipalAnyone( )->c_str( ) ); else return NULL; } char* libcmis_repository_getCapability( libcmis_RepositoryPtr repository, libcmis_repository_capability_Type capability ) { if ( repository != NULL && repository->handle != NULL ) { std::string value = repository->handle->getCapability( ( libcmis::Repository::Capability ) capability ); return strdup( value.c_str( ) ); } else return NULL; } bool libcmis_repository_getCapabilityAsBool( libcmis_RepositoryPtr repository, libcmis_repository_capability_Type capability ) { if ( repository != NULL && repository->handle != NULL ) { return repository->handle->getCapabilityAsBool( ( libcmis::Repository::Capability ) capability ); } else return false; } libcmis-0.4.1/src/libcmis-c/types.h0000644000175000001440000001261512200144721014017 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2011 SUSE * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #ifndef _LIBCMIS_TYPES_H_ #define _LIBCMIS_TYPES_H_ #ifndef __cplusplus #include #else extern "C" { #endif #include /* Vectors of simple types */ typedef struct libcmis_vector_bool* libcmis_vector_bool_Ptr; typedef struct libcmis_vector_string* libcmis_vector_string_Ptr; typedef struct libcmis_vector_long* libcmis_vector_long_Ptr; typedef struct libcmis_vector_double* libcmis_vector_double_Ptr; typedef struct libcmis_vector_time* libcmis_vector_time_Ptr; typedef struct libcmis_vector_repository* libcmis_vector_Repository_Ptr; /* AllowableActions */ typedef struct libcmis_allowable_actions* libcmis_AllowableActionsPtr; typedef enum { libcmis_DeleteObject, libcmis_UpdateProperties, libcmis_GetFolderTree, libcmis_GetProperties, libcmis_GetObjectRelationships, libcmis_GetObjectParents, libcmis_GetFolderParent, libcmis_GetDescendants, libcmis_MoveObject, libcmis_DeleteContentStream, libcmis_CheckOut, libcmis_CancelCheckOut, libcmis_CheckIn, libcmis_SetContentStream, libcmis_GetAllVersions, libcmis_AddObjectToFolder, libcmis_RemoveObjectFromFolder, libcmis_GetContentStream, libcmis_ApplyPolicy, libcmis_GetAppliedPolicies, libcmis_RemovePolicy, libcmis_GetChildren, libcmis_CreateDocument, libcmis_CreateFolder, libcmis_CreateRelationship, libcmis_DeleteTree, libcmis_GetRenditions, libcmis_GetACL, libcmis_ApplyACL } libcmis_allowable_actions_Type; /* Document */ typedef struct libcmis_document* libcmis_DocumentPtr; typedef size_t ( *libcmis_writeFn )( const void*, size_t, size_t, void* ); typedef size_t ( *libcmis_readFn )( void*, size_t, size_t, void* ); typedef struct libcmis_vector_document* libcmis_vector_document_Ptr; /* Error */ typedef struct libcmis_error* libcmis_ErrorPtr; /* Folder */ typedef struct libcmis_folder* libcmis_FolderPtr; typedef struct libcmis_vector_folder* libcmis_vector_folder_Ptr; typedef enum { libcmis_Unfile, libcmis_DeleteSingleFiled, libcmis_Delete } libcmis_folder_UnfileObjects; /* ObjectType */ typedef struct libcmis_object_type* libcmis_ObjectTypePtr; typedef struct libcmis_vector_object_type* libcmis_vector_object_type_Ptr; typedef enum { libcmis_NotAllowed, libcmis_Allowed, libcmis_Required } libcmis_object_type_ContentStreamAllowed; /* Object */ typedef struct libcmis_object* libcmis_ObjectPtr; typedef struct libcmis_vector_object* libcmis_vector_object_Ptr; /* Property */ typedef struct libcmis_property* libcmis_PropertyPtr; typedef struct libcmis_vector_property* libcmis_vector_property_Ptr; /* PropertyType */ typedef struct libcmis_property_type* libcmis_PropertyTypePtr; typedef struct libcmis_vector_property_type* libcmis_vector_property_type_Ptr; typedef enum { libcmis_String, libcmis_Integer, libcmis_Decimal, libcmis_Bool, libcmis_DateTime } libcmis_property_type_Type; /* Repository */ typedef enum { libcmis_capability_ACL, libcmis_capability_AllVersionsSearchable, libcmis_capability_Changes, libcmis_capability_ContentStreamUpdatability, libcmis_capability_GetDescendants, libcmis_capability_GetFolderTree, libcmis_capability_OrderBy, libcmis_capability_Multifiling, libcmis_capability_PWCSearchable, libcmis_capability_PWCUpdatable, libcmis_capability_Query, libcmis_capability_Renditions, libcmis_capability_Unfiling, libcmis_capability_VersionSpecificFiling, libcmis_capability_Join } libcmis_repository_capability_Type; typedef struct libcmis_repository* libcmis_RepositoryPtr; /* Session */ typedef struct libcmis_session* libcmis_SessionPtr; typedef bool ( *libcmis_authenticationCallback )( char* username, char* password ); typedef bool ( *libcmis_certValidationCallback )( libcmis_vector_string_Ptr certificatesChain ); typedef char * ( *libcmis_oauth2AuthCodeProvider ) ( const char* authUrl, const char* username, const char* password ); /* OAuth2Data */ typedef struct libcmis_oauth2data* libcmis_OAuth2DataPtr; typedef char* ( *libcmis_OAuth2AuthCodeProvider )( const char* authUrl, const char* username, const char* password ); /* Rendition */ typedef struct libcmis_rendition* libcmis_RenditionPtr; typedef struct libcmis_vector_rendition* libcmis_vector_rendition_Ptr; #ifdef __cplusplus } #endif #endif libcmis-0.4.1/src/libcmis-c/session-factory.h0000644000175000001440000000450412176730654016023 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2011 SUSE * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #ifndef _SESSION_FACTORY_H_ #define _SESSION_FACTORY_H_ #ifdef __cplusplus extern "C" { #endif #include "types.h" void libcmis_setAuthenticationCallback( libcmis_authenticationCallback callback ); void libcmis_setCertValidationCallback( libcmis_certValidationCallback callback ); void libcmis_setOAuth2AuthCodeProvider( libcmis_oauth2AuthCodeProvider callback ); libcmis_oauth2AuthCodeProvider libcmis_getOAuth2AuthCodeProvider( ); void libcmis_setProxySettings( char* proxy, char* noProxy, char* proxyUser, char* proxyPass ); const char* libcmis_getProxy( ); const char* libcmis_getNoProxy( ); const char* libcmis_getProxyUser( ); const char* libcmis_getProxyPass( ); libcmis_SessionPtr libcmis_createSession( char* bindingUrl, char* repositoryId, char* username, char* password, bool noSslCheck, libcmis_OAuth2DataPtr oauth2, bool verbose, libcmis_ErrorPtr error ); /** \deprecated use libcmis_createSession and libcmis_session_getRepositories instead */ libcmis_vector_Repository_Ptr libcmis_getRepositories( char* bindingUrl, char* username, char* password, bool verbose, libcmis_ErrorPtr error ); #ifdef __cplusplus } #endif #endif libcmis-0.4.1/Makefile.in0000644000175000001440000010437112200457432012125 00000000000000# Makefile.in generated by automake 1.13.4 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = . DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/configure $(am__configure_deps) \ $(srcdir)/libcmis.pc.in $(srcdir)/libcmis-c.pc.in \ $(srcdir)/run-test.sh.in $(srcdir)/cppcheck-test.sh.in \ $(dist_man_MANS) AUTHORS ChangeLog NEWS README config.guess \ config.sub depcomp install-sh missing ltmain.sh ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/boost.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = libcmis.pc libcmis-c.pc run-test.sh \ cppcheck-test.sh CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } manxdir = $(mandir)/manx am__installdirs = "$(DESTDIR)$(manxdir)" "$(DESTDIR)$(pkgconfigdir)" NROFF = nroff MANS = $(dist_man_MANS) DATA = $(pkgconfig_DATA) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ cscope distdir dist dist-all distcheck am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags CSCOPE = cscope am__tty_colors_dummy = \ mgn= red= grn= lgn= blu= brg= std=; \ am__color_tests=no am__tty_colors = { \ $(am__tty_colors_dummy); \ if test "X$(AM_COLOR_TESTS)" = Xno; then \ am__color_tests=no; \ elif test "X$(AM_COLOR_TESTS)" = Xalways; then \ am__color_tests=yes; \ elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \ am__color_tests=yes; \ fi; \ if test $$am__color_tests = yes; then \ red=''; \ grn=''; \ lgn=''; \ blu=''; \ mgn=''; \ brg=''; \ std=''; \ fi; \ } DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ if test -d "$(distdir)"; then \ find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -rf "$(distdir)" \ || { sleep 5 && rm -rf "$(distdir)"; }; \ else :; fi am__post_remove_distdir = $(am__remove_distdir) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best DIST_TARGETS = dist-gzip distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BOOST_CPPFLAGS = @BOOST_CPPFLAGS@ BOOST_DATE_TIME_LDFLAGS = @BOOST_DATE_TIME_LDFLAGS@ BOOST_DATE_TIME_LIBS = @BOOST_DATE_TIME_LIBS@ BOOST_PROGRAM_OPTIONS_LDFLAGS = @BOOST_PROGRAM_OPTIONS_LDFLAGS@ BOOST_PROGRAM_OPTIONS_LIBS = @BOOST_PROGRAM_OPTIONS_LIBS@ BOOST_ROOT = @BOOST_ROOT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPCHECK = @CPPCHECK@ CPPFLAGS = @CPPFLAGS@ CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ CPPUNIT_LIBS = @CPPUNIT_LIBS@ CURL_CFLAGS = @CURL_CFLAGS@ CURL_LIBS = @CURL_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISTCHECK_CONFIGURE_FLAGS = "--disable-long-tests" DLLTOOL = @DLLTOOL@ DOCBOOK2MAN = @DOCBOOK2MAN@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBCMIS_API_VERSION = @LIBCMIS_API_VERSION@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SRCDIR = @SRCDIR@ STRIP = @STRIP@ VERSION = @VERSION@ XML2_CFLAGS = @XML2_CFLAGS@ XML2_LIBS = @XML2_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = src qa ACLOCAL_AMFLAGS = -I m4 pkgconfig_DATA = \ libcmis-@LIBCMIS_API_VERSION@.pc \ libcmis-c-@LIBCMIS_API_VERSION@.pc pkgconfigdir = $(libdir)/pkgconfig dist_man_MANS = doc/cmis-client.xml EXTRA_DIST = \ libcmis.pc.in \ libcmis-c.pc.in \ run-test.sh \ COPYING.MPL \ COPYING.GPL \ COPYING.LGPL \ doc/cmis-client.xml \ cppcheck-test.sh \ qa/libcmis/data @ENABLE_CPPCHECK_TRUE@TESTS_ENVIRONMENT = $(SHELL) @ENABLE_CPPCHECK_TRUE@TESTS = cppcheck-test.sh DISTCLEANFILES = \ cmis-client.1 \ libcmis-@LIBCMIS_API_VERSION@.pc \ libcmis-c-@LIBCMIS_API_VERSION@.pc all: all-recursive .SUFFIXES: am--refresh: Makefile @: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): libcmis.pc: $(top_builddir)/config.status $(srcdir)/libcmis.pc.in cd $(top_builddir) && $(SHELL) ./config.status $@ libcmis-c.pc: $(top_builddir)/config.status $(srcdir)/libcmis-c.pc.in cd $(top_builddir) && $(SHELL) ./config.status $@ run-test.sh: $(top_builddir)/config.status $(srcdir)/run-test.sh.in cd $(top_builddir) && $(SHELL) ./config.status $@ cppcheck-test.sh: $(top_builddir)/config.status $(srcdir)/cppcheck-test.sh.in cd $(top_builddir) && $(SHELL) ./config.status $@ mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool config.lt install-manx: $(dist_man_MANS) @$(NORMAL_INSTALL) @list1=''; \ list2='$(dist_man_MANS)'; \ test -n "$(manxdir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(manxdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(manxdir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.x[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^x][0-9a-z]*$$,x,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(manxdir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(manxdir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(manxdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(manxdir)" || exit $$?; }; \ done; } uninstall-manx: @$(NORMAL_UNINSTALL) @list=''; test -n "$(manxdir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(dist_man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.x[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^x][0-9a-z]*$$,x,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(manxdir)'; $(am__uninstall_files_from_dir) install-pkgconfigDATA: $(pkgconfig_DATA) @$(NORMAL_INSTALL) @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(pkgconfigdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \ done uninstall-pkgconfigDATA: @$(NORMAL_UNINSTALL) @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(pkgconfigdir)'; $(am__uninstall_files_from_dir) # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscope: cscope.files test ! -s cscope.files \ || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) clean-cscope: -rm -f cscope.files cscope.files: clean-cscope cscopelist cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -rm -f cscope.out cscope.in.out cscope.po.out cscope.files check-TESTS: $(TESTS) @failed=0; all=0; xfail=0; xpass=0; skip=0; \ srcdir=$(srcdir); export srcdir; \ list=' $(TESTS) '; \ $(am__tty_colors); \ if test -n "$$list"; then \ for tst in $$list; do \ if test -f ./$$tst; then dir=./; \ elif test -f $$tst; then dir=; \ else dir="$(srcdir)/"; fi; \ if $(TESTS_ENVIRONMENT) $${dir}$$tst $(AM_TESTS_FD_REDIRECT); then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$tst[\ \ ]*) \ xpass=`expr $$xpass + 1`; \ failed=`expr $$failed + 1`; \ col=$$red; res=XPASS; \ ;; \ *) \ col=$$grn; res=PASS; \ ;; \ esac; \ elif test $$? -ne 77; then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$tst[\ \ ]*) \ xfail=`expr $$xfail + 1`; \ col=$$lgn; res=XFAIL; \ ;; \ *) \ failed=`expr $$failed + 1`; \ col=$$red; res=FAIL; \ ;; \ esac; \ else \ skip=`expr $$skip + 1`; \ col=$$blu; res=SKIP; \ fi; \ echo "$${col}$$res$${std}: $$tst"; \ done; \ if test "$$all" -eq 1; then \ tests="test"; \ All=""; \ else \ tests="tests"; \ All="All "; \ fi; \ if test "$$failed" -eq 0; then \ if test "$$xfail" -eq 0; then \ banner="$$All$$all $$tests passed"; \ else \ if test "$$xfail" -eq 1; then failures=failure; else failures=failures; fi; \ banner="$$All$$all $$tests behaved as expected ($$xfail expected $$failures)"; \ fi; \ else \ if test "$$xpass" -eq 0; then \ banner="$$failed of $$all $$tests failed"; \ else \ if test "$$xpass" -eq 1; then passes=pass; else passes=passes; fi; \ banner="$$failed of $$all $$tests did not behave as expected ($$xpass unexpected $$passes)"; \ fi; \ fi; \ dashes="$$banner"; \ skipped=""; \ if test "$$skip" -ne 0; then \ if test "$$skip" -eq 1; then \ skipped="($$skip test was not run)"; \ else \ skipped="($$skip tests were not run)"; \ fi; \ test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \ dashes="$$skipped"; \ fi; \ report=""; \ if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \ report="Please report to $(PACKAGE_BUGREPORT)"; \ test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \ dashes="$$report"; \ fi; \ dashes=`echo "$$dashes" | sed s/./=/g`; \ if test "$$failed" -eq 0; then \ col="$$grn"; \ else \ col="$$red"; \ fi; \ echo "$${col}$$dashes$${std}"; \ echo "$${col}$$banner$${std}"; \ test -z "$$skipped" || echo "$${col}$$skipped$${std}"; \ test -z "$$report" || echo "$${col}$$report$${std}"; \ echo "$${col}$$dashes$${std}"; \ test "$$failed" -eq 0; \ else :; fi distdir: $(DISTFILES) $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$(top_distdir)" distdir="$(distdir)" \ dist-hook -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__post_remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 $(am__post_remove_distdir) dist-lzip: distdir tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz $(am__post_remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__post_remove_distdir) dist-tarZ: distdir tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__post_remove_distdir) dist-shar: distdir shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__post_remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__post_remove_distdir) dist dist-all: $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' $(am__post_remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lz*) \ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir) chmod u+w $(distdir) mkdir $(distdir)/_build $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 $(am__post_remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @test -n '$(distuninstallcheck_dir)' || { \ echo 'ERROR: trying to run $@ with an empty' \ '$$(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ $(am__cd) '$(distuninstallcheck_dir)' || { \ echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-recursive all-am: Makefile $(MANS) $(DATA) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(manxdir)" "$(DESTDIR)$(pkgconfigdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-generic distclean-libtool \ distclean-local distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-man install-pkgconfigDATA install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: @WITH_LIBCMIS_MAN_FALSE@install-man: install-manx install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-man uninstall-pkgconfigDATA @WITH_LIBCMIS_MAN_FALSE@uninstall-man: uninstall-manx .MAKE: $(am__recursive_targets) check-am install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ am--refresh check check-TESTS check-am clean clean-cscope \ clean-generic clean-libtool cscope cscopelist-am ctags \ ctags-am dist dist-all dist-bzip2 dist-gzip dist-hook \ dist-lzip dist-shar dist-tarZ dist-xz dist-zip distcheck \ distclean distclean-generic distclean-libtool distclean-local \ distclean-tags distcleancheck distdir distuninstallcheck dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-manx \ install-pdf install-pdf-am install-pkgconfigDATA install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am uninstall-man uninstall-manx \ uninstall-pkgconfigDATA libcmis-@LIBCMIS_API_VERSION@.pc: libcmis.pc @cp -f $< $@ libcmis-c-@LIBCMIS_API_VERSION@.pc: libcmis-c.pc @cp -f $< $@ @WITH_LIBCMIS_MAN_TRUE@cmis-client.1: doc/cmis-client.xml @WITH_LIBCMIS_MAN_TRUE@ $(DOCBOOK2MAN) $< @WITH_LIBCMIS_MAN_TRUE@install-man: cmis-client.1 @WITH_LIBCMIS_MAN_TRUE@ mkdir -p $(DESTDIR)$(mandir)/man1/ @WITH_LIBCMIS_MAN_TRUE@ $(INSTALL_DATA) cmis-client.1 $(DESTDIR)$(mandir)/man1/ @WITH_LIBCMIS_MAN_TRUE@uninstall-man: @WITH_LIBCMIS_MAN_TRUE@ -rm -rf $(DESTDIR)$(mandir)/man1/ distclean-local: -rm -rf test-server -rm chemistry-opencmis-*.tar.gz -rm jetty-*.tar.gz dist-hook: @if test -d "$(srcdir)/.git"; \ then \ echo Creating ChangeLog && \ ( cd "$(top_srcdir)" && \ echo '# Generated by Makefile. Do not edit.'; echo; \ $(top_srcdir)/missing --run git log --pretty=medium ) > ChangeLog.tmp \ && mv -f ChangeLog.tmp $(top_distdir)/ChangeLog \ || ( rm -f ChangeLog.tmp ; \ echo Failed to generate ChangeLog >&2 ); \ else \ echo A git clone is required to generate a ChangeLog >&2; \ fi # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: libcmis-0.4.1/README0000644000175000001440000000002011667412242010730 00000000000000LibCMIS project libcmis-0.4.1/run-test.sh.in0000755000175000001440000000474312167544732012623 00000000000000#!/usr/bin/env sh LIBCMIS_DIR=$PWD/`dirname $0` TEST_SERVER=${LIBCMIS_DIR}/test-server TEST_SERVER_SCRIPT=${TEST_SERVER}/bin/jetty.sh TEST_SERVER_URL=http://localhost:8080/inmemory REST_URL=${TEST_SERVER_URL}/atom SOAP_URL=${TEST_SERVER_URL}/RepositoryService JETTY_VERSION=8.0.1 JETTY_NAME=jetty-hightide-${JETTY_VERSION}.v20110908 CHEMISTRY_VERSION=0.7.0 CHEMISTRY_WEBAPPS=chemistry-opencmis-dist-${CHEMISTRY_VERSION}-server-webapps.tar.gz INMEMORY_WAR=chemistry-opencmis-server-inmemory-${CHEMISTRY_VERSION}.war function setup_server() { # Downloads if test ! -e ${LIBCMIS_DIR}/${JETTY_NAME}.tar.gz; then echo "Downloading Jetty" curl -o ${LIBCMIS_DIR}/${JETTY_NAME}.tar.gz \ http://dist.codehaus.org/jetty/jetty-hightide-${JETTY_VERSION}/${JETTY_NAME}.tar.gz fi if test ! -e ${LIBCMIS_DIR}/${CHEMISTRY_WEBAPPS}; then echo "Downloading apache chemistry webapps" curl -o ${LIBCMIS_DIR}/${CHEMISTRY_WEBAPPS} \ http://archive.apache.org/dist/chemistry/opencmis/${CHEMISTRY_VERSION}/${CHEMISTRY_WEBAPPS} fi # Untar it all echo "Uncompressing ${JETTY_NAME}.tar.gz" tar xzf ${LIBCMIS_DIR}/${JETTY_NAME}.tar.gz -C ${LIBCMIS_DIR} mv ${LIBCMIS_DIR}/${JETTY_NAME} ${TEST_SERVER} echo "Uncompressing ${CHEMISTRY_WEBAPPS}" tar xzf ${LIBCMIS_DIR}/${CHEMISTRY_WEBAPPS} -C ${LIBCMIS_DIR} ${INMEMORY_WAR} mv ${LIBCMIS_DIR}/${INMEMORY_WAR} ${TEST_SERVER}/webapps/inmemory.war } function server() { case $1 in start) ${TEST_SERVER_SCRIPT} start >/dev/null 2>&1 # Wait for the server to be actually up and running i="0" started="no" echo -n "Waiting for test web server to be started" while test $i -lt 120; do sleep 1s curl --silent ${TEST_SERVER_URL} >/dev/null if test $? -eq 0; then break fi i=`expr $i + 1` echo -n "." done echo "Started" ;; stop) ${TEST_SERVER_SCRIPT} stop >/dev/null ;; esac } case `basename $1` in test-nosrv*) ;; *) if test ! -e ${TEST_SERVER}/webapps/inmemory.war; then setup_server fi server "start" ;; esac #Run the test $1 $REST_URL $SOAP_URL result=$? case `basename $1` in test-nosrv*) ;; *) server "stop" ;; esac exit $result libcmis-0.4.1/ltmain.sh0000644000175000001440000105152212166466061011711 00000000000000 # libtool (GNU libtool) 2.4.2 # Written by Gordon Matzigkeit , 1996 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, # 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # GNU Libtool is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, # or obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Usage: $progname [OPTION]... [MODE-ARG]... # # Provide generalized library-building support services. # # --config show all configuration variables # --debug enable verbose shell tracing # -n, --dry-run display commands without modifying any files # --features display basic configuration information and exit # --mode=MODE use operation mode MODE # --preserve-dup-deps don't remove duplicate dependency libraries # --quiet, --silent don't print informational messages # --no-quiet, --no-silent # print informational messages (default) # --no-warn don't display warning messages # --tag=TAG use configuration variables from tag TAG # -v, --verbose print more informational messages than default # --no-verbose don't print the extra informational messages # --version print version information # -h, --help, --help-all print short, long, or detailed help message # # MODE must be one of the following: # # clean remove files from the build directory # compile compile a source file into a libtool object # execute automatically set library path, then run a program # finish complete the installation of libtool libraries # install install libraries or executables # link create a library or an executable # uninstall remove libraries from an installed directory # # MODE-ARGS vary depending on the MODE. When passed as first option, # `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that. # Try `$progname --help --mode=MODE' for a more detailed description of MODE. # # When reporting a bug, please describe a test case to reproduce it and # include the following information: # # host-triplet: $host # shell: $SHELL # compiler: $LTCC # compiler flags: $LTCFLAGS # linker: $LD (gnu? $with_gnu_ld) # $progname: (GNU libtool) 2.4.2 # automake: $automake_version # autoconf: $autoconf_version # # Report bugs to . # GNU libtool home page: . # General help using GNU software: . PROGRAM=libtool PACKAGE=libtool VERSION=2.4.2 TIMESTAMP="" package_revision=1.3337 # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } # NLS nuisances: We save the old values to restore during execute mode. lt_user_locale= lt_safe_locale= for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${$lt_var+set}\" = set; then save_$lt_var=\$$lt_var $lt_var=C export $lt_var lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\" lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\" fi" done LC_ALL=C LANGUAGE=C export LANGUAGE LC_ALL $lt_unset CDPATH # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh # is ksh but when the shell is invoked as "sh" and the current value of # the _XPG environment variable is not equal to 1 (one), the special # positional parameter $0, within a function call, is the name of the # function. progpath="$0" : ${CP="cp -f"} test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'} : ${MAKE="make"} : ${MKDIR="mkdir"} : ${MV="mv -f"} : ${RM="rm -f"} : ${SHELL="${CONFIG_SHELL-/bin/sh}"} : ${Xsed="$SED -e 1s/^X//"} # Global variables: EXIT_SUCCESS=0 EXIT_FAILURE=1 EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. exit_status=$EXIT_SUCCESS # Make sure IFS has a sensible default lt_nl=' ' IFS=" $lt_nl" dirname="s,/[^/]*$,," basename="s,^.*/,," # func_dirname file append nondir_replacement # Compute the dirname of FILE. If nonempty, add APPEND to the result, # otherwise set result to NONDIR_REPLACEMENT. func_dirname () { func_dirname_result=`$ECHO "${1}" | $SED "$dirname"` if test "X$func_dirname_result" = "X${1}"; then func_dirname_result="${3}" else func_dirname_result="$func_dirname_result${2}" fi } # func_dirname may be replaced by extended shell implementation # func_basename file func_basename () { func_basename_result=`$ECHO "${1}" | $SED "$basename"` } # func_basename may be replaced by extended shell implementation # func_dirname_and_basename file append nondir_replacement # perform func_basename and func_dirname in a single function # call: # dirname: Compute the dirname of FILE. If nonempty, # add APPEND to the result, otherwise set result # to NONDIR_REPLACEMENT. # value returned in "$func_dirname_result" # basename: Compute filename of FILE. # value retuned in "$func_basename_result" # Implementation must be kept synchronized with func_dirname # and func_basename. For efficiency, we do not delegate to # those functions but instead duplicate the functionality here. func_dirname_and_basename () { # Extract subdirectory from the argument. func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"` if test "X$func_dirname_result" = "X${1}"; then func_dirname_result="${3}" else func_dirname_result="$func_dirname_result${2}" fi func_basename_result=`$ECHO "${1}" | $SED -e "$basename"` } # func_dirname_and_basename may be replaced by extended shell implementation # func_stripname prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). # func_strip_suffix prefix name func_stripname () { case ${2} in .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; esac } # func_stripname may be replaced by extended shell implementation # These SED scripts presuppose an absolute path with a trailing slash. pathcar='s,^/\([^/]*\).*$,\1,' pathcdr='s,^/[^/]*,,' removedotparts=':dotsl s@/\./@/@g t dotsl s,/\.$,/,' collapseslashes='s@/\{1,\}@/@g' finalslash='s,/*$,/,' # func_normal_abspath PATH # Remove doubled-up and trailing slashes, "." path components, # and cancel out any ".." path components in PATH after making # it an absolute path. # value returned in "$func_normal_abspath_result" func_normal_abspath () { # Start from root dir and reassemble the path. func_normal_abspath_result= func_normal_abspath_tpath=$1 func_normal_abspath_altnamespace= case $func_normal_abspath_tpath in "") # Empty path, that just means $cwd. func_stripname '' '/' "`pwd`" func_normal_abspath_result=$func_stripname_result return ;; # The next three entries are used to spot a run of precisely # two leading slashes without using negated character classes; # we take advantage of case's first-match behaviour. ///*) # Unusual form of absolute path, do nothing. ;; //*) # Not necessarily an ordinary path; POSIX reserves leading '//' # and for example Cygwin uses it to access remote file shares # over CIFS/SMB, so we conserve a leading double slash if found. func_normal_abspath_altnamespace=/ ;; /*) # Absolute path, do nothing. ;; *) # Relative path, prepend $cwd. func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath ;; esac # Cancel out all the simple stuff to save iterations. We also want # the path to end with a slash for ease of parsing, so make sure # there is one (and only one) here. func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"` while :; do # Processed it all yet? if test "$func_normal_abspath_tpath" = / ; then # If we ascended to the root using ".." the result may be empty now. if test -z "$func_normal_abspath_result" ; then func_normal_abspath_result=/ fi break fi func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$pathcar"` func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$pathcdr"` # Figure out what to do with it case $func_normal_abspath_tcomponent in "") # Trailing empty path component, ignore it. ;; ..) # Parent dir; strip last assembled component from result. func_dirname "$func_normal_abspath_result" func_normal_abspath_result=$func_dirname_result ;; *) # Actual path component, append it. func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent ;; esac done # Restore leading double-slash if one was found on entry. func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result } # func_relative_path SRCDIR DSTDIR # generates a relative path from SRCDIR to DSTDIR, with a trailing # slash if non-empty, suitable for immediately appending a filename # without needing to append a separator. # value returned in "$func_relative_path_result" func_relative_path () { func_relative_path_result= func_normal_abspath "$1" func_relative_path_tlibdir=$func_normal_abspath_result func_normal_abspath "$2" func_relative_path_tbindir=$func_normal_abspath_result # Ascend the tree starting from libdir while :; do # check if we have found a prefix of bindir case $func_relative_path_tbindir in $func_relative_path_tlibdir) # found an exact match func_relative_path_tcancelled= break ;; $func_relative_path_tlibdir*) # found a matching prefix func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" func_relative_path_tcancelled=$func_stripname_result if test -z "$func_relative_path_result"; then func_relative_path_result=. fi break ;; *) func_dirname $func_relative_path_tlibdir func_relative_path_tlibdir=${func_dirname_result} if test "x$func_relative_path_tlibdir" = x ; then # Have to descend all the way to the root! func_relative_path_result=../$func_relative_path_result func_relative_path_tcancelled=$func_relative_path_tbindir break fi func_relative_path_result=../$func_relative_path_result ;; esac done # Now calculate path; take care to avoid doubling-up slashes. func_stripname '' '/' "$func_relative_path_result" func_relative_path_result=$func_stripname_result func_stripname '/' '/' "$func_relative_path_tcancelled" if test "x$func_stripname_result" != x ; then func_relative_path_result=${func_relative_path_result}/${func_stripname_result} fi # Normalisation. If bindir is libdir, return empty string, # else relative path ending with a slash; either way, target # file name can be directly appended. if test ! -z "$func_relative_path_result"; then func_stripname './' '' "$func_relative_path_result/" func_relative_path_result=$func_stripname_result fi } # The name of this program: func_dirname_and_basename "$progpath" progname=$func_basename_result # Make sure we have an absolute path for reexecution: case $progpath in [\\/]*|[A-Za-z]:\\*) ;; *[\\/]*) progdir=$func_dirname_result progdir=`cd "$progdir" && pwd` progpath="$progdir/$progname" ;; *) save_IFS="$IFS" IFS=${PATH_SEPARATOR-:} for progdir in $PATH; do IFS="$save_IFS" test -x "$progdir/$progname" && break done IFS="$save_IFS" test -n "$progdir" || progdir=`pwd` progpath="$progdir/$progname" ;; esac # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed="${SED}"' -e 1s/^X//' sed_quote_subst='s/\([`"$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution that turns a string into a regex matching for the # string literally. sed_make_literal_regex='s,[].[^$\\*\/],\\&,g' # Sed substitution that converts a w32 file name or path # which contains forward slashes, into one that contains # (escaped) backslashes. A very naive implementation. lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' # Re-`\' parameter expansions in output of double_quote_subst that were # `\'-ed in input to the same. If an odd number of `\' preceded a '$' # in input to double_quote_subst, that '$' was protected from expansion. # Since each input `\' is now two `\'s, look for any number of runs of # four `\'s followed by two `\'s and then a '$'. `\' that '$'. bs='\\' bs2='\\\\' bs4='\\\\\\\\' dollar='\$' sed_double_backslash="\ s/$bs4/&\\ /g s/^$bs2$dollar/$bs&/ s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g s/\n//g" # Standard options: opt_dry_run=false opt_help=false opt_quiet=false opt_verbose=false opt_warning=: # func_echo arg... # Echo program name prefixed message, along with the current mode # name if it has been set yet. func_echo () { $ECHO "$progname: ${opt_mode+$opt_mode: }$*" } # func_verbose arg... # Echo program name prefixed message in verbose mode only. func_verbose () { $opt_verbose && func_echo ${1+"$@"} # A bug in bash halts the script if the last line of a function # fails when set -e is in force, so we need another command to # work around that: : } # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } # func_error arg... # Echo program name prefixed message to standard error. func_error () { $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2 } # func_warning arg... # Echo program name prefixed warning message to standard error. func_warning () { $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2 # bash bug again: : } # func_fatal_error arg... # Echo program name prefixed message to standard error, and exit. func_fatal_error () { func_error ${1+"$@"} exit $EXIT_FAILURE } # func_fatal_help arg... # Echo program name prefixed message to standard error, followed by # a help hint, and exit. func_fatal_help () { func_error ${1+"$@"} func_fatal_error "$help" } help="Try \`$progname --help' for more information." ## default # func_grep expression filename # Check whether EXPRESSION matches any line of FILENAME, without output. func_grep () { $GREP "$1" "$2" >/dev/null 2>&1 } # func_mkdir_p directory-path # Make sure the entire path to DIRECTORY-PATH is available. func_mkdir_p () { my_directory_path="$1" my_dir_list= if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then # Protect directory names starting with `-' case $my_directory_path in -*) my_directory_path="./$my_directory_path" ;; esac # While some portion of DIR does not yet exist... while test ! -d "$my_directory_path"; do # ...make a list in topmost first order. Use a colon delimited # list incase some portion of path contains whitespace. my_dir_list="$my_directory_path:$my_dir_list" # If the last portion added has no slash in it, the list is done case $my_directory_path in */*) ;; *) break ;; esac # ...otherwise throw away the child directory and loop my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"` done my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'` save_mkdir_p_IFS="$IFS"; IFS=':' for my_dir in $my_dir_list; do IFS="$save_mkdir_p_IFS" # mkdir can fail with a `File exist' error if two processes # try to create one of the directories concurrently. Don't # stop in that case! $MKDIR "$my_dir" 2>/dev/null || : done IFS="$save_mkdir_p_IFS" # Bail out if we (or some other process) failed to create a directory. test -d "$my_directory_path" || \ func_fatal_error "Failed to create \`$1'" fi } # func_mktempdir [string] # Make a temporary directory that won't clash with other running # libtool processes, and avoids race conditions if possible. If # given, STRING is the basename for that directory. func_mktempdir () { my_template="${TMPDIR-/tmp}/${1-$progname}" if test "$opt_dry_run" = ":"; then # Return a directory name, but don't create it in dry-run mode my_tmpdir="${my_template}-$$" else # If mktemp works, use that first and foremost my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` if test ! -d "$my_tmpdir"; then # Failing that, at least try and use $RANDOM to avoid a race my_tmpdir="${my_template}-${RANDOM-0}$$" save_mktempdir_umask=`umask` umask 0077 $MKDIR "$my_tmpdir" umask $save_mktempdir_umask fi # If we're not in dry-run mode, bomb out on failure test -d "$my_tmpdir" || \ func_fatal_error "cannot create temporary directory \`$my_tmpdir'" fi $ECHO "$my_tmpdir" } # func_quote_for_eval arg # Aesthetically quote ARG to be evaled later. # This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT # is double-quoted, suitable for a subsequent eval, whereas # FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters # which are still active within double quotes backslashified. func_quote_for_eval () { case $1 in *[\\\`\"\$]*) func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;; *) func_quote_for_eval_unquoted_result="$1" ;; esac case $func_quote_for_eval_unquoted_result in # Double-quote args containing shell metacharacters to delay # word splitting, command substitution and and variable # expansion for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\"" ;; *) func_quote_for_eval_result="$func_quote_for_eval_unquoted_result" esac } # func_quote_for_expand arg # Aesthetically quote ARG to be evaled later; same as above, # but do not quote variable references. func_quote_for_expand () { case $1 in *[\\\`\"]*) my_arg=`$ECHO "$1" | $SED \ -e "$double_quote_subst" -e "$sed_double_backslash"` ;; *) my_arg="$1" ;; esac case $my_arg in # Double-quote args containing shell metacharacters to delay # word splitting and command substitution for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") my_arg="\"$my_arg\"" ;; esac func_quote_for_expand_result="$my_arg" } # func_show_eval cmd [fail_exp] # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. func_show_eval () { my_cmd="$1" my_fail_exp="${2-:}" ${opt_silent-false} || { func_quote_for_expand "$my_cmd" eval "func_echo $func_quote_for_expand_result" } if ${opt_dry_run-false}; then :; else eval "$my_cmd" my_status=$? if test "$my_status" -eq 0; then :; else eval "(exit $my_status); $my_fail_exp" fi fi } # func_show_eval_locale cmd [fail_exp] # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. Use the saved locale for evaluation. func_show_eval_locale () { my_cmd="$1" my_fail_exp="${2-:}" ${opt_silent-false} || { func_quote_for_expand "$my_cmd" eval "func_echo $func_quote_for_expand_result" } if ${opt_dry_run-false}; then :; else eval "$lt_user_locale $my_cmd" my_status=$? eval "$lt_safe_locale" if test "$my_status" -eq 0; then :; else eval "(exit $my_status); $my_fail_exp" fi fi } # func_tr_sh # Turn $1 into a string suitable for a shell variable name. # Result is stored in $func_tr_sh_result. All characters # not in the set a-zA-Z0-9_ are replaced with '_'. Further, # if $1 begins with a digit, a '_' is prepended as well. func_tr_sh () { case $1 in [0-9]* | *[!a-zA-Z0-9_]*) func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'` ;; * ) func_tr_sh_result=$1 ;; esac } # func_version # Echo version message to standard output and exit. func_version () { $opt_debug $SED -n '/(C)/!b go :more /\./!{ N s/\n# / / b more } :go /^# '$PROGRAM' (GNU /,/# warranty; / { s/^# // s/^# *$// s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/ p }' < "$progpath" exit $? } # func_usage # Echo short help message to standard output and exit. func_usage () { $opt_debug $SED -n '/^# Usage:/,/^# *.*--help/ { s/^# // s/^# *$// s/\$progname/'$progname'/ p }' < "$progpath" echo $ECHO "run \`$progname --help | more' for full usage" exit $? } # func_help [NOEXIT] # Echo long help message to standard output and exit, # unless 'noexit' is passed as argument. func_help () { $opt_debug $SED -n '/^# Usage:/,/# Report bugs to/ { :print s/^# // s/^# *$// s*\$progname*'$progname'* s*\$host*'"$host"'* s*\$SHELL*'"$SHELL"'* s*\$LTCC*'"$LTCC"'* s*\$LTCFLAGS*'"$LTCFLAGS"'* s*\$LD*'"$LD"'* s/\$with_gnu_ld/'"$with_gnu_ld"'/ s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/ s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/ p d } /^# .* home page:/b print /^# General help using/b print ' < "$progpath" ret=$? if test -z "$1"; then exit $ret fi } # func_missing_arg argname # Echo program name prefixed message to standard error and set global # exit_cmd. func_missing_arg () { $opt_debug func_error "missing argument for $1." exit_cmd=exit } # func_split_short_opt shortopt # Set func_split_short_opt_name and func_split_short_opt_arg shell # variables after splitting SHORTOPT after the 2nd character. func_split_short_opt () { my_sed_short_opt='1s/^\(..\).*$/\1/;q' my_sed_short_rest='1s/^..\(.*\)$/\1/;q' func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"` func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"` } # func_split_short_opt may be replaced by extended shell implementation # func_split_long_opt longopt # Set func_split_long_opt_name and func_split_long_opt_arg shell # variables after splitting LONGOPT at the `=' sign. func_split_long_opt () { my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q' my_sed_long_arg='1s/^--[^=]*=//' func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"` func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"` } # func_split_long_opt may be replaced by extended shell implementation exit_cmd=: magic="%%%MAGIC variable%%%" magic_exe="%%%MAGIC EXE variable%%%" # Global variables. nonopt= preserve_args= lo2o="s/\\.lo\$/.${objext}/" o2lo="s/\\.${objext}\$/.lo/" extracted_archives= extracted_serial=0 # If this variable is set in any of the actions, the command in it # will be execed at the end. This prevents here-documents from being # left over by shells. exec_cmd= # func_append var value # Append VALUE to the end of shell variable VAR. func_append () { eval "${1}=\$${1}\${2}" } # func_append may be replaced by extended shell implementation # func_append_quoted var value # Quote VALUE and append to the end of shell variable VAR, separated # by a space. func_append_quoted () { func_quote_for_eval "${2}" eval "${1}=\$${1}\\ \$func_quote_for_eval_result" } # func_append_quoted may be replaced by extended shell implementation # func_arith arithmetic-term... func_arith () { func_arith_result=`expr "${@}"` } # func_arith may be replaced by extended shell implementation # func_len string # STRING may not start with a hyphen. func_len () { func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len` } # func_len may be replaced by extended shell implementation # func_lo2o object func_lo2o () { func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"` } # func_lo2o may be replaced by extended shell implementation # func_xform libobj-or-source func_xform () { func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'` } # func_xform may be replaced by extended shell implementation # func_fatal_configuration arg... # Echo program name prefixed message to standard error, followed by # a configuration failure hint, and exit. func_fatal_configuration () { func_error ${1+"$@"} func_error "See the $PACKAGE documentation for more information." func_fatal_error "Fatal configuration error." } # func_config # Display the configuration for all the tags in this script. func_config () { re_begincf='^# ### BEGIN LIBTOOL' re_endcf='^# ### END LIBTOOL' # Default configuration. $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath" # Now print the configurations for the tags. for tagname in $taglist; do $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath" done exit $? } # func_features # Display the features supported by this script. func_features () { echo "host: $host" if test "$build_libtool_libs" = yes; then echo "enable shared libraries" else echo "disable shared libraries" fi if test "$build_old_libs" = yes; then echo "enable static libraries" else echo "disable static libraries" fi exit $? } # func_enable_tag tagname # Verify that TAGNAME is valid, and either flag an error and exit, or # enable the TAGNAME tag. We also add TAGNAME to the global $taglist # variable here. func_enable_tag () { # Global variable: tagname="$1" re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" sed_extractcf="/$re_begincf/,/$re_endcf/p" # Validate tagname. case $tagname in *[!-_A-Za-z0-9,/]*) func_fatal_error "invalid tag name: $tagname" ;; esac # Don't test for the "default" C tag, as we know it's # there but not specially marked. case $tagname in CC) ;; *) if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then taglist="$taglist $tagname" # Evaluate the configuration. Be careful to quote the path # and the sed script, to avoid splitting on whitespace, but # also don't use non-portable quotes within backquotes within # quotes we have to do it in 2 steps: extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` eval "$extractedcf" else func_error "ignoring unknown tag $tagname" fi ;; esac } # func_check_version_match # Ensure that we are using m4 macros, and libtool script from the same # release of libtool. func_check_version_match () { if test "$package_revision" != "$macro_revision"; then if test "$VERSION" != "$macro_version"; then if test -z "$macro_version"; then cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from an older release. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from $PACKAGE $macro_version. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF fi else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, $progname: but the definition of this LT_INIT comes from revision $macro_revision. $progname: You should recreate aclocal.m4 with macros from revision $package_revision $progname: of $PACKAGE $VERSION and run autoconf again. _LT_EOF fi exit $EXIT_MISMATCH fi } # Shorthand for --mode=foo, only valid as the first argument case $1 in clean|clea|cle|cl) shift; set dummy --mode clean ${1+"$@"}; shift ;; compile|compil|compi|comp|com|co|c) shift; set dummy --mode compile ${1+"$@"}; shift ;; execute|execut|execu|exec|exe|ex|e) shift; set dummy --mode execute ${1+"$@"}; shift ;; finish|finis|fini|fin|fi|f) shift; set dummy --mode finish ${1+"$@"}; shift ;; install|instal|insta|inst|ins|in|i) shift; set dummy --mode install ${1+"$@"}; shift ;; link|lin|li|l) shift; set dummy --mode link ${1+"$@"}; shift ;; uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) shift; set dummy --mode uninstall ${1+"$@"}; shift ;; esac # Option defaults: opt_debug=: opt_dry_run=false opt_config=false opt_preserve_dup_deps=false opt_features=false opt_finish=false opt_help=false opt_help_all=false opt_silent=: opt_warning=: opt_verbose=: opt_silent=false opt_verbose=false # Parse options once, thoroughly. This comes as soon as possible in the # script to make things like `--version' happen as quickly as we can. { # this just eases exit handling while test $# -gt 0; do opt="$1" shift case $opt in --debug|-x) opt_debug='set -x' func_echo "enabling shell trace mode" $opt_debug ;; --dry-run|--dryrun|-n) opt_dry_run=: ;; --config) opt_config=: func_config ;; --dlopen|-dlopen) optarg="$1" opt_dlopen="${opt_dlopen+$opt_dlopen }$optarg" shift ;; --preserve-dup-deps) opt_preserve_dup_deps=: ;; --features) opt_features=: func_features ;; --finish) opt_finish=: set dummy --mode finish ${1+"$@"}; shift ;; --help) opt_help=: ;; --help-all) opt_help_all=: opt_help=': help-all' ;; --mode) test $# = 0 && func_missing_arg $opt && break optarg="$1" opt_mode="$optarg" case $optarg in # Valid mode arguments: clean|compile|execute|finish|install|link|relink|uninstall) ;; # Catch anything else as an error *) func_error "invalid argument for $opt" exit_cmd=exit break ;; esac shift ;; --no-silent|--no-quiet) opt_silent=false func_append preserve_args " $opt" ;; --no-warning|--no-warn) opt_warning=false func_append preserve_args " $opt" ;; --no-verbose) opt_verbose=false func_append preserve_args " $opt" ;; --silent|--quiet) opt_silent=: func_append preserve_args " $opt" opt_verbose=false ;; --verbose|-v) opt_verbose=: func_append preserve_args " $opt" opt_silent=false ;; --tag) test $# = 0 && func_missing_arg $opt && break optarg="$1" opt_tag="$optarg" func_append preserve_args " $opt $optarg" func_enable_tag "$optarg" shift ;; -\?|-h) func_usage ;; --help) func_help ;; --version) func_version ;; # Separate optargs to long options: --*=*) func_split_long_opt "$opt" set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"} shift ;; # Separate non-argument short options: -\?*|-h*|-n*|-v*) func_split_short_opt "$opt" set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"} shift ;; --) break ;; -*) func_fatal_help "unrecognized option \`$opt'" ;; *) set dummy "$opt" ${1+"$@"}; shift; break ;; esac done # Validate options: # save first non-option argument if test "$#" -gt 0; then nonopt="$opt" shift fi # preserve --debug test "$opt_debug" = : || func_append preserve_args " --debug" case $host in *cygwin* | *mingw* | *pw32* | *cegcc*) # don't eliminate duplications in $postdeps and $predeps opt_duplicate_compiler_generated_deps=: ;; *) opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps ;; esac $opt_help || { # Sanity checks first: func_check_version_match if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then func_fatal_configuration "not configured to build any kind of library" fi # Darwin sucks eval std_shrext=\"$shrext_cmds\" # Only execute mode is allowed to have -dlopen flags. if test -n "$opt_dlopen" && test "$opt_mode" != execute; then func_error "unrecognized option \`-dlopen'" $ECHO "$help" 1>&2 exit $EXIT_FAILURE fi # Change the help message to a mode-specific one. generic_help="$help" help="Try \`$progname --help --mode=$opt_mode' for more information." } # Bail if the options were screwed $exit_cmd $EXIT_FAILURE } ## ----------- ## ## Main. ## ## ----------- ## # func_lalib_p file # True iff FILE is a libtool `.la' library or `.lo' object file. # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_lalib_p () { test -f "$1" && $SED -e 4q "$1" 2>/dev/null \ | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 } # func_lalib_unsafe_p file # True iff FILE is a libtool `.la' library or `.lo' object file. # This function implements the same check as func_lalib_p without # resorting to external programs. To this end, it redirects stdin and # closes it afterwards, without saving the original file descriptor. # As a safety measure, use it only where a negative result would be # fatal anyway. Works if `file' does not exist. func_lalib_unsafe_p () { lalib_p=no if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then for lalib_p_l in 1 2 3 4 do read lalib_p_line case "$lalib_p_line" in \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; esac done exec 0<&5 5<&- fi test "$lalib_p" = yes } # func_ltwrapper_script_p file # True iff FILE is a libtool wrapper script # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_script_p () { func_lalib_p "$1" } # func_ltwrapper_executable_p file # True iff FILE is a libtool wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_executable_p () { func_ltwrapper_exec_suffix= case $1 in *.exe) ;; *) func_ltwrapper_exec_suffix=.exe ;; esac $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 } # func_ltwrapper_scriptname file # Assumes file is an ltwrapper_executable # uses $file to determine the appropriate filename for a # temporary ltwrapper_script. func_ltwrapper_scriptname () { func_dirname_and_basename "$1" "" "." func_stripname '' '.exe' "$func_basename_result" func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper" } # func_ltwrapper_p file # True iff FILE is a libtool wrapper script or wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_p () { func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" } # func_execute_cmds commands fail_cmd # Execute tilde-delimited COMMANDS. # If FAIL_CMD is given, eval that upon failure. # FAIL_CMD may read-access the current command in variable CMD! func_execute_cmds () { $opt_debug save_ifs=$IFS; IFS='~' for cmd in $1; do IFS=$save_ifs eval cmd=\"$cmd\" func_show_eval "$cmd" "${2-:}" done IFS=$save_ifs } # func_source file # Source FILE, adding directory component if necessary. # Note that it is not necessary on cygwin/mingw to append a dot to # FILE even if both FILE and FILE.exe exist: automatic-append-.exe # behavior happens only for exec(3), not for open(2)! Also, sourcing # `FILE.' does not work on cygwin managed mounts. func_source () { $opt_debug case $1 in */* | *\\*) . "$1" ;; *) . "./$1" ;; esac } # func_resolve_sysroot PATH # Replace a leading = in PATH with a sysroot. Store the result into # func_resolve_sysroot_result func_resolve_sysroot () { func_resolve_sysroot_result=$1 case $func_resolve_sysroot_result in =*) func_stripname '=' '' "$func_resolve_sysroot_result" func_resolve_sysroot_result=$lt_sysroot$func_stripname_result ;; esac } # func_replace_sysroot PATH # If PATH begins with the sysroot, replace it with = and # store the result into func_replace_sysroot_result. func_replace_sysroot () { case "$lt_sysroot:$1" in ?*:"$lt_sysroot"*) func_stripname "$lt_sysroot" '' "$1" func_replace_sysroot_result="=$func_stripname_result" ;; *) # Including no sysroot. func_replace_sysroot_result=$1 ;; esac } # func_infer_tag arg # Infer tagged configuration to use if any are available and # if one wasn't chosen via the "--tag" command line option. # Only attempt this if the compiler in the base compile # command doesn't match the default compiler. # arg is usually of the form 'gcc ...' func_infer_tag () { $opt_debug if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case $@ in # Blanks in the command may have been stripped by the calling shell, # but not from the CC environment variable when configure was run. " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;; # Blanks at the start of $base_compile will cause this to fail # if we don't check for them as well. *) for z in $available_tags; do if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then # Evaluate the configuration. eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" CC_quoted= for arg in $CC; do # Double-quote args containing other shell metacharacters. func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case "$@ " in " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) # The compiler in the base compile command matches # the one in the tagged configuration. # Assume this is the tagged configuration we want. tagname=$z break ;; esac fi done # If $tagname still isn't set, then no tagged configuration # was found and let the user know that the "--tag" command # line option must be used. if test -z "$tagname"; then func_echo "unable to infer tagged configuration" func_fatal_error "specify a tag with \`--tag'" # else # func_verbose "using $tagname tagged configuration" fi ;; esac fi } # func_write_libtool_object output_name pic_name nonpic_name # Create a libtool object file (analogous to a ".la" file), # but don't create it if we're doing a dry run. func_write_libtool_object () { write_libobj=${1} if test "$build_libtool_libs" = yes; then write_lobj=\'${2}\' else write_lobj=none fi if test "$build_old_libs" = yes; then write_oldobj=\'${3}\' else write_oldobj=none fi $opt_dry_run || { cat >${write_libobj}T </dev/null` if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | $SED -e "$lt_sed_naive_backslashify"` else func_convert_core_file_wine_to_w32_result= fi fi } # end: func_convert_core_file_wine_to_w32 # func_convert_core_path_wine_to_w32 ARG # Helper function used by path conversion functions when $build is *nix, and # $host is mingw, cygwin, or some other w32 environment. Relies on a correctly # configured wine environment available, with the winepath program in $build's # $PATH. Assumes ARG has no leading or trailing path separator characters. # # ARG is path to be converted from $build format to win32. # Result is available in $func_convert_core_path_wine_to_w32_result. # Unconvertible file (directory) names in ARG are skipped; if no directory names # are convertible, then the result may be empty. func_convert_core_path_wine_to_w32 () { $opt_debug # unfortunately, winepath doesn't convert paths, only file names func_convert_core_path_wine_to_w32_result="" if test -n "$1"; then oldIFS=$IFS IFS=: for func_convert_core_path_wine_to_w32_f in $1; do IFS=$oldIFS func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f" if test -n "$func_convert_core_file_wine_to_w32_result" ; then if test -z "$func_convert_core_path_wine_to_w32_result"; then func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result" else func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" fi fi done IFS=$oldIFS fi } # end: func_convert_core_path_wine_to_w32 # func_cygpath ARGS... # Wrapper around calling the cygpath program via LT_CYGPATH. This is used when # when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2) # $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or # (2), returns the Cygwin file name or path in func_cygpath_result (input # file name or path is assumed to be in w32 format, as previously converted # from $build's *nix or MSYS format). In case (3), returns the w32 file name # or path in func_cygpath_result (input file name or path is assumed to be in # Cygwin format). Returns an empty string on error. # # ARGS are passed to cygpath, with the last one being the file name or path to # be converted. # # Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH # environment variable; do not put it in $PATH. func_cygpath () { $opt_debug if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` if test "$?" -ne 0; then # on failure, ensure result is empty func_cygpath_result= fi else func_cygpath_result= func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'" fi } #end: func_cygpath # func_convert_core_msys_to_w32 ARG # Convert file name or path ARG from MSYS format to w32 format. Return # result in func_convert_core_msys_to_w32_result. func_convert_core_msys_to_w32 () { $opt_debug # awkward: cmd appends spaces to result func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"` } #end: func_convert_core_msys_to_w32 # func_convert_file_check ARG1 ARG2 # Verify that ARG1 (a file name in $build format) was converted to $host # format in ARG2. Otherwise, emit an error message, but continue (resetting # func_to_host_file_result to ARG1). func_convert_file_check () { $opt_debug if test -z "$2" && test -n "$1" ; then func_error "Could not determine host file name corresponding to" func_error " \`$1'" func_error "Continuing, but uninstalled executables may not work." # Fallback: func_to_host_file_result="$1" fi } # end func_convert_file_check # func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH # Verify that FROM_PATH (a path in $build format) was converted to $host # format in TO_PATH. Otherwise, emit an error message, but continue, resetting # func_to_host_file_result to a simplistic fallback value (see below). func_convert_path_check () { $opt_debug if test -z "$4" && test -n "$3"; then func_error "Could not determine the host path corresponding to" func_error " \`$3'" func_error "Continuing, but uninstalled executables may not work." # Fallback. This is a deliberately simplistic "conversion" and # should not be "improved". See libtool.info. if test "x$1" != "x$2"; then lt_replace_pathsep_chars="s|$1|$2|g" func_to_host_path_result=`echo "$3" | $SED -e "$lt_replace_pathsep_chars"` else func_to_host_path_result="$3" fi fi } # end func_convert_path_check # func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG # Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT # and appending REPL if ORIG matches BACKPAT. func_convert_path_front_back_pathsep () { $opt_debug case $4 in $1 ) func_to_host_path_result="$3$func_to_host_path_result" ;; esac case $4 in $2 ) func_append func_to_host_path_result "$3" ;; esac } # end func_convert_path_front_back_pathsep ################################################## # $build to $host FILE NAME CONVERSION FUNCTIONS # ################################################## # invoked via `$to_host_file_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # Result will be available in $func_to_host_file_result. # func_to_host_file ARG # Converts the file name ARG from $build format to $host format. Return result # in func_to_host_file_result. func_to_host_file () { $opt_debug $to_host_file_cmd "$1" } # end func_to_host_file # func_to_tool_file ARG LAZY # converts the file name ARG from $build format to toolchain format. Return # result in func_to_tool_file_result. If the conversion in use is listed # in (the comma separated) LAZY, no conversion takes place. func_to_tool_file () { $opt_debug case ,$2, in *,"$to_tool_file_cmd",*) func_to_tool_file_result=$1 ;; *) $to_tool_file_cmd "$1" func_to_tool_file_result=$func_to_host_file_result ;; esac } # end func_to_tool_file # func_convert_file_noop ARG # Copy ARG to func_to_host_file_result. func_convert_file_noop () { func_to_host_file_result="$1" } # end func_convert_file_noop # func_convert_file_msys_to_w32 ARG # Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_file_result. func_convert_file_msys_to_w32 () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_to_host_file_result="$func_convert_core_msys_to_w32_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_w32 # func_convert_file_cygwin_to_w32 ARG # Convert file name ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_file_cygwin_to_w32 () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then # because $build is cygwin, we call "the" cygpath in $PATH; no need to use # LT_CYGPATH in this case. func_to_host_file_result=`cygpath -m "$1"` fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_cygwin_to_w32 # func_convert_file_nix_to_w32 ARG # Convert file name ARG from *nix to w32 format. Requires a wine environment # and a working winepath. Returns result in func_to_host_file_result. func_convert_file_nix_to_w32 () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_file_wine_to_w32 "$1" func_to_host_file_result="$func_convert_core_file_wine_to_w32_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_w32 # func_convert_file_msys_to_cygwin ARG # Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_file_msys_to_cygwin () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_cygpath -u "$func_convert_core_msys_to_w32_result" func_to_host_file_result="$func_cygpath_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_cygwin # func_convert_file_nix_to_cygwin ARG # Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed # in a wine environment, working winepath, and LT_CYGPATH set. Returns result # in func_to_host_file_result. func_convert_file_nix_to_cygwin () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then # convert from *nix to w32, then use cygpath to convert from w32 to cygwin. func_convert_core_file_wine_to_w32 "$1" func_cygpath -u "$func_convert_core_file_wine_to_w32_result" func_to_host_file_result="$func_cygpath_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_cygwin ############################################# # $build to $host PATH CONVERSION FUNCTIONS # ############################################# # invoked via `$to_host_path_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # The result will be available in $func_to_host_path_result. # # Path separators are also converted from $build format to $host format. If # ARG begins or ends with a path separator character, it is preserved (but # converted to $host format) on output. # # All path conversion functions are named using the following convention: # file name conversion function : func_convert_file_X_to_Y () # path conversion function : func_convert_path_X_to_Y () # where, for any given $build/$host combination the 'X_to_Y' value is the # same. If conversion functions are added for new $build/$host combinations, # the two new functions must follow this pattern, or func_init_to_host_path_cmd # will break. # func_init_to_host_path_cmd # Ensures that function "pointer" variable $to_host_path_cmd is set to the # appropriate value, based on the value of $to_host_file_cmd. to_host_path_cmd= func_init_to_host_path_cmd () { $opt_debug if test -z "$to_host_path_cmd"; then func_stripname 'func_convert_file_' '' "$to_host_file_cmd" to_host_path_cmd="func_convert_path_${func_stripname_result}" fi } # func_to_host_path ARG # Converts the path ARG from $build format to $host format. Return result # in func_to_host_path_result. func_to_host_path () { $opt_debug func_init_to_host_path_cmd $to_host_path_cmd "$1" } # end func_to_host_path # func_convert_path_noop ARG # Copy ARG to func_to_host_path_result. func_convert_path_noop () { func_to_host_path_result="$1" } # end func_convert_path_noop # func_convert_path_msys_to_w32 ARG # Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_path_result. func_convert_path_msys_to_w32 () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # Remove leading and trailing path separator characters from ARG. MSYS # behavior is inconsistent here; cygpath turns them into '.;' and ';.'; # and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result="$func_convert_core_msys_to_w32_result" func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_msys_to_w32 # func_convert_path_cygwin_to_w32 ARG # Convert path ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_path_cygwin_to_w32 () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"` func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_cygwin_to_w32 # func_convert_path_nix_to_w32 ARG # Convert path ARG from *nix to w32 format. Requires a wine environment and # a working winepath. Returns result in func_to_host_file_result. func_convert_path_nix_to_w32 () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result="$func_convert_core_path_wine_to_w32_result" func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_nix_to_w32 # func_convert_path_msys_to_cygwin ARG # Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_path_msys_to_cygwin () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_msys_to_w32_result" func_to_host_path_result="$func_cygpath_result" func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_msys_to_cygwin # func_convert_path_nix_to_cygwin ARG # Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a # a wine environment, working winepath, and LT_CYGPATH set. Returns result in # func_to_host_file_result. func_convert_path_nix_to_cygwin () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # Remove leading and trailing path separator characters from # ARG. msys behavior is inconsistent here, cygpath turns them # into '.;' and ';.', and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" func_to_host_path_result="$func_cygpath_result" func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_nix_to_cygwin # func_mode_compile arg... func_mode_compile () { $opt_debug # Get the compilation command and the source file. base_compile= srcfile="$nonopt" # always keep a non-empty value in "srcfile" suppress_opt=yes suppress_output= arg_mode=normal libobj= later= pie_flag= for arg do case $arg_mode in arg ) # do not "continue". Instead, add this to base_compile lastarg="$arg" arg_mode=normal ;; target ) libobj="$arg" arg_mode=normal continue ;; normal ) # Accept any command-line options. case $arg in -o) test -n "$libobj" && \ func_fatal_error "you cannot specify \`-o' more than once" arg_mode=target continue ;; -pie | -fpie | -fPIE) func_append pie_flag " $arg" continue ;; -shared | -static | -prefer-pic | -prefer-non-pic) func_append later " $arg" continue ;; -no-suppress) suppress_opt=no continue ;; -Xcompiler) arg_mode=arg # the next one goes into the "base_compile" arg list continue # The current "srcfile" will either be retained or ;; # replaced later. I would guess that would be a bug. -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result lastarg= save_ifs="$IFS"; IFS=',' for arg in $args; do IFS="$save_ifs" func_append_quoted lastarg "$arg" done IFS="$save_ifs" func_stripname ' ' '' "$lastarg" lastarg=$func_stripname_result # Add the arguments to base_compile. func_append base_compile " $lastarg" continue ;; *) # Accept the current argument as the source file. # The previous "srcfile" becomes the current argument. # lastarg="$srcfile" srcfile="$arg" ;; esac # case $arg ;; esac # case $arg_mode # Aesthetically quote the previous argument. func_append_quoted base_compile "$lastarg" done # for arg case $arg_mode in arg) func_fatal_error "you must specify an argument for -Xcompile" ;; target) func_fatal_error "you must specify a target with \`-o'" ;; *) # Get the name of the library object. test -z "$libobj" && { func_basename "$srcfile" libobj="$func_basename_result" } ;; esac # Recognize several different file suffixes. # If the user specifies -o file.o, it is replaced with file.lo case $libobj in *.[cCFSifmso] | \ *.ada | *.adb | *.ads | *.asm | \ *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup) func_xform "$libobj" libobj=$func_xform_result ;; esac case $libobj in *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;; *) func_fatal_error "cannot determine name of library object from \`$libobj'" ;; esac func_infer_tag $base_compile for arg in $later; do case $arg in -shared) test "$build_libtool_libs" != yes && \ func_fatal_configuration "can not build a shared library" build_old_libs=no continue ;; -static) build_libtool_libs=no build_old_libs=yes continue ;; -prefer-pic) pic_mode=yes continue ;; -prefer-non-pic) pic_mode=no continue ;; esac done func_quote_for_eval "$libobj" test "X$libobj" != "X$func_quote_for_eval_result" \ && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ && func_warning "libobj name \`$libobj' may not contain shell special characters." func_dirname_and_basename "$obj" "/" "" objname="$func_basename_result" xdir="$func_dirname_result" lobj=${xdir}$objdir/$objname test -z "$base_compile" && \ func_fatal_help "you must specify a compilation command" # Delete any leftover library objects. if test "$build_old_libs" = yes; then removelist="$obj $lobj $libobj ${libobj}T" else removelist="$lobj $libobj ${libobj}T" fi # On Cygwin there's no "real" PIC flag so we must build both object types case $host_os in cygwin* | mingw* | pw32* | os2* | cegcc*) pic_mode=default ;; esac if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then # non-PIC code in shared libraries is not supported pic_mode=default fi # Calculate the filename of the output object if compiler does # not support -o with -c if test "$compiler_c_o" = no; then output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext} lockfile="$output_obj.lock" else output_obj= need_locks=no lockfile= fi # Lock this critical section if it is needed # We use this script file to make the link, it avoids creating a new file if test "$need_locks" = yes; then until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done elif test "$need_locks" = warn; then if test -f "$lockfile"; then $ECHO "\ *** ERROR, $lockfile exists and contains: `cat $lockfile 2>/dev/null` This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi func_append removelist " $output_obj" $ECHO "$srcfile" > "$lockfile" fi $opt_dry_run || $RM $removelist func_append removelist " $lockfile" trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 srcfile=$func_to_tool_file_result func_quote_for_eval "$srcfile" qsrcfile=$func_quote_for_eval_result # Only build a PIC object if we are building libtool libraries. if test "$build_libtool_libs" = yes; then # Without this assignment, base_compile gets emptied. fbsd_hideous_sh_bug=$base_compile if test "$pic_mode" != no; then command="$base_compile $qsrcfile $pic_flag" else # Don't build PIC code command="$base_compile $qsrcfile" fi func_mkdir_p "$xdir$objdir" if test -z "$output_obj"; then # Place PIC objects in $objdir func_append command " -o $lobj" fi func_show_eval_locale "$command" \ 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' if test "$need_locks" = warn && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed, then go on to compile the next one if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then func_show_eval '$MV "$output_obj" "$lobj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi # Allow error messages only from the first compilation. if test "$suppress_opt" = yes; then suppress_output=' >/dev/null 2>&1' fi fi # Only build a position-dependent object if we build old libraries. if test "$build_old_libs" = yes; then if test "$pic_mode" != yes; then # Don't build PIC code command="$base_compile $qsrcfile$pie_flag" else command="$base_compile $qsrcfile $pic_flag" fi if test "$compiler_c_o" = yes; then func_append command " -o $obj" fi # Suppress compiler output if we already did a PIC compilation. func_append command "$suppress_output" func_show_eval_locale "$command" \ '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' if test "$need_locks" = warn && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then func_show_eval '$MV "$output_obj" "$obj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi fi $opt_dry_run || { func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" # Unlock the critical section if it was locked if test "$need_locks" != no; then removelist=$lockfile $RM "$lockfile" fi } exit $EXIT_SUCCESS } $opt_help || { test "$opt_mode" = compile && func_mode_compile ${1+"$@"} } func_mode_help () { # We need to display help for each of the modes. case $opt_mode in "") # Generic help is extracted from the usage comments # at the start of this file. func_help ;; clean) $ECHO \ "Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE... Remove files from the build directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, object or program, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; compile) $ECHO \ "Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE Compile a source file into a libtool library object. This mode accepts the following additional options: -o OUTPUT-FILE set the output file name to OUTPUT-FILE -no-suppress do not suppress compiler output for multiple passes -prefer-pic try to build PIC objects only -prefer-non-pic try to build non-PIC objects only -shared do not build a \`.o' file suitable for static linking -static only build a \`.o' file suitable for static linking -Wc,FLAG pass FLAG directly to the compiler COMPILE-COMMAND is a command to be used in creating a \`standard' object file from the given SOURCEFILE. The output file name is determined by removing the directory component from SOURCEFILE, then substituting the C source code suffix \`.c' with the library object suffix, \`.lo'." ;; execute) $ECHO \ "Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]... Automatically set library path, then run a program. This mode accepts the following additional options: -dlopen FILE add the directory containing FILE to the library path This mode sets the library path environment variable according to \`-dlopen' flags. If any of the ARGS are libtool executable wrappers, then they are translated into their corresponding uninstalled binary, and any of their required library directories are added to the library path. Then, COMMAND is executed, with ARGS as arguments." ;; finish) $ECHO \ "Usage: $progname [OPTION]... --mode=finish [LIBDIR]... Complete the installation of libtool libraries. Each LIBDIR is a directory that contains libtool libraries. The commands that this mode executes may require superuser privileges. Use the \`--dry-run' option if you just want to see what would be executed." ;; install) $ECHO \ "Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND... Install executables or libraries. INSTALL-COMMAND is the installation command. The first component should be either the \`install' or \`cp' program. The following components of INSTALL-COMMAND are treated specially: -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation The rest of the components are interpreted as arguments to that command (only BSD-compatible install options are recognized)." ;; link) $ECHO \ "Usage: $progname [OPTION]... --mode=link LINK-COMMAND... Link object files or libraries together to form another library, or to create an executable program. LINK-COMMAND is a command using the C compiler that you would use to create a program from several object files. The following components of LINK-COMMAND are treated specially: -all-static do not do any dynamic linking at all -avoid-version do not add a version suffix if possible -bindir BINDIR specify path to binaries directory (for systems where libraries must be found in the PATH setting at runtime) -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) -export-symbols SYMFILE try to export only the symbols listed in SYMFILE -export-symbols-regex REGEX try to export only the symbols matching REGEX -LLIBDIR search LIBDIR for required installed libraries -lNAME OUTPUT-FILE requires the installed library libNAME -module build a library that can dlopened -no-fast-install disable the fast-install mode -no-install link a not-installable executable -no-undefined declare that a library does not refer to external symbols -o OUTPUT-FILE create OUTPUT-FILE from the specified objects -objectlist FILE Use a list of object files found in FILE to specify objects -precious-files-regex REGEX don't remove output files matching REGEX -release RELEASE specify package release information -rpath LIBDIR the created library will eventually be installed in LIBDIR -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries -shared only do dynamic linking of libtool libraries -shrext SUFFIX override the standard shared library file extension -static do not do any dynamic linking of uninstalled libtool libraries -static-libtool-libs do not do any dynamic linking of libtool libraries -version-info CURRENT[:REVISION[:AGE]] specify library version info [each variable defaults to 0] -weak LIBNAME declare that the target provides the LIBNAME interface -Wc,FLAG -Xcompiler FLAG pass linker-specific FLAG directly to the compiler -Wl,FLAG -Xlinker FLAG pass linker-specific FLAG directly to the linker -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) All other options (arguments beginning with \`-') are ignored. Every other argument is treated as a filename. Files ending in \`.la' are treated as uninstalled libtool libraries, other files are standard or library object files. If the OUTPUT-FILE ends in \`.la', then a libtool library is created, only library objects (\`.lo' files) may be specified, and \`-rpath' is required, except when creating a convenience library. If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created using \`ar' and \`ranlib', or on Windows using \`lib'. If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file is created, otherwise an executable program is created." ;; uninstall) $ECHO \ "Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... Remove libraries from an installation directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; *) func_fatal_help "invalid operation mode \`$opt_mode'" ;; esac echo $ECHO "Try \`$progname --help' for more information about other modes." } # Now that we've collected a possible --mode arg, show help if necessary if $opt_help; then if test "$opt_help" = :; then func_mode_help else { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do func_mode_help done } | sed -n '1p; 2,$s/^Usage:/ or: /p' { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do echo func_mode_help done } | sed '1d /^When reporting/,/^Report/{ H d } $x /information about other modes/d /more detailed .*MODE/d s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/' fi exit $? fi # func_mode_execute arg... func_mode_execute () { $opt_debug # The first argument is the command name. cmd="$nonopt" test -z "$cmd" && \ func_fatal_help "you must specify a COMMAND" # Handle -dlopen flags immediately. for file in $opt_dlopen; do test -f "$file" \ || func_fatal_help "\`$file' is not a file" dir= case $file in *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "\`$lib' is not a valid libtool archive" # Read the libtool library. dlname= library_names= func_source "$file" # Skip this library if it cannot be dlopened. if test -z "$dlname"; then # Warn if it was a shared library. test -n "$library_names" && \ func_warning "\`$file' was not linked with \`-export-dynamic'" continue fi func_dirname "$file" "" "." dir="$func_dirname_result" if test -f "$dir/$objdir/$dlname"; then func_append dir "/$objdir" else if test ! -f "$dir/$dlname"; then func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" fi fi ;; *.lo) # Just add the directory containing the .lo file. func_dirname "$file" "" "." dir="$func_dirname_result" ;; *) func_warning "\`-dlopen' is ignored for non-libtool libraries and objects" continue ;; esac # Get the absolute pathname. absdir=`cd "$dir" && pwd` test -n "$absdir" && dir="$absdir" # Now add the directory to shlibpath_var. if eval "test -z \"\$$shlibpath_var\""; then eval "$shlibpath_var=\"\$dir\"" else eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" fi done # This variable tells wrapper scripts just to set shlibpath_var # rather than running their programs. libtool_execute_magic="$magic" # Check if any of the arguments is a wrapper script. args= for file do case $file in -* | *.la | *.lo ) ;; *) # Do a test to see if this is really a libtool program. if func_ltwrapper_script_p "$file"; then func_source "$file" # Transform arg to wrapped name. file="$progdir/$program" elif func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" func_source "$func_ltwrapper_scriptname_result" # Transform arg to wrapped name. file="$progdir/$program" fi ;; esac # Quote arguments (to preserve shell metacharacters). func_append_quoted args "$file" done if test "X$opt_dry_run" = Xfalse; then if test -n "$shlibpath_var"; then # Export the shlibpath_var. eval "export $shlibpath_var" fi # Restore saved environment variables for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${save_$lt_var+set}\" = set; then $lt_var=\$save_$lt_var; export $lt_var else $lt_unset $lt_var fi" done # Now prepare to actually exec the command. exec_cmd="\$cmd$args" else # Display what would be done. if test -n "$shlibpath_var"; then eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" echo "export $shlibpath_var" fi $ECHO "$cmd$args" exit $EXIT_SUCCESS fi } test "$opt_mode" = execute && func_mode_execute ${1+"$@"} # func_mode_finish arg... func_mode_finish () { $opt_debug libs= libdirs= admincmds= for opt in "$nonopt" ${1+"$@"} do if test -d "$opt"; then func_append libdirs " $opt" elif test -f "$opt"; then if func_lalib_unsafe_p "$opt"; then func_append libs " $opt" else func_warning "\`$opt' is not a valid libtool archive" fi else func_fatal_error "invalid argument \`$opt'" fi done if test -n "$libs"; then if test -n "$lt_sysroot"; then sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"` sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;" else sysroot_cmd= fi # Remove sysroot references if $opt_dry_run; then for lib in $libs; do echo "removing references to $lt_sysroot and \`=' prefixes from $lib" done else tmpdir=`func_mktempdir` for lib in $libs; do sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ > $tmpdir/tmp-la mv -f $tmpdir/tmp-la $lib done ${RM}r "$tmpdir" fi fi if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. func_execute_cmds "$finish_cmds" 'admincmds="$admincmds '"$cmd"'"' fi if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" $opt_dry_run || eval "$cmds" || func_append admincmds " $cmds" fi done fi # Exit here if they wanted silent mode. $opt_silent && exit $EXIT_SUCCESS if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then echo "----------------------------------------------------------------------" echo "Libraries have been installed in:" for libdir in $libdirs; do $ECHO " $libdir" done echo echo "If you ever happen to want to link against installed libraries" echo "in a given directory, LIBDIR, you must either use libtool, and" echo "specify the full pathname of the library, or use the \`-LLIBDIR'" echo "flag during linking and do at least one of the following:" if test -n "$shlibpath_var"; then echo " - add LIBDIR to the \`$shlibpath_var' environment variable" echo " during execution" fi if test -n "$runpath_var"; then echo " - add LIBDIR to the \`$runpath_var' environment variable" echo " during linking" fi if test -n "$hardcode_libdir_flag_spec"; then libdir=LIBDIR eval flag=\"$hardcode_libdir_flag_spec\" $ECHO " - use the \`$flag' linker flag" fi if test -n "$admincmds"; then $ECHO " - have your system administrator run these commands:$admincmds" fi if test -f /etc/ld.so.conf; then echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" fi echo echo "See any operating system documentation about shared libraries for" case $host in solaris2.[6789]|solaris2.1[0-9]) echo "more information, such as the ld(1), crle(1) and ld.so(8) manual" echo "pages." ;; *) echo "more information, such as the ld(1) and ld.so(8) manual pages." ;; esac echo "----------------------------------------------------------------------" fi exit $EXIT_SUCCESS } test "$opt_mode" = finish && func_mode_finish ${1+"$@"} # func_mode_install arg... func_mode_install () { $opt_debug # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || # Allow the use of GNU shtool's install command. case $nonopt in *shtool*) :;; *) false;; esac; then # Aesthetically quote it. func_quote_for_eval "$nonopt" install_prog="$func_quote_for_eval_result " arg=$1 shift else install_prog= arg=$nonopt fi # The real first argument should be the name of the installation program. # Aesthetically quote it. func_quote_for_eval "$arg" func_append install_prog "$func_quote_for_eval_result" install_shared_prog=$install_prog case " $install_prog " in *[\\\ /]cp\ *) install_cp=: ;; *) install_cp=false ;; esac # We need to accept at least all the BSD install flags. dest= files= opts= prev= install_type= isdir=no stripme= no_mode=: for arg do arg2= if test -n "$dest"; then func_append files " $dest" dest=$arg continue fi case $arg in -d) isdir=yes ;; -f) if $install_cp; then :; else prev=$arg fi ;; -g | -m | -o) prev=$arg ;; -s) stripme=" -s" continue ;; -*) ;; *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then if test "x$prev" = x-m && test -n "$install_override_mode"; then arg2=$install_override_mode no_mode=false fi prev= else dest=$arg continue fi ;; esac # Aesthetically quote the argument. func_quote_for_eval "$arg" func_append install_prog " $func_quote_for_eval_result" if test -n "$arg2"; then func_quote_for_eval "$arg2" fi func_append install_shared_prog " $func_quote_for_eval_result" done test -z "$install_prog" && \ func_fatal_help "you must specify an install program" test -n "$prev" && \ func_fatal_help "the \`$prev' option requires an argument" if test -n "$install_override_mode" && $no_mode; then if $install_cp; then :; else func_quote_for_eval "$install_override_mode" func_append install_shared_prog " -m $func_quote_for_eval_result" fi fi if test -z "$files"; then if test -z "$dest"; then func_fatal_help "no file or destination specified" else func_fatal_help "you must specify a destination" fi fi # Strip any trailing slash from the destination. func_stripname '' '/' "$dest" dest=$func_stripname_result # Check to see that the destination is a directory. test -d "$dest" && isdir=yes if test "$isdir" = yes; then destdir="$dest" destname= else func_dirname_and_basename "$dest" "" "." destdir="$func_dirname_result" destname="$func_basename_result" # Not a directory, so check to see that there is only one file specified. set dummy $files; shift test "$#" -gt 1 && \ func_fatal_help "\`$dest' is not a directory" fi case $destdir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) for file in $files; do case $file in *.lo) ;; *) func_fatal_help "\`$destdir' must be an absolute directory name" ;; esac done ;; esac # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" staticlibs= future_libdirs= current_libdirs= for file in $files; do # Do each installation. case $file in *.$libext) # Do the static libraries later. func_append staticlibs " $file" ;; *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "\`$file' is not a valid libtool archive" library_names= old_library= relink_command= func_source "$file" # Add the libdir to current_libdirs if it is the destination. if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; *) func_append current_libdirs " $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; *) func_append future_libdirs " $libdir" ;; esac fi func_dirname "$file" "/" "" dir="$func_dirname_result" func_append dir "$objdir" if test -n "$relink_command"; then # Determine the prefix the user has applied to our future dir. inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"` # Don't allow the user to place us outside of our expected # location b/c this prevents finding dependent libraries that # are installed to the same prefix. # At present, this check doesn't affect windows .dll's that # are installed into $libdir/../bin (currently, that works fine) # but it's something to keep an eye on. test "$inst_prefix_dir" = "$destdir" && \ func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir" if test -n "$inst_prefix_dir"; then # Stick the inst_prefix_dir data into the link command. relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` else relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` fi func_warning "relinking \`$file'" func_show_eval "$relink_command" \ 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"' fi # See the names of the shared library. set dummy $library_names; shift if test -n "$1"; then realname="$1" shift srcname="$realname" test -n "$relink_command" && srcname="$realname"T # Install the shared library and build the symlinks. func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ 'exit $?' tstripme="$stripme" case $host_os in cygwin* | mingw* | pw32* | cegcc*) case $realname in *.dll.a) tstripme="" ;; esac ;; esac if test -n "$tstripme" && test -n "$striplib"; then func_show_eval "$striplib $destdir/$realname" 'exit $?' fi if test "$#" -gt 0; then # Delete the old symlinks, and create new ones. # Try `ln -sf' first, because the `ln' binary might depend on # the symlink we replace! Solaris /bin/ln does not understand -f, # so we also need to try rm && ln -s. for linkname do test "$linkname" != "$realname" \ && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" done fi # Do each command in the postinstall commands. lib="$destdir/$realname" func_execute_cmds "$postinstall_cmds" 'exit $?' fi # Install the pseudo-library for information purposes. func_basename "$file" name="$func_basename_result" instname="$dir/$name"i func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' # Maybe install the static library, too. test -n "$old_library" && func_append staticlibs " $dir/$old_library" ;; *.lo) # Install (i.e. copy) a libtool object. # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else func_basename "$file" destfile="$func_basename_result" destfile="$destdir/$destfile" fi # Deduce the name of the destination old-style object file. case $destfile in *.lo) func_lo2o "$destfile" staticdest=$func_lo2o_result ;; *.$objext) staticdest="$destfile" destfile= ;; *) func_fatal_help "cannot copy a libtool object to \`$destfile'" ;; esac # Install the libtool object if requested. test -n "$destfile" && \ func_show_eval "$install_prog $file $destfile" 'exit $?' # Install the old object if enabled. if test "$build_old_libs" = yes; then # Deduce the name of the old-style object file. func_lo2o "$file" staticobj=$func_lo2o_result func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?' fi exit $EXIT_SUCCESS ;; *) # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else func_basename "$file" destfile="$func_basename_result" destfile="$destdir/$destfile" fi # If the file is missing, and there is a .exe on the end, strip it # because it is most likely a libtool script we actually want to # install stripped_ext="" case $file in *.exe) if test ! -f "$file"; then func_stripname '' '.exe' "$file" file=$func_stripname_result stripped_ext=".exe" fi ;; esac # Do a test to see if this is really a libtool program. case $host in *cygwin* | *mingw*) if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" wrapper=$func_ltwrapper_scriptname_result else func_stripname '' '.exe' "$file" wrapper=$func_stripname_result fi ;; *) wrapper=$file ;; esac if func_ltwrapper_script_p "$wrapper"; then notinst_deplibs= relink_command= func_source "$wrapper" # Check the variables that should have been set. test -z "$generated_by_libtool_version" && \ func_fatal_error "invalid libtool wrapper script \`$wrapper'" finalize=yes for lib in $notinst_deplibs; do # Check to see that each library is installed. libdir= if test -f "$lib"; then func_source "$lib" fi libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test if test -n "$libdir" && test ! -f "$libfile"; then func_warning "\`$lib' has not been installed in \`$libdir'" finalize=no fi done relink_command= func_source "$wrapper" outputname= if test "$fast_install" = no && test -n "$relink_command"; then $opt_dry_run || { if test "$finalize" = yes; then tmpdir=`func_mktempdir` func_basename "$file$stripped_ext" file="$func_basename_result" outputname="$tmpdir/$file" # Replace the output file specification. relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` $opt_silent || { func_quote_for_expand "$relink_command" eval "func_echo $func_quote_for_expand_result" } if eval "$relink_command"; then : else func_error "error: relink \`$file' with the above command before installing it" $opt_dry_run || ${RM}r "$tmpdir" continue fi file="$outputname" else func_warning "cannot relink \`$file'" fi } else # Install the binary that we compiled earlier. file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"` fi fi # remove .exe since cygwin /usr/bin/install will append another # one anyway case $install_prog,$host in */usr/bin/install*,*cygwin*) case $file:$destfile in *.exe:*.exe) # this is ok ;; *.exe:*) destfile=$destfile.exe ;; *:*.exe) func_stripname '' '.exe' "$destfile" destfile=$func_stripname_result ;; esac ;; esac func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' $opt_dry_run || if test -n "$outputname"; then ${RM}r "$tmpdir" fi ;; esac done for file in $staticlibs; do func_basename "$file" name="$func_basename_result" # Set up the ranlib parameters. oldlib="$destdir/$name" func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result func_show_eval "$install_prog \$file \$oldlib" 'exit $?' if test -n "$stripme" && test -n "$old_striplib"; then func_show_eval "$old_striplib $tool_oldlib" 'exit $?' fi # Do each command in the postinstall commands. func_execute_cmds "$old_postinstall_cmds" 'exit $?' done test -n "$future_libdirs" && \ func_warning "remember to run \`$progname --finish$future_libdirs'" if test -n "$current_libdirs"; then # Maybe just do a dry run. $opt_dry_run && current_libdirs=" -n$current_libdirs" exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' else exit $EXIT_SUCCESS fi } test "$opt_mode" = install && func_mode_install ${1+"$@"} # func_generate_dlsyms outputname originator pic_p # Extract symbols from dlprefiles and create ${outputname}S.o with # a dlpreopen symbol table. func_generate_dlsyms () { $opt_debug my_outputname="$1" my_originator="$2" my_pic_p="${3-no}" my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'` my_dlsyms= if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then if test -n "$NM" && test -n "$global_symbol_pipe"; then my_dlsyms="${my_outputname}S.c" else func_error "not configured to extract global symbols from dlpreopened files" fi fi if test -n "$my_dlsyms"; then case $my_dlsyms in "") ;; *.c) # Discover the nlist of each of the dlfiles. nlist="$output_objdir/${my_outputname}.nm" func_show_eval "$RM $nlist ${nlist}S ${nlist}T" # Parse the name list into a source file. func_verbose "creating $output_objdir/$my_dlsyms" $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ /* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */ /* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */ #ifdef __cplusplus extern \"C\" { #endif #if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) #pragma GCC diagnostic ignored \"-Wstrict-prototypes\" #endif /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined(__osf__) /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif /* External symbol declarations for the compiler. */\ " if test "$dlself" = yes; then func_verbose "generating symbol list for \`$output'" $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` for progfile in $progfiles; do func_to_tool_file "$progfile" func_convert_file_msys_to_w32 func_verbose "extracting global C symbols from \`$func_to_tool_file_result'" $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'" done if test -n "$exclude_expsyms"; then $opt_dry_run || { eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi if test -n "$export_symbols_regex"; then $opt_dry_run || { eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi # Prepare the list of exported symbols if test -z "$export_symbols"; then export_symbols="$output_objdir/$outputname.exp" $opt_dry_run || { $RM $export_symbols eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' ;; esac } else $opt_dry_run || { eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' ;; esac } fi fi for dlprefile in $dlprefiles; do func_verbose "extracting global C symbols from \`$dlprefile'" func_basename "$dlprefile" name="$func_basename_result" case $host in *cygwin* | *mingw* | *cegcc* ) # if an import library, we need to obtain dlname if func_win32_import_lib_p "$dlprefile"; then func_tr_sh "$dlprefile" eval "curr_lafile=\$libfile_$func_tr_sh_result" dlprefile_dlbasename="" if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then # Use subshell, to avoid clobbering current variable values dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` if test -n "$dlprefile_dlname" ; then func_basename "$dlprefile_dlname" dlprefile_dlbasename="$func_basename_result" else # no lafile. user explicitly requested -dlpreopen . $sharedlib_from_linklib_cmd "$dlprefile" dlprefile_dlbasename=$sharedlib_from_linklib_result fi fi $opt_dry_run || { if test -n "$dlprefile_dlbasename" ; then eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' else func_warning "Could not compute DLL name from $name" eval '$ECHO ": $name " >> "$nlist"' fi func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" } else # not an import lib $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } fi ;; *) $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } ;; esac done $opt_dry_run || { # Make sure we have at least an empty file. test -f "$nlist" || : > "$nlist" if test -n "$exclude_expsyms"; then $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T $MV "$nlist"T "$nlist" fi # Try sorting and uniquifying the output. if $GREP -v "^: " < "$nlist" | if sort -k 3 /dev/null 2>&1; then sort -k 3 else sort +2 fi | uniq > "$nlist"S; then : else $GREP -v "^: " < "$nlist" > "$nlist"S fi if test -f "$nlist"S; then eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' else echo '/* NONE */' >> "$output_objdir/$my_dlsyms" fi echo >> "$output_objdir/$my_dlsyms" "\ /* The mapping between symbol names and symbols. */ typedef struct { const char *name; void *address; } lt_dlsymlist; extern LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[]; LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[] = {\ { \"$my_originator\", (void *) 0 }," case $need_lib_prefix in no) eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; *) eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; esac echo >> "$output_objdir/$my_dlsyms" "\ {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt_${my_prefix}_LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif\ " } # !$opt_dry_run pic_flag_for_symtable= case "$compile_command " in *" -static "*) ;; *) case $host in # compiling the symbol table file with pic_flag works around # a FreeBSD bug that causes programs to crash when -lm is # linked before any other PIC object. But we must not use # pic_flag when linking with -static. The problem exists in # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; *-*-hpux*) pic_flag_for_symtable=" $pic_flag" ;; *) if test "X$my_pic_p" != Xno; then pic_flag_for_symtable=" $pic_flag" fi ;; esac ;; esac symtab_cflags= for arg in $LTCFLAGS; do case $arg in -pie | -fpie | -fPIE) ;; *) func_append symtab_cflags " $arg" ;; esac done # Now compile the dynamic symbol file. func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' # Clean up the generated files. func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"' # Transform the symbol file into the correct name. symfileobj="$output_objdir/${my_outputname}S.$objext" case $host in *cygwin* | *mingw* | *cegcc* ) if test -f "$output_objdir/$my_outputname.def"; then compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` else compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` fi ;; *) compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` ;; esac ;; *) func_fatal_error "unknown suffix for \`$my_dlsyms'" ;; esac else # We keep going just in case the user didn't refer to # lt_preloaded_symbols. The linker will fail if global_symbol_pipe # really was required. # Nullify the symbol file. compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"` finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` fi } # func_win32_libid arg # return the library type of file 'arg' # # Need a lot of goo to handle *both* DLLs and import libs # Has to be a shell function in order to 'eat' the argument # that is supplied when $file_magic_command is called. # Despite the name, also deal with 64 bit binaries. func_win32_libid () { $opt_debug win32_libid_type="unknown" win32_fileres=`file -L $1 2>/dev/null` case $win32_fileres in *ar\ archive\ import\ library*) # definitely import win32_libid_type="x86 archive import" ;; *ar\ archive*) # could be an import, or static # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then func_to_tool_file "$1" func_convert_file_msys_to_w32 win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | $SED -n -e ' 1,100{ / I /{ s,.*,import, p q } }'` case $win32_nmres in import*) win32_libid_type="x86 archive import";; *) win32_libid_type="x86 archive static";; esac fi ;; *DLL*) win32_libid_type="x86 DLL" ;; *executable*) # but shell scripts are "executable" too... case $win32_fileres in *MS\ Windows\ PE\ Intel*) win32_libid_type="x86 DLL" ;; esac ;; esac $ECHO "$win32_libid_type" } # func_cygming_dll_for_implib ARG # # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib () { $opt_debug sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` } # func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs # # The is the core of a fallback implementation of a # platform-specific function to extract the name of the # DLL associated with the specified import library LIBNAME. # # SECTION_NAME is either .idata$6 or .idata$7, depending # on the platform and compiler that created the implib. # # Echos the name of the DLL associated with the # specified import library. func_cygming_dll_for_implib_fallback_core () { $opt_debug match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` $OBJDUMP -s --section "$1" "$2" 2>/dev/null | $SED '/^Contents of section '"$match_literal"':/{ # Place marker at beginning of archive member dllname section s/.*/====MARK====/ p d } # These lines can sometimes be longer than 43 characters, but # are always uninteresting /:[ ]*file format pe[i]\{,1\}-/d /^In archive [^:]*:/d # Ensure marker is printed /^====MARK====/p # Remove all lines with less than 43 characters /^.\{43\}/!d # From remaining lines, remove first 43 characters s/^.\{43\}//' | $SED -n ' # Join marker and all lines until next marker into a single line /^====MARK====/ b para H $ b para b :para x s/\n//g # Remove the marker s/^====MARK====// # Remove trailing dots and whitespace s/[\. \t]*$// # Print /./p' | # we now have a list, one entry per line, of the stringified # contents of the appropriate section of all members of the # archive which possess that section. Heuristic: eliminate # all those which have a first or second character that is # a '.' (that is, objdump's representation of an unprintable # character.) This should work for all archives with less than # 0x302f exports -- but will fail for DLLs whose name actually # begins with a literal '.' or a single character followed by # a '.'. # # Of those that remain, print the first one. $SED -e '/^\./d;/^.\./d;q' } # func_cygming_gnu_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is a GNU/binutils-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_gnu_implib_p () { $opt_debug func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` test -n "$func_cygming_gnu_implib_tmp" } # func_cygming_ms_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is an MS-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_ms_implib_p () { $opt_debug func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` test -n "$func_cygming_ms_implib_tmp" } # func_cygming_dll_for_implib_fallback ARG # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # # This fallback implementation is for use when $DLLTOOL # does not support the --identify-strict option. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib_fallback () { $opt_debug if func_cygming_gnu_implib_p "$1" ; then # binutils import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"` elif func_cygming_ms_implib_p "$1" ; then # ms-generated import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` else # unknown sharedlib_from_linklib_result="" fi } # func_extract_an_archive dir oldlib func_extract_an_archive () { $opt_debug f_ex_an_ar_dir="$1"; shift f_ex_an_ar_oldlib="$1" if test "$lock_old_archive_extraction" = yes; then lockfile=$f_ex_an_ar_oldlib.lock until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done fi func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ 'stat=$?; rm -f "$lockfile"; exit $stat' if test "$lock_old_archive_extraction" = yes; then $opt_dry_run || rm -f "$lockfile" fi if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then : else func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" fi } # func_extract_archives gentop oldlib ... func_extract_archives () { $opt_debug my_gentop="$1"; shift my_oldlibs=${1+"$@"} my_oldobjs="" my_xlib="" my_xabs="" my_xdir="" for my_xlib in $my_oldlibs; do # Extract the objects. case $my_xlib in [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; *) my_xabs=`pwd`"/$my_xlib" ;; esac func_basename "$my_xlib" my_xlib="$func_basename_result" my_xlib_u=$my_xlib while :; do case " $extracted_archives " in *" $my_xlib_u "*) func_arith $extracted_serial + 1 extracted_serial=$func_arith_result my_xlib_u=lt$extracted_serial-$my_xlib ;; *) break ;; esac done extracted_archives="$extracted_archives $my_xlib_u" my_xdir="$my_gentop/$my_xlib_u" func_mkdir_p "$my_xdir" case $host in *-darwin*) func_verbose "Extracting $my_xabs" # Do not bother doing anything if just a dry run $opt_dry_run || { darwin_orig_dir=`pwd` cd $my_xdir || exit $? darwin_archive=$my_xabs darwin_curdir=`pwd` darwin_base_archive=`basename "$darwin_archive"` darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` if test -n "$darwin_arches"; then darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` darwin_arch= func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" for darwin_arch in $darwin_arches ; do func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}" $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" func_extract_an_archive "`pwd`" "${darwin_base_archive}" cd "$darwin_curdir" $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" done # $darwin_arches ## Okay now we've a bunch of thin objects, gotta fatten them up :) darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u` darwin_file= darwin_files= for darwin_file in $darwin_filelist; do darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP` $LIPO -create -output "$darwin_file" $darwin_files done # $darwin_filelist $RM -rf unfat-$$ cd "$darwin_orig_dir" else cd $darwin_orig_dir func_extract_an_archive "$my_xdir" "$my_xabs" fi # $darwin_arches } # !$opt_dry_run ;; *) func_extract_an_archive "$my_xdir" "$my_xabs" ;; esac my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` done func_extract_archives_result="$my_oldobjs" } # func_emit_wrapper [arg=no] # # Emit a libtool wrapper script on stdout. # Don't directly open a file because we may want to # incorporate the script contents within a cygwin/mingw # wrapper executable. Must ONLY be called from within # func_mode_link because it depends on a number of variables # set therein. # # ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR # variable will take. If 'yes', then the emitted script # will assume that the directory in which it is stored is # the $objdir directory. This is a cygwin/mingw-specific # behavior. func_emit_wrapper () { func_emit_wrapper_arg1=${1-no} $ECHO "\ #! $SHELL # $output - temporary wrapper script for $objdir/$outputname # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION # # The $output program cannot be directly executed until all the libtool # libraries that it depends on are installed. # # This wrapper script should never be moved out of the build directory. # If it is, it will not operate correctly. # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. sed_quote_subst='$sed_quote_subst' # Be Bourne compatible if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH relink_command=\"$relink_command\" # This environment variable determines our operation mode. if test \"\$libtool_install_magic\" = \"$magic\"; then # install mode needs the following variables: generated_by_libtool_version='$macro_version' notinst_deplibs='$notinst_deplibs' else # When we are sourced in execute mode, \$file and \$ECHO are already set. if test \"\$libtool_execute_magic\" != \"$magic\"; then file=\"\$0\"" qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"` $ECHO "\ # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } ECHO=\"$qECHO\" fi # Very basic option parsing. These options are (a) specific to # the libtool wrapper, (b) are identical between the wrapper # /script/ and the wrapper /executable/ which is used only on # windows platforms, and (c) all begin with the string "--lt-" # (application programs are unlikely to have options which match # this pattern). # # There are only two supported options: --lt-debug and # --lt-dump-script. There is, deliberately, no --lt-help. # # The first argument to this parsing function should be the # script's $0 value, followed by "$@". lt_option_debug= func_parse_lt_options () { lt_script_arg0=\$0 shift for lt_opt do case \"\$lt_opt\" in --lt-debug) lt_option_debug=1 ;; --lt-dump-script) lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\` cat \"\$lt_dump_D/\$lt_dump_F\" exit 0 ;; --lt-*) \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 exit 1 ;; esac done # Print the debug banner immediately: if test -n \"\$lt_option_debug\"; then echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2 fi } # Used when --lt-debug. Prints its arguments to stdout # (redirection is the responsibility of the caller) func_lt_dump_args () { lt_dump_args_N=1; for lt_arg do \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\" lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` done } # Core function for launching the target application func_exec_program_core () { " case $host in # Backslashes separate directories on plain windows *-*-mingw | *-*-os2* | *-cegcc*) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} " ;; *) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir/\$program\" \${1+\"\$@\"} " ;; esac $ECHO "\ \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 exit 1 } # A function to encapsulate launching the target application # Strips options in the --lt-* namespace from \$@ and # launches target application with the remaining arguments. func_exec_program () { case \" \$* \" in *\\ --lt-*) for lt_wr_arg do case \$lt_wr_arg in --lt-*) ;; *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; esac shift done ;; esac func_exec_program_core \${1+\"\$@\"} } # Parse options func_parse_lt_options \"\$0\" \${1+\"\$@\"} # Find the directory that this script lives in. thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\` test \"x\$thisdir\" = \"x\$file\" && thisdir=. # Follow symbolic links until we get to the real thisdir. file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\` while test -n \"\$file\"; do destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\` # If there was a directory component, then change thisdir. if test \"x\$destdir\" != \"x\$file\"; then case \"\$destdir\" in [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; *) thisdir=\"\$thisdir/\$destdir\" ;; esac fi file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\` file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` done # Usually 'no', except on cygwin/mingw when embedded into # the cwrapper. WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then # special case for '.' if test \"\$thisdir\" = \".\"; then thisdir=\`pwd\` fi # remove .libs from thisdir case \"\$thisdir\" in *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; $objdir ) thisdir=. ;; esac fi # Try to get the absolute directory name. absdir=\`cd \"\$thisdir\" && pwd\` test -n \"\$absdir\" && thisdir=\"\$absdir\" " if test "$fast_install" = yes; then $ECHO "\ program=lt-'$outputname'$exeext progdir=\"\$thisdir/$objdir\" if test ! -f \"\$progdir/\$program\" || { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ test \"X\$file\" != \"X\$progdir/\$program\"; }; then file=\"\$\$-\$program\" if test ! -d \"\$progdir\"; then $MKDIR \"\$progdir\" else $RM \"\$progdir/\$file\" fi" $ECHO "\ # relink executable if necessary if test -n \"\$relink_command\"; then if relink_command_output=\`eval \$relink_command 2>&1\`; then : else $ECHO \"\$relink_command_output\" >&2 $RM \"\$progdir/\$file\" exit 1 fi fi $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || { $RM \"\$progdir/\$program\"; $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } $RM \"\$progdir/\$file\" fi" else $ECHO "\ program='$outputname' progdir=\"\$thisdir/$objdir\" " fi $ECHO "\ if test -f \"\$progdir/\$program\"; then" # fixup the dll searchpath if we need to. # # Fix the DLL searchpath if we need to. Do this before prepending # to shlibpath, because on Windows, both are PATH and uninstalled # libraries must come first. if test -n "$dllsearchpath"; then $ECHO "\ # Add the dll search path components to the executable PATH PATH=$dllsearchpath:\$PATH " fi # Export our shlibpath_var if we have one. if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $ECHO "\ # Add our own library path to $shlibpath_var $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" # Some systems cannot cope with colon-terminated $shlibpath_var # The second colon is a workaround for a bug in BeOS R4 sed $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\` export $shlibpath_var " fi $ECHO "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. func_exec_program \${1+\"\$@\"} fi else # The program doesn't exist. \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 exit 1 fi fi\ " } # func_emit_cwrapperexe_src # emit the source code for a wrapper executable on stdout # Must ONLY be called from within func_mode_link because # it depends on a number of variable set therein. func_emit_cwrapperexe_src () { cat < #include #ifdef _MSC_VER # include # include # include #else # include # include # ifdef __CYGWIN__ # include # endif #endif #include #include #include #include #include #include #include #include /* declarations of non-ANSI functions */ #if defined(__MINGW32__) # ifdef __STRICT_ANSI__ int _putenv (const char *); # endif #elif defined(__CYGWIN__) # ifdef __STRICT_ANSI__ char *realpath (const char *, char *); int putenv (char *); int setenv (const char *, const char *, int); # endif /* #elif defined (other platforms) ... */ #endif /* portability defines, excluding path handling macros */ #if defined(_MSC_VER) # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv # define S_IXUSR _S_IEXEC # ifndef _INTPTR_T_DEFINED # define _INTPTR_T_DEFINED # define intptr_t int # endif #elif defined(__MINGW32__) # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv #elif defined(__CYGWIN__) # define HAVE_SETENV # define FOPEN_WB "wb" /* #elif defined (other platforms) ... */ #endif #if defined(PATH_MAX) # define LT_PATHMAX PATH_MAX #elif defined(MAXPATHLEN) # define LT_PATHMAX MAXPATHLEN #else # define LT_PATHMAX 1024 #endif #ifndef S_IXOTH # define S_IXOTH 0 #endif #ifndef S_IXGRP # define S_IXGRP 0 #endif /* path handling portability macros */ #ifndef DIR_SEPARATOR # define DIR_SEPARATOR '/' # define PATH_SEPARATOR ':' #endif #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ defined (__OS2__) # define HAVE_DOS_BASED_FILE_SYSTEM # define FOPEN_WB "wb" # ifndef DIR_SEPARATOR_2 # define DIR_SEPARATOR_2 '\\' # endif # ifndef PATH_SEPARATOR_2 # define PATH_SEPARATOR_2 ';' # endif #endif #ifndef DIR_SEPARATOR_2 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) #else /* DIR_SEPARATOR_2 */ # define IS_DIR_SEPARATOR(ch) \ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) #endif /* DIR_SEPARATOR_2 */ #ifndef PATH_SEPARATOR_2 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) #else /* PATH_SEPARATOR_2 */ # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) #endif /* PATH_SEPARATOR_2 */ #ifndef FOPEN_WB # define FOPEN_WB "w" #endif #ifndef _O_BINARY # define _O_BINARY 0 #endif #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) #define XFREE(stale) do { \ if (stale) { free ((void *) stale); stale = 0; } \ } while (0) #if defined(LT_DEBUGWRAPPER) static int lt_debug = 1; #else static int lt_debug = 0; #endif const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ void *xmalloc (size_t num); char *xstrdup (const char *string); const char *base_name (const char *name); char *find_executable (const char *wrapper); char *chase_symlinks (const char *pathspec); int make_executable (const char *path); int check_executable (const char *path); char *strendzap (char *str, const char *pat); void lt_debugprintf (const char *file, int line, const char *fmt, ...); void lt_fatal (const char *file, int line, const char *message, ...); static const char *nonnull (const char *s); static const char *nonempty (const char *s); void lt_setenv (const char *name, const char *value); char *lt_extend_str (const char *orig_value, const char *add, int to_end); void lt_update_exe_path (const char *name, const char *value); void lt_update_lib_path (const char *name, const char *value); char **prepare_spawn (char **argv); void lt_dump_script (FILE *f); EOF cat <= 0) && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) return 1; else return 0; } int make_executable (const char *path) { int rval = 0; struct stat st; lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", nonempty (path)); if ((!path) || (!*path)) return 0; if (stat (path, &st) >= 0) { rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); } return rval; } /* Searches for the full path of the wrapper. Returns newly allocated full path name if found, NULL otherwise Does not chase symlinks, even on platforms that support them. */ char * find_executable (const char *wrapper) { int has_slash = 0; const char *p; const char *p_next; /* static buffer for getcwd */ char tmp[LT_PATHMAX + 1]; int tmp_len; char *concat_name; lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", nonempty (wrapper)); if ((wrapper == NULL) || (*wrapper == '\0')) return NULL; /* Absolute path? */ #if defined (HAVE_DOS_BASED_FILE_SYSTEM) if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } else { #endif if (IS_DIR_SEPARATOR (wrapper[0])) { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } #if defined (HAVE_DOS_BASED_FILE_SYSTEM) } #endif for (p = wrapper; *p; p++) if (*p == '/') { has_slash = 1; break; } if (!has_slash) { /* no slashes; search PATH */ const char *path = getenv ("PATH"); if (path != NULL) { for (p = path; *p; p = p_next) { const char *q; size_t p_len; for (q = p; *q; q++) if (IS_PATH_SEPARATOR (*q)) break; p_len = q - p; p_next = (*q == '\0' ? q : q + 1); if (p_len == 0) { /* empty path: current directory */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); } else { concat_name = XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, p, p_len); concat_name[p_len] = '/'; strcpy (concat_name + p_len + 1, wrapper); } if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } } /* not found in PATH; assume curdir */ } /* Relative path | not found in path: prepend cwd */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); return NULL; } char * chase_symlinks (const char *pathspec) { #ifndef S_ISLNK return xstrdup (pathspec); #else char buf[LT_PATHMAX]; struct stat s; char *tmp_pathspec = xstrdup (pathspec); char *p; int has_symlinks = 0; while (strlen (tmp_pathspec) && !has_symlinks) { lt_debugprintf (__FILE__, __LINE__, "checking path component for symlinks: %s\n", tmp_pathspec); if (lstat (tmp_pathspec, &s) == 0) { if (S_ISLNK (s.st_mode) != 0) { has_symlinks = 1; break; } /* search backwards for last DIR_SEPARATOR */ p = tmp_pathspec + strlen (tmp_pathspec) - 1; while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) p--; if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) { /* no more DIR_SEPARATORS left */ break; } *p = '\0'; } else { lt_fatal (__FILE__, __LINE__, "error accessing file \"%s\": %s", tmp_pathspec, nonnull (strerror (errno))); } } XFREE (tmp_pathspec); if (!has_symlinks) { return xstrdup (pathspec); } tmp_pathspec = realpath (pathspec, buf); if (tmp_pathspec == 0) { lt_fatal (__FILE__, __LINE__, "could not follow symlinks for %s", pathspec); } return xstrdup (tmp_pathspec); #endif } char * strendzap (char *str, const char *pat) { size_t len, patlen; assert (str != NULL); assert (pat != NULL); len = strlen (str); patlen = strlen (pat); if (patlen <= len) { str += len - patlen; if (strcmp (str, pat) == 0) *str = '\0'; } return str; } void lt_debugprintf (const char *file, int line, const char *fmt, ...) { va_list args; if (lt_debug) { (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line); va_start (args, fmt); (void) vfprintf (stderr, fmt, args); va_end (args); } } static void lt_error_core (int exit_status, const char *file, int line, const char *mode, const char *message, va_list ap) { fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); vfprintf (stderr, message, ap); fprintf (stderr, ".\n"); if (exit_status >= 0) exit (exit_status); } void lt_fatal (const char *file, int line, const char *message, ...) { va_list ap; va_start (ap, message); lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap); va_end (ap); } static const char * nonnull (const char *s) { return s ? s : "(null)"; } static const char * nonempty (const char *s) { return (s && !*s) ? "(empty)" : nonnull (s); } void lt_setenv (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_setenv) setting '%s' to '%s'\n", nonnull (name), nonnull (value)); { #ifdef HAVE_SETENV /* always make a copy, for consistency with !HAVE_SETENV */ char *str = xstrdup (value); setenv (name, str, 1); #else int len = strlen (name) + 1 + strlen (value) + 1; char *str = XMALLOC (char, len); sprintf (str, "%s=%s", name, value); if (putenv (str) != EXIT_SUCCESS) { XFREE (str); } #endif } } char * lt_extend_str (const char *orig_value, const char *add, int to_end) { char *new_value; if (orig_value && *orig_value) { int orig_value_len = strlen (orig_value); int add_len = strlen (add); new_value = XMALLOC (char, add_len + orig_value_len + 1); if (to_end) { strcpy (new_value, orig_value); strcpy (new_value + orig_value_len, add); } else { strcpy (new_value, add); strcpy (new_value + add_len, orig_value); } } else { new_value = xstrdup (add); } return new_value; } void lt_update_exe_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); /* some systems can't cope with a ':'-terminated path #' */ int len = strlen (new_value); while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1])) { new_value[len-1] = '\0'; } lt_setenv (name, new_value); XFREE (new_value); } } void lt_update_lib_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); lt_setenv (name, new_value); XFREE (new_value); } } EOF case $host_os in mingw*) cat <<"EOF" /* Prepares an argument vector before calling spawn(). Note that spawn() does not by itself call the command interpreter (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") : ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); GetVersionEx(&v); v.dwPlatformId == VER_PLATFORM_WIN32_NT; }) ? "cmd.exe" : "command.com"). Instead it simply concatenates the arguments, separated by ' ', and calls CreateProcess(). We must quote the arguments since Win32 CreateProcess() interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a special way: - Space and tab are interpreted as delimiters. They are not treated as delimiters if they are surrounded by double quotes: "...". - Unescaped double quotes are removed from the input. Their only effect is that within double quotes, space and tab are treated like normal characters. - Backslashes not followed by double quotes are not special. - But 2*n+1 backslashes followed by a double quote become n backslashes followed by a double quote (n >= 0): \" -> " \\\" -> \" \\\\\" -> \\" */ #define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" #define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" char ** prepare_spawn (char **argv) { size_t argc; char **new_argv; size_t i; /* Count number of arguments. */ for (argc = 0; argv[argc] != NULL; argc++) ; /* Allocate new argument vector. */ new_argv = XMALLOC (char *, argc + 1); /* Put quoted arguments into the new argument vector. */ for (i = 0; i < argc; i++) { const char *string = argv[i]; if (string[0] == '\0') new_argv[i] = xstrdup ("\"\""); else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) { int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); size_t length; unsigned int backslashes; const char *s; char *quoted_string; char *p; length = 0; backslashes = 0; if (quote_around) length++; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') length += backslashes + 1; length++; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) length += backslashes + 1; quoted_string = XMALLOC (char, length + 1); p = quoted_string; backslashes = 0; if (quote_around) *p++ = '"'; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') { unsigned int j; for (j = backslashes + 1; j > 0; j--) *p++ = '\\'; } *p++ = c; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) { unsigned int j; for (j = backslashes; j > 0; j--) *p++ = '\\'; *p++ = '"'; } *p = '\0'; new_argv[i] = quoted_string; } else new_argv[i] = (char *) string; } new_argv[argc] = NULL; return new_argv; } EOF ;; esac cat <<"EOF" void lt_dump_script (FILE* f) { EOF func_emit_wrapper yes | $SED -n -e ' s/^\(.\{79\}\)\(..*\)/\1\ \2/ h s/\([\\"]\)/\\\1/g s/$/\\n/ s/\([^\n]*\).*/ fputs ("\1", f);/p g D' cat <<"EOF" } EOF } # end: func_emit_cwrapperexe_src # func_win32_import_lib_p ARG # True if ARG is an import lib, as indicated by $file_magic_cmd func_win32_import_lib_p () { $opt_debug case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in *import*) : ;; *) false ;; esac } # func_mode_link arg... func_mode_link () { $opt_debug case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) # It is impossible to link a dll without this setting, and # we shouldn't force the makefile maintainer to figure out # which system we are compiling for in order to pass an extra # flag for every libtool invocation. # allow_undefined=no # FIXME: Unfortunately, there are problems with the above when trying # to make a dll which has undefined symbols, in which case not # even a static library is built. For now, we need to specify # -no-undefined on the libtool link line when we can be certain # that all symbols are satisfied, otherwise we get a static library. allow_undefined=yes ;; *) allow_undefined=yes ;; esac libtool_args=$nonopt base_compile="$nonopt $@" compile_command=$nonopt finalize_command=$nonopt compile_rpath= finalize_rpath= compile_shlibpath= finalize_shlibpath= convenience= old_convenience= deplibs= old_deplibs= compiler_flags= linker_flags= dllsearchpath= lib_search_path=`pwd` inst_prefix_dir= new_inherited_linker_flags= avoid_version=no bindir= dlfiles= dlprefiles= dlself=no export_dynamic=no export_symbols= export_symbols_regex= generated= libobjs= ltlibs= module=no no_install=no objs= non_pic_objects= precious_files_regex= prefer_static_libs=no preload=no prev= prevarg= release= rpath= xrpath= perm_rpath= temp_rpath= thread_safe=no vinfo= vinfo_number=no weak_libs= single_module="${wl}-single_module" func_infer_tag $base_compile # We need to know -static, to get the right output filenames. for arg do case $arg in -shared) test "$build_libtool_libs" != yes && \ func_fatal_configuration "can not build a shared library" build_old_libs=no break ;; -all-static | -static | -static-libtool-libs) case $arg in -all-static) if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then func_warning "complete static linking is impossible in this configuration" fi if test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; -static) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=built ;; -static-libtool-libs) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; esac build_libtool_libs=no build_old_libs=yes break ;; esac done # See if our shared archives depend on static archives. test -n "$old_archive_from_new_cmds" && build_old_libs=yes # Go through the arguments, transforming them on the way. while test "$#" -gt 0; do arg="$1" shift func_quote_for_eval "$arg" qarg=$func_quote_for_eval_unquoted_result func_append libtool_args " $func_quote_for_eval_result" # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in output) func_append compile_command " @OUTPUT@" func_append finalize_command " @OUTPUT@" ;; esac case $prev in bindir) bindir="$arg" prev= continue ;; dlfiles|dlprefiles) if test "$preload" = no; then # Add the symbol object into the linking commands. func_append compile_command " @SYMFILE@" func_append finalize_command " @SYMFILE@" preload=yes fi case $arg in *.la | *.lo) ;; # We handle these cases below. force) if test "$dlself" = no; then dlself=needless export_dynamic=yes fi prev= continue ;; self) if test "$prev" = dlprefiles; then dlself=yes elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then dlself=yes else dlself=needless export_dynamic=yes fi prev= continue ;; *) if test "$prev" = dlfiles; then func_append dlfiles " $arg" else func_append dlprefiles " $arg" fi prev= continue ;; esac ;; expsyms) export_symbols="$arg" test -f "$arg" \ || func_fatal_error "symbol file \`$arg' does not exist" prev= continue ;; expsyms_regex) export_symbols_regex="$arg" prev= continue ;; framework) case $host in *-*-darwin*) case "$deplibs " in *" $qarg.ltframework "*) ;; *) func_append deplibs " $qarg.ltframework" # this is fixed later ;; esac ;; esac prev= continue ;; inst_prefix) inst_prefix_dir="$arg" prev= continue ;; objectlist) if test -f "$arg"; then save_arg=$arg moreargs= for fil in `cat "$save_arg"` do # func_append moreargs " $fil" arg=$fil # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test "$pic_object" = none && test "$non_pic_object" = none; then func_fatal_error "cannot find name of object for \`$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "\`$arg' is not a valid libtool object" fi fi done else func_fatal_error "link input file \`$arg' does not exist" fi arg=$save_arg prev= continue ;; precious_regex) precious_files_regex="$arg" prev= continue ;; release) release="-$arg" prev= continue ;; rpath | xrpath) # We need an absolute path. case $arg in [\\/]* | [A-Za-z]:[\\/]*) ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac if test "$prev" = rpath; then case "$rpath " in *" $arg "*) ;; *) func_append rpath " $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; *) func_append xrpath " $arg" ;; esac fi prev= continue ;; shrext) shrext_cmds="$arg" prev= continue ;; weak) func_append weak_libs " $arg" prev= continue ;; xcclinker) func_append linker_flags " $qarg" func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xcompiler) func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xlinker) func_append linker_flags " $qarg" func_append compiler_flags " $wl$qarg" prev= func_append compile_command " $wl$qarg" func_append finalize_command " $wl$qarg" continue ;; *) eval "$prev=\"\$arg\"" prev= continue ;; esac fi # test -n "$prev" prevarg="$arg" case $arg in -all-static) if test -n "$link_static_flag"; then # See comment for -static flag below, for more details. func_append compile_command " $link_static_flag" func_append finalize_command " $link_static_flag" fi continue ;; -allow-undefined) # FIXME: remove this flag sometime in the future. func_fatal_error "\`-allow-undefined' must not be used because it is the default" ;; -avoid-version) avoid_version=yes continue ;; -bindir) prev=bindir continue ;; -dlopen) prev=dlfiles continue ;; -dlpreopen) prev=dlprefiles continue ;; -export-dynamic) export_dynamic=yes continue ;; -export-symbols | -export-symbols-regex) if test -n "$export_symbols" || test -n "$export_symbols_regex"; then func_fatal_error "more than one -exported-symbols argument is not allowed" fi if test "X$arg" = "X-export-symbols"; then prev=expsyms else prev=expsyms_regex fi continue ;; -framework) prev=framework continue ;; -inst-prefix-dir) prev=inst_prefix continue ;; # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* # so, if we see these flags be careful not to treat them like -L -L[A-Z][A-Z]*:*) case $with_gcc/$host in no/*-*-irix* | /*-*-irix*) func_append compile_command " $arg" func_append finalize_command " $arg" ;; esac continue ;; -L*) func_stripname "-L" '' "$arg" if test -z "$func_stripname_result"; then if test "$#" -gt 0; then func_fatal_error "require no space between \`-L' and \`$1'" else func_fatal_error "need path for \`-L' option" fi fi func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) absdir=`cd "$dir" && pwd` test -z "$absdir" && \ func_fatal_error "cannot determine absolute directory name of \`$dir'" dir="$absdir" ;; esac case "$deplibs " in *" -L$dir "* | *" $arg "*) # Will only happen for absolute or sysroot arguments ;; *) # Preserve sysroot, but never include relative directories case $dir in [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;; *) func_append deplibs " -L$dir" ;; esac func_append lib_search_path " $dir" ;; esac case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` case :$dllsearchpath: in *":$dir:"*) ;; ::) dllsearchpath=$dir;; *) func_append dllsearchpath ":$dir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac continue ;; -l*) if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) # These systems don't actually have a C or math library (as such) continue ;; *-*-os2*) # These systems don't actually have a C library (as such) test "X$arg" = "X-lc" && continue ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. test "X$arg" = "X-lc" && continue ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C and math libraries are in the System framework func_append deplibs " System.ltframework" continue ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype test "X$arg" = "X-lc" && continue ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work test "X$arg" = "X-lc" && continue ;; esac elif test "X$arg" = "X-lc_r"; then case $host in *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc_r directly, use -pthread flag. continue ;; esac fi func_append deplibs " $arg" continue ;; -module) module=yes continue ;; # Tru64 UNIX uses -model [arg] to determine the layout of C++ # classes, name mangling, and exception handling. # Darwin uses the -arch flag to determine output architecture. -model|-arch|-isysroot|--sysroot) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" prev=xcompiler continue ;; -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" case "$new_inherited_linker_flags " in *" $arg "*) ;; * ) func_append new_inherited_linker_flags " $arg" ;; esac continue ;; -multi_module) single_module="${wl}-multi_module" continue ;; -no-fast-install) fast_install=no continue ;; -no-install) case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) # The PATH hackery in wrapper scripts is required on Windows # and Darwin in order for the loader to find any dlls it needs. func_warning "\`-no-install' is ignored for $host" func_warning "assuming \`-no-fast-install' instead" fast_install=no ;; *) no_install=yes ;; esac continue ;; -no-undefined) allow_undefined=no continue ;; -objectlist) prev=objectlist continue ;; -o) prev=output ;; -precious-files-regex) prev=precious_regex continue ;; -release) prev=release continue ;; -rpath) prev=rpath continue ;; -R) prev=xrpath continue ;; -R*) func_stripname '-R' '' "$arg" dir=$func_stripname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; =*) func_stripname '=' '' "$dir" dir=$lt_sysroot$func_stripname_result ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac continue ;; -shared) # The effects of -shared are defined in a previous loop. continue ;; -shrext) prev=shrext continue ;; -static | -static-libtool-libs) # The effects of -static are defined in a previous loop. # We used to do the same as -all-static on platforms that # didn't have a PIC flag, but the assumption that the effects # would be equivalent was wrong. It would break on at least # Digital Unix and AIX. continue ;; -thread-safe) thread_safe=yes continue ;; -version-info) prev=vinfo continue ;; -version-number) prev=vinfo vinfo_number=yes continue ;; -weak) prev=weak continue ;; -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" func_quote_for_eval "$flag" func_append arg " $func_quote_for_eval_result" func_append compiler_flags " $func_quote_for_eval_result" done IFS="$save_ifs" func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Wl,*) func_stripname '-Wl,' '' "$arg" args=$func_stripname_result arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" func_quote_for_eval "$flag" func_append arg " $wl$func_quote_for_eval_result" func_append compiler_flags " $wl$func_quote_for_eval_result" func_append linker_flags " $func_quote_for_eval_result" done IFS="$save_ifs" func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Xcompiler) prev=xcompiler continue ;; -Xlinker) prev=xlinker continue ;; -XCClinker) prev=xcclinker continue ;; # -msg_* for osf cc -msg_*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; # Flags to be passed through unchanged, with rationale: # -64, -mips[0-9] enable 64-bit mode for the SGI compiler # -r[0-9][0-9]* specify processor for the SGI compiler # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler # +DA*, +DD* enable 64-bit mode for the HP compiler # -q* compiler args for the IBM compiler # -m*, -t[45]*, -txscale* architecture-specific flags for GCC # -F/path path to uninstalled frameworks, gcc on darwin # -p, -pg, --coverage, -fprofile-* profiling flags for GCC # @file GCC response files # -tp=* Portland pgcc target processor selection # --sysroot=* for sysroot support # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ -O*|-flto*|-fwhopr*|-fuse-linker-plugin) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" func_append compile_command " $arg" func_append finalize_command " $arg" func_append compiler_flags " $arg" continue ;; # Some other compiler flag. -* | +*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; *.$objext) # A standard object. func_append objs " $arg" ;; *.lo) # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test "$pic_object" = none && test "$non_pic_object" = none; then func_fatal_error "cannot find name of object for \`$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "\`$arg' is not a valid libtool object" fi fi ;; *.$libext) # An archive. func_append deplibs " $arg" func_append old_deplibs " $arg" continue ;; *.la) # A libtool-controlled library. func_resolve_sysroot "$arg" if test "$prev" = dlfiles; then # This library was specified with -dlopen. func_append dlfiles " $func_resolve_sysroot_result" prev= elif test "$prev" = dlprefiles; then # The library was specified with -dlpreopen. func_append dlprefiles " $func_resolve_sysroot_result" prev= else func_append deplibs " $func_resolve_sysroot_result" fi continue ;; # Some other compiler argument. *) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; esac # arg # Now actually substitute the argument into the commands. if test -n "$arg"; then func_append compile_command " $arg" func_append finalize_command " $arg" fi done # argument parsing loop test -n "$prev" && \ func_fatal_help "the \`$prevarg' option requires an argument" if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then eval arg=\"$export_dynamic_flag_spec\" func_append compile_command " $arg" func_append finalize_command " $arg" fi oldlibs= # calculate the name of the file, without its directory func_basename "$output" outputname="$func_basename_result" libobjs_save="$libobjs" if test -n "$shlibpath_var"; then # get the directories listed in $shlibpath_var eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\` else shlib_search_path= fi eval sys_lib_search_path=\"$sys_lib_search_path_spec\" eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" func_dirname "$output" "/" "" output_objdir="$func_dirname_result$objdir" func_to_tool_file "$output_objdir/" tool_output_objdir=$func_to_tool_file_result # Create the object directory. func_mkdir_p "$output_objdir" # Determine the type of output case $output in "") func_fatal_help "you must specify an output file" ;; *.$libext) linkmode=oldlib ;; *.lo | *.$objext) linkmode=obj ;; *.la) linkmode=lib ;; *) linkmode=prog ;; # Anything else should be a program. esac specialdeplibs= libs= # Find all interdependent deplibs by searching for libraries # that are linked more than once (e.g. -la -lb -la) for deplib in $deplibs; do if $opt_preserve_dup_deps ; then case "$libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append libs " $deplib" done if test "$linkmode" = lib; then libs="$predeps $libs $compiler_lib_search_path $postdeps" # Compute libraries that are listed more than once in $predeps # $postdeps and mark them as special (i.e., whose duplicates are # not to be eliminated). pre_post_deps= if $opt_duplicate_compiler_generated_deps; then for pre_post_dep in $predeps $postdeps; do case "$pre_post_deps " in *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;; esac func_append pre_post_deps " $pre_post_dep" done fi pre_post_deps= fi deplibs= newdependency_libs= newlib_search_path= need_relink=no # whether we're linking any uninstalled libtool libraries notinst_deplibs= # not-installed libtool libraries notinst_path= # paths that contain not-installed libtool libraries case $linkmode in lib) passes="conv dlpreopen link" for file in $dlfiles $dlprefiles; do case $file in *.la) ;; *) func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file" ;; esac done ;; prog) compile_deplibs= finalize_deplibs= alldeplibs=no newdlfiles= newdlprefiles= passes="conv scan dlopen dlpreopen link" ;; *) passes="conv" ;; esac for pass in $passes; do # The preopen pass in lib mode reverses $deplibs; put it back here # so that -L comes before libs that need it for instance... if test "$linkmode,$pass" = "lib,link"; then ## FIXME: Find the place where the list is rebuilt in the wrong ## order, and fix it there properly tmp_deplibs= for deplib in $deplibs; do tmp_deplibs="$deplib $tmp_deplibs" done deplibs="$tmp_deplibs" fi if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan"; then libs="$deplibs" deplibs= fi if test "$linkmode" = prog; then case $pass in dlopen) libs="$dlfiles" ;; dlpreopen) libs="$dlprefiles" ;; link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; esac fi if test "$linkmode,$pass" = "lib,dlpreopen"; then # Collect and forward deplibs of preopened libtool libs for lib in $dlprefiles; do # Ignore non-libtool-libs dependency_libs= func_resolve_sysroot "$lib" case $lib in *.la) func_source "$func_resolve_sysroot_result" ;; esac # Collect preopened libtool deplibs, except any this library # has declared as weak libs for deplib in $dependency_libs; do func_basename "$deplib" deplib_base=$func_basename_result case " $weak_libs " in *" $deplib_base "*) ;; *) func_append deplibs " $deplib" ;; esac done done libs="$dlprefiles" fi if test "$pass" = dlopen; then # Collect dlpreopened libraries save_deplibs="$deplibs" deplibs= fi for deplib in $libs; do lib= found=no case $deplib in -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append compiler_flags " $deplib" if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -l*) if test "$linkmode" != lib && test "$linkmode" != prog; then func_warning "\`-l' is ignored for archives/objects" continue fi func_stripname '-l' '' "$deplib" name=$func_stripname_result if test "$linkmode" = lib; then searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" else searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" fi for searchdir in $searchdirs; do for search_ext in .la $std_shrext .so .a; do # Search the libtool library lib="$searchdir/lib${name}${search_ext}" if test -f "$lib"; then if test "$search_ext" = ".la"; then found=yes else found=no fi break 2 fi done done if test "$found" != yes; then # deplib doesn't seem to be a libtool library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue else # deplib is a libtool library # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, # We need to do some special things here, and not later. if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $deplib "*) if func_lalib_p "$lib"; then library_names= old_library= func_source "$lib" for l in $old_library $library_names; do ll="$l" done if test "X$ll" = "X$old_library" ; then # only static version available found=no func_dirname "$lib" "" "." ladir="$func_dirname_result" lib=$ladir/$old_library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue fi fi ;; *) ;; esac fi fi ;; # -l *.ltframework) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -L*) case $linkmode in lib) deplibs="$deplib $deplibs" test "$pass" = conv && continue newdependency_libs="$deplib $newdependency_libs" func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; prog) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi if test "$pass" = scan; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; *) func_warning "\`-L' is ignored for archives/objects" ;; esac # linkmode continue ;; # -L -R*) if test "$pass" = link; then func_stripname '-R' '' "$deplib" func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # Make sure the xrpath contains only unique directories. case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac fi deplibs="$deplib $deplibs" continue ;; *.la) func_resolve_sysroot "$deplib" lib=$func_resolve_sysroot_result ;; *.$libext) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi case $linkmode in lib) # Linking convenience modules into shared libraries is allowed, # but linking other static libraries is non-portable. case " $dlpreconveniencelibs " in *" $deplib "*) ;; *) valid_a_lib=no case $deplibs_check_method in match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then valid_a_lib=yes fi ;; pass_all) valid_a_lib=yes ;; esac if test "$valid_a_lib" != yes; then echo $ECHO "*** Warning: Trying to link with static lib archive $deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because the file extensions .$libext of this argument makes me believe" echo "*** that it is just a static archive that I should not use here." else echo $ECHO "*** Warning: Linking the shared library $output against the" $ECHO "*** static library $deplib is not portable!" deplibs="$deplib $deplibs" fi ;; esac continue ;; prog) if test "$pass" != link; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi continue ;; esac # linkmode ;; # *.$libext *.lo | *.$objext) if test "$pass" = conv; then deplibs="$deplib $deplibs" elif test "$linkmode" = prog; then if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlopen support or we're linking statically, # we need to preload. func_append newdlprefiles " $deplib" compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append newdlfiles " $deplib" fi fi continue ;; %DEPLIBS%) alldeplibs=yes continue ;; esac # case $deplib if test "$found" = yes || test -f "$lib"; then : else func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'" fi # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$lib" \ || func_fatal_error "\`$lib' is not a valid libtool archive" func_dirname "$lib" "" "." ladir="$func_dirname_result" dlname= dlopen= dlpreopen= libdir= library_names= old_library= inherited_linker_flags= # If the library was installed with an old release of libtool, # it will not redefine variables installed, or shouldnotlink installed=yes shouldnotlink=no avoidtemprpath= # Read the .la file func_source "$lib" # Convert "-framework foo" to "foo.ltframework" if test -n "$inherited_linker_flags"; then tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'` for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do case " $new_inherited_linker_flags " in *" $tmp_inherited_linker_flag "*) ;; *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";; esac done fi dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan" || { test "$linkmode" != prog && test "$linkmode" != lib; }; then test -n "$dlopen" && func_append dlfiles " $dlopen" test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen" fi if test "$pass" = conv; then # Only check for convenience libraries deplibs="$lib $deplibs" if test -z "$libdir"; then if test -z "$old_library"; then func_fatal_error "cannot find name of link library for \`$lib'" fi # It is a libtool convenience library, so add in its objects. func_append convenience " $ladir/$objdir/$old_library" func_append old_convenience " $ladir/$objdir/$old_library" elif test "$linkmode" != prog && test "$linkmode" != lib; then func_fatal_error "\`$lib' is not a convenience library" fi tmp_libs= for deplib in $dependency_libs; do deplibs="$deplib $deplibs" if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done continue fi # $pass = conv # Get the name of the library we link against. linklib= if test -n "$old_library" && { test "$prefer_static_libs" = yes || test "$prefer_static_libs,$installed" = "built,no"; }; then linklib=$old_library else for l in $old_library $library_names; do linklib="$l" done fi if test -z "$linklib"; then func_fatal_error "cannot find name of link library for \`$lib'" fi # This library was specified with -dlopen. if test "$pass" = dlopen; then if test -z "$libdir"; then func_fatal_error "cannot -dlopen a convenience library: \`$lib'" fi if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlname, no dlopen support or we're linking # statically, we need to preload. We also need to preload any # dependent libraries so libltdl's deplib preloader doesn't # bomb out in the load deplibs phase. func_append dlprefiles " $lib $dependency_libs" else func_append newdlfiles " $lib" fi continue fi # $pass = dlopen # We need an absolute path. case $ladir in [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; *) abs_ladir=`cd "$ladir" && pwd` if test -z "$abs_ladir"; then func_warning "cannot determine absolute directory name of \`$ladir'" func_warning "passing it literally to the linker, although it might fail" abs_ladir="$ladir" fi ;; esac func_basename "$lib" laname="$func_basename_result" # Find the relevant object directory and library name. if test "X$installed" = Xyes; then if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then func_warning "library \`$lib' was moved." dir="$ladir" absdir="$abs_ladir" libdir="$abs_ladir" else dir="$lt_sysroot$libdir" absdir="$lt_sysroot$libdir" fi test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes else if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then dir="$ladir" absdir="$abs_ladir" # Remove this search path later func_append notinst_path " $abs_ladir" else dir="$ladir/$objdir" absdir="$abs_ladir/$objdir" # Remove this search path later func_append notinst_path " $abs_ladir" fi fi # $installed = yes func_stripname 'lib' '.la' "$laname" name=$func_stripname_result # This library was specified with -dlpreopen. if test "$pass" = dlpreopen; then if test -z "$libdir" && test "$linkmode" = prog; then func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'" fi case "$host" in # special handling for platforms with PE-DLLs. *cygwin* | *mingw* | *cegcc* ) # Linker will automatically link against shared library if both # static and shared are present. Therefore, ensure we extract # symbols from the import library if a shared library is present # (otherwise, the dlopen module name will be incorrect). We do # this by putting the import library name into $newdlprefiles. # We recover the dlopen module name by 'saving' the la file # name in a special purpose variable, and (later) extracting the # dlname from the la file. if test -n "$dlname"; then func_tr_sh "$dir/$linklib" eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname" func_append newdlprefiles " $dir/$linklib" else func_append newdlprefiles " $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ func_append dlpreconveniencelibs " $dir/$old_library" fi ;; * ) # Prefer using a static library (so that no silly _DYNAMIC symbols # are required to link). if test -n "$old_library"; then func_append newdlprefiles " $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ func_append dlpreconveniencelibs " $dir/$old_library" # Otherwise, use the dlname, so that lt_dlopen finds it. elif test -n "$dlname"; then func_append newdlprefiles " $dir/$dlname" else func_append newdlprefiles " $dir/$linklib" fi ;; esac fi # $pass = dlpreopen if test -z "$libdir"; then # Link the convenience library if test "$linkmode" = lib; then deplibs="$dir/$old_library $deplibs" elif test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$dir/$old_library $compile_deplibs" finalize_deplibs="$dir/$old_library $finalize_deplibs" else deplibs="$lib $deplibs" # used for prog,scan pass fi continue fi if test "$linkmode" = prog && test "$pass" != link; then func_append newlib_search_path " $ladir" deplibs="$lib $deplibs" linkalldeplibs=no if test "$link_all_deplibs" != no || test -z "$library_names" || test "$build_libtool_libs" = no; then linkalldeplibs=yes fi tmp_libs= for deplib in $dependency_libs; do case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; esac # Need to link against all dependency_libs? if test "$linkalldeplibs" = yes; then deplibs="$deplib $deplibs" else # Need to hardcode shared library paths # or/and link against static libraries newdependency_libs="$deplib $newdependency_libs" fi if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done # for deplib continue fi # $linkmode = prog... if test "$linkmode,$pass" = "prog,link"; then if test -n "$library_names" && { { test "$prefer_static_libs" = no || test "$prefer_static_libs,$installed" = "built,yes"; } || test -z "$old_library"; }; then # We need to hardcode the library path if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then # Make sure the rpath contains only unique directories. case "$temp_rpath:" in *"$absdir:"*) ;; *) func_append temp_rpath "$absdir:" ;; esac fi # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi # $linkmode,$pass = prog,link... if test "$alldeplibs" = yes && { test "$deplibs_check_method" = pass_all || { test "$build_libtool_libs" = yes && test -n "$library_names"; }; }; then # We only need to search for static libraries continue fi fi link_static=no # Whether the deplib will be linked statically use_static_libs=$prefer_static_libs if test "$use_static_libs" = built && test "$installed" = yes; then use_static_libs=no fi if test -n "$library_names" && { test "$use_static_libs" = no || test -z "$old_library"; }; then case $host in *cygwin* | *mingw* | *cegcc*) # No point in relinking DLLs because paths are not encoded func_append notinst_deplibs " $lib" need_relink=no ;; *) if test "$installed" = no; then func_append notinst_deplibs " $lib" need_relink=yes fi ;; esac # This is a shared library # Warn about portability, can't link against -module's on some # systems (darwin). Don't bleat about dlopened modules though! dlopenmodule="" for dlpremoduletest in $dlprefiles; do if test "X$dlpremoduletest" = "X$lib"; then dlopenmodule="$dlpremoduletest" break fi done if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then echo if test "$linkmode" = prog; then $ECHO "*** Warning: Linking the executable $output against the loadable module" else $ECHO "*** Warning: Linking the shared library $output against the loadable module" fi $ECHO "*** $linklib is not portable!" fi if test "$linkmode" = lib && test "$hardcode_into_libs" = yes; then # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi if test -n "$old_archive_from_expsyms_cmds"; then # figure out the soname set dummy $library_names shift realname="$1" shift libname=`eval "\\$ECHO \"$libname_spec\""` # use dlname if we got it. it's perfectly good, no? if test -n "$dlname"; then soname="$dlname" elif test -n "$soname_spec"; then # bleh windows case $host in *cygwin* | mingw* | *cegcc*) func_arith $current - $age major=$func_arith_result versuffix="-$major" ;; esac eval soname=\"$soname_spec\" else soname="$realname" fi # Make a new name for the extract_expsyms_cmds to use soroot="$soname" func_basename "$soroot" soname="$func_basename_result" func_stripname 'lib' '.dll' "$soname" newlib=libimp-$func_stripname_result.a # If the library has no export list, then create one now if test -f "$output_objdir/$soname-def"; then : else func_verbose "extracting exported symbol list from \`$soname'" func_execute_cmds "$extract_expsyms_cmds" 'exit $?' fi # Create $newlib if test -f "$output_objdir/$newlib"; then :; else func_verbose "generating import library for \`$soname'" func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?' fi # make sure the library variables are pointing to the new library dir=$output_objdir linklib=$newlib fi # test -n "$old_archive_from_expsyms_cmds" if test "$linkmode" = prog || test "$opt_mode" != relink; then add_shlibpath= add_dir= add= lib_linked=yes case $hardcode_action in immediate | unsupported) if test "$hardcode_direct" = no; then add="$dir/$linklib" case $host in *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; *-*-sysv4*uw2*) add_dir="-L$dir" ;; *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ *-*-unixware7*) add_dir="-L$dir" ;; *-*-darwin* ) # if the lib is a (non-dlopened) module then we can not # link against it, someone is ignoring the earlier warnings if /usr/bin/file -L $add 2> /dev/null | $GREP ": [^:]* bundle" >/dev/null ; then if test "X$dlopenmodule" != "X$lib"; then $ECHO "*** Warning: lib $linklib is a module, not a shared library" if test -z "$old_library" ; then echo echo "*** And there doesn't seem to be a static archive available" echo "*** The link will probably fail, sorry" else add="$dir/$old_library" fi elif test -n "$old_library"; then add="$dir/$old_library" fi fi esac elif test "$hardcode_minus_L" = no; then case $host in *-*-sunos*) add_shlibpath="$dir" ;; esac add_dir="-L$dir" add="-l$name" elif test "$hardcode_shlibpath_var" = no; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; relink) if test "$hardcode_direct" = yes && test "$hardcode_direct_absolute" = no; then add="$dir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$absdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; *) lib_linked=no ;; esac if test "$lib_linked" != yes; then func_fatal_configuration "unsupported hardcode properties" fi if test -n "$add_shlibpath"; then case :$compile_shlibpath: in *":$add_shlibpath:"*) ;; *) func_append compile_shlibpath "$add_shlibpath:" ;; esac fi if test "$linkmode" = prog; then test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" test -n "$add" && compile_deplibs="$add $compile_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" if test "$hardcode_direct" != yes && test "$hardcode_minus_L" != yes && test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac fi fi fi if test "$linkmode" = prog || test "$opt_mode" = relink; then add_shlibpath= add_dir= add= # Finalize command for both is simple: just hardcode it. if test "$hardcode_direct" = yes && test "$hardcode_direct_absolute" = no; then add="$libdir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$libdir" add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac add="-l$name" elif test "$hardcode_automatic" = yes; then if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib" ; then add="$inst_prefix_dir$libdir/$linklib" else add="$libdir/$linklib" fi else # We cannot seem to hardcode it, guess we'll fake it. add_dir="-L$libdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" fi if test "$linkmode" = prog; then test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" test -n "$add" && finalize_deplibs="$add $finalize_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" fi fi elif test "$linkmode" = prog; then # Here we assume that one of hardcode_direct or hardcode_minus_L # is not unsupported. This is valid on all known static and # shared platforms. if test "$hardcode_direct" != unsupported; then test -n "$old_library" && linklib="$old_library" compile_deplibs="$dir/$linklib $compile_deplibs" finalize_deplibs="$dir/$linklib $finalize_deplibs" else compile_deplibs="-l$name -L$dir $compile_deplibs" finalize_deplibs="-l$name -L$dir $finalize_deplibs" fi elif test "$build_libtool_libs" = yes; then # Not a shared library if test "$deplibs_check_method" != pass_all; then # We're trying link a shared library against a static one # but the system doesn't support it. # Just print a warning and add the library to dependency_libs so # that the program can be linked against the static library. echo $ECHO "*** Warning: This system can not link to static lib archive $lib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have." if test "$module" = yes; then echo "*** But as you try to build a module library, libtool will still create " echo "*** a static module, that should work as long as the dlopening application" echo "*** is linked with the -dlopen flag to resolve symbols at runtime." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using \`nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi else deplibs="$dir/$old_library $deplibs" link_static=yes fi fi # link shared/static library? if test "$linkmode" = lib; then if test -n "$dependency_libs" && { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes || test "$link_static" = yes; }; then # Extract -R from dependency_libs temp_deplibs= for libdir in $dependency_libs; do case $libdir in -R*) func_stripname '-R' '' "$libdir" temp_xrpath=$func_stripname_result case " $xrpath " in *" $temp_xrpath "*) ;; *) func_append xrpath " $temp_xrpath";; esac;; *) func_append temp_deplibs " $libdir";; esac done dependency_libs="$temp_deplibs" fi func_append newlib_search_path " $absdir" # Link against this library test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" # ... and its dependency_libs tmp_libs= for deplib in $dependency_libs; do newdependency_libs="$deplib $newdependency_libs" case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result";; *) func_resolve_sysroot "$deplib" ;; esac if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $func_resolve_sysroot_result "*) func_append specialdeplibs " $func_resolve_sysroot_result" ;; esac fi func_append tmp_libs " $func_resolve_sysroot_result" done if test "$link_all_deplibs" != no; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do path= case $deplib in -L*) path="$deplib" ;; *.la) func_resolve_sysroot "$deplib" deplib=$func_resolve_sysroot_result func_dirname "$deplib" "" "." dir=$func_dirname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then func_warning "cannot determine absolute directory name of \`$dir'" absdir="$dir" fi ;; esac if $GREP "^installed=no" $deplib > /dev/null; then case $host in *-*-darwin*) depdepl= eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` if test -n "$deplibrary_names" ; then for tmp in $deplibrary_names ; do depdepl=$tmp done if test -f "$absdir/$objdir/$depdepl" ; then depdepl="$absdir/$objdir/$depdepl" darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` if test -z "$darwin_install_name"; then darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` fi func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}" func_append linker_flags " -dylib_file ${darwin_install_name}:${depdepl}" path= fi fi ;; *) path="-L$absdir/$objdir" ;; esac else eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` test -z "$libdir" && \ func_fatal_error "\`$deplib' is not a valid libtool archive" test "$absdir" != "$libdir" && \ func_warning "\`$deplib' seems to be moved" path="-L$absdir" fi ;; esac case " $deplibs " in *" $path "*) ;; *) deplibs="$path $deplibs" ;; esac done fi # link_all_deplibs != no fi # linkmode = lib done # for deplib in $libs if test "$pass" = link; then if test "$linkmode" = "prog"; then compile_deplibs="$new_inherited_linker_flags $compile_deplibs" finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" else compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` fi fi dependency_libs="$newdependency_libs" if test "$pass" = dlpreopen; then # Link the dlpreopened libraries before other libraries for deplib in $save_deplibs; do deplibs="$deplib $deplibs" done fi if test "$pass" != dlopen; then if test "$pass" != conv; then # Make sure lib_search_path contains only unique directories. lib_search_path= for dir in $newlib_search_path; do case "$lib_search_path " in *" $dir "*) ;; *) func_append lib_search_path " $dir" ;; esac done newlib_search_path= fi if test "$linkmode,$pass" != "prog,link"; then vars="deplibs" else vars="compile_deplibs finalize_deplibs" fi for var in $vars dependency_libs; do # Add libraries to $var in reverse order eval tmp_libs=\"\$$var\" new_libs= for deplib in $tmp_libs; do # FIXME: Pedantically, this is the right thing to do, so # that some nasty dependency loop isn't accidentally # broken: #new_libs="$deplib $new_libs" # Pragmatically, this seems to cause very few problems in # practice: case $deplib in -L*) new_libs="$deplib $new_libs" ;; -R*) ;; *) # And here is the reason: when a library appears more # than once as an explicit dependence of a library, or # is implicitly linked in more than once by the # compiler, it is considered special, and multiple # occurrences thereof are not removed. Compare this # with having the same library being listed as a # dependency of multiple other libraries: in this case, # we know (pedantically, we assume) the library does not # need to be listed more than once, so we keep only the # last copy. This is not always right, but it is rare # enough that we require users that really mean to play # such unportable linking tricks to link the library # using -Wl,-lname, so that libtool does not consider it # for duplicate removal. case " $specialdeplibs " in *" $deplib "*) new_libs="$deplib $new_libs" ;; *) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$deplib $new_libs" ;; esac ;; esac ;; esac done tmp_libs= for deplib in $new_libs; do case $deplib in -L*) case " $tmp_libs " in *" $deplib "*) ;; *) func_append tmp_libs " $deplib" ;; esac ;; *) func_append tmp_libs " $deplib" ;; esac done eval $var=\"$tmp_libs\" done # for var fi # Last step: remove runtime libs from dependency_libs # (they stay in deplibs) tmp_libs= for i in $dependency_libs ; do case " $predeps $postdeps $compiler_lib_search_path " in *" $i "*) i="" ;; esac if test -n "$i" ; then func_append tmp_libs " $i" fi done dependency_libs=$tmp_libs done # for pass if test "$linkmode" = prog; then dlfiles="$newdlfiles" fi if test "$linkmode" = prog || test "$linkmode" = lib; then dlprefiles="$newdlprefiles" fi case $linkmode in oldlib) if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then func_warning "\`-dlopen' is ignored for archives" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "\`-l' and \`-L' are ignored for archives" ;; esac test -n "$rpath" && \ func_warning "\`-rpath' is ignored for archives" test -n "$xrpath" && \ func_warning "\`-R' is ignored for archives" test -n "$vinfo" && \ func_warning "\`-version-info/-version-number' is ignored for archives" test -n "$release" && \ func_warning "\`-release' is ignored for archives" test -n "$export_symbols$export_symbols_regex" && \ func_warning "\`-export-symbols' is ignored for archives" # Now set the variables for building old libraries. build_libtool_libs=no oldlibs="$output" func_append objs "$old_deplibs" ;; lib) # Make sure we only generate libraries of the form `libNAME.la'. case $outputname in lib*) func_stripname 'lib' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" ;; *) test "$module" = no && \ func_fatal_help "libtool library \`$output' must begin with \`lib'" if test "$need_lib_prefix" != no; then # Add the "lib" prefix for modules if required func_stripname '' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" else func_stripname '' '.la' "$outputname" libname=$func_stripname_result fi ;; esac if test -n "$objs"; then if test "$deplibs_check_method" != pass_all; then func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs" else echo $ECHO "*** Warning: Linking the shared library $output against the non-libtool" $ECHO "*** objects $objs is not portable!" func_append libobjs " $objs" fi fi test "$dlself" != no && \ func_warning "\`-dlopen self' is ignored for libtool libraries" set dummy $rpath shift test "$#" -gt 1 && \ func_warning "ignoring multiple \`-rpath's for a libtool library" install_libdir="$1" oldlibs= if test -z "$rpath"; then if test "$build_libtool_libs" = yes; then # Building a libtool convenience library. # Some compilers have problems with a `.al' extension so # convenience libraries should have the same extension an # archive normally would. oldlibs="$output_objdir/$libname.$libext $oldlibs" build_libtool_libs=convenience build_old_libs=yes fi test -n "$vinfo" && \ func_warning "\`-version-info/-version-number' is ignored for convenience libraries" test -n "$release" && \ func_warning "\`-release' is ignored for convenience libraries" else # Parse the version information argument. save_ifs="$IFS"; IFS=':' set dummy $vinfo 0 0 0 shift IFS="$save_ifs" test -n "$7" && \ func_fatal_help "too many parameters to \`-version-info'" # convert absolute version numbers to libtool ages # this retains compatibility with .la files and attempts # to make the code below a bit more comprehensible case $vinfo_number in yes) number_major="$1" number_minor="$2" number_revision="$3" # # There are really only two kinds -- those that # use the current revision as the major version # and those that subtract age and use age as # a minor version. But, then there is irix # which has an extra 1 added just for fun # case $version_type in # correct linux to gnu/linux during the next big refactor darwin|linux|osf|windows|none) func_arith $number_major + $number_minor current=$func_arith_result age="$number_minor" revision="$number_revision" ;; freebsd-aout|freebsd-elf|qnx|sunos) current="$number_major" revision="$number_minor" age="0" ;; irix|nonstopux) func_arith $number_major + $number_minor current=$func_arith_result age="$number_minor" revision="$number_minor" lt_irix_increment=no ;; esac ;; no) current="$1" revision="$2" age="$3" ;; esac # Check that each of the things are valid numbers. case $current in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "CURRENT \`$current' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac case $revision in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "REVISION \`$revision' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac case $age in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "AGE \`$age' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac if test "$age" -gt "$current"; then func_error "AGE \`$age' is greater than the current interface number \`$current'" func_fatal_error "\`$vinfo' is not valid version information" fi # Calculate the version variables. major= versuffix= verstring= case $version_type in none) ;; darwin) # Like Linux, but with the current version available in # verstring for coding it into the library header func_arith $current - $age major=.$func_arith_result versuffix="$major.$age.$revision" # Darwin ld doesn't like 0 for these options... func_arith $current + 1 minor_current=$func_arith_result xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" ;; freebsd-aout) major=".$current" versuffix=".$current.$revision"; ;; freebsd-elf) major=".$current" versuffix=".$current" ;; irix | nonstopux) if test "X$lt_irix_increment" = "Xno"; then func_arith $current - $age else func_arith $current - $age + 1 fi major=$func_arith_result case $version_type in nonstopux) verstring_prefix=nonstopux ;; *) verstring_prefix=sgi ;; esac verstring="$verstring_prefix$major.$revision" # Add in all the interfaces that we are compatible with. loop=$revision while test "$loop" -ne 0; do func_arith $revision - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring="$verstring_prefix$major.$iface:$verstring" done # Before this point, $major must not contain `.'. major=.$major versuffix="$major.$revision" ;; linux) # correct to gnu/linux during the next big refactor func_arith $current - $age major=.$func_arith_result versuffix="$major.$age.$revision" ;; osf) func_arith $current - $age major=.$func_arith_result versuffix=".$current.$age.$revision" verstring="$current.$age.$revision" # Add in all the interfaces that we are compatible with. loop=$age while test "$loop" -ne 0; do func_arith $current - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring="$verstring:${iface}.0" done # Make executables depend on our current version. func_append verstring ":${current}.0" ;; qnx) major=".$current" versuffix=".$current" ;; sunos) major=".$current" versuffix=".$current.$revision" ;; windows) # Use '-' rather than '.', since we only want one # extension on DOS 8.3 filesystems. func_arith $current - $age major=$func_arith_result versuffix="-$major" ;; *) func_fatal_configuration "unknown library version type \`$version_type'" ;; esac # Clear the version info if we defaulted, and they specified a release. if test -z "$vinfo" && test -n "$release"; then major= case $version_type in darwin) # we can't check for "0.0" in archive_cmds due to quoting # problems, so we reset it completely verstring= ;; *) verstring="0.0" ;; esac if test "$need_version" = no; then versuffix= else versuffix=".0.0" fi fi # Remove version info from name if versioning should be avoided if test "$avoid_version" = yes && test "$need_version" = no; then major= versuffix= verstring="" fi # Check to see if the archive will have undefined symbols. if test "$allow_undefined" = yes; then if test "$allow_undefined_flag" = unsupported; then func_warning "undefined symbols not allowed in $host shared libraries" build_libtool_libs=no build_old_libs=yes fi else # Don't allow undefined symbols. allow_undefined_flag="$no_undefined_flag" fi fi func_generate_dlsyms "$libname" "$libname" "yes" func_append libobjs " $symfileobj" test "X$libobjs" = "X " && libobjs= if test "$opt_mode" != relink; then # Remove our outputs, but don't remove object files since they # may have been created when compiling PIC objects. removelist= tempremovelist=`$ECHO "$output_objdir/*"` for p in $tempremovelist; do case $p in *.$objext | *.gcno) ;; $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) if test "X$precious_files_regex" != "X"; then if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 then continue fi fi func_append removelist " $p" ;; *) ;; esac done test -n "$removelist" && \ func_show_eval "${RM}r \$removelist" fi # Now set the variables for building old libraries. if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then func_append oldlibs " $output_objdir/$libname.$libext" # Transform .lo files to .o files. oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP` fi # Eliminate all temporary directories. #for path in $notinst_path; do # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"` # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"` # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"` #done if test -n "$xrpath"; then # If the user specified any rpath flags, then add them. temp_xrpath= for libdir in $xrpath; do func_replace_sysroot "$libdir" func_append temp_xrpath " -R$func_replace_sysroot_result" case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then dependency_libs="$temp_xrpath $dependency_libs" fi fi # Make sure dlfiles contains only unique files that won't be dlpreopened old_dlfiles="$dlfiles" dlfiles= for lib in $old_dlfiles; do case " $dlprefiles $dlfiles " in *" $lib "*) ;; *) func_append dlfiles " $lib" ;; esac done # Make sure dlprefiles contains only unique files old_dlprefiles="$dlprefiles" dlprefiles= for lib in $old_dlprefiles; do case "$dlprefiles " in *" $lib "*) ;; *) func_append dlprefiles " $lib" ;; esac done if test "$build_libtool_libs" = yes; then if test -n "$rpath"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) # these systems don't actually have a c library (as such)! ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C library is in the System framework func_append deplibs " System.ltframework" ;; *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work ;; *) # Add libc to deplibs on all other systems if necessary. if test "$build_libtool_need_lc" = "yes"; then func_append deplibs " -lc" fi ;; esac fi # Transform deplibs into only deplibs that can be linked in shared. name_save=$name libname_save=$libname release_save=$release versuffix_save=$versuffix major_save=$major # I'm not sure if I'm treating the release correctly. I think # release should show up in the -l (ie -lgmp5) so we don't want to # add it in twice. Is that correct? release="" versuffix="" major="" newdeplibs= droppeddeps=no case $deplibs_check_method in pass_all) # Don't check for shared/static. Everything works. # This might be a little naive. We might want to check # whether the library exists or not. But this is on # osf3 & osf4 and I'm not really sure... Just # implementing what was already the behavior. newdeplibs=$deplibs ;; test_compile) # This code stresses the "libraries are programs" paradigm to its # limits. Maybe even breaks it. We compile a program, linking it # against the deplibs as a proxy for the library. Then we can check # whether they linked in statically or dynamically with ldd. $opt_dry_run || $RM conftest.c cat > conftest.c </dev/null` $nocaseglob else potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` fi for potent_lib in $potential_libs; do # Follow soft links. if ls -lLd "$potent_lib" 2>/dev/null | $GREP " -> " >/dev/null; then continue fi # The statement above tries to avoid entering an # endless loop below, in case of cyclic links. # We might still enter an endless loop, since a link # loop can be closed while we follow links, # but so what? potlib="$potent_lib" while test -h "$potlib" 2>/dev/null; do potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` case $potliblink in [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; *) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | $SED -e 10q | $EGREP "$file_magic_regex" > /dev/null; then func_append newdeplibs " $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $ECHO "*** with $libname but no candidates were found. (...for file magic test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a file magic. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` for a_deplib in $deplibs; do case $a_deplib in -l*) func_stripname -l '' "$a_deplib" name=$func_stripname_result if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $a_deplib "*) func_append newdeplibs " $a_deplib" a_deplib="" ;; esac fi if test -n "$a_deplib" ; then libname=`eval "\\$ECHO \"$libname_spec\""` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do potential_libs=`ls $i/$libname[.-]* 2>/dev/null` for potent_lib in $potential_libs; do potlib="$potent_lib" # see symlink-check above in file_magic test if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \ $EGREP "$match_pattern_regex" > /dev/null; then func_append newdeplibs " $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a regex pattern. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; none | unknown | *) newdeplibs="" tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'` if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then for i in $predeps $postdeps ; do # can't use Xsed below, because $i might contain '/' tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"` done fi case $tmp_deplibs in *[!\ \ ]*) echo if test "X$deplibs_check_method" = "Xnone"; then echo "*** Warning: inter-library dependencies are not supported in this platform." else echo "*** Warning: inter-library dependencies are not known to be supported." fi echo "*** All declared inter-library dependencies are being dropped." droppeddeps=yes ;; esac ;; esac versuffix=$versuffix_save major=$major_save release=$release_save libname=$libname_save name=$name_save case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library with the System framework newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac if test "$droppeddeps" = yes; then if test "$module" = yes; then echo echo "*** Warning: libtool could not satisfy all declared inter-library" $ECHO "*** dependencies of module $libname. Therefore, libtool will create" echo "*** a static module, that should work as long as the dlopening" echo "*** application is linked with the -dlopen flag." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using \`nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi else echo "*** The inter-library dependencies that have been dropped here will be" echo "*** automatically added whenever a program is linked with this library" echo "*** or is declared to -dlopen it." if test "$allow_undefined" = no; then echo echo "*** Since this library must not contain undefined symbols," echo "*** because either the platform does not support them or" echo "*** it was explicitly requested with -no-undefined," echo "*** libtool will only create a static version of it." if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi fi fi # Done checking deplibs! deplibs=$newdeplibs fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" case $host in *-*-darwin*) newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done deplibs="$new_libs" # All the library-specific variables (install_libdir is set above). library_names= old_library= dlname= # Test again, we may have decided not to build it any more if test "$build_libtool_libs" = yes; then # Remove ${wl} instances when linking with ld. # FIXME: should test the right _cmds variable. case $archive_cmds in *\$LD\ *) wl= ;; esac if test "$hardcode_into_libs" = yes; then # Hardcode the library paths hardcode_libdirs= dep_rpath= rpath="$finalize_rpath" test "$opt_mode" != relink && rpath="$compile_rpath$rpath" for libdir in $rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then func_replace_sysroot "$libdir" libdir=$func_replace_sysroot_result if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append dep_rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append perm_rpath " $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval "dep_rpath=\"$hardcode_libdir_flag_spec\"" fi if test -n "$runpath_var" && test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append rpath "$dir:" done eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" fi test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" fi shlibpath="$finalize_shlibpath" test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath" if test -n "$shlibpath"; then eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" fi # Get the real and link names of the library. eval shared_ext=\"$shrext_cmds\" eval library_names=\"$library_names_spec\" set dummy $library_names shift realname="$1" shift if test -n "$soname_spec"; then eval soname=\"$soname_spec\" else soname="$realname" fi if test -z "$dlname"; then dlname=$soname fi lib="$output_objdir/$realname" linknames= for link do func_append linknames " $link" done # Use standard objects if they are pic test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP` test "X$libobjs" = "X " && libobjs= delfiles= if test -n "$export_symbols" && test -n "$include_expsyms"; then $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" export_symbols="$output_objdir/$libname.uexp" func_append delfiles " $export_symbols" fi orig_export_symbols= case $host_os in cygwin* | mingw* | cegcc*) if test -n "$export_symbols" && test -z "$export_symbols_regex"; then # exporting using user supplied symfile if test "x`$SED 1q $export_symbols`" != xEXPORTS; then # and it's NOT already a .def file. Must figure out # which of the given symbols are data symbols and tag # them as such. So, trigger use of export_symbols_cmds. # export_symbols gets reassigned inside the "prepare # the list of exported symbols" if statement, so the # include_expsyms logic still works. orig_export_symbols="$export_symbols" export_symbols= always_export_symbols=yes fi fi ;; esac # Prepare the list of exported symbols if test -z "$export_symbols"; then if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then func_verbose "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $opt_dry_run || $RM $export_symbols cmds=$export_symbols_cmds save_ifs="$IFS"; IFS='~' for cmd1 in $cmds; do IFS="$save_ifs" # Take the normal branch if the nm_file_list_spec branch # doesn't work or if tool conversion is not needed. case $nm_file_list_spec~$to_tool_file_cmd in *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*) try_normal_branch=yes eval cmd=\"$cmd1\" func_len " $cmd" len=$func_len_result ;; *) try_normal_branch=no ;; esac if test "$try_normal_branch" = yes \ && { test "$len" -lt "$max_cmd_len" \ || test "$max_cmd_len" -le -1; } then func_show_eval "$cmd" 'exit $?' skipped_export=false elif test -n "$nm_file_list_spec"; then func_basename "$output" output_la=$func_basename_result save_libobjs=$libobjs save_output=$output output=${output_objdir}/${output_la}.nm func_to_tool_file "$output" libobjs=$nm_file_list_spec$func_to_tool_file_result func_append delfiles " $output" func_verbose "creating $NM input file list: $output" for obj in $save_libobjs; do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > "$output" eval cmd=\"$cmd1\" func_show_eval "$cmd" 'exit $?' output=$save_output libobjs=$save_libobjs skipped_export=false else # The command line is too long to execute in one step. func_verbose "using reloadable object file for export list..." skipped_export=: # Break out early, otherwise skipped_export may be # set to false by a later but shorter cmd. break fi done IFS="$save_ifs" if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi fi if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols="$export_symbols" test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi tmp_deplibs= for test_deplib in $deplibs; do case " $convenience " in *" $test_deplib "*) ;; *) func_append tmp_deplibs " $test_deplib" ;; esac done deplibs="$tmp_deplibs" if test -n "$convenience"; then if test -n "$whole_archive_flag_spec" && test "$compiler_needs_object" = yes && test -z "$libobjs"; then # extract the archives, so we have objects to list. # TODO: could optimize this to just extract one archive. whole_archive_flag_spec= fi if test -n "$whole_archive_flag_spec"; then save_libobjs=$libobjs eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= else gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $convenience func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi fi if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" func_append linker_flags " $flag" fi # Make a backup of the uninstalled library when relinking if test "$opt_mode" = relink; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? fi # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then eval test_cmds=\"$module_expsym_cmds\" cmds=$module_expsym_cmds else eval test_cmds=\"$module_cmds\" cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then eval test_cmds=\"$archive_expsym_cmds\" cmds=$archive_expsym_cmds else eval test_cmds=\"$archive_cmds\" cmds=$archive_cmds fi fi if test "X$skipped_export" != "X:" && func_len " $test_cmds" && len=$func_len_result && test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then : else # The command line is too long to link in one step, link piecewise # or, if using GNU ld and skipped_export is not :, use a linker # script. # Save the value of $output and $libobjs because we want to # use them later. If we have whole_archive_flag_spec, we # want to use save_libobjs as it was before # whole_archive_flag_spec was expanded, because we can't # assume the linker understands whole_archive_flag_spec. # This may have to be revisited, in case too many # convenience libraries get linked in and end up exceeding # the spec. if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then save_libobjs=$libobjs fi save_output=$output func_basename "$output" output_la=$func_basename_result # Clear the reloadable object creation command queue and # initialize k to one. test_cmds= concat_cmds= objlist= last_robj= k=1 if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then output=${output_objdir}/${output_la}.lnkscript func_verbose "creating GNU ld script: $output" echo 'INPUT (' > $output for obj in $save_libobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done echo ')' >> $output func_append delfiles " $output" func_to_tool_file "$output" output=$func_to_tool_file_result elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then output=${output_objdir}/${output_la}.lnk func_verbose "creating linker input file list: $output" : > $output set x $save_libobjs shift firstobj= if test "$compiler_needs_object" = yes; then firstobj="$1 " shift fi for obj do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done func_append delfiles " $output" func_to_tool_file "$output" output=$firstobj\"$file_list_spec$func_to_tool_file_result\" else if test -n "$save_libobjs"; then func_verbose "creating reloadable object files..." output=$output_objdir/$output_la-${k}.$objext eval test_cmds=\"$reload_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 # Loop over the list of objects to be linked. for obj in $save_libobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result if test "X$objlist" = X || test "$len" -lt "$max_cmd_len"; then func_append objlist " $obj" else # The command $test_cmds is almost too long, add a # command to the queue. if test "$k" -eq 1 ; then # The first file doesn't have a previous command to add. reload_objs=$objlist eval concat_cmds=\"$reload_cmds\" else # All subsequent reloadable object files will link in # the last one created. reload_objs="$objlist $last_robj" eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\" fi last_robj=$output_objdir/$output_la-${k}.$objext func_arith $k + 1 k=$func_arith_result output=$output_objdir/$output_la-${k}.$objext objlist=" $obj" func_len " $last_robj" func_arith $len0 + $func_len_result len=$func_arith_result fi done # Handle the remaining objects by creating one last # reloadable object file. All subsequent reloadable object # files will link in the last one created. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ reload_objs="$objlist $last_robj" eval concat_cmds=\"\${concat_cmds}$reload_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\" fi func_append delfiles " $output" else output= fi if ${skipped_export-false}; then func_verbose "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $opt_dry_run || $RM $export_symbols libobjs=$output # Append the command to create the export file. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" fi fi test -n "$save_libobjs" && func_verbose "creating a temporary reloadable object file: $output" # Loop through the commands generated above and execute them. save_ifs="$IFS"; IFS='~' for cmd in $concat_cmds; do IFS="$save_ifs" $opt_silent || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$opt_mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS="$save_ifs" if test -n "$export_symbols_regex" && ${skipped_export-false}; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi if ${skipped_export-false}; then if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols="$export_symbols" test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi fi libobjs=$output # Restore the value of output. output=$save_output if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= fi # Expand the library linking commands again to reset the # value of $libobjs for piecewise linking. # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then cmds=$module_expsym_cmds else cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then cmds=$archive_expsym_cmds else cmds=$archive_cmds fi fi fi if test -n "$delfiles"; then # Append the command to remove temporary files to $cmds. eval cmds=\"\$cmds~\$RM $delfiles\" fi # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $opt_silent || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$opt_mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS="$save_ifs" # Restore the uninstalled library and exit if test "$opt_mode" = relink; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? if test -n "$convenience"; then if test -z "$whole_archive_flag_spec"; then func_show_eval '${RM}r "$gentop"' fi fi exit $EXIT_SUCCESS fi # Create links to the real library. for linkname in $linknames; do if test "$realname" != "$linkname"; then func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?' fi done # If -module or -export-dynamic was specified, set the dlname. if test "$module" = yes || test "$export_dynamic" = yes; then # On all known operating systems, these are identical. dlname="$soname" fi fi ;; obj) if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then func_warning "\`-dlopen' is ignored for objects" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "\`-l' and \`-L' are ignored for objects" ;; esac test -n "$rpath" && \ func_warning "\`-rpath' is ignored for objects" test -n "$xrpath" && \ func_warning "\`-R' is ignored for objects" test -n "$vinfo" && \ func_warning "\`-version-info' is ignored for objects" test -n "$release" && \ func_warning "\`-release' is ignored for objects" case $output in *.lo) test -n "$objs$old_deplibs" && \ func_fatal_error "cannot build library object \`$output' from non-libtool objects" libobj=$output func_lo2o "$libobj" obj=$func_lo2o_result ;; *) libobj= obj="$output" ;; esac # Delete the old objects. $opt_dry_run || $RM $obj $libobj # Objects from convenience libraries. This assumes # single-version convenience libraries. Whenever we create # different ones for PIC/non-PIC, this we'll have to duplicate # the extraction. reload_conv_objs= gentop= # reload_cmds runs $LD directly, so let us get rid of # -Wl from whole_archive_flag_spec and hope we can get by with # turning comma into space.. wl= if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` else gentop="$output_objdir/${obj}x" func_append generated " $gentop" func_extract_archives $gentop $convenience reload_conv_objs="$reload_objs $func_extract_archives_result" fi fi # If we're not building shared, we need to use non_pic_objs test "$build_libtool_libs" != yes && libobjs="$non_pic_objects" # Create the old-style object. reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test output="$obj" func_execute_cmds "$reload_cmds" 'exit $?' # Exit if we aren't doing a library object file. if test -z "$libobj"; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS fi if test "$build_libtool_libs" != yes; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi # Create an invalid libtool object if no PIC, so that we don't # accidentally link it into a program. # $show "echo timestamp > $libobj" # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? exit $EXIT_SUCCESS fi if test -n "$pic_flag" || test "$pic_mode" != default; then # Only do commands if we really have different PIC objects. reload_objs="$libobjs $reload_conv_objs" output="$libobj" func_execute_cmds "$reload_cmds" 'exit $?' fi if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS ;; prog) case $host in *cygwin*) func_stripname '' '.exe' "$output" output=$func_stripname_result.exe;; esac test -n "$vinfo" && \ func_warning "\`-version-info' is ignored for programs" test -n "$release" && \ func_warning "\`-release' is ignored for programs" test "$preload" = yes \ && test "$dlopen_support" = unknown \ && test "$dlopen_self" = unknown \ && test "$dlopen_self_static" = unknown && \ func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support." case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac case $host in *-*-darwin*) # Don't allow lazy linking, it breaks C++ global constructors # But is supposedly fixed on 10.4 or later (yay!). if test "$tagname" = CXX ; then case ${MACOSX_DEPLOYMENT_TARGET-10.0} in 10.[0123]) func_append compile_command " ${wl}-bind_at_load" func_append finalize_command " ${wl}-bind_at_load" ;; esac fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $compile_deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $compile_deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done compile_deplibs="$new_libs" func_append compile_command " $compile_deplibs" func_append finalize_command " $finalize_deplibs" if test -n "$rpath$xrpath"; then # If the user specified any rpath flags, then add them. for libdir in $rpath $xrpath; do # This is the magic to use -rpath. case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done fi # Now hardcode the library paths rpath= hardcode_libdirs= for libdir in $compile_rpath $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append perm_rpath " $libdir" ;; esac fi case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$libdir:"*) ;; ::) dllsearchpath=$libdir;; *) func_append dllsearchpath ":$libdir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi compile_rpath="$rpath" rpath= hardcode_libdirs= for libdir in $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$finalize_perm_rpath " in *" $libdir "*) ;; *) func_append finalize_perm_rpath " $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi finalize_rpath="$rpath" if test -n "$libobjs" && test "$build_old_libs" = yes; then # Transform all the library objects into standard objects. compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP` finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP` fi func_generate_dlsyms "$outputname" "@PROGRAM@" "no" # template prelinking step if test -n "$prelink_cmds"; then func_execute_cmds "$prelink_cmds" 'exit $?' fi wrappers_required=yes case $host in *cegcc* | *mingw32ce*) # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. wrappers_required=no ;; *cygwin* | *mingw* ) if test "$build_libtool_libs" != yes; then wrappers_required=no fi ;; *) if test "$need_relink" = no || test "$build_libtool_libs" != yes; then wrappers_required=no fi ;; esac if test "$wrappers_required" = no; then # Replace the output file specification. compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'` link_command="$compile_command$compile_rpath" # We have no uninstalled library dependencies, so finalize right now. exit_status=0 func_show_eval "$link_command" 'exit_status=$?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Delete the generated files. if test -f "$output_objdir/${outputname}S.${objext}"; then func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"' fi exit $exit_status fi if test -n "$compile_shlibpath$finalize_shlibpath"; then compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" fi if test -n "$finalize_shlibpath"; then finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" fi compile_var= finalize_var= if test -n "$runpath_var"; then if test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append rpath "$dir:" done compile_var="$runpath_var=\"$rpath\$$runpath_var\" " fi if test -n "$finalize_perm_rpath"; then # We should set the runpath_var. rpath= for dir in $finalize_perm_rpath; do func_append rpath "$dir:" done finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " fi fi if test "$no_install" = yes; then # We don't need to create a wrapper script. link_command="$compile_var$compile_command$compile_rpath" # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'` # Delete the old output file. $opt_dry_run || $RM $output # Link the executable and exit func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi exit $EXIT_SUCCESS fi if test "$hardcode_action" = relink; then # Fast installation is not supported link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" func_warning "this platform does not like uninstalled shared libraries" func_warning "\`$output' will be relinked during installation" else if test "$fast_install" != no; then link_command="$finalize_var$compile_command$finalize_rpath" if test "$fast_install" = yes; then relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` else # fast_install is set to needless relink_command= fi else link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" fi fi # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` # Delete the old output files. $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output_objdir/$outputname" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Now create the wrapper script. func_verbose "creating $output" # Quote the relink command for shipping. if test -n "$relink_command"; then # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done relink_command="(cd `pwd`; $relink_command)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` fi # Only actually do things if not in dry run mode. $opt_dry_run || { # win32 will think the script is a binary if it has # a .exe suffix, so we strip it off here. case $output in *.exe) func_stripname '' '.exe' "$output" output=$func_stripname_result ;; esac # test for cygwin because mv fails w/o .exe extensions case $host in *cygwin*) exeext=.exe func_stripname '' '.exe' "$outputname" outputname=$func_stripname_result ;; *) exeext= ;; esac case $host in *cygwin* | *mingw* ) func_dirname_and_basename "$output" "" "." output_name=$func_basename_result output_path=$func_dirname_result cwrappersource="$output_path/$objdir/lt-$output_name.c" cwrapper="$output_path/$output_name.exe" $RM $cwrappersource $cwrapper trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 func_emit_cwrapperexe_src > $cwrappersource # The wrapper executable is built using the $host compiler, # because it contains $host paths and files. If cross- # compiling, it, like the target executable, must be # executed on the $host or under an emulation environment. $opt_dry_run || { $LTCC $LTCFLAGS -o $cwrapper $cwrappersource $STRIP $cwrapper } # Now, create the wrapper script for func_source use: func_ltwrapper_scriptname $cwrapper $RM $func_ltwrapper_scriptname_result trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 $opt_dry_run || { # note: this script will not be executed, so do not chmod. if test "x$build" = "x$host" ; then $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result else func_emit_wrapper no > $func_ltwrapper_scriptname_result fi } ;; * ) $RM $output trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 func_emit_wrapper no > $output chmod +x $output ;; esac } exit $EXIT_SUCCESS ;; esac # See if we need to build an old-fashioned archive. for oldlib in $oldlibs; do if test "$build_libtool_libs" = convenience; then oldobjs="$libobjs_save $symfileobj" addlibs="$convenience" build_libtool_libs=no else if test "$build_libtool_libs" = module; then oldobjs="$libobjs_save" build_libtool_libs=no else oldobjs="$old_deplibs $non_pic_objects" if test "$preload" = yes && test -f "$symfileobj"; then func_append oldobjs " $symfileobj" fi fi addlibs="$old_convenience" fi if test -n "$addlibs"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $addlibs func_append oldobjs " $func_extract_archives_result" fi # Do each command in the archive commands. if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then cmds=$old_archive_from_new_cmds else # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append oldobjs " $func_extract_archives_result" fi # POSIX demands no paths to be encoded in archives. We have # to avoid creating archives with duplicate basenames if we # might have to extract them afterwards, e.g., when creating a # static archive out of a convenience library, or when linking # the entirety of a libtool archive into another (currently # not supported by libtool). if (for obj in $oldobjs do func_basename "$obj" $ECHO "$func_basename_result" done | sort | sort -uc >/dev/null 2>&1); then : else echo "copying selected object files to avoid basename conflicts..." gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_mkdir_p "$gentop" save_oldobjs=$oldobjs oldobjs= counter=1 for obj in $save_oldobjs do func_basename "$obj" objbase="$func_basename_result" case " $oldobjs " in " ") oldobjs=$obj ;; *[\ /]"$objbase "*) while :; do # Make sure we don't pick an alternate name that also # overlaps. newobj=lt$counter-$objbase func_arith $counter + 1 counter=$func_arith_result case " $oldobjs " in *[\ /]"$newobj "*) ;; *) if test ! -f "$gentop/$newobj"; then break; fi ;; esac done func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" func_append oldobjs " $gentop/$newobj" ;; *) func_append oldobjs " $obj" ;; esac done fi func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result eval cmds=\"$old_archive_cmds\" func_len " $cmds" len=$func_len_result if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then cmds=$old_archive_cmds elif test -n "$archiver_list_spec"; then func_verbose "using command file archive linking..." for obj in $oldobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > $output_objdir/$libname.libcmd func_to_tool_file "$output_objdir/$libname.libcmd" oldobjs=" $archiver_list_spec$func_to_tool_file_result" cmds=$old_archive_cmds else # the command line is too long to link in one step, link in parts func_verbose "using piecewise archive linking..." save_RANLIB=$RANLIB RANLIB=: objlist= concat_cmds= save_oldobjs=$oldobjs oldobjs= # Is there a better way of finding the last object in the list? for obj in $save_oldobjs do last_oldobj=$obj done eval test_cmds=\"$old_archive_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 for obj in $save_oldobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result func_append objlist " $obj" if test "$len" -lt "$max_cmd_len"; then : else # the above command should be used before it gets too long oldobjs=$objlist if test "$obj" = "$last_oldobj" ; then RANLIB=$save_RANLIB fi test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" objlist= len=$len0 fi done RANLIB=$save_RANLIB oldobjs=$objlist if test "X$oldobjs" = "X" ; then eval cmds=\"\$concat_cmds\" else eval cmds=\"\$concat_cmds~\$old_archive_cmds\" fi fi fi func_execute_cmds "$cmds" 'exit $?' done test -n "$generated" && \ func_show_eval "${RM}r$generated" # Now create the libtool archive. case $output in *.la) old_library= test "$build_old_libs" = yes && old_library="$libname.$libext" func_verbose "creating $output" # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done # Quote the link command for shipping. relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` if test "$hardcode_automatic" = yes ; then relink_command= fi # Only create the output if not a dry run. $opt_dry_run || { for installed in no yes; do if test "$installed" = yes; then if test -z "$install_libdir"; then break fi output="$output_objdir/$outputname"i # Replace all uninstalled libtool libraries with the installed ones newdependency_libs= for deplib in $dependency_libs; do case $deplib in *.la) func_basename "$deplib" name="$func_basename_result" func_resolve_sysroot "$deplib" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result` test -z "$libdir" && \ func_fatal_error "\`$deplib' is not a valid libtool archive" func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" ;; -L*) func_stripname -L '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -L$func_replace_sysroot_result" ;; -R*) func_stripname -R '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -R$func_replace_sysroot_result" ;; *) func_append newdependency_libs " $deplib" ;; esac done dependency_libs="$newdependency_libs" newdlfiles= for lib in $dlfiles; do case $lib in *.la) func_basename "$lib" name="$func_basename_result" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "\`$lib' is not a valid libtool archive" func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name" ;; *) func_append newdlfiles " $lib" ;; esac done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in *.la) # Only pass preopened files to the pseudo-archive (for # eventual linking with the app. that links it) if we # didn't already link the preopened objects directly into # the library: func_basename "$lib" name="$func_basename_result" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "\`$lib' is not a valid libtool archive" func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name" ;; esac done dlprefiles="$newdlprefiles" else newdlfiles= for lib in $dlfiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlfiles " $abs" done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlprefiles " $abs" done dlprefiles="$newdlprefiles" fi $RM $output # place dlname in correct position for cygwin # In fact, it would be nice if we could use this code for all target # systems that can't hard-code library paths into their executables # and that have no shared library path variable independent of PATH, # but it turns out we can't easily determine that from inspecting # libtool variables, so we have to hard-code the OSs to which it # applies here; at the moment, that means platforms that use the PE # object format with DLL files. See the long comment at the top of # tests/bindir.at for full details. tdlname=$dlname case $host,$output,$installed,$module,$dlname in *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) # If a -bindir argument was supplied, place the dll there. if test "x$bindir" != x ; then func_relative_path "$install_libdir" "$bindir" tdlname=$func_relative_path_result$dlname else # Otherwise fall back on heuristic. tdlname=../bin/$dlname fi ;; esac $ECHO > $output "\ # $outputname - a libtool library file # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION # # Please DO NOT delete this file! # It is necessary for linking the library. # The name that we can dlopen(3). dlname='$tdlname' # Names of this library. library_names='$library_names' # The name of the static archive. old_library='$old_library' # Linker flags that can not go in dependency_libs. inherited_linker_flags='$new_inherited_linker_flags' # Libraries that this one depends upon. dependency_libs='$dependency_libs' # Names of additional weak libraries provided by this library weak_library_names='$weak_libs' # Version information for $libname. current=$current age=$age revision=$revision # Is this an already installed library? installed=$installed # Should we warn about portability when linking against -modules? shouldnotlink=$module # Files to dlopen/dlpreopen dlopen='$dlfiles' dlpreopen='$dlprefiles' # Directory that this library needs to be installed in: libdir='$install_libdir'" if test "$installed" = no && test "$need_relink" = yes; then $ECHO >> $output "\ relink_command=\"$relink_command\"" fi done } # Do a symbolic link so that the libtool archive can be found in # LD_LIBRARY_PATH before the program is installed. func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?' ;; esac exit $EXIT_SUCCESS } { test "$opt_mode" = link || test "$opt_mode" = relink; } && func_mode_link ${1+"$@"} # func_mode_uninstall arg... func_mode_uninstall () { $opt_debug RM="$nonopt" files= rmforce= exit_status=0 # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" for arg do case $arg in -f) func_append RM " $arg"; rmforce=yes ;; -*) func_append RM " $arg" ;; *) func_append files " $arg" ;; esac done test -z "$RM" && \ func_fatal_help "you must specify an RM program" rmdirs= for file in $files; do func_dirname "$file" "" "." dir="$func_dirname_result" if test "X$dir" = X.; then odir="$objdir" else odir="$dir/$objdir" fi func_basename "$file" name="$func_basename_result" test "$opt_mode" = uninstall && odir="$dir" # Remember odir for removal later, being careful to avoid duplicates if test "$opt_mode" = clean; then case " $rmdirs " in *" $odir "*) ;; *) func_append rmdirs " $odir" ;; esac fi # Don't error if the file doesn't exist and rm -f was used. if { test -L "$file"; } >/dev/null 2>&1 || { test -h "$file"; } >/dev/null 2>&1 || test -f "$file"; then : elif test -d "$file"; then exit_status=1 continue elif test "$rmforce" = yes; then continue fi rmfiles="$file" case $name in *.la) # Possibly a libtool archive, so verify it. if func_lalib_p "$file"; then func_source $dir/$name # Delete the libtool libraries and symlinks. for n in $library_names; do func_append rmfiles " $odir/$n" done test -n "$old_library" && func_append rmfiles " $odir/$old_library" case "$opt_mode" in clean) case " $library_names " in *" $dlname "*) ;; *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;; esac test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i" ;; uninstall) if test -n "$library_names"; then # Do each command in the postuninstall commands. func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' fi if test -n "$old_library"; then # Do each command in the old_postuninstall commands. func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' fi # FIXME: should reinstall the best remaining shared library. ;; esac fi ;; *.lo) # Possibly a libtool object, so verify it. if func_lalib_p "$file"; then # Read the .lo file func_source $dir/$name # Add PIC object to the list of files to remove. if test -n "$pic_object" && test "$pic_object" != none; then func_append rmfiles " $dir/$pic_object" fi # Add non-PIC object to the list of files to remove. if test -n "$non_pic_object" && test "$non_pic_object" != none; then func_append rmfiles " $dir/$non_pic_object" fi fi ;; *) if test "$opt_mode" = clean ; then noexename=$name case $file in *.exe) func_stripname '' '.exe' "$file" file=$func_stripname_result func_stripname '' '.exe' "$name" noexename=$func_stripname_result # $file with .exe has already been added to rmfiles, # add $file without .exe func_append rmfiles " $file" ;; esac # Do a test to see if this is a libtool program. if func_ltwrapper_p "$file"; then if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" relink_command= func_source $func_ltwrapper_scriptname_result func_append rmfiles " $func_ltwrapper_scriptname_result" else relink_command= func_source $dir/$noexename fi # note $name still contains .exe if it was in $file originally # as does the version of $file that was added into $rmfiles func_append rmfiles " $odir/$name $odir/${name}S.${objext}" if test "$fast_install" = yes && test -n "$relink_command"; then func_append rmfiles " $odir/lt-$name" fi if test "X$noexename" != "X$name" ; then func_append rmfiles " $odir/lt-${noexename}.c" fi fi fi ;; esac func_show_eval "$RM $rmfiles" 'exit_status=1' done # Try to remove the ${objdir}s in the directories where we deleted files for dir in $rmdirs; do if test -d "$dir"; then func_show_eval "rmdir $dir >/dev/null 2>&1" fi done exit $exit_status } { test "$opt_mode" = uninstall || test "$opt_mode" = clean; } && func_mode_uninstall ${1+"$@"} test -z "$opt_mode" && { help="$generic_help" func_fatal_help "you must specify a MODE" } test -z "$exec_cmd" && \ func_fatal_help "invalid operation mode \`$opt_mode'" if test -n "$exec_cmd"; then eval exec "$exec_cmd" exit $EXIT_FAILURE fi exit $exit_status # The TAGs below are defined such that we never get into a situation # in which we disable both kinds of libraries. Given conflicting # choices, we go for a static library, that is the most portable, # since we can't tell whether shared libraries were disabled because # the user asked for that or because the platform doesn't support # them. This is particularly important on AIX, because we don't # support having both static and shared libraries enabled at the same # time on that platform, so we default to a shared-only configuration. # If a disable-shared tag is given, we'll fallback to a static-only # configuration. But we'll never go from static-only to shared-only. # ### BEGIN LIBTOOL TAG CONFIG: disable-shared build_libtool_libs=no build_old_libs=yes # ### END LIBTOOL TAG CONFIG: disable-shared # ### BEGIN LIBTOOL TAG CONFIG: disable-static build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` # ### END LIBTOOL TAG CONFIG: disable-static # Local Variables: # mode:shell-script # sh-indentation:2 # End: # vi:sw=2 libcmis-0.4.1/Makefile.am0000644000175000001440000000301512200433722012101 00000000000000SUBDIRS = src qa ACLOCAL_AMFLAGS = -I m4 libcmis-@LIBCMIS_API_VERSION@.pc: libcmis.pc @cp -f $< $@ libcmis-c-@LIBCMIS_API_VERSION@.pc: libcmis-c.pc @cp -f $< $@ pkgconfig_DATA = \ libcmis-@LIBCMIS_API_VERSION@.pc \ libcmis-c-@LIBCMIS_API_VERSION@.pc pkgconfigdir = $(libdir)/pkgconfig if WITH_LIBCMIS_MAN cmis-client.1: doc/cmis-client.xml $(DOCBOOK2MAN) $< install-man: cmis-client.1 mkdir -p $(DESTDIR)$(mandir)/man1/ $(INSTALL_DATA) cmis-client.1 $(DESTDIR)$(mandir)/man1/ uninstall-man: -rm -rf $(DESTDIR)$(mandir)/man1/ endif dist_man_MANS = doc/cmis-client.xml EXTRA_DIST = \ libcmis.pc.in \ libcmis-c.pc.in \ run-test.sh \ COPYING.MPL \ COPYING.GPL \ COPYING.LGPL \ doc/cmis-client.xml \ cppcheck-test.sh \ qa/libcmis/data if ENABLE_CPPCHECK TESTS_ENVIRONMENT = $(SHELL) TESTS = cppcheck-test.sh endif distclean-local: -rm -rf test-server -rm chemistry-opencmis-*.tar.gz -rm jetty-*.tar.gz DISTCLEANFILES = \ cmis-client.1 \ libcmis-@LIBCMIS_API_VERSION@.pc \ libcmis-c-@LIBCMIS_API_VERSION@.pc DISTCHECK_CONFIGURE_FLAGS = "--disable-long-tests" dist-hook: @if test -d "$(srcdir)/.git"; \ then \ echo Creating ChangeLog && \ ( cd "$(top_srcdir)" && \ echo '# Generated by Makefile. Do not edit.'; echo; \ $(top_srcdir)/missing --run git log --pretty=medium ) > ChangeLog.tmp \ && mv -f ChangeLog.tmp $(top_distdir)/ChangeLog \ || ( rm -f ChangeLog.tmp ; \ echo Failed to generate ChangeLog >&2 ); \ else \ echo A git clone is required to generate a ChangeLog >&2; \ fi libcmis-0.4.1/COPYING.MPL0000644000175000001440000006222311667412272011552 00000000000000 MOZILLA PUBLIC LICENSE Version 1.1 --------------- 1. Definitions. 1.0.1. "Commercial Use" means distribution or otherwise making the Covered Code available to a third party. 1.1. "Contributor" means each entity that creates or contributes to the creation of Modifications. 1.2. "Contributor Version" means the combination of the Original Code, prior Modifications used by a Contributor, and the Modifications made by that particular Contributor. 1.3. "Covered Code" means the Original Code or Modifications or the combination of the Original Code and Modifications, in each case including portions thereof. 1.4. "Electronic Distribution Mechanism" means a mechanism generally accepted in the software development community for the electronic transfer of data. 1.5. "Executable" means Covered Code in any form other than Source Code. 1.6. "Initial Developer" means the individual or entity identified as the Initial Developer in the Source Code notice required by Exhibit A. 1.7. "Larger Work" means a work which combines Covered Code or portions thereof with code not governed by the terms of this License. 1.8. "License" means this document. 1.8.1. "Licensable" means having the right to grant, to the maximum extent possible, whether at the time of the initial grant or subsequently acquired, any and all of the rights conveyed herein. 1.9. "Modifications" means any addition to or deletion from the substance or structure of either the Original Code or any previous Modifications. When Covered Code is released as a series of files, a Modification is: A. Any addition to or deletion from the contents of a file containing Original Code or previous Modifications. B. Any new file that contains any part of the Original Code or previous Modifications. 1.10. "Original Code" means Source Code of computer software code which is described in the Source Code notice required by Exhibit A as Original Code, and which, at the time of its release under this License is not already Covered Code governed by this License. 1.10.1. "Patent Claims" means any patent claim(s), now owned or hereafter acquired, including without limitation, method, process, and apparatus claims, in any patent Licensable by grantor. 1.11. "Source Code" means the preferred form of the Covered Code for making modifications to it, including all modules it contains, plus any associated interface definition files, scripts used to control compilation and installation of an Executable, or source code differential comparisons against either the Original Code or another well known, available Covered Code of the Contributor's choice. The Source Code can be in a compressed or archival form, provided the appropriate decompression or de-archiving software is widely available for no charge. 1.12. "You" (or "Your") means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License or a future version of this License issued under Section 6.1. For legal entities, "You" includes any entity which controls, is controlled by, or is under common control with You. For purposes of this definition, "control" means (a) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b) ownership of more than fifty percent (50%) of the outstanding shares or beneficial ownership of such entity. 2. Source Code License. 2.1. The Initial Developer Grant. The Initial Developer hereby grants You a world-wide, royalty-free, non-exclusive license, subject to third party intellectual property claims: (a) under intellectual property rights (other than patent or trademark) Licensable by Initial Developer to use, reproduce, modify, display, perform, sublicense and distribute the Original Code (or portions thereof) with or without Modifications, and/or as part of a Larger Work; and (b) under Patents Claims infringed by the making, using or selling of Original Code, to make, have made, use, practice, sell, and offer for sale, and/or otherwise dispose of the Original Code (or portions thereof). (c) the licenses granted in this Section 2.1(a) and (b) are effective on the date Initial Developer first distributes Original Code under the terms of this License. (d) Notwithstanding Section 2.1(b) above, no patent license is granted: 1) for code that You delete from the Original Code; 2) separate from the Original Code; or 3) for infringements caused by: i) the modification of the Original Code or ii) the combination of the Original Code with other software or devices. 2.2. Contributor Grant. Subject to third party intellectual property claims, each Contributor hereby grants You a world-wide, royalty-free, non-exclusive license (a) under intellectual property rights (other than patent or trademark) Licensable by Contributor, to use, reproduce, modify, display, perform, sublicense and distribute the Modifications created by such Contributor (or portions thereof) either on an unmodified basis, with other Modifications, as Covered Code and/or as part of a Larger Work; and (b) under Patent Claims infringed by the making, using, or selling of Modifications made by that Contributor either alone and/or in combination with its Contributor Version (or portions of such combination), to make, use, sell, offer for sale, have made, and/or otherwise dispose of: 1) Modifications made by that Contributor (or portions thereof); and 2) the combination of Modifications made by that Contributor with its Contributor Version (or portions of such combination). (c) the licenses granted in Sections 2.2(a) and 2.2(b) are effective on the date Contributor first makes Commercial Use of the Covered Code. (d) Notwithstanding Section 2.2(b) above, no patent license is granted: 1) for any code that Contributor has deleted from the Contributor Version; 2) separate from the Contributor Version; 3) for infringements caused by: i) third party modifications of Contributor Version or ii) the combination of Modifications made by that Contributor with other software (except as part of the Contributor Version) or other devices; or 4) under Patent Claims infringed by Covered Code in the absence of Modifications made by that Contributor. 3. Distribution Obligations. 3.1. Application of License. The Modifications which You create or to which You contribute are governed by the terms of this License, including without limitation Section 2.2. The Source Code version of Covered Code may be distributed only under the terms of this License or a future version of this License released under Section 6.1, and You must include a copy of this License with every copy of the Source Code You distribute. You may not offer or impose any terms on any Source Code version that alters or restricts the applicable version of this License or the recipients' rights hereunder. However, You may include an additional document offering the additional rights described in Section 3.5. 3.2. Availability of Source Code. Any Modification which You create or to which You contribute must be made available in Source Code form under the terms of this License either on the same media as an Executable version or via an accepted Electronic Distribution Mechanism to anyone to whom you made an Executable version available; and if made available via Electronic Distribution Mechanism, must remain available for at least twelve (12) months after the date it initially became available, or at least six (6) months after a subsequent version of that particular Modification has been made available to such recipients. You are responsible for ensuring that the Source Code version remains available even if the Electronic Distribution Mechanism is maintained by a third party. 3.3. Description of Modifications. You must cause all Covered Code to which You contribute to contain a file documenting the changes You made to create that Covered Code and the date of any change. You must include a prominent statement that the Modification is derived, directly or indirectly, from Original Code provided by the Initial Developer and including the name of the Initial Developer in (a) the Source Code, and (b) in any notice in an Executable version or related documentation in which You describe the origin or ownership of the Covered Code. 3.4. Intellectual Property Matters (a) Third Party Claims. If Contributor has knowledge that a license under a third party's intellectual property rights is required to exercise the rights granted by such Contributor under Sections 2.1 or 2.2, Contributor must include a text file with the Source Code distribution titled "LEGAL" which describes the claim and the party making the claim in sufficient detail that a recipient will know whom to contact. If Contributor obtains such knowledge after the Modification is made available as described in Section 3.2, Contributor shall promptly modify the LEGAL file in all copies Contributor makes available thereafter and shall take other steps (such as notifying appropriate mailing lists or newsgroups) reasonably calculated to inform those who received the Covered Code that new knowledge has been obtained. (b) Contributor APIs. If Contributor's Modifications include an application programming interface and Contributor has knowledge of patent licenses which are reasonably necessary to implement that API, Contributor must also include this information in the LEGAL file. (c) Representations. Contributor represents that, except as disclosed pursuant to Section 3.4(a) above, Contributor believes that Contributor's Modifications are Contributor's original creation(s) and/or Contributor has sufficient rights to grant the rights conveyed by this License. 3.5. Required Notices. You must duplicate the notice in Exhibit A in each file of the Source Code. If it is not possible to put such notice in a particular Source Code file due to its structure, then You must include such notice in a location (such as a relevant directory) where a user would be likely to look for such a notice. If You created one or more Modification(s) You may add your name as a Contributor to the notice described in Exhibit A. You must also duplicate this License in any documentation for the Source Code where You describe recipients' rights or ownership rights relating to Covered Code. You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations to one or more recipients of Covered Code. However, You may do so only on Your own behalf, and not on behalf of the Initial Developer or any Contributor. You must make it absolutely clear than any such warranty, support, indemnity or liability obligation is offered by You alone, and You hereby agree to indemnify the Initial Developer and every Contributor for any liability incurred by the Initial Developer or such Contributor as a result of warranty, support, indemnity or liability terms You offer. 3.6. Distribution of Executable Versions. You may distribute Covered Code in Executable form only if the requirements of Section 3.1-3.5 have been met for that Covered Code, and if You include a notice stating that the Source Code version of the Covered Code is available under the terms of this License, including a description of how and where You have fulfilled the obligations of Section 3.2. The notice must be conspicuously included in any notice in an Executable version, related documentation or collateral in which You describe recipients' rights relating to the Covered Code. You may distribute the Executable version of Covered Code or ownership rights under a license of Your choice, which may contain terms different from this License, provided that You are in compliance with the terms of this License and that the license for the Executable version does not attempt to limit or alter the recipient's rights in the Source Code version from the rights set forth in this License. If You distribute the Executable version under a different license You must make it absolutely clear that any terms which differ from this License are offered by You alone, not by the Initial Developer or any Contributor. You hereby agree to indemnify the Initial Developer and every Contributor for any liability incurred by the Initial Developer or such Contributor as a result of any such terms You offer. 3.7. Larger Works. You may create a Larger Work by combining Covered Code with other code not governed by the terms of this License and distribute the Larger Work as a single product. In such a case, You must make sure the requirements of this License are fulfilled for the Covered Code. 4. Inability to Comply Due to Statute or Regulation. If it is impossible for You to comply with any of the terms of this License with respect to some or all of the Covered Code due to statute, judicial order, or regulation then You must: (a) comply with the terms of this License to the maximum extent possible; and (b) describe the limitations and the code they affect. Such description must be included in the LEGAL file described in Section 3.4 and must be included with all distributions of the Source Code. Except to the extent prohibited by statute or regulation, such description must be sufficiently detailed for a recipient of ordinary skill to be able to understand it. 5. Application of this License. This License applies to code to which the Initial Developer has attached the notice in Exhibit A and to related Covered Code. 6. Versions of the License. 6.1. New Versions. BBC Communications Corporation ("Netscape") may publish revised and/or new versions of the License from time to time. Each version will be given a distinguishing version number. 6.2. Effect of New Versions. Once Covered Code has been published under a particular version of the License, You may always continue to use it under the terms of that version. You may also choose to use such Covered Code under the terms of any subsequent version of the License published by BBC. No one other than BBC has the right to modify the terms applicable to Covered Code created under this License. 6.3. Derivative Works. If You create or use a modified version of this License (which you may only do in order to apply it to code which is not already Covered Code governed by this License), You must (a) rename Your license so that the phrases "Mozilla", "MOZILLAPL", "MOZPL", "BBC", "MPL", "NPL" or any confusingly similar phrase do not appear in your license (except to note that your license differs from this License) and (b) otherwise make it clear that Your version of the license contains terms which differ from the Mozilla Public License and BBC Public License. (Filling in the name of the Initial Developer, Original Code or Contributor in the notice described in Exhibit A shall not of themselves be deemed to be modifications of this License.) 7. DISCLAIMER OF WARRANTY. COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED CODE IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER. 8. TERMINATION. 8.1. This License and the rights granted hereunder will terminate automatically if You fail to comply with terms herein and fail to cure such breach within 30 days of becoming aware of the breach. All sublicenses to the Covered Code which are properly granted shall survive any termination of this License. Provisions which, by their nature, must remain in effect beyond the termination of this License shall survive. 8.2. If You initiate litigation by asserting a patent infringement claim (excluding declatory judgment actions) against Initial Developer or a Contributor (the Initial Developer or Contributor against whom You file such action is referred to as "Participant") alleging that: (a) such Participant's Contributor Version directly or indirectly infringes any patent, then any and all rights granted by such Participant to You under Sections 2.1 and/or 2.2 of this License shall, upon 60 days notice from Participant terminate prospectively, unless if within 60 days after receipt of notice You either: (i) agree in writing to pay Participant a mutually agreeable reasonable royalty for Your past and future use of Modifications made by such Participant, or (ii) withdraw Your litigation claim with respect to the Contributor Version against such Participant. If within 60 days of notice, a reasonable royalty and payment arrangement are not mutually agreed upon in writing by the parties or the litigation claim is not withdrawn, the rights granted by Participant to You under Sections 2.1 and/or 2.2 automatically terminate at the expiration of the 60 day notice period specified above. (b) any software, hardware, or device, other than such Participant's Contributor Version, directly or indirectly infringes any patent, then any rights granted to You by such Participant under Sections 2.1(b) and 2.2(b) are revoked effective as of the date You first made, used, sold, distributed, or had made, Modifications made by that Participant. 8.3. If You assert a patent infringement claim against Participant alleging that such Participant's Contributor Version directly or indirectly infringes any patent where such claim is resolved (such as by license or settlement) prior to the initiation of patent infringement litigation, then the reasonable value of the licenses granted by such Participant under Sections 2.1 or 2.2 shall be taken into account in determining the amount or value of any payment or license. 8.4. In the event of termination under Sections 8.1 or 8.2 above, all end user license agreements (excluding distributors and resellers) which have been validly granted by You or any distributor hereunder prior to termination shall survive termination. 9. LIMITATION OF LIABILITY. UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU. 10. U.S. GOVERNMENT END USERS. The Covered Code is a "commercial item," as that term is defined in 48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer software" and "commercial computer software documentation," as such terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48 C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995), all U.S. Government End Users acquire Covered Code with only those rights set forth herein. 11. MISCELLANEOUS. This License represents the complete agreement concerning subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. This License shall be governed by California law provisions (except to the extent applicable law, if any, provides otherwise), excluding its conflict-of-law provisions. With respect to disputes in which at least one party is a citizen of, or an entity chartered or registered to do business in the United States of America, any litigation relating to this License shall be subject to the jurisdiction of the Federal Courts of the Northern District of California, with venue lying in Santa Clara County, California, with the losing party responsible for costs, including without limitation, court costs and reasonable attorneys' fees and expenses. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any law or regulation which provides that the language of a contract shall be construed against the drafter shall not apply to this License. 12. RESPONSIBILITY FOR CLAIMS. As between Initial Developer and the Contributors, each party is responsible for claims and damages arising, directly or indirectly, out of its utilization of rights under this License and You agree to work with Initial Developer and Contributors to distribute such responsibility on an equitable basis. Nothing herein is intended or shall be deemed to constitute any admission of liability. 13. MULTIPLE-LICENSED CODE. Initial Developer may designate portions of the Covered Code as "Multiple-Licensed". "Multiple-Licensed" means that the Initial Developer permits you to utilize portions of the Covered Code under Your choice of the GPL, LGPL, MIT or the alternative licenses, if any, specified by the Initial Developer in the file described in Exhibit A. EXHIBIT A -Mozilla Public License. ``The contents of this file are subject to the Mozilla Public License Version 1.1 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.mozilla.org/MPL/ Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License. The Original Code is ______________________________________. The Initial Developer of the Original Code is ________________________. Portions created by ______________________ are Copyright (C) ______ _______________________. All Rights Reserved. Contributor(s): ______________________________________. Alternatively, the contents of this file may be used under the terms of the _____ license (the "[___] License"), in which case the provisions of [______] License are applicable instead of those above. If you wish to allow use of your version of this file only under the terms of the [____] License and not to allow others to use your version of this file under the MPL, indicate your decision by deleting the provisions above and replace them with the notice and other provisions required by the [___] License. If you do not delete the provisions above, a recipient may use your version of this file under either the MPL or the [___] License." [NOTE: The text of this Exhibit A may differ slightly from the text of the notices in the Source Code files of the Original Code. You should use the text of this Exhibit A rather than the text found in the Original Code Source Code for Your Modifications.] libcmis-0.4.1/configure.ac0000644000175000001440000001201712200455674012347 00000000000000# -*- Autoconf -*- # Process this file with autoconf to produce a configure script. m4_define([libcmis_major_version], [0]) m4_define([libcmis_minor_version], [4]) m4_define([libcmis_micro_version], [1]) m4_define([libcmis_api_version], [libcmis_major_version.libcmis_minor_version]) m4_define([libcmis_version],[libcmis_api_version.libcmis_micro_version]) AC_PREREQ([2.63]) AC_INIT([libcmis], [libcmis_version]) AM_INIT_AUTOMAKE(serial-tests) m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])]) AC_ARG_ENABLE(client, AC_HELP_STRING([--disable-client],[Compile only the library, not the client tool]), enable_client=$enableval, enable_client=yes) AM_CONDITIONAL(ENABLE_CLIENT, test "x$enable_client" != "xno") AC_ARG_ENABLE([tests], [AS_HELP_STRING([--disable-tests], [Do not build the unit tests])], [enable_tests="$enableval"], [enable_tests=yes] ) AM_CONDITIONAL(ENABLE_TESTS, test "x$enable_tests" != "xno") AS_IF([test "x$enable_tests" != "xno"], [ AC_ARG_ENABLE([long-tests], [AS_HELP_STRING([--disable-long-tests], [Do not build the unit tests needing to start a server])], [enable_long_tests="$enableval"], [enable_long_tests=yes] ) ], [enable_long_tests=no]) AM_CONDITIONAL(ENABLE_LONG_TESTS, test "x$enable_long_tests" != "xno") LIBCMIS_API_VERSION=libcmis_api_version AC_SUBST(LIBCMIS_API_VERSION) AC_CONFIG_MACRO_DIR([m4]) for top_builddir in . .. ../.. $ac_auxdir $ac_auxdir/..; do test -f $top_builddir/configure && break done SRCDIR=$srcdir AC_SUBST(SRCDIR) AC_LANG([C++]) # Checks for programs. AC_PROG_CC AC_PROG_CPP AC_PROG_CXX AC_PROG_INSTALL AC_PROG_LN_S AC_PROG_MAKE_SET AC_PROG_LIBTOOL LT_INIT([win32-dll disable-static pic-only]) AC_CANONICAL_HOST # ========================== # Platform check for windows # ========================== AC_MSG_CHECKING([for native Win32]) AS_CASE([$host], [*-*-mingw*], [native_win32=yes], [native_win32=no]) AC_MSG_RESULT([$native_win32]) AM_CONDITIONAL(OS_WIN32, [test "x$native_win32" = "xyes"]) # TODO Check for docbook-to-man # ============= # Documentation # ============= AC_ARG_WITH(man, [AS_HELP_STRING([--without-man], [Do not build manpage])], [with_man="$withval"], [with_man=yes] ) AS_IF([test "x$with_man" != "xno"], [ build_man=yes AS_IF([test -z "$DOCBOOK2MAN"], [ AC_PATH_PROG(DOCBOOK2MAN,[docbook2x-man]) AS_IF([test -z "$DOCBOOK2MAN"], [ AC_PATH_PROG(DOCBOOK2MAN,[docbook-to-man]) AS_IF([test -z "$DOCBOOK2MAN"], [ AC_PATH_PROG(DOCBOOK2MAN,[docbook2man.pl]) AS_IF([test -z "$DOCBOOK2MAN"], [ AC_MSG_ERROR([docbook-to-man is missing. Install docbook2X package.]) ]) ]) ]) ]) ], [build_man=no]) AC_SUBST(DOCBOOK2MAN) AM_CONDITIONAL([WITH_LIBCMIS_MAN], [test "x$build_man" != "xno"]) # ======== # Cppcheck # ======== AC_PATH_PROG(CPPCHECK,[cppcheck],[]) AS_IF([test "x$ac_cv_path_CPPCHECK" != "x"], [enable_cppcheck=yes], [enable_cppcheck=no]) AM_CONDITIONAL(ENABLE_CPPCHECK, [test "x$ac_cv_path_CPPCHECK" != "x"]) AC_SUBST(CPPCHECK) AC_ARG_ENABLE([werror], [AS_HELP_STRING([--disable-werror], [Treat all warnings as errors, usefull for development])], [enable_werror="$enableval"], [enable_werror=yes] ) AS_IF([test x"$enable_werror" != "xno"], [ CFLAGS="$CFLAGS -Werror" CXXFLAGS="$CXXFLAGS -Werror" ]) AS_IF([test x"$GCC" = xyes], [ # Be tough with warnings and produce less careless code CFLAGS="$CFLAGS -Wall -pedantic -Wshadow -Wendif-labels -Wextra" CXXFLAGS="$CXXFLAGS -Wall -pedantic -Weffc++ -Wshadow -Wendif-labels -Wextra -Wsign-promo -Woverloaded-virtual -Wnon-virtual-dtor -Wsign-promo" ]) # Check for curl PKG_CHECK_MODULES(CURL,[ libcurl ]) AC_SUBST(CURL_CFLAGS) AC_SUBST(CURL_LIBS) # Check for lixml2 PKG_CHECK_MODULES(XML2,[ libxml-2.0 ]) AC_SUBST(XML2_CFLAGS) AC_SUBST(XML2_LIBS) # Check for cppunit AS_IF([test "x$enable_tests" != "xno"], [ PKG_CHECK_MODULES(CPPUNIT, cppunit >= 1.12 ) AC_SUBST(CPPUNIT_CFLAGS) AC_SUBST(CPPUNIT_LIBS) ]) # Check for boost m4_pattern_allow([^BOOST_]) BOOST_DATE_TIME BOOST_SMART_PTR BOOST_UUID AS_IF([test "x$enable_client" != "xno"], [ BOOST_PROGRAM_OPTIONS ]) AC_SUBST(BOOST_CPPFLAGS) # Checks for header files. AC_CHECK_HEADERS([stdlib.h unistd.h]) # Checks for typedefs, structures, and compiler characteristics. AC_HEADER_STDBOOL AC_C_INLINE AC_TYPE_MODE_T AC_TYPE_SIZE_T # Checks for library functions. AC_CONFIG_FILES([ Makefile libcmis.pc libcmis-c.pc run-test.sh cppcheck-test.sh src/Makefile src/libcmis/Makefile src/libcmis-c/Makefile qa/Makefile qa/mockup/Makefile qa/libcmis/Makefile qa/libcmis-c/Makefile ]) AC_OUTPUT AC_MSG_NOTICE([ libcmis $VERSION: Prefix: ${prefix} Compiler flags: ${CXXFLAGS} client: ${enable_client} werror: ${enable_werror} tests: ${enable_tests} long tests: ${enable_long_tests} cppcheck tests: ${enable_cppcheck} mans: ${build_man} ]) libcmis-0.4.1/AUTHORS0000644000175000001440000000012412177662511011130 00000000000000Cedric Bosdonnat Cao Cuong Ngo libcmis-0.4.1/cppcheck-test.sh0000644000175000001440000000015712200457454013152 00000000000000#!/bin/sh /usr/bin/cppcheck -q --enable=style,performance,portability,information --error-exitcode=1 . exit $? libcmis-0.4.1/config.sub0000755000175000001440000010527412102025510012033 00000000000000#! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, # 2011, 2012 Free Software Foundation, Inc. timestamp='2012-04-18' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software # can handle that machine. It does not imply ALL GNU software can. # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Please send patches to . Submit a context # diff and a properly formatted GNU ChangeLog entry. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ knetbsd*-gnu* | netbsd*-gnu* | \ kopensolaris*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; android-linux) os=-linux-android basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray | -microblaze) os= basic_machine=$1 ;; -bluegene*) os=-cnk ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco6) os=-sco5v6 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5v6*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*178) os=-lynxos178 ;; -lynx*5) os=-lynxos5 ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | aarch64 | aarch64_be \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ | be32 | be64 \ | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ | epiphany \ | fido | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | hexagon \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | le32 | le64 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64octeon | mips64octeonel \ | mips64orion | mips64orionel \ | mips64r5900 | mips64r5900el \ | mips64vr | mips64vrel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | moxie \ | mt \ | msp430 \ | nds32 | nds32le | nds32be \ | nios | nios2 \ | ns16k | ns32k \ | open8 \ | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ | pyramid \ | rl78 | rx \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu \ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ | we32k \ | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown ;; c54x) basic_machine=tic54x-unknown ;; c55x) basic_machine=tic55x-unknown ;; c6x) basic_machine=tic6x-unknown ;; m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip) basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; ms1) basic_machine=mt-unknown ;; strongarm | thumb | xscale) basic_machine=arm-unknown ;; xgate) basic_machine=$basic_machine-unknown os=-none ;; xscaleeb) basic_machine=armeb-unknown ;; xscaleel) basic_machine=armel-unknown ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | aarch64-* | aarch64_be-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | hexagon-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | le32-* | le64-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64octeon-* | mips64octeonel-* \ | mips64orion-* | mips64orionel-* \ | mips64r5900-* | mips64r5900el-* \ | mips64vr-* | mips64vrel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nds32-* | nds32le-* | nds32be-* \ | nios-* | nios2-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | open8-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ | pyramid-* \ | rl78-* | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ | tahoe-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tile*-* \ | tron-* \ | ubicom32-* \ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ | vax-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-* | z80-*) ;; # Recognize the basic CPU types without company name, with glob match. xtensa*) basic_machine=$basic_machine-unknown ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aros) basic_machine=i386-pc os=-aros ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; blackfin) basic_machine=bfin-unknown os=-linux ;; blackfin-*) basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; bluegene*) basic_machine=powerpc-ibm os=-cnk ;; c54x-*) basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c55x-*) basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c6x-*) basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c90) basic_machine=c90-cray os=-unicos ;; cegcc) basic_machine=arm-unknown os=-cegcc ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16 | cr16-*) basic_machine=cr16-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; dicos) basic_machine=i686-pc os=-dicos ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; m68knommu) basic_machine=m68k-unknown os=-linux ;; m68knommu-*) basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; microblaze) basic_machine=microblaze-xilinx ;; mingw32) basic_machine=i386-pc os=-mingw32 ;; mingw32ce) basic_machine=arm-unknown os=-mingw32ce ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; msys) basic_machine=i386-pc os=-msys ;; mvs) basic_machine=i370-ibm os=-mvs ;; nacl) basic_machine=le32-unknown os=-nacl ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; neo-tandem) basic_machine=neo-tandem ;; nse-tandem) basic_machine=nse-tandem ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; parisc) basic_machine=hppa-unknown os=-linux ;; parisc-*) basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pc98) basic_machine=i386-pc ;; pc98-*) basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc | ppcbe) basic_machine=powerpc-unknown ;; ppc-* | ppcbe-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rdos) basic_machine=i386-pc os=-rdos ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sde) basic_machine=mipsisa32-sde os=-elf ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh5el) basic_machine=sh5le-unknown ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; strongarm-* | thumb-*) basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tile*) basic_machine=$basic_machine-unknown os=-linux-gnu ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; xscale-* | xscalee[bl]-*) basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; z80-*-coff) basic_machine=z80-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -auroraux) os=-auroraux ;; -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ | -sym* | -kopensolaris* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* | -aros* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ | -openbsd* | -solidbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* | -cegcc* \ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -kaos*) os=-kaos ;; -zvmoe) os=-zvmoe ;; -dicos*) os=-dicos ;; -nacl*) ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in score-*) os=-elf ;; spu-*) os=-elf ;; *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; tic54x-*) os=-coff ;; tic55x-*) os=-coff ;; tic6x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 ;; m68*-cisco) os=-aout ;; mep-*) os=-elf ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-haiku) os=-haiku ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -cnk*|-aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: libcmis-0.4.1/aclocal.m40000644000175000001440000013131012200457432011711 00000000000000# generated automatically by aclocal 1.13.4 -*- Autoconf -*- # Copyright (C) 1996-2013 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, [m4_warning([this file was generated for autoconf 2.69. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) # pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- # serial 1 (pkg-config-0.24) # # Copyright © 2004 Scott James Remnant . # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # PKG_PROG_PKG_CONFIG([MIN-VERSION]) # ---------------------------------- AC_DEFUN([PKG_PROG_PKG_CONFIG], [m4_pattern_forbid([^_?PKG_[A-Z_]+$]) m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$]) m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$]) AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility]) AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path]) AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path]) if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) fi if test -n "$PKG_CONFIG"; then _pkg_min_version=m4_default([$1], [0.9.0]) AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) PKG_CONFIG="" fi fi[]dnl ])# PKG_PROG_PKG_CONFIG # PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) # # Check to see whether a particular set of modules exists. Similar # to PKG_CHECK_MODULES(), but does not set variables or print errors. # # Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) # only at the first occurence in configure.ac, so if the first place # it's called might be skipped (such as if it is within an "if", you # have to call PKG_CHECK_EXISTS manually # -------------------------------------------------------------- AC_DEFUN([PKG_CHECK_EXISTS], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl if test -n "$PKG_CONFIG" && \ AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then m4_default([$2], [:]) m4_ifvaln([$3], [else $3])dnl fi]) # _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) # --------------------------------------------- m4_define([_PKG_CONFIG], [if test -n "$$1"; then pkg_cv_[]$1="$$1" elif test -n "$PKG_CONFIG"; then PKG_CHECK_EXISTS([$3], [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes ], [pkg_failed=yes]) else pkg_failed=untried fi[]dnl ])# _PKG_CONFIG # _PKG_SHORT_ERRORS_SUPPORTED # ----------------------------- AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], [AC_REQUIRE([PKG_PROG_PKG_CONFIG]) if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi[]dnl ])# _PKG_SHORT_ERRORS_SUPPORTED # PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], # [ACTION-IF-NOT-FOUND]) # # # Note that if there is a possibility the first call to # PKG_CHECK_MODULES might not happen, you should be sure to include an # explicit call to PKG_PROG_PKG_CONFIG in your configure.ac # # # -------------------------------------------------------------- AC_DEFUN([PKG_CHECK_MODULES], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl pkg_failed=no AC_MSG_CHECKING([for $1]) _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) _PKG_CONFIG([$1][_LIBS], [libs], [$2]) m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS and $1[]_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details.]) if test $pkg_failed = yes; then AC_MSG_RESULT([no]) _PKG_SHORT_ERRORS_SUPPORTED if test $_pkg_short_errors_supported = yes; then $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1` else $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD m4_default([$4], [AC_MSG_ERROR( [Package requirements ($2) were not met: $$1_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. _PKG_TEXT])[]dnl ]) elif test $pkg_failed = untried; then AC_MSG_RESULT([no]) m4_default([$4], [AC_MSG_FAILURE( [The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. _PKG_TEXT To get pkg-config, see .])[]dnl ]) else $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS $1[]_LIBS=$pkg_cv_[]$1[]_LIBS AC_MSG_RESULT([yes]) $3 fi[]dnl ])# PKG_CHECK_MODULES # PKG_INSTALLDIR(DIRECTORY) # ------------------------- # Substitutes the variable pkgconfigdir as the location where a module # should install pkg-config .pc files. By default the directory is # $libdir/pkgconfig, but the default can be changed by passing # DIRECTORY. The user can override through the --with-pkgconfigdir # parameter. AC_DEFUN([PKG_INSTALLDIR], [m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])]) m4_pushdef([pkg_description], [pkg-config installation directory @<:@]pkg_default[@:>@]) AC_ARG_WITH([pkgconfigdir], [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],, [with_pkgconfigdir=]pkg_default) AC_SUBST([pkgconfigdir], [$with_pkgconfigdir]) m4_popdef([pkg_default]) m4_popdef([pkg_description]) ]) dnl PKG_INSTALLDIR # PKG_NOARCH_INSTALLDIR(DIRECTORY) # ------------------------- # Substitutes the variable noarch_pkgconfigdir as the location where a # module should install arch-independent pkg-config .pc files. By # default the directory is $datadir/pkgconfig, but the default can be # changed by passing DIRECTORY. The user can override through the # --with-noarch-pkgconfigdir parameter. AC_DEFUN([PKG_NOARCH_INSTALLDIR], [m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])]) m4_pushdef([pkg_description], [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@]) AC_ARG_WITH([noarch-pkgconfigdir], [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],, [with_noarch_pkgconfigdir=]pkg_default) AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir]) m4_popdef([pkg_default]) m4_popdef([pkg_description]) ]) dnl PKG_NOARCH_INSTALLDIR # PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE, # [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) # ------------------------------------------- # Retrieves the value of the pkg-config variable for the given module. AC_DEFUN([PKG_CHECK_VAR], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl _PKG_CONFIG([$1], [variable="][$3]["], [$2]) AS_VAR_COPY([$1], [pkg_cv_][$1]) AS_VAR_IF([$1], [""], [$5], [$4])dnl ])# PKG_CHECK_VAR # Copyright (C) 2002-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.13' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. m4_if([$1], [1.13.4], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.13.4])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to # '$srcdir', '$srcdir/..', or '$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is '.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [dnl Rely on autoconf to set up CDPATH properly. AC_PREREQ([2.50])dnl # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ([2.52])dnl m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl m4_define([_AM_COND_VALUE_$1], [$2])dnl if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Copyright (C) 1999-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], [$1], [CXX], [depcc="$CXX" am_compiler_list=], [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], [$1], [UPC], [depcc="$UPC" am_compiler_list=], [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi am__universal=false m4_case([$1], [CC], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac], [CXX], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac]) for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES. AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE([dependency-tracking], [dnl AS_HELP_STRING( [--enable-dependency-tracking], [do not reject slow dependency extractors]) AS_HELP_STRING( [--disable-dependency-tracking], [speeds up one-time build])]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl AC_SUBST([am__nodep])dnl _AM_SUBST_NOTMAKE([am__nodep])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named 'Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running 'make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "$am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` AS_MKDIR_P([$dirpart/$fdir]) # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking # is enabled. FIXME. This creates each '.P' file that we will # need in order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.65])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [AC_DIAGNOSE([obsolete], [$0: two- and three-arguments forms are deprecated.]) m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if( m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), [ok:ok],, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) AM_MISSING_PROG([AUTOCONF], [autoconf]) AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) AM_MISSING_PROG([AUTOHEADER], [autoheader]) AM_MISSING_PROG([MAKEINFO], [makeinfo]) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # AC_SUBST([mkdir_p], ['$(MKDIR_P)']) # We need awk for the "check" target. The system "awk" is bad on # some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES([CC])], [m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES([CXX])], [m4_define([AC_PROG_CXX], m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES([OBJC])], [m4_define([AC_PROG_OBJC], m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], [_AM_DEPENDENCIES([OBJCXX])], [m4_define([AC_PROG_OBJCXX], m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl ]) AC_REQUIRE([AM_SILENT_RULES])dnl dnl The testsuite driver may need to know about EXEEXT, so add the dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl ]) dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi AC_SUBST([install_sh])]) # Copyright (C) 2003-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from 'make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi AC_SUBST([am__include]) AC_SUBST([am__quote]) AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it is modern enough. # If it is, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= AC_MSG_WARN(['missing' script is too old or missing]) fi ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # -------------------- # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), [1])]) # _AM_SET_OPTIONS(OPTIONS) # ------------------------ # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[[\\\"\#\$\&\'\`$am_lf]]*) AC_MSG_ERROR([unsafe absolute working directory name]);; esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi if test "$[2]" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT([yes]) # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi AC_CONFIG_COMMANDS_PRE( [AC_MSG_CHECKING([that generated files are newer than configure]) if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi AC_MSG_RESULT([done])]) rm -f conftest.file ]) # Copyright (C) 2009-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_SILENT_RULES([DEFAULT]) # -------------------------- # Enable less verbose build rules; with the default set to DEFAULT # ("yes" being less verbose, "no" or empty being verbose). AC_DEFUN([AM_SILENT_RULES], [AC_ARG_ENABLE([silent-rules], [dnl AS_HELP_STRING( [--enable-silent-rules], [less verbose build output (undo: "make V=1")]) AS_HELP_STRING( [--disable-silent-rules], [verbose build output (undo: "make V=0")])dnl ]) case $enable_silent_rules in @%:@ ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; esac dnl dnl A few 'make' implementations (e.g., NonStop OS and NextStep) dnl do not support nested variable expansions. dnl See automake bug#9928 and bug#10237. am_make=${MAKE-make} AC_CACHE_CHECK([whether $am_make supports nested variables], [am_cv_make_support_nested_variables], [if AS_ECHO([['TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi]) if test $am_cv_make_support_nested_variables = yes; then dnl Using '$V' instead of '$(V)' breaks IRIX make. AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AC_SUBST([AM_V])dnl AM_SUBST_NOTMAKE([AM_V])dnl AC_SUBST([AM_DEFAULT_V])dnl AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl AC_SUBST([AM_DEFAULT_VERBOSITY])dnl AM_BACKSLASH='\' AC_SUBST([AM_BACKSLASH])dnl _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) # Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor 'install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in "make install-strip", and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # AM_SUBST_NOTMAKE(VARIABLE) # -------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of 'v7', 'ustar', or 'pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar # AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AC_SUBST([AMTAR], ['$${TAR-tar}']) # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' m4_if([$1], [v7], [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], [m4_case([$1], [ustar], [# The POSIX 1988 'ustar' format is defined with fixed-size fields. # There is notably a 21 bits limit for the UID and the GID. In fact, # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 # and bug#13588). am_max_uid=2097151 # 2^21 - 1 am_max_gid=$am_max_uid # The $UID and $GID variables are not portable, so we need to resort # to the POSIX-mandated id(1) utility. Errors in the 'id' calls # below are definitely unexpected, so allow the users to see them # (that is, avoid stderr redirection). am_uid=`id -u || echo unknown` am_gid=`id -g || echo unknown` AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) if test $am_uid -le $am_max_uid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) if test $am_gid -le $am_max_gid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi], [pax], [], [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Go ahead even if we have the value already cached. We do so because we # need to set the values for the 'am__tar' and 'am__untar' variables. _am_tools=${am_cv_prog_tar_$1-$_am_tools} for _am_tool in $_am_tools; do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works. rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR m4_include([m4/boost.m4]) m4_include([m4/libtool.m4]) m4_include([m4/ltoptions.m4]) m4_include([m4/ltsugar.m4]) m4_include([m4/ltversion.m4]) m4_include([m4/lt~obsolete.m4]) libcmis-0.4.1/missing0000755000175000001440000002370312102025510011443 00000000000000#! /bin/sh # Common stub for a few missing GNU programs while installing. scriptversion=2012-01-06.18; # UTC # Copyright (C) 1996-2012 Free Software Foundation, Inc. # Originally by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try '$0 --help' for more information" exit 1 fi run=: sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' sed_minuso='s/.* -o \([^ ]*\).*/\1/p' # In the cases where this matters, 'missing' is being run in the # srcdir already. if test -f configure.ac; then configure_ac=configure.ac else configure_ac=configure.in fi msg="missing on your system" case $1 in --run) # Try to run requested program, and just exit if it succeeds. run= shift "$@" && exit 0 # Exit code 63 means version mismatch. This often happens # when the user try to use an ancient version of a tool on # a file that requires a minimum version. In this case we # we should proceed has if the program had been absent, or # if --run hadn't been passed. if test $? = 63; then run=: msg="probably too old" fi ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Handle 'PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an error status if there is no known handling for PROGRAM. Options: -h, --help display this help and exit -v, --version output version information and exit --run try to run the given command, and emulate it if it fails Supported PROGRAM values: aclocal touch file 'aclocal.m4' autoconf touch file 'configure' autoheader touch file 'config.h.in' autom4te touch the output file, or create a stub one automake touch all 'Makefile.in' files bison create 'y.tab.[ch]', if possible, from existing .[ch] flex create 'lex.yy.c', if possible, from existing .c help2man touch the output file lex create 'lex.yy.c', if possible, from existing .c makeinfo touch the output file yacc create 'y.tab.[ch]', if possible, from existing .[ch] Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and 'g' are ignored when checking the name. Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: Unknown '$1' option" echo 1>&2 "Try '$0 --help' for more information" exit 1 ;; esac # normalize program name to check for. program=`echo "$1" | sed ' s/^gnu-//; t s/^gnu//; t s/^g//; t'` # Now exit if we have it, but it failed. Also exit now if we # don't have it and --version was passed (most likely to detect # the program). This is about non-GNU programs, so use $1 not # $program. case $1 in lex*|yacc*) # Not GNU programs, they don't have --version. ;; *) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then # Could not run --version or --help. This is probably someone # running '$TOOL --version' or '$TOOL --help' to check whether # $TOOL exists and not knowing $TOOL uses missing. exit 1 fi ;; esac # If it does not exist, or fails to run (possibly an outdated version), # try to emulate it. case $program in aclocal*) echo 1>&2 "\ WARNING: '$1' is $msg. You should only need it if you modified 'acinclude.m4' or '${configure_ac}'. You might want to install the Automake and Perl packages. Grab them from any GNU archive site." touch aclocal.m4 ;; autoconf*) echo 1>&2 "\ WARNING: '$1' is $msg. You should only need it if you modified '${configure_ac}'. You might want to install the Autoconf and GNU m4 packages. Grab them from any GNU archive site." touch configure ;; autoheader*) echo 1>&2 "\ WARNING: '$1' is $msg. You should only need it if you modified 'acconfig.h' or '${configure_ac}'. You might want to install the Autoconf and GNU m4 packages. Grab them from any GNU archive site." files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` test -z "$files" && files="config.h" touch_files= for f in $files; do case $f in *:*) touch_files="$touch_files "`echo "$f" | sed -e 's/^[^:]*://' -e 's/:.*//'`;; *) touch_files="$touch_files $f.in";; esac done touch $touch_files ;; automake*) echo 1>&2 "\ WARNING: '$1' is $msg. You should only need it if you modified 'Makefile.am', 'acinclude.m4' or '${configure_ac}'. You might want to install the Automake and Perl packages. Grab them from any GNU archive site." find . -type f -name Makefile.am -print | sed 's/\.am$/.in/' | while read f; do touch "$f"; done ;; autom4te*) echo 1>&2 "\ WARNING: '$1' is needed, but is $msg. You might have modified some files without having the proper tools for further handling them. You can get '$1' as part of Autoconf from any GNU archive site." file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo "#! /bin/sh" echo "# Created by GNU Automake missing as a replacement of" echo "# $ $@" echo "exit 0" chmod +x $file exit 1 fi ;; bison*|yacc*) echo 1>&2 "\ WARNING: '$1' $msg. You should only need it if you modified a '.y' file. You may need the Bison package in order for those modifications to take effect. You can get Bison from any GNU archive site." rm -f y.tab.c y.tab.h if test $# -ne 1; then eval LASTARG=\${$#} case $LASTARG in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.h fi ;; esac fi if test ! -f y.tab.h; then echo >y.tab.h fi if test ! -f y.tab.c; then echo 'main() { return 0; }' >y.tab.c fi ;; lex*|flex*) echo 1>&2 "\ WARNING: '$1' is $msg. You should only need it if you modified a '.l' file. You may need the Flex package in order for those modifications to take effect. You can get Flex from any GNU archive site." rm -f lex.yy.c if test $# -ne 1; then eval LASTARG=\${$#} case $LASTARG in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` if test -f "$SRCFILE"; then cp "$SRCFILE" lex.yy.c fi ;; esac fi if test ! -f lex.yy.c; then echo 'main() { return 0; }' >lex.yy.c fi ;; help2man*) echo 1>&2 "\ WARNING: '$1' is $msg. You should only need it if you modified a dependency of a manual page. You may need the Help2man package in order for those modifications to take effect. You can get Help2man from any GNU archive site." file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo ".ab help2man is required to generate this page" exit $? fi ;; makeinfo*) echo 1>&2 "\ WARNING: '$1' is $msg. You should only need it if you modified a '.texi' or '.texinfo' file, or any other file indirectly affecting the aspect of the manual. The spurious call might also be the consequence of using a buggy 'make' (AIX, DU, IRIX). You might want to install the Texinfo package or the GNU make package. Grab either from any GNU archive site." # The file to touch is that specified with -o ... file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -z "$file"; then # ... or it is the one specified with @setfilename ... infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` file=`sed -n ' /^@setfilename/{ s/.* \([^ ]*\) *$/\1/ p q }' $infile` # ... or it is derived from the source name (dir/f.texi becomes f.info) test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info fi # If the file does not exist, the user really needs makeinfo; # let's fail without touching anything. test -f $file || exit 1 touch $file ;; *) echo 1>&2 "\ WARNING: '$1' is needed, and is $msg. You might have modified some files without having the proper tools for further handling them. Check the 'README' file, it often tells you about the needed prerequisites for installing this package. You may also peek at any GNU archive site, in case some other package would contain this missing '$1' program." exit 1 ;; esac exit 0 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: libcmis-0.4.1/ChangeLog0000644000175000001440000034000612200457455011634 00000000000000# Generated by Makefile. Do not edit. commit 387d362fbdd33908ab11fcfbd3d1e516429754d5 Author: Cédric Bosdonnat Date: Wed Aug 7 16:49:58 2013 +0200 Bumped to 0.4.1 commit c09ab20c046049d5a8ae0c812c97e3d653ecd6ce Author: Cédric Bosdonnat Date: Wed Aug 7 16:09:05 2013 +0200 Don't install libcmis-mockup: it's only for testing commit 66a387cc62f3ed6f328d37bf739120fd9bfd64e1 Author: Cédric Bosdonnat Date: Wed Aug 7 14:03:09 2013 +0200 makefile.mk no longer needed for LibreOffice builds commit 409a319e0188de90c6d5fae6c3ce2fe328ebca91 Author: Cédric Bosdonnat Date: Tue Aug 6 19:03:48 2013 +0200 Fixed typo commit c7ff67a093519c16a177ff1d529794ae39e762c3 Author: Cédric Bosdonnat Date: Tue Aug 6 16:20:46 2013 +0200 Unit test for invalid SSL certificate handling commit 2691e6026dd9ba8c13fbed3df6805c34d764d7d9 Author: Cédric Bosdonnat Date: Tue Aug 6 15:42:07 2013 +0200 cmis-client: cache the SSL certificate validation answers commit 5bc05fe6a4124cc3459fb977850d0aca93ea253f Author: Cao Cuong Ngo Date: Tue Aug 6 17:00:32 2013 +0200 add gdrive-repository.cxx commit 2bc26640fe44940ec3eb760577c3866fc6d1ded8 Author: Cao Cuong Ngo Date: Tue Aug 6 13:59:21 2013 +0200 Add GDrive repository capabilities commit 193e53dff45016345b187c650ec77d9b4431c982 Author: Cédric Bosdonnat Date: Tue Aug 6 12:37:29 2013 +0200 Updated NEWS file commit d77e524aeafffbf03a31ed851795c1a620234733 Author: Cédric Bosdonnat Date: Tue Aug 6 12:32:36 2013 +0200 WSObject don't ask renditions to the server if it doesn't handle the feature commit 34e02faca4d38fd6d98ca88efa887c71d0d870b5 Author: Cédric Bosdonnat Date: Tue Aug 6 12:25:49 2013 +0200 Added libcmis-c part for the repository capabilities commit c3804f754abd8662f4840386b77904db83ee1af3 Author: Cédric Bosdonnat Date: Tue Aug 6 11:48:59 2013 +0200 Repository: provide access to capabilities Added cmis-client repo-infos command. commit e82faf704c6c8912db2bee62dcca552ad9dec359 Author: Cao Cuong Ngo Date: Tue Aug 6 11:03:50 2013 +0200 GDrive: make object type versionalle, creatable. commit 2b1b91a4a0d61305320fd1a09d10658a3900b794 Author: Cédric Bosdonnat Date: Mon Aug 5 18:08:34 2013 +0200 Added implementation for CMIS renditions in both Atom and WS bindings commit 557229b4c2ecde0656c3b06dbbba458ececd79ff Author: Cédric Bosdonnat Date: Mon Aug 5 10:46:51 2013 +0200 NEWS file: mention the unit test changes commit ee186f6e3ce0bf5c2defe0f8b022df287c125b13 Author: Cédric Bosdonnat Date: Mon Aug 5 10:44:46 2013 +0200 Updated NEWS file commit 5b91cf762047996e484bfecd05b1fe0805fac64c Author: Cédric Bosdonnat Date: Mon Aug 5 10:42:00 2013 +0200 Added Cuong to AUTHORS file commit 7747ef55f70965b2d509154491079b4ad3c04732 Author: Cédric Bosdonnat Date: Mon Aug 5 10:40:14 2013 +0200 libcmis-c: don't use internal type names in the API commit 0deb3957036fb91fe16b557bab94bd278735a556 Author: Cédric Bosdonnat Date: Fri Aug 2 16:31:35 2013 +0200 Added missing libcmis-c bits to cover new things from libcmis commit b494d2c5c9210d6c9407ffa5c4f0cf212c5ec9a0 Author: Cédric Bosdonnat Date: Thu Jul 25 14:10:44 2013 +0200 Give the complete certificate with PEM header/footer lines commit d9bdbb654d68f54ddcb2032997fffacc4a841ef6 Author: Cédric Bosdonnat Date: Thu Jul 25 13:52:01 2013 +0200 Added a static handler to have user validate SSL certificates. commit 6b73428786a9734b3313103500904aae8e3f2dfe Author: Cédric Bosdonnat Date: Thu Jul 25 11:44:39 2013 +0200 Remove the certificate's header/footer to only provide the Base64 part commit 9d1da17b6cce4074eb0e684281bfc52f422d8bc9 Author: Cédric Bosdonnat Date: Wed Jul 24 15:04:15 2013 +0200 Fixed cppunit errors in json-utils and gdrive some classes commit e253fbd7fdf3f540546be71246e5911902dcf790 Author: Cédric Bosdonnat Date: Wed Jul 24 13:49:48 2013 +0200 We need to show the whole chain of certificate for client to verify it commit 35e9ffd17479a1433a533b7ff6c4813e125467e3 Author: Cédric Bosdonnat Date: Thu Jul 11 17:05:41 2013 +0200 cmis-client: show the bad certificate if any commit 5589a8fdaca88aea441e90d43a5c10eaf77c311b Author: Cao Cuong Ngo Date: Fri Jul 19 23:00:11 2013 +0200 GDrive revisions: populate revision name, created date and created user commit 125bea9c59972a376bcaa0b8613fb0fd2bc316de Author: Cao Cuong Ngo Date: Thu Jul 18 19:49:18 2013 +0200 typo fix commit fdc99a0c1068b81c898f5e7c24dccf03c23ee6a5 Author: Cao Cuong Ngo Date: Thu Jul 18 19:46:50 2013 +0200 GDrive: revisions ID Revisions of GDrive has a different ID than the original file. Changed it to the original file to avoid confusion. commit b8075edcf1f4b75b9db41ee16cba986052598d55 Author: Cao Cuong Ngo Date: Thu Jul 18 14:14:42 2013 +0200 GDrive: set property MultiValued commit 257e53a291eb2a0e8d4a6231b45bc870ead4c9a9 Author: Cao Cuong Ngo Date: Thu Jul 18 10:29:47 2013 +0200 GDrive: better properties presentation commit 0be7eb2144c35dca2ea2ea7634f8cf7d1a85eef6 Author: Cao Cuong Ngo Date: Wed Jul 17 18:42:59 2013 +0200 GDrive set content stream Only upload filename when it's modified commit 3a5f9e5f39ab717cd6a3860271ff8aefc4c9cd39 Author: Cao Cuong Ngo Date: Wed Jul 17 09:23:04 2013 +0200 GDrive repository: a better name commit 574834017bc81c1553766b6bab1194ff658b6597 Author: Cao Cuong Ngo Date: Wed Jul 17 09:22:05 2013 +0200 GDrive: create repositories even if we are not authenticated commit 7a2e9221ad3074483c1b17adc6e27f092012f714 Author: Cao Cuong Ngo Date: Tue Jul 16 20:01:21 2013 +0200 GDrive: root folder name mapping commit 66064aff9205e7476f97ec52446aca3fdf374c51 Author: Cao Cuong Ngo Date: Tue Jul 16 14:41:39 2013 +0200 GDrive to CMIS property values mapping commit 59e05698ace71684a7adb4ed961538935bb0d766 Author: Cao Cuong Ngo Date: Tue Jul 16 14:29:43 2013 +0200 GDrive: root doesn't have a parent commit f2a770627ab76b955f95920a4be5f370b6bf1228 Author: Cao Cuong Ngo Date: Tue Jul 16 12:26:23 2013 +0200 JSON parser: switch to libboost commit afab987c67ec7393b7bcc0acb1543b8906601755 Author: Cédric Bosdonnat Date: Mon Jul 15 11:18:21 2013 +0200 Added noSslCheck parameter to createSession and cmis-client commit c9258990fadebf83e99e029a601a5a42b1c0d81c Author: Cao Cuong Ngo Date: Mon Jul 15 10:55:18 2013 +0200 GDrive get object by path Uses path as ID since Google Drive doesn't support get object by path. commit fc25cd22e77b6eb995104190219ef34a7f0740cb Author: Cédric Bosdonnat Date: Fri Jul 12 17:20:26 2013 +0200 Allow to disable SSL verification for a session commit 07b08ec5eabd16ab3015cae7ca722be4851585eb Author: Cao Cuong Ngo Date: Fri Jul 12 11:14:37 2013 +0200 configure: change docbook2x to docbook2x-man commit 5cbd3d65603a862fa9e4c8dde801afb2fb64bff5 Author: Cédric Bosdonnat Date: Fri Jul 12 10:53:39 2013 +0200 In some distros docbook-to-man only handles SGML, prefer docbook2x commit 693b05a9f4520c3f13378507afbc2ee62d259a52 Author: Cédric Bosdonnat Date: Thu Jul 11 16:38:35 2013 +0200 added libcmis-c/libcmis-c.h main header commit e0f3923d36a3b03729a707da803c6b2ee6b3c092 Author: Cédric Bosdonnat Date: Thu Jul 11 16:18:58 2013 +0200 Added a central header libcmis/libcmis.hxx commit b4b61112ac9a93e4712a282ca94a429db4a4d6c6 Author: Cédric Bosdonnat Date: Thu Jul 11 16:18:13 2013 +0200 Added missing libcmis-c.pc.in to extra dist commit 96b9e07cf527b3de521f0b7c3bdb0e88d451b476 Author: Cédric Bosdonnat Date: Thu Jul 11 16:17:00 2013 +0200 Removed json-utils.hxx from some public header commit 825b12d02c5e3116fb176026bc14a5548dbe5c68 Author: Cédric Bosdonnat Date: Thu Jul 11 16:16:02 2013 +0200 Fixed opencmis webapps tarball download URL (long tests) commit 2db9dbb36527cbdaeac0b8be313005c307ac442d Author: Cédric Bosdonnat Date: Wed Jul 10 17:58:37 2013 +0200 Bubble up the SSL certificate errors Get the failing SSL certificate and make it visible from the API. Note that this depends on libcurl to be built with openssl support. commit 57fcf5b076d2c5a4117191c3acbb1702e54db6ca Author: Cédric Bosdonnat Date: Wed Jul 10 11:09:23 2013 +0200 renamed test-mock-atom.cxx into test-atom.cxx commit 6c513ea816bfef6ccc807b2c24bf20dc0038d7af Author: Cédric Bosdonnat Date: Wed Jul 10 10:09:14 2013 +0200 automake now has parallel-tests as default, force serial-tests The long tests needing the run-test.sh can't be run with the test-driver in parallel: turning that feature back to serial to avoid problems. commit 270542cc7e2277f30b570043b1d7734b93d48f61 Author: Cédric Bosdonnat Date: Wed Jul 10 10:01:31 2013 +0200 Moved the last atom unit test to mockup tests commit 763308a8ac3ebdbaddea8548dd933c7bb7861574 Author: Cédric Bosdonnat Date: Thu Jun 13 14:58:10 2013 +0200 Moved AtomTest::getAllVersionTest to mockup tests commit fbb4d46c065a2018da970a35a1d04138e1663f90 Author: Cao Cuong Ngo Date: Tue Jun 18 12:12:03 2013 +0200 Gdrive property: keep the GDrive display name commit e6d340e70a50797326195219b155ebfe83fa543d Author: Cédric Bosdonnat Date: Thu Jun 13 11:46:18 2013 +0200 Make cmis-client remember the asked username/password commit 262f1372c2ff1cdaae69d11f51df5772b5782eb0 Author: Cédric Bosdonnat Date: Thu Jun 13 10:12:06 2013 +0200 Fixed related multipart import: there may be spaces in the content type commit 1436b7b824a185e6b768688a3395d0120af84a65 Author: Cédric Bosdonnat Date: Tue Jun 11 10:13:38 2013 +0200 some newer versions of cppcheck bring loads of false positives with unusedFunctions commit 90eef104c8b601dc57df51dedc1c30b3d31ca8e5 Author: Cédric Bosdonnat Date: Tue Jun 11 09:44:06 2013 +0200 Fixed cppcheck test missing sources in make distcheck commit 5e90af9c436db138b9ee33a4776a28f5d1c743e1 Author: Cédric Bosdonnat Date: Mon Jun 10 18:04:34 2013 +0200 Fixed some make distcheck problems commit 6dd7f758298643563bbc39e1dbeb7e226181e4f4 Author: Cédric Bosdonnat Date: Mon Jun 10 16:28:04 2013 +0200 some more cppcheck fixes commit b298e52bd3ab4cdc7c10f58f0c696df6759b4e00 Author: Cédric Bosdonnat Date: Mon Jun 10 16:27:46 2013 +0200 run cppcheck in make check if we have it around commit 6ae5279516c1342b444e92e06f4cc6ef962e15e4 Author: Cédric Bosdonnat Date: Mon Jun 10 14:54:27 2013 +0200 Fixed cppcheck-reported problems commit 96b3512c5276602427354e8e0e4c26ff018b74e2 Author: Cédric Bosdonnat Date: Mon Jun 10 14:14:15 2013 +0200 atom test: moved checkin to mockup tests commit 572aaf3fb98cec88f5a2622b3ed4250250365e0f Author: Cédric Bosdonnat Date: Wed Jun 5 11:45:31 2013 +0200 Added unit test for fdo#60954 property parsing case commit 4f532d4a2dd5e86e4a17e30ed703a67a4f149530 Author: Cao Cuong Ngo Date: Fri May 31 16:17:20 2013 +0200 GDrive: revisions should have the same parent ID with the original document commit c80e00195a5ad14ec45311cf1303518382a2176d Author: Cao Cuong Ngo Date: Fri May 31 16:00:06 2013 +0200 GDrive test: getAllVersions commit 1c8449c2693e69b4a7131331b5b1f484e65f5891 Author: Cao Cuong Ngo Date: Fri May 31 15:27:27 2013 +0200 Move some methods from GdriveUtils to OAuth2Providers commit c9a7b72944c1da7bb031aaa83e67c71aac8a0df7 Author: Cédric Bosdonnat Date: Thu May 30 14:28:09 2013 +0200 Renamed BaseSession::getBaseUrl() into getBindingUrl() commit 27f14a81c879e37eb87c9d97ef93e44bf4ef9c4a Author: Cédric Bosdonnat Date: Thu May 30 14:27:49 2013 +0200 Match Alfresco in the cloud OAuth2 parser based on the hostname only commit 5742fcab9f6d9b275d07b493fe1c32319798c778 Author: Cao Cuong Ngo Date: Thu May 30 13:55:20 2013 +0200 OAuth2 session refactoring commit a4235d5037a663020d7f18c8fa04c6f888d76c7e Author: Cédric Bosdonnat Date: Thu May 30 13:40:42 2013 +0200 AtomTest moved cancelCheckOutTest to mockup tests commit 26882d09e33d90c0198e727d2de688c22245118f Author: Cédric Bosdonnat Date: Thu May 30 13:40:17 2013 +0200 getAllowableActions() should catch CurlException commit e6b8f3688569d757c5d7dfc459556cc2d551daf0 Author: Cédric Bosdonnat Date: Thu May 30 10:48:24 2013 +0200 libcmis-c: readded oauth2-data removed code and fixed it commit b1cb78b419268877d61e6c39c2e5a255881f6cc5 Author: Cao Cuong Ngo Date: Wed May 29 15:31:45 2013 +0200 Rendition: some refactoring + C wrapper commit 4263ddd04b51a4010906ba857c7911418a717f97 Author: Cédric Bosdonnat Date: Tue May 28 17:04:52 2013 +0200 Added rendition.hxx to the public headers commit 65c580736ca8c13e311308eb99600c58d8b03be8 Author: Cao Cuong Ngo Date: Tue May 28 14:19:22 2013 +0200 OAuth2: drop authentication by refresh key. We always require username/password for each session creation. commit dbdaf2972f9c781fb6f89618261ca3a1e4e736a5 Author: Cao Cuong Ngo Date: Tue May 21 21:05:13 2013 +0200 return empty code to use fallback provider commit 52be61185d256ce97e48689bfd3371f7d039c36f Author: Cao Cuong Ngo Date: Tue May 21 20:26:22 2013 +0200 Oauth2Authenticate: return an empty auth code to fallback commit de8de722adc7963a1ceee83d2f0957049e4d9c49 Author: Cao Cuong Ngo Date: Tue May 21 19:45:26 2013 +0200 no need to create a temporary oauth2handler commit f919ca96408c4009c263e53d9d997533c0d05de0 Author: Cao Cuong Ngo Date: Tue May 21 19:05:39 2013 +0200 Alfresco public API OAuth2 parsing commit fa49b75ef7021282e58e0ae244a67822ccb620bb Author: Cao Cuong Ngo Date: Tue May 21 17:37:32 2013 +0200 OAuth2: if session creation fails with refresh token, continue with other methods commit e8e5d0e40a46bf37224299bfdd625254d24ac0ae Author: Cédric Bosdonnat Date: Tue May 21 16:31:48 2013 +0200 atom tests: moved checkOutTest to mockup commit f2be182947efbbefb92c161e3bac867b72f1829a Author: Cao Cuong Ngo Date: Tue May 21 15:29:58 2013 +0200 OAuth2AuthCodeProvider: return string instead of char* to free caller from deletion commit afc1523da778d9c18493a22b55560acca7c8f501 Author: Cédric Bosdonnat Date: Tue May 21 13:31:16 2013 +0200 Fixed test-jsonutils build: no need of the mockup libcurl commit 9baf1e12f46136171096c533bebba6f99d7c27ca Author: Cédric Bosdonnat Date: Tue May 21 10:29:40 2013 +0200 cmis-client: don't drop the temporary session, reuse it commit fc3a0aee07fbd362cd0a398dd6c1a844e5b5f475 Author: Cédric Bosdonnat Date: Thu May 16 13:58:48 2013 +0200 disable unit tests on windows as they don't build commit 13cb7a2a30fed32bfab344d43075f1af0ea00f54 Author: Cao Cuong Ngo Date: Tue May 21 11:34:54 2013 +0200 Object: add getThumbnailUrl( ) method which fetch the thumbnail link from renditions list. commit 97f44d66085e14fb85fbfb2cb3ad7e92cfc2db92 Author: Cao Cuong Ngo Date: Tue May 21 11:12:20 2013 +0200 OAuth2: allows client to fetch the refresh token from a session commit 3baa0c55ddc0f75f95cf8de2b415dcbc37ee7009 Author: Cao Cuong Ngo Date: Mon May 20 13:33:43 2013 +0200 GDrive: some clean up, move const strings to utility class commit 319441f3d94e33c8a96a4f1a9f2e2cb72853216a Author: Cao Cuong Ngo Date: Mon May 20 03:48:32 2013 +0200 OAuth2: access token expires in [expires_in] seconds, need to refresh it to get a new one commit 0945b5b98252d4d1be96ab31a75df21b532a678e Author: Cao Cuong Ngo Date: Mon May 20 00:48:02 2013 +0200 cmis-client: allows using of OAuth2 refresh token commit c68775892536f5f605f002c70a09007bab96431a Author: Cao Cuong Ngo Date: Sat May 18 11:28:22 2013 +0200 OAuth2: allow using of refresh token. OAuth2Data now allows client to use their refresh token to get access key directly without username/password commit 1d185b4424ffcc0bf1d29e64155b59fc0abf2044 Author: Cao Cuong Ngo Date: Fri May 17 22:03:51 2013 +0200 GDrive document: fetch thumbnail to renditions commit 9a177b9e12b2f638404f612c72caa3be2c7524d5 Author: Cao Cuong Ngo Date: Fri May 17 21:48:37 2013 +0200 GDrive move object: an object can have multi parents, The move function should replace only the source Id and keep the rest parents commit b88bd4663b6ed347ed4454d0bad4f9b65a8d7b21 Author: Cao Cuong Ngo Date: Fri May 17 21:10:14 2013 +0200 Move some methods to Gdrive utils commit ba6416ad7855d9742135a1b838cc5563eef90ff9 Author: Cao Cuong Ngo Date: Fri May 17 20:08:30 2013 +0200 GDrive: don't fetch trashed children commit 1f45f8760d774fe4128ee01134ff6f52ed0fbb58 Author: Cao Cuong Ngo Date: Fri May 17 19:26:42 2013 +0200 GDrive doesn't have a link to all children, we send a query to search for all files whose parentID is equal to the current folder to avoid using multiple queries. commit dd26e9f41fa5aa131a46b2fe196cdb2206486693 Author: Cao Cuong Ngo Date: Fri May 17 14:12:11 2013 +0200 Rendition: print to string commit 9956accb1564e5953164a7f15c805803c08a2b4b Author: Cao Cuong Ngo Date: Fri May 17 11:41:47 2013 +0200 cmis-client: add support for streamId commit ffbf74ba226a7e716d3689ca17a8556251527689 Author: Cao Cuong Ngo Date: Fri May 17 11:18:57 2013 +0200 GDrive document: use mimeType to check if it is a Google doc commit 07931cfb4b1ccc6f408ec1d9963dc5935079a05e Author: Cao Cuong Ngo Date: Fri May 17 09:56:32 2013 +0200 Add renditions support commit 69009b73c525553f947d147cecdf8d4b64cb47f2 Author: Cao Cuong Ngo Date: Thu May 16 22:54:56 2013 +0200 More Gdrive tests commit db48572f8eca70bb79f81f50aac2d07a2d1a3a90 Author: Cao Cuong Ngo Date: Thu May 16 22:19:12 2013 +0200 More Json tests commit 180ef55a1befd3a18a9f6b8a3b592a82520c4dac Author: Cao Cuong Ngo Date: Thu May 16 21:26:18 2013 +0200 Gdrive: CMIS name conversion of cmis:description commit 4f118e775ce31cbaaaa909ee2b91f9dbb7b2b5d9 Author: Cao Cuong Ngo Date: Thu May 16 19:46:36 2013 +0200 property: default constructor should not be public commit 4ca972d42472ecbf8e06e7302474d1735df5b381 Author: Cao Cuong Ngo Date: Thu May 16 19:21:55 2013 +0200 Gdrive: set object type updatable commit b841045e963257f8147110ff8022c741a71c201f Author: Cao Cuong Ngo Date: Thu May 16 17:19:54 2013 +0200 cmis:name and cmis:contentStreamFileName can be duplicated or not, better check before converting key. commit 29a18bfbf9501675b535287a7756742ecf6ac1ce Author: Cao Cuong Ngo Date: Thu May 16 15:29:02 2013 +0200 move compability functions to a separate file commit 13b127ab921444de24266707ff654dee7176c6ee Author: Cao Cuong Ngo Date: Thu May 16 11:17:23 2013 +0200 GDrive: Folder has one parent but Document can have multiples commit cc04585cb8347945a8d3b605025063f99ca0f5d6 Author: Cao Cuong Ngo Date: Wed May 15 21:42:25 2013 +0200 Google Drive doesn't support get object by path commit f9a4c6f5a0b51e0057546ab69224073f25a1e8cc Author: Cao Cuong Ngo Date: Wed May 15 21:33:34 2013 +0200 GDrive folder remove tree commit 925fadc037c31ef0ef77724e93f901e45b07713b Author: Cao Cuong Ngo Date: Wed May 15 20:34:52 2013 +0200 Missing move-object in client help commit 8db5ddee5684ccdd0867da89c3ceb137e7000ec1 Author: Cao Cuong Ngo Date: Wed May 15 16:00:43 2013 +0200 GDrive createDocument and CreateFolder commit c8e1e7553b26ca0f3982dd048ee13e8b0ac287bb Author: Cao Cuong Ngo Date: Wed May 15 15:14:49 2013 +0200 GDrive move object commit d8ba6350ebdd7ffcb95ee6cd3a0efcb9460ce94b Author: Cao Cuong Ngo Date: Wed May 15 14:00:08 2013 +0200 Gdrive Object: remove commit 28572214556509295b09e1da45feb4c3835f8d06 Author: Cao Cuong Ngo Date: Wed May 15 13:17:29 2013 +0200 Separate GDrive object type commit 721e18b7cab53c1de8f5e030ac6cb21531772185 Author: Cao Cuong Ngo Date: Wed May 15 12:57:14 2013 +0200 Handle json object when it's null commit 1e9eb3f3bb40b211cdb29e79cbaa51216c175fd3 Author: Cao Cuong Ngo Date: Wed May 15 11:12:13 2013 +0200 GDrive fixed: some folder doesn't have parent commit ff9738006b65b94cde7105f392e1b07db93912f4 Author: Cao Cuong Ngo Date: Wed May 15 01:38:46 2013 +0200 Fixed setContentStream fileName, Fixed updateProperties Url commit 43da75bf9d19321623501effa5a0634230797b7e Author: Cao Cuong Ngo Date: Wed May 15 00:42:34 2013 +0200 separate Gdrive repository commit d0cd11fafd9202afa3e03e5bf4c9217770ba17c0 Author: Cao Cuong Ngo Date: Wed May 15 00:20:58 2013 +0200 Gdrive: getUrl() and getUploadUrl() to avoid redundant codes commit bfc161949dabb998afa7d1ced4d594596ccec4fd Author: Cao Cuong Ngo Date: Tue May 14 23:08:29 2013 +0200 create Json object from properties commit caf61096d1b37f3a9df16ae6a63fe1a6150e2cfe Author: Cao Cuong Ngo Date: Tue May 14 20:57:57 2013 +0200 GDrive object refresh commit f200e755a5f4fc9ef217dbf688417638dee07e7b Author: Cao Cuong Ngo Date: Tue May 14 18:19:31 2013 +0200 Handle json type since libjson doesn't do it properly commit 733276acaf78f033ffbad05128b99fb1d9e5c503 Author: Cao Cuong Ngo Date: Tue May 14 17:26:29 2013 +0200 Avoid using namespace in .hxx commit 74939ae4539f11fc6ebfd6e5737c090eda99f627 Author: Cao Cuong Ngo Date: Tue May 14 11:16:12 2013 +0200 Some refactoring in Gdrive AllowableActions commit 659712b20452c26db67fc0178e571d4d42ee8b78 Author: Cao Cuong Ngo Date: Mon May 13 20:51:04 2013 +0200 GDrive CheckIn/CheckOut commit 2ddfe2d145aa4e4a1b19e8df6da520188118d40b Author: Cao Cuong Ngo Date: Mon May 13 20:02:00 2013 +0200 set GDrive allowable actions commit 38aa8e5c8fa005080b5a3329929a06b8c1893a7a Author: Cao Cuong Ngo Date: Mon May 13 18:25:20 2013 +0200 Extract the parentId from the parent list commit 06a6635992e56fc62d9a947c6f20241ecc913e73 Author: Cao Cuong Ngo Date: Mon May 13 16:29:14 2013 +0200 More GDrive tests commit 6d45fe16cb79c496a0ecacd4bef91a8e7cfc4706 Author: Fridrich Å trba Date: Mon May 13 11:51:45 2013 +0200 Check for Windows on configure time commit cc2aec888303eea547d0916ce7e025f20c1638d9 Author: Cédric Bosdonnat Date: Mon May 13 11:24:33 2013 +0200 Revert "Fix linking of libcurl-mockup (why to dupplicate internal curl functions???)" This reverts commit 533307c86c59c8353ea62279bcfd6c9b13a98f3b: this links the mockup tests with the real libcurl instead of its mockup even on linux... and breaks quite a lot of tests commit 4eb9e3ce42ed5c23fab48b27fab3195c6e42ea8f Author: Cao Cuong Ngo Date: Sun May 12 23:32:44 2013 +0200 GDrive test: more tests + refactoring commit 3b6b3a17282bbdc34509b0a91dafa8ddc9036b12 Author: Cao Cuong Ngo Date: Sat May 11 22:24:39 2013 +0200 Clean up GDrive test commit 533307c86c59c8353ea62279bcfd6c9b13a98f3b Author: Fridrich Å trba Date: Sat Apr 27 11:48:46 2013 +0200 Fix linking of libcurl-mockup (why to dupplicate internal curl functions???) commit ec0c35ef460c0e6d315cb3c03b5542125568464a Author: Fridrich Å trba Date: Sat Apr 27 10:53:39 2013 +0200 Fix linking on windows-mingw (cherry picked from commit 2682c3c0a03894a9e68bf9db9151cd03b1829581) commit e75bd2548101b8681edf13ea085d62634b7668cf Author: Cédric Bosdonnat Date: Mon Apr 22 15:45:26 2013 +0200 Init protocols should be done right after resetting curl handle commit 6401443248d7ce9fad1b42bad291418d59f4a623 Author: David Tardon Date: Mon Apr 8 20:18:19 2013 +0200 rhbz#918080 restrict the set of protocols for curl commit 8e66145d204f7d053549b7cc28aef6863cfd38c8 Author: David Tardon Date: Mon Apr 8 14:07:23 2013 +0200 rhbz#918079 always return 40 hexa digits commit 581a2ea1693b572d9f0a9f3cf356064c9920f71d Author: Cédric Bosdonnat Date: Fri Apr 12 11:05:25 2013 +0200 made libcmis_session_get... functions string parameters const commit f711bfaf9e6f8bcc7b2bc54f9ed558ccf419c2b2 Author: Cédric Bosdonnat Date: Fri Apr 12 11:04:34 2013 +0200 Fixed WSSession::setRepository() commit 3ebb532625ced11fa166cd6ac51505c539a8ee50 Author: Cédric Bosdonnat Date: Thu Apr 11 09:21:35 2013 +0200 added libcmis_session_setRepository() commit dabad5febb2f6673a31dc4f0511759e08a6cfd6c Author: Cédric Bosdonnat Date: Thu Apr 11 08:35:36 2013 +0200 Forgot unused parameter commit 862a85f487903feef0335dd7ec55ef9ffc73b8c0 Author: Cédric Bosdonnat Date: Thu Apr 11 08:31:24 2013 +0200 Added Session::setRepository to allow choosing a repo without recreating the session commit c461bde87188c88a59e775d9c62ceff7fbe47199 Author: Cédric Bosdonnat Date: Thu Apr 11 08:30:43 2013 +0200 Fixed GDriveTest::getObjectTest commit 30f82b2ad56add3dab6799a8be4a5df9701a4ff0 Author: Cédric Bosdonnat Date: Wed Apr 10 17:09:10 2013 +0200 libcmis_session_getRepository returns NULL if no repository is set commit 833a6d93bd05b83180a40a99800400e314eeb79b Author: Cédric Bosdonnat Date: Wed Apr 10 12:06:42 2013 +0200 libcmis-c tests adapted to error API changes commit 673619e4d8f46a61cd27431b586b27b9f93f8c62 Author: Cédric Bosdonnat Date: Tue Apr 9 16:53:32 2013 +0200 libcmis_createSession make sure we're not creating std::string from NULL commit 1785bd837ad159f18588f470508627f127d42237 Author: Cédric Bosdonnat Date: Mon Apr 8 11:25:55 2013 +0200 fixed libcmis-c.pc to point to versioned libcmis pc file commit 75801d0996e6b2b6bd4a1e3337f13a0b7149bf0d Author: Cédric Bosdonnat Date: Mon Apr 8 09:26:20 2013 +0200 libcmis-c: handle possible bad allocations commit bf8070dfed5532a96079e82c4083033365b0791b Author: Cao Cuong Ngo Date: Wed Mar 27 19:36:28 2013 +0100 GDrive folder implementation Conversion from properties to Json still need more work out. commit e0e0653944ab164918b1f0c9a9b29007174d66b1 Author: Cédric Bosdonnat Date: Fri Apr 5 15:23:55 2013 +0200 libcmis-c unit test: fixed valgrind errors commit 9c2269efd28d8520a281db1efaac383db07767d0 Author: Cédric Bosdonnat Date: Fri Apr 5 14:39:53 2013 +0200 Override delete operator to call free to avoid valgrind shout commit 23b7a1ee873997f08094df43ade445d6eb07c537 Author: Cédric Bosdonnat Date: Fri Apr 5 14:14:04 2013 +0200 rhbz#918044: bad_alloc handling in libcmis_document_getContentStream To test bad_alloc, the new operator is overridden in test-dummies.cxx and uses a global variable to throw bad_alloc at will. Just pay attention that the test objects may also call new: temporarily switch the flag off in those cases. commit c706615d560df583c48f526fb0ce280c05624cac Author: Cédric Bosdonnat Date: Fri Apr 5 10:27:53 2013 +0200 Reworked libcmis_getRepositories to fix several issues: * a potential memory leak (see rhbz#918044) * no size was returned: so method not usable * create and use libcmis_session_getRepositories to reflect the recent changes in libcmis * transformed the Session::getRepositories result from list to vector to ease mapping in C wrapper and for more consistance with other structures used in libcmis commit 0f7b1455a05136747740af8aa869af2b28593519 Author: Cao Cuong Ngo Date: Mon Mar 25 12:46:30 2013 +0100 Rename PropertyListPtr to PropertyPtrMap commit af54b07c1269f78de2389516e388d7c9ae05fb68 Author: Cao Cuong Ngo Date: Mon Mar 25 12:37:45 2013 +0100 We don't have to use base64 encode stream for Google Drive. commit 7a7d3f13751c7b0775edaeb510e5e8343d01e420 Author: Cédric Bosdonnat Date: Mon Mar 25 11:08:07 2013 +0100 Google Drive: document and folder types need to be mapped to CMIS types and are no arbitrary strings. Used cmis:document and cmis:folder for GDriveDocument and GDriveFolder commit f65c6d1d49cd522b453d8a44244bd57c9bb1f821 Author: Cao Cuong Ngo Date: Sun Mar 24 19:15:40 2013 +0100 GDriveObject::updateProperties commit ae5698ad293d8f04506d932bf6229cc1e0bf631f Author: Cao Cuong Ngo Date: Sun Mar 24 16:05:14 2013 +0100 typedef map< string, libcmis::PropertyPtr > PropertyListPtr which is frequently used and too long. commit 2bd907bc3c8bbc1bb4f32b6dd48980c71f3cf493 Author: Cao Cuong Ngo Date: Sun Mar 24 14:52:16 2013 +0100 Add catch exception for http requests commit c7399edab18997e455e665e5c3d9bebb616f3eaa Author: Cao Cuong Ngo Date: Sun Mar 24 13:47:29 2013 +0100 GDriveFolder::getChildren commit 9ab98a3430749edc8bb918e8c1a81fcd8c130057 Author: Cao Cuong Ngo Date: Sun Mar 24 01:04:39 2013 +0100 Dummy object-type commit 65220f1dd916dcf97ebe5db51630870614473382 Author: Cao Cuong Ngo Date: Sat Mar 23 00:47:54 2013 +0100 GDriveDocument::getParents commit 14f894615208dedd9639b1e12bd297349be1843f Author: Cao Cuong Ngo Date: Sat Mar 23 00:40:15 2013 +0100 GDriveDocumenet::getAllVersion commit d5803155ae8301b2a2328a02ee94a92dcd076a97 Author: Cao Cuong Ngo Date: Fri Mar 22 23:55:32 2013 +0100 remove commented code commit a2827304420a53281f1d0188810b7ab0657873f7 Author: Cao Cuong Ngo Date: Fri Mar 22 23:49:43 2013 +0100 GDriveDocument::setContentStream commit 0c5c977f782e3321c332ce6bae01297a6c6ef238 Author: Cao Cuong Ngo Date: Fri Mar 22 20:59:26 2013 +0100 GDriveDocument::getContentStream commit a9f74f1080c45a80423975a4f7f973c475a8d7a7 Author: Cao Cuong Ngo Date: Fri Mar 22 19:34:11 2013 +0100 GDriveSession: search for "kind" property first to determine if it's a file or not commit e3b18923c525ba23ee7649845a2f1f3ca9a7e0eb Author: Cao Cuong Ngo Date: Fri Mar 22 19:16:45 2013 +0100 gdrive folder skeleton commit 140a22660561fd283a72c56a23ccc71b57f49495 Author: Cao Cuong Ngo Date: Fri Mar 22 16:44:09 2013 +0100 getStringProperty( ) refactoring commit 93f1fec03ef7ccbc430bdcadfe2e36de0825a90f Author: Cao Cuong Ngo Date: Fri Mar 22 15:45:30 2013 +0100 GDrive Document skeleton, fix Document::getContentLength( ) bug commit 7b9cbc23fb056d42972e9bd4714fd2820e6753ad Author: Cao Cuong Ngo Date: Thu Mar 21 16:50:24 2013 +0100 Fix property names mapping commit 2cb1f18d4638b3c70cc2b8af533ba849a354a888 Author: Cao Cuong Ngo Date: Wed Mar 20 18:53:49 2013 +0100 Fix Json datetime type commit d2a5963961df49de4c5725682a8c8a3ca13fb7cb Author: Cao Cuong Ngo Date: Wed Mar 20 18:32:56 2013 +0100 Fix OAuth2 append header bug commit 78388176e832a6af1728e9428fad8df2d78d9a2c Author: Cao Cuong Ngo Date: Wed Mar 20 17:49:18 2013 +0100 Push dummy repository in Gdrive Session. Add default constructor in GdriveProperty. Simplify json test file. commit 1f3d81ca2e9fd303b50d5cad0ba825906e4cbddb Author: Cao Cuong Ngo Date: Wed Mar 20 14:40:05 2013 +0100 Move GDrive specified code to its classes from base classes. Some minor refactorings in test. commit 2b3da04277b69140f86642e7a3df47fdde628c2c Author: Cao Cuong Ngo Date: Wed Mar 20 10:00:35 2013 +0100 Typo fix commit cba5023e6f7a542797cab52692039b1f7234f9df Author: Cao Cuong Ngo Date: Wed Mar 20 09:50:41 2013 +0100 Using a DummyRepository class instead of a dummy constructor commit d901838bd98b9c64b4d0eaeb079e9f1ff61ae631 Author: Cao Cuong Ngo Date: Wed Mar 20 00:29:23 2013 +0100 Dummy repository commit 01dc2dd4d9983a53bfa9a0d9d9e1ee1f650ab631 Author: Cao Cuong Ngo Date: Tue Mar 19 21:09:45 2013 +0100 GDrive Object creation implementation + test commit b689104e6bea33cbf277089f359064fcad08f9d2 Author: Cédric Bosdonnat Date: Tue Mar 19 16:03:39 2013 +0100 GDriveSession: silence the HTML parsing and make it recovering errors commit dd5d309358a75fd1f2f50e12e623bbd4aba0b434 Author: Cédric Bosdonnat Date: Tue Mar 19 15:55:47 2013 +0100 GDrive, skeleton of GDriveObject to start to implement commit acd39fb53e8fb9d40dde9d2a4ec88ea6f777f49d Author: Cao Cuong Ngo Date: Sun Mar 17 23:43:44 2013 +0100 Pass oauth2 informations as arguments to Gdrive session instead of using predefined string. Use xmlTextReader instead of xml tree commit d26dbbf2b4c26594937c5920d43ade819a2d28da Author: Cao Cuong Ngo Date: Fri Mar 15 20:36:49 2013 +0100 Using libxml2 HTMP Parser instead of manual parsing commit 849bc7c282dda4a3262d0f7f8f256420f5ed01b3 Author: Cao Cuong Ngo Date: Thu Mar 14 20:44:42 2013 +0100 Move cookie handler to base-session, just activate the curl cookie engine is enough. commit 179a561e74d58070384d1f8e8544269d345167e4 Author: Cao Cuong Ngo Date: Thu Mar 14 19:14:12 2013 +0100 GDrive Session: - Parse all the input values of the response page to post instead of just necessary one. - Update mock test, check for post requests. Base Session: - Move follow location to httpRunRequest OAuth2 Hander: - Modify exception message commit 51547efd058e6db15aa4c57894aa214aa506f59b Author: Cédric Bosdonnat Date: Thu Mar 14 16:38:38 2013 +0100 Mockup test: moved the atom data files in their own folder commit 5529dc2f364c7ffe5c4ee5d5225ca3e0c4492a5d Author: Cédric Bosdonnat Date: Thu Mar 14 16:08:42 2013 +0100 Moved AtomTest::deleteTreeTest to mockup tests commit 473f90b8b9689bc1dc182014ffd57e17f1fde35e Merge: b17f620 8bd63be Author: Cao Cuong Ngo Date: Thu Mar 14 00:36:38 2013 +0100 Merge branch 'master' of ssh://git.code.sf.net/p/libcmis/code commit b17f6203f9219c60fa780c66dca59288b15e3284 Author: Cao Cuong Ngo Date: Thu Mar 14 00:34:46 2013 +0100 Gdrive oauth2 session mock test commit 8bd63be8bd6d43d0b287847bacd66ce0020b16cb Author: Cédric Bosdonnat Date: Wed Mar 13 11:32:48 2013 +0100 Made auth2Authenticate throw CurlException and catch it in order to help handling the problems when sending the HTTP requests: can be wrong client_id / secret_id, but also any network problem: we shouldn't obsfuscate the error message. commit 14099216e44894250ac5dadf7a0cb5f133bb16f2 Author: Cao Cuong Ngo Date: Wed Mar 13 00:25:40 2013 +0100 Handle exceptions of bad username/password, bad client ID and bad client secret commit e033e0ed7d07e36ec1fc51d12215ea83d114e06d Author: Cédric Bosdonnat Date: Tue Mar 12 11:55:46 2013 +0100 cmis-client now prompts for username/password if those are missing. The password is still shown on the console (hiding is varing with the platform/OS), but at least the password won't be in the shell history this way. commit 0a2e70014064ed507495a4148d8207a74385f35c Author: Cédric Bosdonnat Date: Tue Mar 12 11:34:06 2013 +0100 Added oauth2 options in cmis-client documentation commit 656b4292deb42c7038d766fa4a3ac3d58a7fd58f Author: Cédric Bosdonnat Date: Tue Mar 12 11:23:41 2013 +0100 BaseSession: make sure the credentials have been completed before using them commit 7f0f541cc8abbb9106a9b0a32c64538c0cd444e0 Author: Cédric Bosdonnat Date: Tue Mar 12 10:46:06 2013 +0100 Added GDriveSession creation in the factory. The binding URL to use to create the GDrive session is: https://www.googleapis.com/drive/v2 commit 24ed5ae02d0b261eb3a45e120c8872f6b501dcc9 Author: Cédric Bosdonnat Date: Tue Mar 12 10:45:31 2013 +0100 Cleaned up the code and comments in GDriveSession::oauth2authenticate commit 8138ef0d0c57f4c1e1d19141e8da73fac64fac37 Author: Cao Cuong Ngo Date: Tue Mar 12 10:29:16 2013 +0100 search for GALX cookie instead of the first cookie commit 3aa216342aed61ee7e62f6a6acbf0e0f319cd8ec Author: Cédric Bosdonnat Date: Tue Mar 12 09:50:18 2013 +0100 Removed the OAuth2Data authentication callback: was moved to BaseSession commit e1d03a8b5c4ac2dba8dcbc609246e73fedb185ec Author: Cédric Bosdonnat Date: Mon Mar 11 17:59:01 2013 +0100 Moved deleteDocumentTest to mockup commit 1c04ed10741e806fda4cebb09a77cb2feec1f3e8 Author: Cao Cuong Ngo Date: Tue Mar 12 09:19:03 2013 +0100 Fix the return authCode (should have used strcpy) commit 4946a8d03d4af3914565d99831d83bfffcb9711a Author: Cao Cuong Ngo Date: Tue Mar 12 00:02:33 2013 +0100 GDrive OAuth2 is now automatic. The HTML response pages are parsed from tags (Google can change the form some day). commit cd73c40023fa1e584f7ba905e990b5728600deb8 Merge: 7cc4b6f 4ee6044 Author: Cao Cuong Ngo Date: Mon Mar 11 18:21:00 2013 +0100 Merge branch 'master' of ssh://git.code.sf.net/p/libcmis/code commit 7cc4b6f5486a24a4a6e85efed259eb7d2d16cbc4 Author: Cao Cuong Ngo Date: Mon Mar 11 18:15:46 2013 +0100 OAuth2: went to the approve page, still have to parse the HTML to get the code commit 4ee6044fc806523c2a6d5f207011fb3257b1946a Author: nccuong Date: Mon Mar 11 18:15:46 2013 +0100 OAuth2: went to the approve page, still have to parse the HTML to get the code commit e4412ae688212bf1b6ab1b13afa4fe2e80d6ed49 Author: Cédric Bosdonnat Date: Fri Mar 8 15:15:41 2013 +0100 fixed build error: missing * commit 410db26bc197e74387141322526e4685f1026321 Author: Cédric Bosdonnat Date: Thu Mar 7 15:29:09 2013 +0100 Add OAuth2 HTTP header if OAuth2 authentication succeeded commit b9c2bc5b45fc4e14d5939b1e3012ba2139d26580 Author: Cédric Bosdonnat Date: Thu Mar 7 10:24:55 2013 +0100 BaseSession: add the headers only in httpRunRequest commit 60fcbac7d43f4c2c6d71e184a4abf02f469dfe4e Author: Cédric Bosdonnat Date: Thu Mar 7 09:23:53 2013 +0100 Removed debugging couts commit 07efd2231c1346b400a3c89d3226e92a210b5200 Author: Cédric Bosdonnat Date: Thu Mar 7 09:21:37 2013 +0100 Initialize OAuth2 after curl handle to avoid crashes commit 43b242651a65714a729a8615ad35dc59f16aa6c2 Author: Cédric Bosdonnat Date: Wed Mar 6 19:49:10 2013 +0100 Rename scopes to scope everywhere as OAuth doc mentions scope commit e44ab9c92ac23d61211645912d5c5b063f4013b3 Author: Cao Cuong NGO Date: Wed Mar 6 17:38:34 2013 +0100 Google Drive implementation start Started implementation of GDriveSession class and corresponding mockup unit tests. Added code to handle OAuth2 at the BaseSession level to benefit all bindings / protocols. This needed some small refactoring of the existing code. commit 75236d120d665198ce23eb7b06ab38c55467a5db Author: Bjoern Michaelsen Date: Fri Mar 1 01:49:37 2013 +0100 prevent warning prevents error: ignoring return value of 'size_t fread(void*, size_t, size_t, FILE*)', declared with attribute warn_unused_result [-Werror=unused-result] with strict CFLAGS (although this is a false positive anyway right now) commit 7cc784f74358dece8440db227e0d460ceafe53ac Author: Cédric Bosdonnat Date: Wed Feb 13 18:45:03 2013 +0100 AtomFolder::createDocument fix: use Location header if needed The specification says the created entry is returned as a URL in Location header. Thus the priority to get it is now: - try the response body - try Location header - try Content-Location header for Lotus Live commit 1b571d0ae214dbae0f8b19d7d46a37dd0bcec873 Author: Cédric Bosdonnat Date: Wed Feb 13 16:00:45 2013 +0100 Added ObjectType::getBaseTypeId() and getParentTypeId() for perf reasons commit c3ba5475fc46dba9fa412c75fe622cf4d724160a Author: Cédric Bosdonnat Date: Wed Feb 13 08:37:43 2013 +0100 AtomTest::createFolderBadType moved to mockup tests commit 61d74599e8db5a739c559abcd43e4ce387e44fe1 Author: Cédric Bosdonnat Date: Wed Feb 13 08:10:24 2013 +0100 AtomTest::createFolderTest moved to mockup tests commit 53f06102a1613dc4ccc660c278a778b581393a21 Author: Cédric Bosdonnat Date: Wed Feb 13 07:40:30 2013 +0100 Atom: fixed the error type for the 404 returns to be objectNotFound commit f86585cb41f79c9928adb480f06699cb23da6272 Author: Cédric Bosdonnat Date: Tue Feb 12 15:46:03 2013 +0100 Atom GetChildren allowableActions is not sent by Lotus Live In that condition, getChildren() should raise an exception only if canGetChildren is not allowed and defined. commit 3b17d146de8802feec25e7c6fd2080c097e8da46 Author: Cédric Bosdonnat Date: Tue Feb 12 15:20:15 2013 +0100 Atom: when we have no allowable actions, try to get them Some servers like Lotus Live aren't providing the allowable actions in the object entry in all cases. Then we need to fetch the allowable actions in the other way even though it adds one more http request. commit ecd344d1000c4a3467868e794f00a4c6780b0910 Author: Cédric Bosdonnat Date: Sun Feb 3 19:47:22 2013 +0100 Moved atom updatePropertiesTest to mockup commit f134d1be356d44f870cb23d8b36a71a398e20413 Author: Cédric Bosdonnat Date: Fri Feb 1 17:36:10 2013 +0100 Moved AtomTest::setContentStreamTest to mockup tests This required to add support for testing the PUT / POST requests in the CURL mockup. The general idea here is to get the request body that was sent and see if it matches the expectations. commit bc6f355317040368dcbac21571b5d472fb56670d Author: Cédric Bosdonnat Date: Fri Feb 1 11:18:01 2013 +0100 Moved AtomTest::getContentStreamTest to mockup tests commit 0790d8be5ea695e1d4bc168b176970f8fe0c7a2c Author: Cédric Bosdonnat Date: Thu Jan 31 10:27:14 2013 +0100 Moved getChildren and getParents atom tests to mockup tests commit 6e6a0f1b25baadc7c775370b7750989412062986 Author: Cédric Bosdonnat Date: Wed Jan 30 10:34:03 2013 +0100 Moved atom getAllowableActions test to mockups test commit 25491d48475cfb870e79e5cba5afd216c10e66c9 Author: Cédric Bosdonnat Date: Wed Jan 30 10:28:25 2013 +0100 Added allowable actions to Atom object responses commit 39b0ec2c8d42798c95f44287eaa07aab853ed2cb Author: Cédric Bosdonnat Date: Tue Jan 29 22:38:01 2013 +0100 Bumped version numbers for 0.4.0 commit 4dcc2f3a92326a2245c77e2f96c27048e5cfe970 Author: Cédric Bosdonnat Date: Mon Jan 28 17:28:27 2013 +0100 Moved Atom getByPath tests to mockup tests commit 0f551a749e5c5655428691189cae3d72b69c5250 Author: Cédric Bosdonnat Date: Mon Jan 28 17:07:38 2013 +0100 Moved Atom document and folder creation tests to mockup tests commit 1ba6d0da01db197f73570db1c6c3e917c5e32996 Author: Cédric Bosdonnat Date: Fri Jan 25 15:57:06 2013 +0100 Moved AtomTest::getUnexistantObjectTest to mockup test commit 70c5ffdc0b7c73b787fc9a40c1ac098390eb60d3 Author: Cédric Bosdonnat Date: Fri Jan 25 14:40:57 2013 +0100 Moved all Atom types tests to the mockup test commit 31cca296a3175a645832ea4329cd0ad7bfacd0f6 Author: Cédric Bosdonnat Date: Thu Jan 24 22:48:26 2013 +0100 Moved AtomTest::authCallback to the mockup test While moving the test method around, I discovered that the previous test wasn't correctly working as it should have failed earlier (when getting the services document). As InMemory required no authentication to get this document, it was working, but this isn't always the case. In order to fix this, the setAuthenticationProvider had to be moved to the session factory level and turned static. This way the same provider is used for all sessions and the auth Provider can be used within the constructr without adding one more parameter to it. commit ba8a6e400ae778cbfb68d2b5acf91b9033f010ba Author: Cédric Bosdonnat Date: Thu Jan 24 10:12:12 2013 +0100 Remember if we should output Expect: 100-Continue to save HTTP requests commit 473817890e25b3b57fd6d573e3122df0bde51306 Author: Cédric Bosdonnat Date: Wed Jan 23 13:37:33 2013 +0100 HTTP 1.0 proxies may reply with 417 error due to 100-Continue In such cases, disable that header and try again (only for POST and PUT methods) commit 4343a5383997795b133dc16eeb0f24f0d47af67a Author: Cédric Bosdonnat Date: Tue Jan 22 14:32:36 2013 +0100 Proxy support: keep API compatibility with older versions of libcmis The tests for the proxy feature required to move the cleanup of the curl handle at the beginning of the request creation (or we couldn't test anything). This commit also fixes the curl versions: the values need to be real hexadecimal. commit 94375caf5c6819aa0e28061765fc76ed435bcd60 Author: Cédric Bosdonnat Date: Thu Jan 17 15:52:46 2013 +0100 Added poxy settings to session to override the system config if needed commit d605a7238df9fdb43457314c06cc84726d8dcadd Author: David Tardon Date: Wed Dec 19 14:39:11 2012 +0100 allow setting of DOCBOOK2MAN on configure cmdline commit 70f38c73fe5c401d759124487190477aaafb47ef Author: David Tardon Date: Wed Dec 19 14:35:49 2012 +0100 rename DOCBOOK2X to DOCBOOK2MAN commit 7312c4479570de63e098177acf5f04b50c486a0d Author: David Tardon Date: Sat Dec 15 08:40:28 2012 +0100 make the man page valid docbook commit 836936b8a6e9cb64bffccd5101b9800a9883d1d8 Author: David Tardon Date: Sat Dec 15 08:36:48 2012 +0100 add public and system ID to doctype commit e8d97b0b2f085c07aeee37cd79f956c9d94f4a6a Author: Cédric Bosdonnat Date: Mon Dec 17 14:47:31 2012 +0100 added licence header in shell scripts commit 9a5861bb9c76a55abdcfc3139136c5aafcc8886c Author: Cédric Bosdonnat Date: Mon Dec 17 14:45:18 2012 +0100 added a sample populate.sh script to push a local tree to a CMIS server using cmis-client commit 451b239a49995f81d8526c68b080eb3f2c70b3b5 Author: Cédric Bosdonnat Date: Mon Dec 17 14:44:37 2012 +0100 fixed typo in cmis-test.sh commit e6e80350b8f31b749e328aabc2cd172e79c16d6c Author: David Tardon Date: Thu Dec 13 16:15:34 2012 +0100 coverity: cannot use content of temp. var. as return value commit fd9702d002988b797803ed489081bc7d192b67b1 Author: David Tardon Date: Thu Dec 13 15:46:38 2012 +0100 coverity: only libcmis::Exception is allowed here commit c6b4e5a52774ec90db8b0f43777d5f4e97ec5ea3 Author: David Tardon Date: Thu Dec 13 15:37:12 2012 +0100 coverity: only throw allowed exceptions commit 5b2f0d83f8aa68c6d197c0cb0cad9a06218f5d75 Author: David Tardon Date: Thu Dec 13 15:32:25 2012 +0100 make sure there is enough space for filled-in credentials commit 5d90791053460d9604d080262cc84136a352cc67 Author: David Tardon Date: Thu Dec 13 14:53:17 2012 +0100 coverity: actually _do_ the reading in a loop .-) The current code amounts to one-time read+write (in a block), followed by a potentially infinite loop with empty body. commit 4958952e4a018361194c54d635ffe5f595a0f5c7 Author: David Tardon Date: Thu Dec 13 14:31:06 2012 +0100 coverity: check dynamic_cast result for NULL commit 95b2038afbbf84d6d4dd566912722055207ecfe7 Author: David Tardon Date: Thu Dec 13 14:27:52 2012 +0100 coverity: check dynamic_cast result for NULL commit 30d6ff829b8ab171aa673c0e812b0d89ac9b73a3 Author: David Tardon Date: Thu Dec 13 14:09:45 2012 +0100 coverity: sizeof(ptr) returs size of the pointer commit 7e3a48fc047de9ddd3de4cf3fe1e368245b6b754 Author: Cédric Bosdonnat Date: Fri Nov 30 17:21:31 2012 +0100 cmis-test.sh: a tiny step further commit 2e76ab11c630f93596c745727eab07e3577c481e Author: Cédric Bosdonnat Date: Fri Nov 30 17:19:37 2012 +0100 Mockup: started moving the getType and getObjectType tests commit 802390b96f77c54e3ee25c9b6d6ad86dae8c555b Author: Cédric Bosdonnat Date: Fri Nov 30 09:13:21 2012 +0100 Oops, forgot to git add mockup-config.cxx commit e59d87191a76e38956c57887177bd0765f47aeb2 Author: Bjoern Michaelsen Date: Fri Nov 30 09:00:00 2012 +0100 Fix printf format error for i386 commit a1ca9414c2a757a5df62abfe51c8736ee0218629 Author: Cédric Bosdonnat Date: Wed Nov 28 11:44:59 2012 +0100 mockup: migrated AtomTest::sessionCreationTest() and added a bad auth test commit 4c2eece3b195927d5a725c6f70b9e76ae4e5e511 Author: Cédric Bosdonnat Date: Wed Nov 28 11:44:27 2012 +0100 Oops, pushed a binary result by mistake commit 38bd015cd04c8ff294f5ff7c491e002c0c67eff3 Author: Cédric Bosdonnat Date: Tue Nov 27 09:50:25 2012 +0100 Moved libcmis-mockup to mockup commit 24c7c551d82b9f8e20276c5f4127774514e0b74d Author: Cédric Bosdonnat Date: Tue Nov 27 09:34:40 2012 +0100 Remove AtomPub getRepositories test: moved to mockup commit a01fda2642d63a58aa97f48135bf0e01d770f381 Author: Cédric Bosdonnat Date: Tue Nov 27 09:33:24 2012 +0100 Mockup: added getRepositoriesBadAuth test commit 9005604ab2de4030ec9f53eec2f8c02d14e9c3a8 Author: Cédric Bosdonnat Date: Tue Nov 27 09:32:19 2012 +0100 Missing equality check in BaseSession::operator= commit 8837275b38d496f3f92ae5d12be88ce5b70bb286 Author: Cédric Bosdonnat Date: Mon Nov 26 17:26:15 2012 +0100 mockup test: not a POC any longer, so change names commit c55c8e364fbc6d1dfaa85c96fb6fe1db698e583c Author: Cédric Bosdonnat Date: Mon Nov 26 17:11:02 2012 +0100 First simple test with mockup is working commit a6d42ec9c55e8eab6e5cf2e7dbd1421a0ea1f7e6 Author: Cédric Bosdonnat Date: Sat Nov 24 22:52:19 2012 +0100 Started to create a libcurl mockup to have better unit tests commit f2d21a2336b0a3203243717b0c9f6b7338a4b8ad Author: Cédric Bosdonnat Date: Fri Nov 23 23:49:33 2012 +0100 Extracted tests in qa folder commit 90dc202e5cb5d80b73c40145dcac792bfc5dabbd Author: Cédric Bosdonnat Date: Tue Nov 20 16:58:57 2012 +0100 Started implementing a shell script to test all operations on various servers The goal of this script is to have on test scenario to run against various servers to spot the server-specific implementation problems. commit 7cc3c8205652e1be4c231b0bb6c3a0562a4403b7 Author: Frederic Bor Date: Mon Nov 19 16:55:24 2012 +0100 Some optimizations related to createDocument commit 632b671e46cfc50318ee58c684975551c2d9132a Author: Cédric Bosdonnat Date: Thu Nov 15 13:52:06 2012 +0100 parse dateTime now handles invalid strings commit 16fa14ee9c328b1d3d67e2e7e5915ad65bb86f51 Author: Cédric Bosdonnat Date: Thu Nov 15 13:10:35 2012 +0100 Some more NULL pointers verifications commit 6e89f59e373da814a970ee22f5049274c5bbedbb Author: Cédric Bosdonnat Date: Wed Nov 7 13:57:02 2012 +0100 Soap binding: safer content output Getting a char* from a temporary string object isn't a good idea as we aren't sure what the pointer will point to later. commit 2965de85c937be11dfbed6c3c42b96b46720ac85 Author: Cédric Bosdonnat Date: Wed Nov 7 10:04:32 2012 +0100 WaE: fixed warnings reported with gcc/g++ 4.7.1 commit b217ee82214edbd84bce27953eae342686289e41 Author: Cédric Bosdonnat Date: Tue Nov 6 17:05:46 2012 +0100 Added some checks for NULL values commit 5463c8444e1fe41b22af1c9db9132ef3fee5e43c Author: Cédric Bosdonnat Date: Sat Oct 20 18:44:03 2012 -0700 Print allowable actions in toString if possible commit d245ad91d964a66880b40359a4335c4ec61f7556 Author: LuboÅ¡ Luňák Date: Mon Sep 17 14:51:51 2012 +0200 Prevent clashes with some windows.h definitions commit 15194151431ce9af7f2d9881422897881b242807 Author: Cédric Bosdonnat Date: Mon Sep 17 14:04:12 2012 +0200 Fixed some more warnings commit 0348a0b77aad18a871cb4179a6a001f868ee2aa4 Author: Cédric Bosdonnat Date: Mon Sep 17 10:09:36 2012 +0200 fixed cppcheck errors commit 0b60c1e4dde7d82ff707c560132454df6a5a8c0e Author: Cédric Bosdonnat Date: Fri Sep 14 10:03:57 2012 +0200 Raise more warnings and fixed them commit c20c3531175677c242c49c68011a37cfee898750 Author: Cédric Bosdonnat Date: Fri Sep 14 09:32:10 2012 +0200 Forgot to remove now useless files commit f0903b355ec26d218833525c41ec235737811be1 Author: Cédric Bosdonnat Date: Thu Sep 13 14:06:08 2012 +0200 Updated NEWS commit 3122aa64eb0bca31bbba3973aa1db686b0691f3b Author: Cédric Bosdonnat Date: Thu Sep 13 13:42:35 2012 +0200 Add Document::getAllVersions and its unit tests commit 6dc474e9e7422609ff9038f2c391a831d46f0c90 Author: Cédric Bosdonnat Date: Wed Sep 12 16:22:00 2012 +0200 fixed libcmis-c library name to be libcmis-c instead of libcmis_c commit b2b0f7b2d238386d286dbde96401eb633b93f332 Author: Cédric Bosdonnat Date: Wed Sep 12 14:07:48 2012 +0200 fixed make distcheck: clean some files and fix the libcmis-c build commit d0c5f6df9352f3bc3e46c833473c06c862afa37d Author: Cédric Bosdonnat Date: Wed Sep 12 10:49:36 2012 +0200 fixed run-test.sh execution in make distcheck commit 1f5d6de81801573620712f10bb6b536ad0ba7aaf Author: Cédric Bosdonnat Date: Tue Sep 11 17:06:23 2012 +0200 bumped -version-info to 3:0:0 commit 932ef9bfd0b338e73f95a8a9281406e0529ca59d Author: Cédric Bosdonnat Date: Tue Sep 11 16:34:55 2012 +0200 Completed NEWS file commit 12a29492172a34ff6ed07ea22b8c14bb88105d17 Author: Cédric Bosdonnat Date: Tue Sep 11 16:17:47 2012 +0200 Added filename to the content stream operations and fixed SharePoint checkin SharePoint checkin requires to have no stream in the checkIn call, but set the content stream on the PWC. If we get that exception, then try out the SharePoint way to do it. Added the filename parameter in createDocument, setContentStream and checkIn as I first though that may fix the SharePoint problem. commit b12d470a2fda1fff14cf56b50c5418427adfe045 Author: Cédric Bosdonnat Date: Mon Sep 10 17:40:03 2012 +0200 cmis-client fixed checkIn: the file wasn't properly provided commit b3c2fb5b0ac7dd3db96a1f571fde243ac895b13f Author: Cédric Bosdonnat Date: Mon Sep 10 17:38:36 2012 +0200 API fix: checkin needs to return a document Some servers like Alfresco have a different ID for the object with the new version. commit b628d6c321459a4ead9e07a6672fe306e5c4fa8c Author: Cédric Bosdonnat Date: Mon Sep 10 15:01:41 2012 +0200 url-decode the part id in xop:Include href attribute commit 34c3400aa67d1d6e32e9e4c53dff39ea9a91abd2 Author: Cédric Bosdonnat Date: Mon Sep 10 14:06:34 2012 +0200 xcmis.org sends back text/xml responses to Soap requests... support them now commit 6744da06a787081ea26bedb95a87f60aefc4e197 Author: Cédric Bosdonnat Date: Mon Sep 10 13:39:02 2012 +0200 Fixed obsolete comment commit 888c9385d582631455f58b741331c4ec87da9f58 Author: Cédric Bosdonnat Date: Fri Sep 7 18:44:40 2012 +0200 Fixed multipart/related parsing received from SharePoint commit fb0182e93eba9105d5fab23b282d5a389770b6a5 Author: Cédric Bosdonnat Date: Fri Sep 7 18:25:49 2012 +0200 Fixed RelatedMultipart for SharePoint to parse it properly commit 42e09dbfb55d6b1ca046fba51e3e275dd2d69e1c Author: Cédric Bosdonnat Date: Thu Sep 6 17:53:44 2012 +0200 updated NEWS file commit 7151924bd1b548a97c5329d3e5766ddf7038ad7e Author: Cédric Bosdonnat Date: Thu Sep 6 17:45:47 2012 +0200 SessionFactory: got rid of that stupid param map for creating sessions commit edaf7ffe17b3979469789f706b7e7cf899990e6f Author: Cédric Bosdonnat Date: Thu Sep 6 17:15:17 2012 +0200 Make the -r parameter optional if there is only one repo on the server commit 6189752de75f760a76b6b502fabb65f696bd0e56 Author: Cédric Bosdonnat Date: Thu Sep 6 16:39:04 2012 +0200 SessionFactory now can decide alone whether to create Atom or WS Session commit ecc21a39219d0c81e212ff190d28d205a3f25451 Author: Cédric Bosdonnat Date: Thu Sep 6 13:51:31 2012 +0200 WSSession: turn all services into members to avoid creating them often commit 50d644e2092e3bb34dfd3b85c26c661e2531955d Author: Cédric Bosdonnat Date: Thu Sep 6 13:39:41 2012 +0200 Implemented WSDocument::checkIn and its test commit d253fce091467ec6b7187055ab6d61345d0ddf1e Author: Cédric Bosdonnat Date: Thu Sep 6 11:31:00 2012 +0200 Implemented WSDocument::cancelCheckOut and its test commit 766e075732786c92220131eab8eaca80db6d4819 Author: Cédric Bosdonnat Date: Thu Sep 6 11:19:03 2012 +0200 Implemented WSDocument::checkOut and its test commit dd8bdad46b08663b9473a4cc99bdc91ec3a0905e Author: Cédric Bosdonnat Date: Thu Sep 6 10:35:21 2012 +0200 Implemented WSFolder::createDocument and its test commit 79f80cdaba18c7e1dee35e217064321524466875 Author: Cédric Bosdonnat Date: Wed Sep 5 17:52:40 2012 +0200 Implemented WSDocument::setContentStream The common part to send a document stream is in a writeCmismStream( ) function so that it could be used by createDocument and checkIn. Fixed the RelatedMultipart parsing to strip the '<' and '>' of the content-Id's in case there are some as this would prevent to match thexop:Include href and the corresponding part. commit 5d98e9473acc3129b3b778ed3cc7c4f03151d1c4 Author: Cédric Bosdonnat Date: Wed Sep 5 10:27:10 2012 +0200 Implement WSFolder::createFolder and is unit tests commit 2c399e3ad9e56edbda80b8b703ada1cd1ce24f1e Author: Cédric Bosdonnat Date: Tue Sep 4 17:05:15 2012 +0200 Implemented WSFolder::getChildren( ) and its test commit ea24f5d4d7cdff7f33215ffce7d18f72971a6bd7 Author: Cédric Bosdonnat Date: Tue Sep 4 15:59:38 2012 +0200 Implemented WSDocument::getFolderParents and its tests commit d96a641f4e7fd2355e446ac7ffa6263d897fcd0c Author: Cédric Bosdonnat Date: Tue Sep 4 14:44:55 2012 +0200 Implemented WSObject::move and its test. NB: the unit test fails due to WSDocument::getParents not being implemented ATM. commit a7ec3188863f5c6feeabc7d263a668c15bcafad1 Author: Cédric Bosdonnat Date: Tue Sep 4 14:03:17 2012 +0200 Implemented WSDocument::getContentStream commit acc5f2fd928169681caa21735a8485acee04cdda Author: Cédric Bosdonnat Date: Mon Sep 3 17:37:08 2012 +0200 WS binding: implemented getObjectByPath commit ad742f453d5e251dd9444a45bdef3c18385d8bb4 Author: Cédric Bosdonnat Date: Mon Sep 3 10:53:00 2012 +0200 WS binding: implemented Folder::removeTree commit 297cf8add3b3814f321aad8dec22c09c09271cbd Author: Cédric Bosdonnat Date: Fri Aug 31 17:18:32 2012 +0200 Added WSDocument creation in getObject and the corresponding tests commit 1c25e90a5181263d2a96abf6e17f15254677292c Author: Cédric Bosdonnat Date: Thu Aug 30 17:07:18 2012 +0200 Added WSFolder and created it in getObjectResponse commit 9f75e2e61bd772b083380bdf41aeb4eb43d81bc6 Author: Cédric Bosdonnat Date: Tue Aug 28 16:22:21 2012 +0200 Moved common parts of AtomDocument and AtomFolder to Document and Folder This is to prepare the arrival of the WS Document and Folder implementation. commit b9459e85ae7a4a91dbde202f77bd3cddfae2a427 Author: Cédric Bosdonnat Date: Fri Aug 24 11:46:04 2012 +0200 WebService: implemented Object::remove commit c8a6957c81a908c420a6562c1ed4a5fbf621712f Author: Cédric Bosdonnat Date: Fri Aug 24 11:13:57 2012 +0200 Object::updateProperties: update with the properties given as parameter This will fix the API problem forcing us to push all the properties of the object during updateProperties (even the ones that didn't change). commit 121cd97f661aa92c9080666e43cb92e8ee38b3ee Author: Cédric Bosdonnat Date: Fri Aug 24 07:40:13 2012 +0200 WebService binding: implement updateProperties The Object::updateProperties( ) API isn't really good: pushing all the object properties to the server may have some bad aspect. For example, when adding an unchanged cmis:name to the request, the server may try to rename the object with the same name... and throw an exception. commit 1fafc8cb21515166c2784dd1793858cedccda556 Author: Cédric Bosdonnat Date: Wed Aug 22 09:16:27 2012 +0200 Object::updateProperties should return the updated object Section "2.2.4.12 updateProperties" of the CMIS specifications says that the returned object may be different from the input one... we need to reflect this in the API as well. commit 9f4c39ffb74ecccc3af38315a3270d511504ea1f Author: Cédric Bosdonnat Date: Mon Aug 20 05:13:10 2012 +0200 Added unit test for WSObject construction commit c1df131ec7ea5313547bd8f1722b0e4610f0119e Author: Cédric Bosdonnat Date: Mon Aug 20 04:51:53 2012 +0200 Object: merged the m_session members of Atom and WS classes commit 4436c0e06941d374c464ebe8395e14d8278d79f2 Author: Cédric Bosdonnat Date: Fri Aug 17 18:15:11 2012 +0200 WebService binding: added ObjectService and WSObject Started AtomObject refactoring to extract the common bits commit 5ab06c01aa58569e6f6c0edd61d4f8e321269d28 Author: Cédric Bosdonnat Date: Fri Aug 17 16:44:12 2012 +0200 Soap binding: added getTypeChildren and its unit test commit 51ba78dfae5d82b97031cb7bf5aa43728a27e361 Author: Cédric Bosdonnat Date: Fri Aug 17 14:31:20 2012 +0200 Added C wrapper and unit tests for Object::move commit d23da90759923bcddf7fe330f6df02c4d81e13ba Author: Alexander Slipchenko Date: Thu Aug 16 18:29:13 2012 +0300 implementation of moveObject service commit 57b5ed7ce1111d1065718de2a6e67aaaaa0d7eb9 Author: Alexander Slipchenko Date: Thu Aug 16 17:51:45 2012 +0300 fix extractInfos. extractInfos did not overwrite object state from the given xml - this causes problems for e.g. the move functionality because parent and path should be updated from service response. commit e3a97126787fb722119819086068d62281e8f898 Author: Alexander Slipchenko Date: Thu Aug 16 17:40:47 2012 +0300 interop with xcmis: ignore spaces in link type attribute commit 4aaaf87891ddfdef4fc443b163c7cd05b40c92de Author: Alexander Slipchenko Date: Thu Aug 16 14:34:55 2012 +0300 fix Cloudoku too many redirects error commit 64e9060c0cefef22277c1d69908ac5ed57d69ee1 Author: Cédric Bosdonnat Date: Fri Aug 17 10:19:28 2012 +0200 WS binding: added the getTypeDefinition implementation This needed a code refactoring to get the common bits between Atom and WS bindings. commit 5d1f22b3b3a70bc1f2fb0e3d41144344bbf143df Author: Cédric Bosdonnat Date: Thu Aug 16 12:32:51 2012 +0200 tests: don't download the server pieces if we don't need them commit 39dfe01cf28007010bf3257c23ec6268e2a77ceb Author: Cédric Bosdonnat Date: Thu Aug 16 12:08:53 2012 +0200 Testing: allow to disable the tests needing a running server only This will allow to run the unit tests that don't need the running server during the packaging process and run the others during the development process. See the --disable-long-tests configure option commit 8a91b159e20d8050c366bd36fb4de194397e5770 Author: Cédric Bosdonnat Date: Thu Aug 16 11:05:21 2012 +0200 Added a type string to libcmis::Exception Getting that error type from the AtomPub binding isn't easy as some HTTP status codes are mapped to several exception types, but this is used in the WebService binding. commit 59278289168ebf69a083e5666b40ca284e9c3b02 Author: Cédric Bosdonnat Date: Mon Aug 13 11:15:45 2012 +0200 libcmis-c: forgot libcmis_folder_getPath unit test commit 08c9bd67ad5d7ea28f2b547c50d54bbe52d8c70f Author: Cédric Bosdonnat Date: Mon Aug 13 11:13:31 2012 +0200 libcmis-c: added document and folder casts from object commit 688a4ffbf9bdfde3743aba54778fa023bea4fb0b Author: Cédric Bosdonnat Date: Fri Aug 10 18:02:24 2012 +0200 libcmis-c: added folder createDocument and its unit tests commit 90d0ad8826d6cb261f1879fa28a53c2ce0ca6c68 Author: Cédric Bosdonnat Date: Fri Aug 10 17:43:30 2012 +0200 libcmis-c: added Document checkin and its unit tests commit f961a15f1449a1ad27f78aba69a86cf66066f599 Author: Cédric Bosdonnat Date: Fri Aug 10 17:11:47 2012 +0200 libcmis-c: added document setContentStream and its tests commit 1f0809297e9f3fb057b1c3c39c15c0eba35aea74 Author: Cédric Bosdonnat Date: Fri Aug 10 15:40:36 2012 +0200 libcmis-c: added document getContentStream and its tests commit 18d43c4afcaae3fd043da5079abd37f9156287ac Author: Cédric Bosdonnat Date: Fri Aug 10 11:57:00 2012 +0200 libcmis-c: add document without stream support commit 91a3dc3389610baa5d223a545bf535decf76990b Author: Cédric Bosdonnat Date: Fri Aug 10 10:23:37 2012 +0200 libcmis-c: added extern "C" blockon headers to link from pure C code commit b6e8f77eb99760c4aa58afdcfd145872749e8b36 Author: Cédric Bosdonnat Date: Fri Aug 10 10:22:59 2012 +0200 Build silently if AM_SILENT_RULES is defined commit bb551a9084f093ba22abfb5b3355414420e21605 Author: Cédric Bosdonnat Date: Thu Aug 9 18:15:56 2012 +0200 libcmis-c: test compilation and link in C Refactored vector types names while fixing them for C compilation commit 4b2a84ad0a2eb2fbf976555ec6551d5c8bc96ee1 Author: Cédric Bosdonnat Date: Thu Aug 9 16:33:06 2012 +0200 libcmis-c: added folder unit tests commit 6d77ff9fb8ac493d118b2e001648a1a07a2812ea Author: Cédric Bosdonnat Date: Thu Aug 9 12:22:06 2012 +0200 libcmis-c: added unit tests for object commit 1ba2d9dd53d88c13578a3fe6e7a85bc663425b24 Author: Cédric Bosdonnat Date: Wed Aug 8 17:15:07 2012 +0200 libcmis-c: copy the strings, and have them free'd This will help libcmis-c to keep indenpendant from the string management of the libcmis implementation: each time we give a string to the user it's strdup'ed, but the user needs to free it. commit 2026b382244dbdbf75dd48cdb5ef6720d8f30d08 Author: Cédric Bosdonnat Date: Wed Aug 8 17:03:02 2012 +0200 libcmis-c: added unit tests for AllowableActions and ObjectType commit b7101af8d5ed14d8f397b40c19463a3e639bed89 Author: Cédric Bosdonnat Date: Wed Aug 8 10:42:18 2012 +0200 libcmis-c: completed unit tests for property commit 8c7af53b077f27a0d83a742859bdfa7d8bc5f3d0 Author: Cédric Bosdonnat Date: Tue Aug 7 18:40:31 2012 +0200 libcmis-c: added unit tests for property Added libcmis_vector_* types to ease handling the mapping of vectors to C commit be45299327728ce7eb7e84c67c508c809ab56890 Author: Cédric Bosdonnat Date: Tue Aug 7 14:32:01 2012 +0200 libcmis-c: unit tests for PropertyType commit 9b0b07292e0f8a411edd305e7ed456802f6d4231 Author: Cédric Bosdonnat Date: Tue Aug 7 11:17:56 2012 +0200 libcmis-c: added foundations for Document commit f5f788f513461a261a2a9e060b2fee28f624af26 Author: Cédric Bosdonnat Date: Tue Aug 7 11:16:48 2012 +0200 libcmis-c: added unit testing for Repository commit a68ddf8f3314b04e0e36d8976ca2036ed2ecc17a Author: Cédric Bosdonnat Date: Tue Aug 7 09:17:32 2012 +0200 libcmis-c: added Folder commit 21afc7c13aa45c1925ff53842b911bf525a877b4 Author: Cédric Bosdonnat Date: Mon Aug 6 17:31:23 2012 +0200 libcmis-c: completed Session commit 73cc1758958595db2e83cd2f0387af316e4dea6a Author: Cédric Bosdonnat Date: Mon Aug 6 17:02:09 2012 +0200 libcmis-c: added Property commit 341d258b4dfc9e76c9d06a506d722251b28a7ccf Author: Cédric Bosdonnat Date: Mon Aug 6 13:40:54 2012 +0200 libcmis-c: added PropertyType commit a79f77063b0f4a9681a4472852ca35c4a24eb2ed Author: Cédric Bosdonnat Date: Sat Aug 4 11:56:48 2012 +0200 libcmis-c: added Object, ObjectType and AllowableActions commit 9dbee4f9612a9a7b9652dd708c56660b8503c998 Author: Cédric Bosdonnat Date: Fri Aug 3 16:05:47 2012 +0200 Started libcmis-c wrapper for use of the library in C programs commit 37c28b19d579e6d91cbb50ca42a38196d33019c5 Author: Cédric Bosdonnat Date: Mon Jul 9 17:39:02 2012 +0200 removed some warnings commit 64b395df637a3680bbdb96f39e6c110cbd59316e Author: Cédric Bosdonnat Date: Thu Jul 5 12:19:45 2012 +0200 SessionFactory::getRepositories, now returns repository objects instead of id commit c8cc343414da65bbe8a766a02844971071d20d48 Author: Cédric Bosdonnat Date: Tue Jul 3 17:01:24 2012 +0200 Allowable actions: read them directly with the object The original aim of this patch is to workaround Alfresco's bug where allowable actions aren't correct when extracted from the Atom entry link. It turns out that this fix is also a nice refactoring allowing to share the allowable actions parsing code between Atom and SOAP bindings. We are also avoiding one more HTTP request when getting an object! commit 2f1d9ea75bba37ce43644ad751e4613815ead4d5 Author: Cédric Bosdonnat Date: Mon Jul 2 14:45:36 2012 +0200 Atom: Document::getPaths() could throw exception when getParents() is not allowed commit 80e2cec16f08b0d5e5c31816e6b18a3c11cbde31 Author: Cédric Bosdonnat Date: Mon Jul 2 10:04:49 2012 +0200 Fixed build errors commit c7b00511e21c9fba1b3e8ddcae4e54add9578129 Author: David Tardon Date: Sat Jun 30 17:18:26 2012 +0200 coverity: return value is destroyed when it exits scope commit 4ffef50019695334d253837cbc5355a0100515ad Author: David Tardon Date: Sat Jun 30 17:04:06 2012 +0200 coverity: protect against self-assignment commit a689e398280ebf5147591c529742d50051a431a7 Author: David Tardon Date: Sat Jun 30 16:51:36 2012 +0200 coverity: possible null dereference commit 33f39fff73a3a858057499e4500c55a592bb8534 Author: David Tardon Date: Sat Jun 30 16:41:50 2012 +0200 coverity: operator= should return non-const ref commit 8df9b5df6ef614ea29a5d2b70114942b5796ebad Author: David Tardon Date: Sat Jun 30 16:37:04 2012 +0200 set language for configure checks Otherwise tests for mode_t and size_t fail here, which results in size_t and mode_t defines on compiler command line, which breaks the build. commit d8bfaaedb4238be14e742b2bfcbfab25ca8567c9 Author: Cédric Bosdonnat Date: Tue Jun 26 10:20:31 2012 +0200 WebService: Use PasswordDigest as specified in WS-I Security Profile See sections 11.1 and 11.3 of WS-I Security Profile 1.0 specification commit 8f8ce16a86d2f0ef2b0a3c9b3c726ef21c1e8905 Author: Cédric Bosdonnat Date: Mon Jun 25 21:28:33 2012 +0200 WebService: fixed the SoapFault processing Here are the changes: * Don't throw CurlException instead of SoapFault. * Added support for fault detail (and cmism:cmisFault detail tag) commit 07cf8bd021640aa6bb2824019cd0829382de2243 Author: Cédric Bosdonnat Date: Thu Jun 21 17:09:53 2012 +0200 Web Services binding: implemented RepositoryService::getRepositoryInfo() This also was the occasion to move the repository infos parsing code to the libcmis::Repository class: this way it benefits both Atom and WebService bindings. commit ed80072ec4ea7302fd36a8e77696f4ec90c0a9b9 Author: Cédric Bosdonnat Date: Thu Jun 21 14:08:34 2012 +0200 Update NEWS file commit b936d117b3b2f366db25334b3a053b0173adb767 Author: Cédric Bosdonnat Date: Thu Jun 21 14:04:06 2012 +0200 Wired pieces together to get SOAP request executed and parsed. Needed changes: * all BaseSession::http*Request methods are now returning a libcmis::HttpResponsePtr containing both the data and HTTP headers * SoapResponses now need the RelatedMultipart object in case there is an attachment to read insise. * WSSession::getRepositories() is working commit 5303784a19126fc70a6a75caf5cc4b9ab50ef6da Author: Cédric Bosdonnat Date: Wed Jun 20 18:32:27 2012 +0200 Started implementing SOAP requests Started implementing RepositoryService::getRepositories, reading and writing SOAP envelopes. As libcurl is not capable to send proper multipart/related content, I had to implement parsing and dumping those. Warning: the whole chain is still not working. commit 634ce90a5fe337745c5b92dac06ea36ee544ec1e Author: Cédric Bosdonnat Date: Fri Jun 15 18:28:41 2012 +0200 WebService binding: initial session implementation WSSession can read the Service URLs from the WSDL file. ws-soap.{hc}xx contains the base logic to generate and parse SOAP messages while ws-requests.{hc}xx contains the CMIS-specific requests and response objects. ATM no service is implemented. commit 2e81df09be4ee0f1592fe9705a48b9036f2bc708 Author: Cédric Bosdonnat Date: Fri Jun 15 10:44:54 2012 +0200 Create a libcmis::Repository API to extract repository infos commit 56ff28be3742e6110936f142d79d6bd5ac8cc81c Author: Cédric Bosdonnat Date: Thu Jun 14 16:48:16 2012 +0200 Split the AtomPubSession in pieces to share with a future WSSession commit 1aad1a7092fba2bb3b78d301c40a33de2aec3368 Author: Cédric Bosdonnat Date: Thu Jun 14 14:23:03 2012 +0200 getChildren: support paged results commit a4d6f4416938e3522dbc366eedc77920d411b479 Author: Cédric Bosdonnat Date: Thu Jun 14 14:22:25 2012 +0200 cmis-client: return 1 on all errors for easier scriptability commit 05178b8c54fd3a381b0e04457b6430323061548b Author: Cédric Bosdonnat Date: Wed Jun 13 17:42:06 2012 +0200 Added Document::checkIn() commit cecf98b5667842c226e9c64105611014551eb8d8 Author: Cédric Bosdonnat Date: Mon Jun 11 20:21:45 2012 +0200 Added Document::cancelCheckout The Unit test for cancelCheckout needed to update InMemory server to a more recent version due to a bug on the server side: update to 0.7.0 commit dd7135c79a80dfc9a71030b5bde68f2931e819fa Author: Cédric Bosdonnat Date: Mon Jun 11 14:21:29 2012 +0200 checkout: fixed it to work for SharePoint commit 7bba87b0496b7d480844538b271f1dee76571ed5 Author: Cédric Bosdonnat Date: Fri Jun 8 18:49:51 2012 +0200 Implemented checkout commit d36a1a935f51916ed4263356bea34cef4a547e2e Author: Cédric Bosdonnat Date: Fri Jun 8 12:44:59 2012 +0200 setContentStream: SharePoint wants base64 encoded content In order to satisfy SharePoint and not break the others, first try to send raw data, and send base64 encoded data only if we got a 400 error. SharePoint also sends a 302 with a Location pointing to an error page when setting content on a non-checkout document: handled all non 2xx statuses as errors. commit 70c820eb62598e5818f7930e598aa2aa4e4ed733 Author: Cédric Bosdonnat Date: Thu Jun 7 11:53:41 2012 +0200 setContentStream: url-encode request params as changeToken is an obscure string commit c10d190b208cdecf9729aa482b5ef2e6cf7e7daf Author: Cédric Bosdonnat Date: Thu Jun 7 11:26:41 2012 +0200 SharePoint: some links have no type, fixed how these are handled commit 36d1027c77216ab823d4c00dc5b4e3b1bf085b7f Author: Cédric Bosdonnat Date: Wed Jun 6 18:09:06 2012 +0200 SharePoint repository id is case insensitive It may not be the best thing to do to always check lowercased strings as IDs are obscure strings commit 321b2dc94b07031b79e0f2932877be1195d02a44 Author: Tomas Chvatal Date: Wed Jun 6 11:08:07 2012 +0200 Add libs/includes that are required when we try to build against cmis and use pc file. commit e351df6bb4c05d2cffa4f3a22688f04e9a83f8f4 Author: Tomas Chvatal Date: Wed Jun 6 11:03:29 2012 +0200 Create the manpage conditionaly, and also install it when needed. Signed-off-by: Tomas Chvatal commit a9e6c907077486b70760e4b26f5e6e98ac107eb9 Author: Cédric Bosdonnat Date: Tue Jun 5 17:24:12 2012 +0200 base64 encoder: fixed signed values encoding The problem is typical the following. Encoding 0x3F 0xEB 0xEF, the values for 0xEB and 0xEF were used as negative values. Casting to an unsigned char will give us the proper 0xEB and 0xEF values to be used in the base64 encoding algorithm. commit f385049ffc9a249e79c71def5804d2cd3da92ebd Author: Cédric Bosdonnat Date: Mon Jun 4 20:39:39 2012 +0200 libcurl version test was wrong... commit 10c765aec2c09fd5746464d5d8c33f19d18e0035 Author: Cédric Bosdonnat Date: Mon Jun 4 18:48:54 2012 +0200 Fixed soname to fit library version commit fed9ebdaa185ab31fe074f18cc6556f2ae73eb4a Author: Cédric Bosdonnat Date: Mon Jun 4 18:40:44 2012 +0200 Changed soname commit a1e2772541ab039c356b09ccb49b048e980aa5bd Author: Cédric Bosdonnat Date: Mon Jun 4 18:23:55 2012 +0200 libcurl: use curl_escape and CURLOPT_USERPWD if version is too old commit 0996ff687d2973b03604153ed2f13debf023bc90 Author: Cédric Bosdonnat Date: Mon Jun 4 13:08:17 2012 +0200 Updated NEWS commit 08e174bb9692f2fa2db58918f20c632baf4f08bd Author: Cédric Bosdonnat Date: Mon Jun 4 12:17:10 2012 +0200 Fixed man dist and install once for good commit 21e23936453273bc5c61b809c08f5cdae99059bc Author: Cédric Bosdonnat Date: Mon Jun 4 11:54:25 2012 +0200 Wrong file to put in dist tarball: put cmis-client.xml instead of .1 commit 05159396dae51ef7cfc3c66dc98d78599ab9b4c4 Author: Cédric Bosdonnat Date: Mon Jun 4 11:59:57 2012 +0200 configure.ac: updated version to 0.3.0 commit 826b141ec822d5f2f700ae09edf019aeaea37258 Author: Cédric Bosdonnat Date: Mon Jun 4 10:18:56 2012 +0200 Added getPaths() convenience method in API commit 7e03d66771f1cb4f53dd4a7f35f84b0d59900430 Author: Cédric Bosdonnat Date: Wed May 30 16:31:41 2012 +0200 Updated README to show the remove and removeTree commit 5e05142716cbfe363ab4751c5a951295821208e6 Author: Cédric Bosdonnat Date: Wed May 30 16:30:07 2012 +0200 cmis-client: use removeTree when possible instead of remove commit a684300a90b6ae2451bfd08a69edd9150c51072f Author: Cédric Bosdonnat Date: Wed May 30 16:20:54 2012 +0200 Folder: implemented removeTree This commit also changed a few URLs in AtomFolder to use the link AtomLink API. commit d5cac575828eacdae066b60b7831589ff9ab7de9 Author: Cédric Bosdonnat Date: Wed May 30 16:20:48 2012 +0200 Atom links: removed a few more URLs extraction to use the new links feature commit 8e78ff35ad5179ea9a6e4406ceae73d4c5284354 Author: Cédric Bosdonnat Date: Wed May 30 15:19:02 2012 +0200 AtomSession: made http request helpers clean their stuffs if there was an exception commit 6d82a61b3eaef6d35512c1eaaae12132d5a30f03 Author: Cédric Bosdonnat Date: Wed May 30 15:17:45 2012 +0200 AtomObject: read all links and store them for later use commit d90b3ca57390bbd2c7901172873f53ff4c34a74a Author: Cédric Bosdonnat Date: Tue May 29 14:19:10 2012 +0200 Implemented object::remove() commit ab71ea5785a0993aa4c796e093874ddcb1057d99 Author: Cédric Bosdonnat Date: Tue May 29 11:39:35 2012 +0200 Escaped URLs as the IDs may contain characters that won't fit in URLs Using curl_easy_escape() was requesting a working CURL handle and works only a chunks of URLs. Escaping the URL happens in the URL creation to ease the work (and avoid parsing URLs). This required to move the CURL handle to a session member. Among the impacts of that change: * Removed the duplicated code to get encoded content * Had to reset the CURL handle before the next use commit c2c9fcce71489e8cfa4fce4736b5df155ef202a8 Author: Cédric Bosdonnat Date: Tue May 29 10:50:43 2012 +0200 Fixed createDocument test commit b19548fc7330d6d229cec54a24a34a7b72a54cd5 Author: Cédric Bosdonnat Date: Thu May 24 22:03:28 2012 +0200 Added and implemented Folder::createDocument() commit 0977eeee3e6d38358e7680885ba93cb7375b3f81 Author: Cédric Bosdonnat Date: Mon May 21 17:02:14 2012 +0200 make more sense in the API: ask for output stream to set content commit 52afd052580cefc0286ac3d04ca8dcf4d24513cb Author: Cédric Bosdonnat Date: Mon May 21 17:01:48 2012 +0200 Declared a few missing exceptions commit fc9c2b3da9bddbee6948b2be86780b9da11eee08 Author: Cédric Bosdonnat Date: Fri May 11 23:12:41 2012 +0200 Silenced unused parameter warning commit 0313d7141a59ee58722bc417267196540bf9ef8c Author: Cédric Bosdonnat Date: Fri May 11 22:36:49 2012 +0200 Added rewind support for Put and Post. Define a CURLOPT_IOCTLFUNCTION callback to rewind in multipass authentication cases (i.e for SharePoint or Alfresco) commit fccae8881c39e56c96283cd9cfd35ce46c61af5d Author: Cédric Bosdonnat Date: Fri May 11 21:12:13 2012 +0200 More robust XML parsing cases: allows getting nodes from Alfresco commit 2769d2eba3da597d832448c59d6db143ef15d0ea Author: Cédric Bosdonnat Date: Fri May 11 10:14:53 2012 +0200 Use a provider class instead of a function pointer to the auth callback commit f360f5fd679a10053f9d05512f629368d8373378 Author: Cédric Bosdonnat Date: Thu May 10 17:16:57 2012 +0200 Added a connection callback to allow providing authentication interactively commit 76f6ae95563b82bc7e4e9e1c737c7e0a1ce213ea Author: Cédric Bosdonnat Date: Wed May 9 16:04:16 2012 +0200 Don't use boost and std namespaces at the same time or you may have conflicts commit e12868c1326a88f39149da632c9139359ef61c7d Author: Cédric Bosdonnat Date: Wed May 9 16:03:26 2012 +0200 Added missing header files... to fix make dist commit c3afde2d1129f203d6b07d4c3560f39f03abc540 Author: Cédric Bosdonnat Date: Wed May 9 12:21:20 2012 +0200 Updated LibreOffice dmake script commit a53e29686b8d44ea67ad2b994b8f6b09cda32d23 Author: Cédric Bosdonnat Date: Wed Feb 22 18:48:33 2012 +0100 cmis-client: added update-object command to allow updating object properties commit f5bc867f2430acdd21515f72887944fe7281739e Author: Cédric Bosdonnat Date: Wed Feb 22 16:36:28 2012 +0100 Implemented a Base64 encoder to be used for the document creation requests commit 40c71f5194354d4644a2ae84b8a094dcd4c098f2 Author: Cédric Bosdonnat Date: Tue Feb 21 17:39:12 2012 +0100 Folder::createFolder( ) implemented commit fae5e2b10ce8083e1c71e016cf623b2498a8045b Author: Cédric Bosdonnat Date: Mon Feb 20 14:35:25 2012 +0100 Updated NEWS file for properties update commit e99ad62bf767fc730b17f3501bd71c1df2d09dae Author: Cédric Bosdonnat Date: Mon Feb 20 13:58:32 2012 +0100 AtomObject::getTypeDescription( ) now caching the result to avoid too frequent requests commit c2917dd80d200b1de07b725045457a4211136f93 Author: Cédric Bosdonnat Date: Mon Feb 20 13:54:58 2012 +0100 AtomObject::updateProperties() implementation complete commit 197915b37c33aef8f877c4b5583ff1bceb89863a Author: Cédric Bosdonnat Date: Fri Feb 17 18:45:37 2012 +0100 ObjectType: forgot 2 properties to read commit 424956dff0f9bc6e548b99f8a0f871f5072f0ece Author: Cédric Bosdonnat Date: Fri Feb 17 17:40:44 2012 +0100 Added libcmis::PropertyType to extract more data from the properties commit 3a0649ad390b7feabd95479a1f6846458b458207 Author: Cédric Bosdonnat Date: Fri Feb 17 10:40:44 2012 +0100 cmis-client: added type-by-id command to fetch types commit 4570916c37cc7137ddc4c71ae2b57b19e176d737 Author: Cédric Bosdonnat Date: Thu Feb 16 19:09:27 2012 +0100 code cleanup commit a61932147d2b641775a8593ee6afc2f54c4fdda4 Author: Cédric Bosdonnat Date: Thu Feb 16 19:01:11 2012 +0100 libcmis::ObjectType first implementation commit e4985599ea6bbe8651691c5fac96d2446114d79c Author: Cédric Bosdonnat Date: Thu Feb 16 13:33:00 2012 +0100 Object::updateProperties( ): first implementation - missing readwrite properties filtering commit 778ad539456f965c4ebc4278ae44405f34c5fcd5 Author: Cédric Bosdonnat Date: Wed Feb 15 16:56:52 2012 +0100 Implement object to XML serialization commit 0d7586ce384d75150200dce89c22e5633a2f4952 Author: Cédric Bosdonnat Date: Mon Feb 6 14:17:45 2012 +0100 libcmis::Property::toXml() implemented commit e4aecc2e44f106460e7371dd22af9b2f15318182 Author: Cédric Bosdonnat Date: Mon Feb 6 00:20:46 2012 +0100 Refactored object properties to catch'em all commit 66287244a7dded08e12e1eb9c6a73a48249a0d0e Author: Cédric Bosdonnat Date: Fri Feb 3 15:58:10 2012 +0100 Implemented Document::getParents() commit 53d9cda7f482b97f4233372185fa8be544a7d47a Author: Cédric Bosdonnat Date: Thu Feb 2 20:43:10 2012 +0100 Updated man page to include set-content command commit a0115995fa2b5979d8ba6b7e0b2d230565ff812a Author: Cédric Bosdonnat Date: Thu Feb 2 18:03:48 2012 +0100 setContentStream fixes: send changeToken and mime type in the query commit 2386e2d5325c55d05abd770d9bf00f04b1060d11 Author: Cédric Bosdonnat Date: Thu Feb 2 18:02:53 2012 +0100 cmis-client: added set-content command commit b50786d6a94b8ac72ceb66dc63a81453189812a5 Author: Cédric Bosdonnat Date: Wed Feb 1 12:15:59 2012 +0100 removed unreliable test commit 6b123d6885a729b500b7d3291e8bf72ff5d72433 Author: Cédric Bosdonnat Date: Wed Feb 1 11:30:45 2012 +0100 Added Folder::isRootFolder() commit 410792a504c0e10daff0ad7e888baaf8eaf22b42 Author: Cédric Bosdonnat Date: Wed Feb 1 11:21:15 2012 +0100 Added Folder::getFolderParent() commit 15c442b449230a8d66e2d4f823da76baa9191120 Author: Cédric Bosdonnat Date: Tue Jan 31 18:16:09 2012 +0100 Added a few AllowedActions checks before doing things commit 6c6b6dcb13df5e5950ad81077dc7885aebdb9070 Author: Cédric Bosdonnat Date: Tue Jan 31 18:09:33 2012 +0100 AtomPub: Fixed AllowableActions reading commit 371d6aa0990bb434c6a36344b659ba0644ee9dcb Author: David Tardon Date: Fri Jan 27 17:37:03 2012 +0100 update COPYING.LGPL to v. 2.1 commit bfd463f3ef3b2e372a110b1b3cbe83213abe1c27 Author: Cédric Bosdonnat Date: Fri Jan 27 17:17:05 2012 +0100 Added cmis-client man page commit 77c4049861553f1e2b70293a2da1f26a219d8039 Author: Cédric Bosdonnat Date: Fri Jan 27 11:19:12 2012 +0100 Updated NEWS file commit 7b604c01a9df770e1224cbab13215de533b07391 Author: Cédric Bosdonnat Date: Thu Jan 19 17:43:14 2012 +0100 Read the allowable actions document to help know what is permitted before doing it commit d90c5a6c2ee6c874c4e77b8e578deea7733ff57b Author: Cédric Bosdonnat Date: Thu Jan 19 10:41:33 2012 +0100 Implemented fetching nodes by path commit 85ecb0f3c77e1590014ce0cccfd613865018d0e0 Author: Cédric Bosdonnat Date: Wed Nov 16 11:03:19 2011 +0100 Implemented AtomDocument::setContentStream method commit 0e96644152ed1f275827f68d968c4a4faf80e0b2 Author: Cédric Bosdonnat Date: Tue Nov 15 12:55:55 2011 +0100 Same code for run an HTTP request everywhere commit 729b16fe03d91bd8373113a41a14ed07dd36280b Author: Cédric Bosdonnat Date: Tue Nov 15 12:18:44 2011 +0100 Moved httpGetRequest to AtomPubSession commit 471099b8f81d50c1534f940af895d91043fa3b9b Author: Cédric Bosdonnat Date: Tue Nov 15 11:45:28 2011 +0100 AtomPubSession::getRepositoriesIds to reuse service document handling The AtomPubSession constructor is fetching and parsing the service document: let's reuse that code for getting the repositories as well. commit 7b0175accf158a39c2563faa03cd3604eb64af87 Author: Cédric Bosdonnat Date: Mon Nov 14 10:06:48 2011 +0100 added API for setContentStream, implementation still missing Reworked the ServiceDocument parsing to ease the move of the httpGetRequest inside the AtomPubSession class. commit de493152741862d7e519abd7d013dc4d709164fa Author: Cédric Bosdonnat Date: Fri Nov 4 11:26:38 2011 +0100 Added Document::getContentStream and deprecated Document::getContent This new method uses the C++ I/O libraries and avoids storing the content as a temporary file. This locks the security to access the document data a bit more. The old Document::getContent method is kept only for compatibility with LibreOffice libcmis usage and will be removed when that code will be updated. Exceptions cleanup: provide better messages in the libcmis::Exception. commit e98747ecc977a996c1a3de55734a189d9092c01c Author: Cédric Bosdonnat Date: Thu Nov 3 22:10:46 2011 +0100 Document: add a C++ stream getter for the content to avoid temp files commit 2aa545f4200dcb9b835779017a7c01b0b356af5b Author: Cédric Bosdonnat Date: Thu Oct 27 18:14:00 2011 +0200 added verbose option to ease debugging commit 29da344391cb93cc6f5ddfc1a51a44eab3a34032 Author: Cédric Bosdonnat Date: Thu Oct 27 17:21:50 2011 +0200 Added libcmis::Exception with message for better user feedback The error message reports libcurl error messages. Libcurl is also now failing when an HTTP error more than 400 is reported (though it doesn't affect authentication). commit e56107d1bf06a65d7765a61f822d8d2275a560d0 Author: Cédric Bosdonnat Date: Wed Oct 26 15:50:13 2011 +0200 cmis-client: print help for unknown command commit edc2fc6415ef025829fcbd1e77239990811f92c0 Author: Cédric Bosdonnat Date: Sat Oct 22 07:30:16 2011 -0700 Added more unit tests for getFolder() and getObject() commit 284eeb6453963c80be1cbe8ef26cbe9bf7c8a6e9 Author: Cédric Bosdonnat Date: Thu Oct 20 14:40:21 2011 +0200 Actually filled the NEWS file commit 36c70303eacc45b90e6e4941859df130cecd75b0 Author: Cédric Bosdonnat Date: Wed Oct 19 17:25:48 2011 +0200 test-decoder.cxx: mention the source of the Base64 test values. commit 68f218f3866a05db77b3e7c27b19169c36c6e13f Author: Cédric Bosdonnat Date: Wed Oct 19 17:22:10 2011 +0200 Content extraction: decode base64 encoded transmitted files This feature is needed for SharePoint implementation of CMIS. commit 2aa6e964fdee4b5c6d14418ae59015a3708b62ec Author: Cédric Bosdonnat Date: Tue Oct 18 17:34:22 2011 +0200 Added authentication support, delegates the method choice to libcurl commit 9e393ab0201086819998b0343389a28aabc3fa62 Author: Cédric Bosdonnat Date: Fri Oct 14 01:28:41 2011 +0200 cmis-client: added show-root command commit 5872b14537e7ff2ae675c16a05757a90a05cb9f6 Author: Fridrich Štrba Date: Sat Oct 8 15:42:55 2011 +0200 Define CmisObject and CmisObjectPtr for temporary backward compatibility commit e7283f6750e3e1a36fbfde842f21594b5b8dc7cd Author: Fridrich Štrba Date: Sat Oct 8 15:28:56 2011 +0200 Some fixage of pkg-config stuff and includes commit 6a939b9e33ff5d5ef470aba62b5e6dc93f86bd84 Author: Cédric Bosdonnat Date: Thu Oct 6 15:19:59 2011 +0200 Fixed version scheme commit de3b3ab93948c5623565175a7552855d5a59deb1 Author: Fridrich Štrba Date: Thu Oct 6 13:39:28 2011 +0200 Trying to make -Weffc++ build link commit c9c7cccd592499bb8d95184a5ad14b19a6d0935a Author: Cédric Bosdonnat Date: Thu Oct 6 13:13:01 2011 +0200 libcmis::Object: added the possibility to refresh the data in the API commit 822840832921b03f12511d747b39cea34aca023a Author: Cédric Bosdonnat Date: Thu Oct 6 12:31:29 2011 +0200 Fixed the warnings when building with -Weffc++ commit 0c1794a03e90cb3c6bb6d861112089cea1fa68e2 Author: Cédric Bosdonnat Date: Wed Oct 5 16:15:56 2011 +0200 -with-libxml2 is now useless commit adf6d2ca7fd3e771590ff22e24275e33f5bef481 Author: Fridrich Štrba Date: Wed Oct 5 16:10:49 2011 +0200 reverted libcurl checking to pkg-config commit 27ae1df24734577fb56e0524ca585b47d09f098e Author: Cédric Bosdonnat Date: Wed Oct 5 15:36:17 2011 +0200 Revert libxml check to pkg_config for windows cross-building commit 84d368a23315f81193bec057704adfbefba79b9c Author: Fridrich Štrba Date: Wed Oct 5 15:20:39 2011 +0200 dmake file for building libcmis in LibreOffice commit 8d809f7f53e152f0b0af714717f7b717a913cba9 Author: Jan Holesovsky Date: Wed Oct 5 11:41:20 2011 +0200 Introduce --with-libxml2, to be able to set the right prefix. commit 47286032a5d29d9e865d4ca2fee986d1825587c4 Author: Cédric Bosdonnat Date: Wed Oct 5 11:20:47 2011 +0200 Object: get all the mandatory properties commit 199133863e2b116f8cb0f8ccc4479252436ee049 Author: Cédric Bosdonnat Date: Tue Oct 4 15:44:19 2011 +0200 Renamed the stupid CmisObject to Object: no confusion possible with namespaces commit f071d7b720fa9c24ac6cdd4b22e365c847fba374 Author: Cédric Bosdonnat Date: Tue Oct 4 12:21:48 2011 +0200 Fixed the LGPL licence file commit d4285bd08ed308a96016fc9a7716424d1062d486 Author: Dominique Leuenberger Date: Tue Oct 4 10:47:03 2011 +0200 m4: Use x in order to avoid variable 'x' set but not used [-Werror=unused-but-set-variable] This error could be caused by configure scripts being run with -Werror -Wall, which would lead to libcurl being detected as unusable. commit be66250ad9c2b10a74364aad18927d6b213aa1cf Author: Miklos Vajna Date: Mon Oct 3 19:00:05 2011 +0200 Spelling fixes commit 7cd26ce3e85374aa9db812760edea78ff97a0ff9 Author: Cédric Bosdonnat Date: Mon Oct 3 16:52:12 2011 +0200 Removed dead code commit 904b4fd3a97f3ec0b8247cbab50cfdd9179c7893 Author: Cédric Bosdonnat Date: Mon Oct 3 15:28:03 2011 +0200 Added a configure --disable-tests switch to skip tests build commit 803cbdb6b3c7105f28bdf3d72ca87c27f4e4c564 Author: Cédric Bosdonnat Date: Mon Oct 3 15:27:45 2011 +0200 Added missing files to the dist tarball commit f8352b06958e1f10eff95bcc589b70c581c987e8 Author: Tomáš Chvátal Date: Mon Oct 3 14:54:41 2011 +0200 Add werror and some gcc flags from libvisio. Whitespace, tabify everywhere. commit cf18961932ba1e62ced469ca844a606dd6abbc14 Author: Cédric Bosdonnat Date: Mon Oct 3 12:09:57 2011 +0200 Make use of BOOST_CPPFLAGS commit 91fcb919b8f8acc1f1142c4506624c5916a2be38 Author: Cédric Bosdonnat Date: Mon Oct 3 10:55:20 2011 +0200 configure: don't check for program_options if client is disabled commit e2d7637080eed924e57ce7b1cfba568a00ec0cf8 Author: Cédric Bosdonnat Date: Mon Oct 3 09:59:28 2011 +0200 configure: use xml2-config instead of pkg-config commit c95aaa42ba9370995b0787f9388a0805e4c272d5 Author: Rene Engelhard Date: Mon Oct 3 09:34:06 2011 +0200 add DEP_CFLAGS, so that those get picked up commit d2cdb314e2613dd6ff166735ace1dcec46922f25 Author: Rene Engelhard Date: Mon Oct 3 09:30:04 2011 +0200 fix libcmis.pc There's no liblibcmis and the Cflags don't match the installed headers commit cedbf4bedc9f51bdb757a14af0b209ce41dcd4ed Author: Cédric Bosdonnat Date: Sun Oct 2 15:55:32 2011 +0200 Iproved configure to build on Macos and inside LibreOffice + Use libcurl.m4 instead of pkg-config as that one isn't available on MacOS X. + Add --disable-client and enable the building cmis-client only if Boost program_options can be found. That library isn't provided by LibreOffice insternal boost. + Add some summary message at the end of the configure to show what will happen. commit 78e0cf1172d30a2a9777558935fb8104980bcea9 Author: Caolán McNamara Date: Sun Oct 2 14:31:34 2011 +0200 Properly add the includes commit 79f208773c0f7b90a3ceaa8d9a290d40f0782216 Author: Cédric Bosdonnat Date: Sat Oct 1 15:06:58 2011 +0200 Changed the API for the Document::getContent() to return a FILE* commit e4f073cce1c9f7d16816fb17a029d1f6f984d172 Author: Cédric Bosdonnat Date: Fri Sep 30 21:01:46 2011 +0200 Types names refactoring: introduced namespace libcmis + Renamed Content to Document in order to match the CMIS specifications terminology. + Added a libcmis namespace to avoid name clashes commit 05093f7e0dab17a7cabd7c509023efd7eb12850e Author: Cédric Bosdonnat Date: Fri Sep 30 15:38:07 2011 +0200 cmis-client: enhanced the help message and options commit 72876a7004b528f81c313d540161f8d168e82fd5 Author: Cédric Bosdonnat Date: Fri Sep 30 12:11:20 2011 +0200 cmis-client: added a get-content command to download the content data commit 0366d8a2515c5bc112790e8290575524369566a5 Author: Cédric Bosdonnat Date: Fri Sep 30 11:21:55 2011 +0200 cmis-client: added a show-by-id command to dump nodes infos Libcmis API additions: + CmisObject::toString method to dump the objects + Content::getContentFilename() to get the filename of the data stream commit 58a2e1e34e544792db739f9c0f142b8ae9761f0f Author: Cédric Bosdonnat Date: Wed Sep 28 16:20:52 2011 +0200 Removed the old bloated test-atom and started some more useful CLI client cmis-client is intended to be a command line client showing what the library can do and hopefuly being useful in some basic CMIS tests. commit c5eaa0006db26735aac94261072f3a76c32c3496 Author: Cédric Bosdonnat Date: Wed Sep 28 15:10:22 2011 +0200 Implemented unit tests using cppunit. commit 42ac4af71b4d4de74b19caf980403780a9a9362d Author: Cédric Bosdonnat Date: Wed Sep 28 10:23:05 2011 +0200 Code cleanup: removed the atom-* headers from the public headers Among the other improvements: moved the test-server directory to the top folder of the libcmis sources: this helps to use that server for the tests of any subdirectory. commit 661951950bea8d767b3188e1be4d28326fb93932 Author: Cédric Bosdonnat Date: Wed Sep 28 08:53:14 2011 +0200 Fixed tests and cmis:name property XPath query commit 0b99f7d6cae059d6b1380b2fc45a153a9cdb4b51 Author: Cédric Bosdonnat Date: Tue Sep 27 18:46:58 2011 +0200 User propertyDefinitionId instead of queryName to get properties commit c55f154bf7c5b80a18f2448ab74e3769f5aee50b Author: Cédric Bosdonnat Date: Tue Sep 27 18:45:33 2011 +0200 Content class: provide the value of cmis:contentStreamLength commit 69ab41fc3714b7f17d53e59637978fa85d153080 Author: Cédric Bosdonnat Date: Tue Sep 27 17:05:01 2011 +0200 Properly set the license of the library commit 521335d638e9872cd9889dd830395ac1dca1d552 Author: Cédric Bosdonnat Date: Tue Sep 27 16:46:09 2011 +0200 Memory leaks fixes Added a missing xmlFree( ) and use boost::shared_ptr for getRootFolder() to avoid leaking the resulting folder. commit ef4afcc25fd5666c7d5bf1b33b5bc94a578b1fef Author: Cédric Bosdonnat Date: Tue Sep 27 16:37:54 2011 +0200 Added the AtomContent class and moved the path to the Folder In CMIS, only the folder objects have a path. commit 315bc3f83870e6731b5d8329937847b22754758f Author: Cédric Bosdonnat Date: Tue Sep 27 15:17:51 2011 +0200 AtomFolder::getChildren - Getting the folders now properly commit c190930ecfc6b2d7c2afb1ba7861dd95656d3e45 Author: Cédric Bosdonnat Date: Tue Sep 27 11:13:40 2011 +0200 AtomFolder::getChildren, basic implementation This has the following limits: + The AtomContent type isn't defined, so only folder children are returned ATM. + The children xml file may be too long. The atom::http_request function needs to use a buffer in order to get the whole content before parsing it. commit 0c772587b06d4d230073643f64593d0d231961b6 Author: Cédric Bosdonnat Date: Mon Sep 26 15:27:37 2011 +0200 Resources: setup the Atom resources classes commit 87dac1fe48c38d8cb554b5cf2d39fbd80a7ad726 Author: Cédric Bosdonnat Date: Mon Sep 26 10:56:49 2011 +0200 AtomSession: get the UriTemplates and root Id commit 18ef944861756924ef7a9585f35c577dc65590ef Author: Cédric Bosdonnat Date: Mon Sep 26 09:33:55 2011 +0200 Session improvements, added a factory and support of multiple repos commit a9664cd909ff0542cb55e3a4532faa9809d8c175 Author: Cédric Bosdonnat Date: Sat Sep 24 13:27:08 2011 +0200 Created a Session base class and started defining the resource classes commit b0a555b8f8b2f7d713608f64fd1a72ba25d6801f Author: Cédric Bosdonnat Date: Thu Sep 22 12:25:31 2011 +0200 Automated tests using an Apache Chemistry InMemory server commit f73aa0f20d17efcb046d9844baa03ec92e4bb2ec Author: Cédric Bosdonnat Date: Wed Sep 21 21:58:26 2011 +0200 Service Document parsing: fixed the collections reading and tested it commit a7a60527c743a39ee6c78facd2d8a80cf23bde82 Author: Cédric Bosdonnat Date: Wed Sep 21 12:09:47 2011 +0200 Finished reading the collections from the Service Document commit dc4b2c84d1f475d771ea3c51cc401db7bb24f1a4 Author: Cédric Bosdonnat Date: Mon Sep 19 21:04:05 2011 +0200 Created AtomPub session class and libtoolized the project libcmis-0.4.1/NEWS0000644000175000001440000000354312200150705010547 000000000000000.1.0 * Generic * Anonymous connection * AtomPub binding * Get the content hierarchy using the down relations * Get the content of a document * Query nodes by ID 0.2.0 * Generic * Support for authentication in the API * Callback for providing interactive authentication * Added API to create documents and folders * Added API to delete documents and folders * AtomPub binding * Handle all the authentication methods that can be handled by libcurl like Basic, NTLM... * Decode base64 encoded content sent by SharePoint * Set the content of a document * Query nodes by path * Get the allowable actions for a node * Object properties can be updated * Query object types * Creation of folders and documents * Deletion of folders and documents 0.2.1 * Fixed documentation distribution 0.2.2 * Fixed soname for the library * Allow building against libcurl 7.13.1 0.2.3 * Fixed SharePoint support * Conditional build of man page 0.3.0 * Added Document::checkOut(), Document::cancelCheckout() and Document::checkIn() * Added Object::move( ) -- Grau Data * Fixes for xcmis and cloudoku.com -- Grau Data * Added Document::getAllVersions( ) * WebService binding implementation * Session factory automatically detects which binding to use * C wrapper API * Unit tests are now split between quick ones and the ones needing a CMIS server 0.4.0 * Support for Google Drive protocol as a binding * Support for Alfresco in the cloud * Added OAuth2 authentication support * Added API to configure HTTP proxy * Handle invalid SSL certificate problems * Added API for renditions * Moved the CMIS Atom binding unit tests to use libcurl mockup * Added repository capabilities support (still missing capabilityCreatablePropertyTypes and capabilityNewTypeSettableAttributes) libcmis-0.4.1/COPYING.GPL0000644000175000001440000004325411667412313011543 00000000000000 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. libcmis-0.4.1/config.guess0000755000175000001440000013014512102025510012363 00000000000000#! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, # 2011, 2012 Free Software Foundation, Inc. timestamp='2012-02-10' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Per Bothner. Please send patches (context # diff format) to and include a ChangeLog # entry. # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and # exits with 0. Otherwise, it exits with 1. # # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ; set_cc_for_build= ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown case "${UNAME_MACHINE}" in i?86) test -z "$VENDOR" && VENDOR=pc ;; *) test -z "$VENDOR" && VENDOR=unknown ;; esac test -f /etc/SuSE-release -o -f /.buildenv && VENDOR=suse # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-${VENDOR}-openbsd${UNAME_RELEASE} exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-${VENDOR}-ekkobsd${UNAME_RELEASE} exit ;; *:SolidBSD:*:*) echo ${UNAME_MACHINE}-${VENDOR}-solidbsd${UNAME_RELEASE} exit ;; macppc:MirBSD:*:*) echo powerpc-${VENDOR}-mirbsd${UNAME_RELEASE} exit ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-${VENDOR}-mirbsd${UNAME_RELEASE} exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE="alpha" ;; "EV4.5 (21064)") UNAME_MACHINE="alpha" ;; "LCA4 (21066/21068)") UNAME_MACHINE="alpha" ;; "EV5 (21164)") UNAME_MACHINE="alphaev5" ;; "EV5.6 (21164A)") UNAME_MACHINE="alphaev56" ;; "EV5.6 (21164PC)") UNAME_MACHINE="alphapca56" ;; "EV5.7 (21164PC)") UNAME_MACHINE="alphapca57" ;; "EV6 (21264)") UNAME_MACHINE="alphaev6" ;; "EV6.7 (21264A)") UNAME_MACHINE="alphaev67" ;; "EV6.8CB (21264C)") UNAME_MACHINE="alphaev68" ;; "EV6.8AL (21264B)") UNAME_MACHINE="alphaev68" ;; "EV6.8CX (21264D)") UNAME_MACHINE="alphaev68" ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE="alphaev69" ;; "EV7 (21364)") UNAME_MACHINE="alphaev7" ;; "EV7.9 (21364A)") UNAME_MACHINE="alphaev79" ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` # Reset EXIT trap before exiting to avoid spurious non-zero exit code. exitcode=$? trap '' 0 exit $exitcode ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-${VENDOR}-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-${VENDOR}-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-${VENDOR}-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit ;; *:OS400:*:*) echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; arm:riscos:*:*|arm:RISCOS:*:*) echo arm-${VENDOR}-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; s390x:SunOS:*:*) echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) echo i386-pc-auroraux${UNAME_RELEASE} exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) eval $set_cc_for_build SUN_ARCH="i386" # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then SUN_ARCH="x86_64" fi fi echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-${VENDOR}-mint${UNAME_RELEASE} exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`$dummy $dummyarg` && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos${UNAME_RELEASE} exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` then echo "$SYSTEM_NAME" else echo rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit ;; *:AIX:*:[4567]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ ${HP_ARCH} = "hppa2.0w" ] then eval $set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-${VENDOR}-osf1mk else echo ${UNAME_MACHINE}-${VENDOR}-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit ;; sparc*:BSD/OS:*:*) echo sparc-${VENDOR}-bsdi${UNAME_RELEASE} exit ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-${VENDOR}-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) UNAME_PROCESSOR=`/usr/bin/uname -p` case ${UNAME_PROCESSOR} in amd64) echo x86_64-${VENDOR}-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) echo ${UNAME_PROCESSOR}-${VENDOR}-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; i*:MSYS*:*) echo ${UNAME_MACHINE}-pc-msys exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; *:Interix*:*) case ${UNAME_MACHINE} in x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; authenticamd | genuineintel | EM64T) echo x86_64-${VENDOR}-interix${UNAME_RELEASE} exit ;; IA64) echo ia64-${VENDOR}-interix${UNAME_RELEASE} exit ;; esac ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; 8664:Windows_NT:*) echo x86_64-pc-mks exit ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-${VENDOR}-cygwin exit ;; p*:CYGWIN*:*) echo powerpcle-${VENDOR}-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-${VENDOR}-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-${VENDOR}-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-${VENDOR}-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; aarch64:Linux:*:*) echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu exit ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu${LIBC} exit ;; arm*:Linux:*:*) eval $set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then echo ${UNAME_MACHINE}-${VENDOR}-linux-gnueabi else echo ${UNAME_MACHINE}-${VENDOR}-linux-gnueabihf fi fi exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu exit ;; cris:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-gnu exit ;; crisv32:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-gnu exit ;; frv:Linux:*:*) echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu exit ;; hexagon:Linux:*:*) echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu exit ;; i*86:Linux:*:*) LIBC=gnu eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __dietlibc__ LIBC=dietlibc #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` echo "${UNAME_MACHINE}-pc-linux-${LIBC}" exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu exit ;; mips:Linux:*:* | mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef ${UNAME_MACHINE} #undef ${UNAME_MACHINE}el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=${UNAME_MACHINE}el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=${UNAME_MACHINE} #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` test x"${CPU}" != x && { echo "${CPU}-${VENDOR}-linux-gnu"; exit; } ;; or32:Linux:*:*) echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu exit ;; padre:Linux:*:*) echo sparc-${VENDOR}-linux-gnu exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-${VENDOR}-linux-gnu exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-${VENDOR}-linux-gnu ;; PA8*) echo hppa2.0-${VENDOR}-linux-gnu ;; *) echo hppa-${VENDOR}-linux-gnu ;; esac exit ;; ppc64:Linux:*:*) echo powerpc64-${VENDOR}-linux-gnu exit ;; ppc:Linux:*:*) echo powerpc-${VENDOR}-linux-gnu exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu exit ;; tile*:Linux:*:*) echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-gnu exit ;; x86_64:Linux:*:*) echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-${VENDOR}-stop exit ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-${VENDOR}-atheos exit ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) echo i386-${VENODR}-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-${VENDOR}-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configury will decide that # this is a cross-build. echo i586-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-${VENODR}-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-${VENDOR}-lynxos${UNAME_RELEASE} exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-${VENDOR}-lynxos${UNAME_RELEASE} exit ;; rs6000:LynxOS:2.*:*) echo rs6000-${VENDOR}-lynxos${UNAME_RELEASE} exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) echo powerpc-${VENDOR}-lynxos${UNAME_RELEASE} exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo ${UNAME_MACHINE}-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-${VENDOR}-sysv${UNAME_RELEASE} fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. echo i586-pc-haiku exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit ;; SX-7:SUPER-UX:*:*) echo sx7-nec-superux${UNAME_RELEASE} exit ;; SX-8:SUPER-UX:*:*) echo sx8-nec-superux${UNAME_RELEASE} exit ;; SX-8R:SUPER-UX:*:*) echo sx8r-nec-superux${UNAME_RELEASE} exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown case $UNAME_PROCESSOR in i386) eval $set_cc_for_build if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then UNAME_PROCESSOR="x86_64" fi fi ;; unknown) UNAME_PROCESSOR=powerpc ;; esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; NEO-?:NONSTOP_KERNEL:*:*) echo neo-tandem-nsk${UNAME_RELEASE} exit ;; NSE-?:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-${VENDOR}-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-${VENDOR}-tops10 exit ;; *:TENEX:*:*) echo pdp10-${VENDOR}-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-${VENDOR}-tops20 exit ;; *:ITS:*:*) echo pdp10-${VENDOR}-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-${VENDOR}-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' exit ;; i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos exit ;; i*86:AROS:*:*) echo ${UNAME_MACHINE}-pc-aros exit ;; x86_64:VMkernel:*:*) echo ${UNAME_MACHINE}-${VENDOR}-esx exit ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 eval $set_cc_for_build cat >$dummy.c < # include #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (__arm) && defined (__acorn) && defined (__unix) printf ("arm-acorn-riscix\n"); exit (0); #endif #if defined (hp300) && !defined (hpux) printf ("m68k-hp-bsd\n"); exit (0); #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) # if !defined (ultrix) # include # if defined (BSD) # if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); # else # if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); # else printf ("vax-dec-bsd\n"); exit (0); # endif # endif # else printf ("vax-dec-bsd\n"); exit (0); # endif # else printf ("vax-dec-ultrix\n"); exit (0); # endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } # Convex versions that predate uname can use getsysinfo(1) if [ -x /usr/convex/getsysinfo ] then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd exit ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; c34*) echo c34-convex-bsd exit ;; c38*) echo c38-convex-bsd exit ;; c4*) echo c4-convex-bsd exit ;; esac fi cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: libcmis-0.4.1/COPYING.LGPL0000644000175000001440000006364211710730544011660 00000000000000 GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! libcmis-0.4.1/doc/0000755000175000001440000000000012200457454010703 500000000000000libcmis-0.4.1/doc/cmis-client.xml0000644000175000001440000005776112200143447013566 00000000000000 2012-02-21 cmis-client 1 cmis-client 0.2.0 cmis-client command line CMIS client tool. 2012-01-27 cmis-client help cmis-client -v --url url://to/binding list-repos cmis-client -v -u login -p secret --url url://to/binding -r repo-id repo-infos cmis-client -v -u login -p secret --url url://to/binding -r repo-id show-root cmis-client -v -u login -p secret --url url://to/binding -r repo-id get-content id cmis-client -v -u login -p secret --url url://to/binding -r repo-id --input-file path/to/file --input-type mime/type --input-name name.ext set-content id cmis-client -v -u login -p secret --url url://to/binding -r repo-id --object-type some:cmistype --object-property prop-id=prop-value create-folder parent-id name cmis-client -v -u login -p secret --url url://to/binding -r repo-id --input-file path/to/file --input-type mime/type --input-name name.ext --object-type some:cmistype --object-property prop-id=prop-value create-document parent-id name cmis-client -v -u login -p secret --url url://to/binding -r repo-id --object-property prop-id=prop-value update-object object-id cmis-client -v -u login -p secret --url url://to/binding -r repo-id type-by-id show-by-id show-by-path delete arg cmis-client -v -u login -p secret --url url://to/binding -r repo-id checkout cancel-checkout get-versions arg cmis-client -v -u login -p secret --url url://to/binding -r repo-id --input-file path/to/file --input-type mime/type --input-name name.ext --object-property prop-id=prop-value --major --message checkin pwc id 2012-01-27 DESCRIPTION The cmis-client tool sends queries over the net to a CMIS-enabled server to access or modify its content. It is originally demonstrating what libcmis is capable of. OPTIONS GLOBAL OPTIONS -v, --verbose Shows a lot of information to monitor what is happening behind the scene. This helps a lot to debug libcmis. --help Show the help and exit. This is equivalent to use the help command. --url url://to/binding url://to/binding needs to point to the service document of either AtomPub or WebService binding. -r,--repository repo-id Operate on the repo-id CMIS repository. If there is only one repository on the server, this parameter is not needed and that repository will be automatically selected. Use this parameter if there are several repositories on the server. -u,--username login Connect as login to the CMIS server. If not provided connect anonymously. -p,--password secret Use secret to authenticate on the CMIS server. --no-ssl-check Disables the SSL certificate verifications. Lowers the security, but may be handy to work around bad certificates like expired or self-signed ones. --proxy url Use url as the HTTP proxy. Setting this value will override the system proxy settings. --proxy-username login Use login to authenticate on the HTTP proxy. --proxy-password secret Use secret to authenticate on the HTTP proxy. --noproxy list Proxy settings won't apply to hostnames and domain names listed in list. This value is a coma separated list. --oauth2-client-id client_id Application client id to use in the OAuth2 authentication flow. --oauth2-client-secret client_secret Application client secret to use in the OAuth2 authentication flow. --oauth2-auth-url url URL to authenticate the user in the OAuth2 authentication flow. --oauth2-token-url url URL to authenticate the application in the OAuth2 authentication flow. The access and refresh tokens are provided by this URL. --oauth2-redirect-uri uri URI where the OAuth2 authentication flow will redirect after a sucessful authentication. --oauth2-scope scope Requested scope to access in the OAuth2 authentication flow. MODIFICATION OPERATIONS OPTIONS --input-file path/to/file Upload path/to/file as the new content stream of the object. --input-type mime/type Set the mime type of the new content stream of the object to mime/type. --input-name name.ext Set the remote content stream filename of the new content stream of the object to name.ext. --object-type some:cmistype Set the object type of the CMIS object to be created to some:cmistype. This is the equivalent of --object-property cmis:objectTypeId=some:cmistype. --object-property prop-id=prop-value Set a property to be updated or added to the CMIS object. prop-id is the property definition id and prop-value is the value to set on it. --major Create a major version when performing a checkin. -m, --message message Set the checking message. COMMANDS help Show the help and exit. list-repos List the repositories available on the server. repo-infos Displays the informations and capabilities of the selected repository show-root Displays the root node infos and children. get-content id Download the content of the CMIS object corresponding to id in the current directory. set-content id Upload a file as the content stream of the CMIS object corresponding to id. create-folder parent-id name Create a sub folder in folder parent-id named name. The default type of the folder to create is cmis:folder, but this can be changed using --object-type option. create-document parent-id name Create a document in folder parent-id named name. The default type of the document to create is cmis:document, but this can be changed using --object-type option. Note that the --input-file and --input-type may be mandatory, depending on the type of the document to create and its constraints. update-object object-id Replace the writeable properties given with --object-property option on the object matching id object-id. type-by-id arg... Displays the infos and children (if any) of all the CMIS types corresponding to the listed ids. show-by-id arg... Displays the infos and children (if any) of all the CMIS objects corresponding to the listed ids. show-by-path arg... Displays the infos and children (if any) of all the CMIS objects corresponding to the listed paths. delete arg... Deletes the CMIS objects corresponding to the listed ids. If the node is a folder, its content will be removed as well. checkout arg Checkout the document corresponding to the provided id and display the infos of the created private working copy. cancel-checkout arg Cancel the Private Working Copy corresponding to the node id. get-versions arg Display the versions (if any) of all the CMIS object corresponding to the provided id. checkin arg Check in the private working copy corresponding to the provided id and display the infos of the resulting document. Use the --major and --message options to define the version to create and the commit to associate to it. Note that repositories without the ability to update the private working copies will need the --input-file, --input-type and --object-property options. USAGE Displays the root node of repository A1: cmis-client -r A1 --url http://localhost/atom show-root Displays the nodes with id 133 and 116 of repository A1: cmis-client -r A1 --url http://localhost/atom show-by id 133 116 AUTHOR Cédric Bosdonnat cbosdo Original author libcmis-0.4.1/m4/0000755000175000001440000000000012200457454010456 500000000000000libcmis-0.4.1/m4/ltoptions.m40000644000175000001440000003007312166466061012703 00000000000000# Helper functions for option handling. -*- Autoconf -*- # # Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation, # Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 7 ltoptions.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) # _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) # ------------------------------------------ m4_define([_LT_MANGLE_OPTION], [[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) # _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) # --------------------------------------- # Set option OPTION-NAME for macro MACRO-NAME, and if there is a # matching handler defined, dispatch to it. Other OPTION-NAMEs are # saved as a flag. m4_define([_LT_SET_OPTION], [m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), _LT_MANGLE_DEFUN([$1], [$2]), [m4_warning([Unknown $1 option `$2'])])[]dnl ]) # _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) # ------------------------------------------------------------ # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. m4_define([_LT_IF_OPTION], [m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) # _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) # ------------------------------------------------------- # Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME # are set. m4_define([_LT_UNLESS_OPTIONS], [m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), [m4_define([$0_found])])])[]dnl m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 ])[]dnl ]) # _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) # ---------------------------------------- # OPTION-LIST is a space-separated list of Libtool options associated # with MACRO-NAME. If any OPTION has a matching handler declared with # LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about # the unknown option and exit. m4_defun([_LT_SET_OPTIONS], [# Set options m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [_LT_SET_OPTION([$1], _LT_Option)]) m4_if([$1],[LT_INIT],[ dnl dnl Simply set some default values (i.e off) if boolean options were not dnl specified: _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no ]) _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no ]) dnl dnl If no reference was made to various pairs of opposing options, then dnl we run the default mode handler for the pair. For example, if neither dnl `shared' nor `disable-shared' was passed, we enable building of shared dnl archives by default: _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], [_LT_ENABLE_FAST_INSTALL]) ]) ])# _LT_SET_OPTIONS ## --------------------------------- ## ## Macros to handle LT_INIT options. ## ## --------------------------------- ## # _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) # ----------------------------------------- m4_define([_LT_MANGLE_DEFUN], [[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) # LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) # ----------------------------------------------- m4_define([LT_OPTION_DEFINE], [m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl ])# LT_OPTION_DEFINE # dlopen # ------ LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes ]) AU_DEFUN([AC_LIBTOOL_DLOPEN], [_LT_SET_OPTION([LT_INIT], [dlopen]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `dlopen' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) # win32-dll # --------- # Declare package support for building win32 dll's. LT_OPTION_DEFINE([LT_INIT], [win32-dll], [enable_win32_dll=yes case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) ;; esac test -z "$AS" && AS=as _LT_DECL([], [AS], [1], [Assembler program])dnl test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl ])# win32-dll AU_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_REQUIRE([AC_CANONICAL_HOST])dnl _LT_SET_OPTION([LT_INIT], [win32-dll]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `win32-dll' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) # _LT_ENABLE_SHARED([DEFAULT]) # ---------------------------- # implement the --enable-shared flag, and supports the `shared' and # `disable-shared' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_SHARED], [m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([shared], [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) _LT_DECL([build_libtool_libs], [enable_shared], [0], [Whether or not to build shared libraries]) ])# _LT_ENABLE_SHARED LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) # Old names: AC_DEFUN([AC_ENABLE_SHARED], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) ]) AC_DEFUN([AC_DISABLE_SHARED], [_LT_SET_OPTION([LT_INIT], [disable-shared]) ]) AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_SHARED], []) dnl AC_DEFUN([AM_DISABLE_SHARED], []) # _LT_ENABLE_STATIC([DEFAULT]) # ---------------------------- # implement the --enable-static flag, and support the `static' and # `disable-static' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_STATIC], [m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([static], [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_static=]_LT_ENABLE_STATIC_DEFAULT) _LT_DECL([build_old_libs], [enable_static], [0], [Whether or not to build static libraries]) ])# _LT_ENABLE_STATIC LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) # Old names: AC_DEFUN([AC_ENABLE_STATIC], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) ]) AC_DEFUN([AC_DISABLE_STATIC], [_LT_SET_OPTION([LT_INIT], [disable-static]) ]) AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_STATIC], []) dnl AC_DEFUN([AM_DISABLE_STATIC], []) # _LT_ENABLE_FAST_INSTALL([DEFAULT]) # ---------------------------------- # implement the --enable-fast-install flag, and support the `fast-install' # and `disable-fast-install' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_FAST_INSTALL], [m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([fast-install], [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) _LT_DECL([fast_install], [enable_fast_install], [0], [Whether or not to optimize for fast installation])dnl ])# _LT_ENABLE_FAST_INSTALL LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) # Old names: AU_DEFUN([AC_ENABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `fast-install' option into LT_INIT's first parameter.]) ]) AU_DEFUN([AC_DISABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], [disable-fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `disable-fast-install' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) # _LT_WITH_PIC([MODE]) # -------------------- # implement the --with-pic flag, and support the `pic-only' and `no-pic' # LT_INIT options. # MODE is either `yes' or `no'. If omitted, it defaults to `both'. m4_define([_LT_WITH_PIC], [AC_ARG_WITH([pic], [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@], [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], [lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for lt_pkg in $withval; do IFS="$lt_save_ifs" if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS="$lt_save_ifs" ;; esac], [pic_mode=default]) test -z "$pic_mode" && pic_mode=m4_default([$1], [default]) _LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl ])# _LT_WITH_PIC LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) # Old name: AU_DEFUN([AC_LIBTOOL_PICMODE], [_LT_SET_OPTION([LT_INIT], [pic-only]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `pic-only' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) ## ----------------- ## ## LTDL_INIT Options ## ## ----------------- ## m4_define([_LTDL_MODE], []) LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive], [m4_define([_LTDL_MODE], [nonrecursive])]) LT_OPTION_DEFINE([LTDL_INIT], [recursive], [m4_define([_LTDL_MODE], [recursive])]) LT_OPTION_DEFINE([LTDL_INIT], [subproject], [m4_define([_LTDL_MODE], [subproject])]) m4_define([_LTDL_TYPE], []) LT_OPTION_DEFINE([LTDL_INIT], [installable], [m4_define([_LTDL_TYPE], [installable])]) LT_OPTION_DEFINE([LTDL_INIT], [convenience], [m4_define([_LTDL_TYPE], [convenience])]) libcmis-0.4.1/m4/ltversion.m40000644000175000001440000000126212166466061012673 00000000000000# ltversion.m4 -- version numbers -*- Autoconf -*- # # Copyright (C) 2004 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # @configure_input@ # serial 3337 ltversion.m4 # This file is part of GNU Libtool m4_define([LT_PACKAGE_VERSION], [2.4.2]) m4_define([LT_PACKAGE_REVISION], [1.3337]) AC_DEFUN([LTVERSION_VERSION], [macro_version='2.4.2' macro_revision='1.3337' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) libcmis-0.4.1/m4/lt~obsolete.m40000644000175000001440000001375612166466061013233 00000000000000# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # # Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004. # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 5 lt~obsolete.m4 # These exist entirely to fool aclocal when bootstrapping libtool. # # In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN) # which have later been changed to m4_define as they aren't part of the # exported API, or moved to Autoconf or Automake where they belong. # # The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN # in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us # using a macro with the same name in our local m4/libtool.m4 it'll # pull the old libtool.m4 in (it doesn't see our shiny new m4_define # and doesn't know about Autoconf macros at all.) # # So we provide this file, which has a silly filename so it's always # included after everything else. This provides aclocal with the # AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything # because those macros already exist, or will be overwritten later. # We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. # # Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. # Yes, that means every name once taken will need to remain here until # we give up compatibility with versions before 1.7, at which point # we need to keep only those names which we still refer to. # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])]) m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])]) m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])]) m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])]) m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) libcmis-0.4.1/m4/ltsugar.m40000644000175000001440000001042412166466061012327 00000000000000# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- # # Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 6 ltsugar.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) # lt_join(SEP, ARG1, [ARG2...]) # ----------------------------- # Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their # associated separator. # Needed until we can rely on m4_join from Autoconf 2.62, since all earlier # versions in m4sugar had bugs. m4_define([lt_join], [m4_if([$#], [1], [], [$#], [2], [[$2]], [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) m4_define([_lt_join], [m4_if([$#$2], [2], [], [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) # lt_car(LIST) # lt_cdr(LIST) # ------------ # Manipulate m4 lists. # These macros are necessary as long as will still need to support # Autoconf-2.59 which quotes differently. m4_define([lt_car], [[$1]]) m4_define([lt_cdr], [m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], [$#], 1, [], [m4_dquote(m4_shift($@))])]) m4_define([lt_unquote], $1) # lt_append(MACRO-NAME, STRING, [SEPARATOR]) # ------------------------------------------ # Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'. # Note that neither SEPARATOR nor STRING are expanded; they are appended # to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). # No SEPARATOR is output if MACRO-NAME was previously undefined (different # than defined and empty). # # This macro is needed until we can rely on Autoconf 2.62, since earlier # versions of m4sugar mistakenly expanded SEPARATOR but not STRING. m4_define([lt_append], [m4_define([$1], m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) # lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) # ---------------------------------------------------------- # Produce a SEP delimited list of all paired combinations of elements of # PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list # has the form PREFIXmINFIXSUFFIXn. # Needed until we can rely on m4_combine added in Autoconf 2.62. m4_define([lt_combine], [m4_if(m4_eval([$# > 3]), [1], [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl [[m4_foreach([_Lt_prefix], [$2], [m4_foreach([_Lt_suffix], ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) # lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) # ----------------------------------------------------------------------- # Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited # by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. m4_define([lt_if_append_uniq], [m4_ifdef([$1], [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], [lt_append([$1], [$2], [$3])$4], [$5])], [lt_append([$1], [$2], [$3])$4])]) # lt_dict_add(DICT, KEY, VALUE) # ----------------------------- m4_define([lt_dict_add], [m4_define([$1($2)], [$3])]) # lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) # -------------------------------------------- m4_define([lt_dict_add_subkey], [m4_define([$1($2:$3)], [$4])]) # lt_dict_fetch(DICT, KEY, [SUBKEY]) # ---------------------------------- m4_define([lt_dict_fetch], [m4_ifval([$3], m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) # lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) # ----------------------------------------------------------------- m4_define([lt_if_dict_fetch], [m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], [$5], [$6])]) # lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) # -------------------------------------------------------------- m4_define([lt_dict_filter], [m4_if([$5], [], [], [lt_join(m4_quote(m4_default([$4], [[, ]])), lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl ]) libcmis-0.4.1/m4/boost.m40000644000175000001440000011576012010710170011762 00000000000000# boost.m4: Locate Boost headers and libraries for autoconf-based projects. # Copyright (C) 2007, 2008, 2009 Benoit Sigoure # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Additional permission under section 7 of the GNU General Public # License, version 3 ("GPLv3"): # # If you convey this file as part of a work that contains a # configuration script generated by Autoconf, you may do so under # terms of your choice. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . m4_define([_BOOST_SERIAL], [m4_translit([ # serial 12 ], [# ], [])]) # Original sources can be found at http://github.com/tsuna/boost.m4 # You can fetch the latest version of the script by doing: # wget http://github.com/tsuna/boost.m4/raw/master/build-aux/boost.m4 # ------ # # README # # ------ # # This file provides several macros to use the various Boost libraries. # The first macro is BOOST_REQUIRE. It will simply check if it's possible to # find the Boost headers of a given (optional) minimum version and it will # define BOOST_CPPFLAGS accordingly. It will add an option --with-boost to # your configure so that users can specify non standard locations. # If the user's environment contains BOOST_ROOT and --with-boost was not # specified, --with-boost=$BOOST_ROOT is implicitly used. # For more README and documentation, go to http://github.com/tsuna/boost.m4 # Note: THESE MACROS ASSUME THAT YOU USE LIBTOOL. If you don't, don't worry, # simply read the README, it will show you what to do step by step. m4_pattern_forbid([^_?BOOST_]) # _BOOST_SED_CPP(SED-PROGRAM, PROGRAM, # [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) # -------------------------------------------------------- # Same as AC_EGREP_CPP, but leave the result in conftest.i. # PATTERN is *not* overquoted, as in AC_EGREP_CPP. It could be useful # to turn this into a macro which extracts the value of any macro. m4_define([_BOOST_SED_CPP], [AC_LANG_PREPROC_REQUIRE()dnl AC_REQUIRE([AC_PROG_SED])dnl AC_LANG_CONFTEST([AC_LANG_SOURCE([[$2]])]) AS_IF([dnl eval is necessary to expand ac_cpp. dnl Ultrix and Pyramid sh refuse to redirect output of eval, so use subshell. dnl Beware of Windows end-of-lines, for instance if we are running dnl some Windows programs under Wine. In that case, boost/version.hpp dnl is certainly using "\r\n", but the regular Unix shell will only dnl strip `\n' with backquotes, not the `\r'. This results in dnl boost_cv_lib_version='1_37\r' for instance, which breaks dnl everything else. dnl Cannot use 'dnl' after [$4] because a trailing dnl may break AC_CACHE_CHECK (eval "$ac_cpp conftest.$ac_ext") 2>&AS_MESSAGE_LOG_FD | tr -d '\r' | $SED -n -e "$1" >conftest.i 2>&1], [$3], [$4]) rm -rf conftest* ])# AC_EGREP_CPP # BOOST_REQUIRE([VERSION], [ACTION-IF-NOT-FOUND]) # ----------------------------------------------- # Look for Boost. If version is given, it must either be a literal of the form # "X.Y.Z" where X, Y and Z are integers (the ".Z" part being optional) or a # variable "$var". # Defines the value BOOST_CPPFLAGS. This macro only checks for headers with # the required version, it does not check for any of the Boost libraries. # On # success, defines HAVE_BOOST. On failure, calls the optional # ACTION-IF-NOT-FOUND action if one was supplied. # Otherwise aborts with an error message. AC_DEFUN([BOOST_REQUIRE], [AC_REQUIRE([AC_PROG_CXX])dnl AC_REQUIRE([AC_PROG_GREP])dnl echo "$as_me: this is boost.m4[]_BOOST_SERIAL" >&AS_MESSAGE_LOG_FD boost_save_IFS=$IFS boost_version_req=$1 IFS=. set x $boost_version_req 0 0 0 IFS=$boost_save_IFS shift boost_version_req=`expr "$[1]" '*' 100000 + "$[2]" '*' 100 + "$[3]"` AC_ARG_WITH([boost], [AS_HELP_STRING([--with-boost=DIR], [prefix of Boost $1 @<:@guess@:>@])])dnl AC_ARG_VAR([BOOST_ROOT],[Location of Boost installation])dnl # If BOOST_ROOT is set and the user has not provided a value to # --with-boost, then treat BOOST_ROOT as if it the user supplied it. if test x"$BOOST_ROOT" != x; then if test x"$with_boost" = x; then AC_MSG_NOTICE([Detected BOOST_ROOT; continuing with --with-boost=$BOOST_ROOT]) with_boost=$BOOST_ROOT else AC_MSG_NOTICE([Detected BOOST_ROOT=$BOOST_ROOT, but overridden by --with-boost=$with_boost]) fi fi AC_SUBST([DISTCHECK_CONFIGURE_FLAGS], ["$DISTCHECK_CONFIGURE_FLAGS '--with-boost=$with_boost'"]) boost_save_CPPFLAGS=$CPPFLAGS AC_CACHE_CHECK([for Boost headers version >= $boost_version_req], [boost_cv_inc_path], [boost_cv_inc_path=no AC_LANG_PUSH([C++])dnl m4_pattern_allow([^BOOST_VERSION$])dnl AC_LANG_CONFTEST([AC_LANG_PROGRAM([[#include #if !defined BOOST_VERSION # error BOOST_VERSION is not defined #elif BOOST_VERSION < $boost_version_req # error Boost headers version < $boost_version_req #endif ]])]) # If the user provided a value to --with-boost, use it and only it. case $with_boost in #( ''|yes) set x '' /opt/local/include /usr/local/include /opt/include \ /usr/include C:/Boost/include;; #( *) set x "$with_boost/include" "$with_boost";; esac shift for boost_dir do # Without --layout=system, Boost (or at least some versions) installs # itself in /include/boost-. This inner loop helps to # find headers in such directories. # # Any ${boost_dir}/boost-x_xx directories are searched in reverse version # order followed by ${boost_dir}. The final '.' is a sentinel for # searching $boost_dir" itself. Entries are whitespace separated. # # I didn't indent this loop on purpose (to avoid over-indented code) boost_layout_system_search_list=`cd "$boost_dir" 2>/dev/null \ && ls -1 | "${GREP}" '^boost-' | sort -rn -t- -k2 \ && echo .` for boost_inc in $boost_layout_system_search_list do if test x"$boost_inc" != x.; then boost_inc="$boost_dir/$boost_inc" else boost_inc="$boost_dir" # Uses sentinel in boost_layout_system_search_list fi if test x"$boost_inc" != x; then # We are going to check whether the version of Boost installed # in $boost_inc is usable by running a compilation that # #includes it. But if we pass a -I/some/path in which Boost # is not installed, the compiler will just skip this -I and # use other locations (either from CPPFLAGS, or from its list # of system include directories). As a result we would use # header installed on the machine instead of the /some/path # specified by the user. So in that precise case (trying # $boost_inc), make sure the version.hpp exists. # # Use test -e as there can be symlinks. test -e "$boost_inc/boost/version.hpp" || continue CPPFLAGS="$CPPFLAGS -I$boost_inc" fi AC_COMPILE_IFELSE([], [boost_cv_inc_path=yes], [boost_cv_version=no]) if test x"$boost_cv_inc_path" = xyes; then if test x"$boost_inc" != x; then boost_cv_inc_path=$boost_inc fi break 2 fi done done AC_LANG_POP([C++])dnl ]) case $boost_cv_inc_path in #( no) boost_errmsg="cannot find Boost headers version >= $boost_version_req" m4_if([$2], [], [AC_MSG_ERROR([$boost_errmsg])], [AC_MSG_NOTICE([$boost_errmsg])]) $2 ;;#( yes) BOOST_CPPFLAGS= ;;#( *) AC_SUBST([BOOST_CPPFLAGS], ["-I$boost_cv_inc_path"]) ;; esac if test x"$boost_cv_inc_path" != xno; then AC_DEFINE([HAVE_BOOST], [1], [Defined if the requested minimum BOOST version is satisfied]) AC_CACHE_CHECK([for Boost's header version], [boost_cv_lib_version], [m4_pattern_allow([^BOOST_LIB_VERSION$])dnl _BOOST_SED_CPP([/^boost-lib-version = /{s///;s/\"//g;p;g;}], [#include boost-lib-version = BOOST_LIB_VERSION], [boost_cv_lib_version=`cat conftest.i`])]) # e.g. "134" for 1_34_1 or "135" for 1_35 boost_major_version=`echo "$boost_cv_lib_version" | sed 's/_//;s/_.*//'` case $boost_major_version in #( '' | *[[!0-9]]*) AC_MSG_ERROR([invalid value: boost_major_version=$boost_major_version]) ;; esac fi CPPFLAGS=$boost_save_CPPFLAGS ])# BOOST_REQUIRE # BOOST_STATIC() # -------------- # Add the "--enable-static-boost" configure argument. If this argument is given # on the command line, static versions of the libraries will be looked up. AC_DEFUN([BOOST_STATIC], [AC_ARG_ENABLE([static-boost], [AC_HELP_STRING([--enable-static-boost], [Prefer the static boost libraries over the shared ones [no]])], [enable_static_boost=yes], [enable_static_boost=no])])# BOOST_STATIC # BOOST_FIND_HEADER([HEADER-NAME], [ACTION-IF-NOT-FOUND], [ACTION-IF-FOUND]) # -------------------------------------------------------------------------- # Wrapper around AC_CHECK_HEADER for Boost headers. Useful to check for # some parts of the Boost library which are only made of headers and don't # require linking (such as Boost.Foreach). # # Default ACTION-IF-NOT-FOUND: Fail with a fatal error unless Boost couldn't be # found in the first place, in which case by default a notice is issued to the # user. Presumably if we haven't died already it's because it's OK to not have # Boost, which is why only a notice is issued instead of a hard error. # # Default ACTION-IF-FOUND: define the preprocessor symbol HAVE_ in # case of success # (where HEADER-NAME is written LIKE_THIS, e.g., # HAVE_BOOST_FOREACH_HPP). AC_DEFUN([BOOST_FIND_HEADER], [AC_REQUIRE([BOOST_REQUIRE])dnl if test x"$boost_cv_inc_path" = xno; then m4_default([$2], [AC_MSG_NOTICE([Boost not available, not searching for $1])]) else AC_LANG_PUSH([C++])dnl boost_save_CPPFLAGS=$CPPFLAGS CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" AC_CHECK_HEADER([$1], [m4_default([$3], [AC_DEFINE(AS_TR_CPP([HAVE_$1]), [1], [Define to 1 if you have <$1>])])], [m4_default([$2], [AC_MSG_ERROR([cannot find $1])])]) CPPFLAGS=$boost_save_CPPFLAGS AC_LANG_POP([C++])dnl fi ])# BOOST_FIND_HEADER # BOOST_FIND_LIB([LIB-NAME], [PREFERRED-RT-OPT], [HEADER-NAME], [CXX-TEST], # [CXX-PROLOGUE]) # ------------------------------------------------------------------------- # Look for the Boost library LIB-NAME (e.g., LIB-NAME = `thread', for # libboost_thread). Check that HEADER-NAME works and check that # libboost_LIB-NAME can link with the code CXX-TEST. The optional argument # CXX-PROLOGUE can be used to include some C++ code before the `main' # function. # # Invokes BOOST_FIND_HEADER([HEADER-NAME]) (see above). # # Boost libraries typically come compiled with several flavors (with different # runtime options) so PREFERRED-RT-OPT is the preferred suffix. A suffix is one # or more of the following letters: sgdpn (in that order). s = static # runtime, d = debug build, g = debug/diagnostic runtime, p = STLPort build, # n = (unsure) STLPort build without iostreams from STLPort (it looks like `n' # must always be used along with `p'). Additionally, PREFERRED-RT-OPT can # start with `mt-' to indicate that there is a preference for multi-thread # builds. Some sample values for PREFERRED-RT-OPT: (nothing), mt, d, mt-d, gdp # ... If you want to make sure you have a specific version of Boost # (eg, >= 1.33) you *must* invoke BOOST_REQUIRE before this macro. AC_DEFUN([BOOST_FIND_LIB], [AC_REQUIRE([BOOST_REQUIRE])dnl AC_REQUIRE([_BOOST_FIND_COMPILER_TAG])dnl AC_REQUIRE([BOOST_STATIC])dnl AC_REQUIRE([_BOOST_GUESS_WHETHER_TO_USE_MT])dnl if test x"$boost_cv_inc_path" = xno; then AC_MSG_NOTICE([Boost not available, not searching for the Boost $1 library]) else dnl The else branch is huge and wasn't intended on purpose. AC_LANG_PUSH([C++])dnl AS_VAR_PUSHDEF([Boost_lib], [boost_cv_lib_$1])dnl AS_VAR_PUSHDEF([Boost_lib_LDFLAGS], [boost_cv_lib_$1_LDFLAGS])dnl AS_VAR_PUSHDEF([Boost_lib_LIBS], [boost_cv_lib_$1_LIBS])dnl BOOST_FIND_HEADER([$3]) boost_save_CPPFLAGS=$CPPFLAGS CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" # Now let's try to find the library. The algorithm is as follows: first look # for a given library name according to the user's PREFERRED-RT-OPT. For each # library name, we prefer to use the ones that carry the tag (toolset name). # Each library is searched through the various standard paths were Boost is # usually installed. If we can't find the standard variants, we try to # enforce -mt (for instance on MacOSX, libboost_threads.dylib doesn't exist # but there's -obviously- libboost_threads-mt.dylib). AC_CACHE_CHECK([for the Boost $1 library], [Boost_lib], [Boost_lib=no case "$2" in #( mt | mt-) boost_mt=-mt; boost_rtopt=;; #( mt* | mt-*) boost_mt=-mt; boost_rtopt=`expr "X$2" : 'Xmt-*\(.*\)'`;; #( *) boost_mt=; boost_rtopt=$2;; esac if test $enable_static_boost = yes; then boost_rtopt="s$boost_rtopt" fi # Find the proper debug variant depending on what we've been asked to find. case $boost_rtopt in #( *d*) boost_rt_d=$boost_rtopt;; #( *[[sgpn]]*) # Insert the `d' at the right place (in between `sg' and `pn') boost_rt_d=`echo "$boost_rtopt" | sed 's/\(s*g*\)\(p*n*\)/\1\2/'`;; #( *) boost_rt_d='-d';; esac # If the PREFERRED-RT-OPT are not empty, prepend a `-'. test -n "$boost_rtopt" && boost_rtopt="-$boost_rtopt" $boost_guess_use_mt && boost_mt=-mt # Look for the abs path the static archive. # $libext is computed by Libtool but let's make sure it's non empty. test -z "$libext" && AC_MSG_ERROR([the libext variable is empty, did you invoke Libtool?]) boost_save_ac_objext=$ac_objext # Generate the test file. AC_LANG_CONFTEST([AC_LANG_PROGRAM([#include <$3> $5], [$4])]) dnl Optimization hacks: compiling C++ is slow, especially with Boost. What dnl we're trying to do here is guess the right combination of link flags dnl (LIBS / LDFLAGS) to use a given library. This can take several dnl iterations before it succeeds and is thus *very* slow. So what we do dnl instead is that we compile the code first (and thus get an object file, dnl typically conftest.o). Then we try various combinations of link flags dnl until we succeed to link conftest.o in an executable. The problem is dnl that the various TRY_LINK / COMPILE_IFELSE macros of Autoconf always dnl remove all the temporary files including conftest.o. So the trick here dnl is to temporarily change the value of ac_objext so that conftest.o is dnl preserved accross tests. This is obviously fragile and I will burn in dnl hell for not respecting Autoconf's documented interfaces, but in the dnl mean time, it optimizes the macro by a factor of 5 to 30. dnl Another small optimization: the first argument of AC_COMPILE_IFELSE left dnl empty because the test file is generated only once above (before we dnl start the for loops). AC_COMPILE_IFELSE([], [ac_objext=do_not_rm_me_plz], [AC_MSG_ERROR([cannot compile a test that uses Boost $1])]) ac_objext=$boost_save_ac_objext boost_failed_libs= # Don't bother to ident the 6 nested for loops, only the 2 innermost ones # matter. for boost_tag_ in -$boost_cv_lib_tag ''; do for boost_ver_ in -$boost_cv_lib_version ''; do for boost_mt_ in $boost_mt -mt ''; do for boost_rtopt_ in $boost_rtopt '' -d; do for boost_lib in \ boost_$1$boost_tag_$boost_mt_$boost_rtopt_$boost_ver_ \ boost_$1$boost_tag_$boost_rtopt_$boost_ver_ \ boost_$1$boost_tag_$boost_mt_$boost_ver_ \ boost_$1$boost_tag_$boost_ver_ do # Avoid testing twice the same lib case $boost_failed_libs in #( *@$boost_lib@*) continue;; esac # If with_boost is empty, we'll search in /lib first, which is not quite # right so instead we'll try to a location based on where the headers are. boost_tmp_lib=$with_boost test x"$with_boost" = x && boost_tmp_lib=${boost_cv_inc_path%/include} for boost_ldpath in "$boost_tmp_lib/lib" '' \ /opt/local/lib /usr/local/lib /opt/lib /usr/lib \ "$with_boost" C:/Boost/lib /lib /usr/lib64 /lib64 do test -e "$boost_ldpath" || continue boost_save_LDFLAGS=$LDFLAGS # Are we looking for a static library? case $boost_ldpath:$boost_rtopt_ in #( *?*:*s*) # Yes (Non empty boost_ldpath + s in rt opt) Boost_lib_LIBS="$boost_ldpath/lib$boost_lib.$libext" test -e "$Boost_lib_LIBS" || continue;; #( *) # No: use -lboost_foo to find the shared library. Boost_lib_LIBS="-l$boost_lib";; esac boost_save_LIBS=$LIBS LIBS="$Boost_lib_LIBS $LIBS" test x"$boost_ldpath" != x && LDFLAGS="$LDFLAGS -L$boost_ldpath" dnl First argument of AC_LINK_IFELSE left empty because the test file is dnl generated only once above (before we start the for loops). _BOOST_AC_LINK_IFELSE([], [Boost_lib=yes], [Boost_lib=no]) ac_objext=$boost_save_ac_objext LDFLAGS=$boost_save_LDFLAGS LIBS=$boost_save_LIBS if test x"$Boost_lib" = xyes; then Boost_lib_LDFLAGS="-L$boost_ldpath -R$boost_ldpath" break 6 else boost_failed_libs="$boost_failed_libs@$boost_lib@" fi done done done done done done rm -f conftest.$ac_objext ]) case $Boost_lib in #( no) _AC_MSG_LOG_CONFTEST AC_MSG_ERROR([cannot not find the flags to link with Boost $1]) ;; esac AC_SUBST(AS_TR_CPP([BOOST_$1_LDFLAGS]), [$Boost_lib_LDFLAGS]) AC_SUBST(AS_TR_CPP([BOOST_$1_LIBS]), [$Boost_lib_LIBS]) CPPFLAGS=$boost_save_CPPFLAGS AS_VAR_POPDEF([Boost_lib])dnl AS_VAR_POPDEF([Boost_lib_LDFLAGS])dnl AS_VAR_POPDEF([Boost_lib_LIBS])dnl AC_LANG_POP([C++])dnl fi ])# BOOST_FIND_LIB # --------------------------------------- # # Checks for the various Boost libraries. # # --------------------------------------- # # List of boost libraries: http://www.boost.org/libs/libraries.htm # The page http://beta.boost.org/doc/libs is useful: it gives the first release # version of each library (among other things). # BOOST_ARRAY() # ------------- # Look for Boost.Array AC_DEFUN([BOOST_ARRAY], [BOOST_FIND_HEADER([boost/array.hpp])]) # BOOST_ASIO() # ------------ # Look for Boost.Asio (new in Boost 1.35). AC_DEFUN([BOOST_ASIO], [AC_REQUIRE([BOOST_SYSTEM])dnl BOOST_FIND_HEADER([boost/asio.hpp])]) # BOOST_BIND() # ------------ # Look for Boost.Bind AC_DEFUN([BOOST_BIND], [BOOST_FIND_HEADER([boost/bind.hpp])]) # BOOST_CONVERSION() # ------------------ # Look for Boost.Conversion (cast / lexical_cast) AC_DEFUN([BOOST_CONVERSION], [BOOST_FIND_HEADER([boost/cast.hpp]) BOOST_FIND_HEADER([boost/lexical_cast.hpp]) ])# BOOST_CONVERSION # BOOST_DATE_TIME([PREFERRED-RT-OPT]) # ----------------------------------- # Look for Boost.Date_Time. For the documentation of PREFERRED-RT-OPT, see the # documentation of BOOST_FIND_LIB above. AC_DEFUN([BOOST_DATE_TIME], [BOOST_FIND_LIB([date_time], [$1], [boost/date_time/posix_time/posix_time.hpp], [boost::posix_time::ptime t;]) ])# BOOST_DATE_TIME # BOOST_FILESYSTEM([PREFERRED-RT-OPT]) # ------------------------------------ # Look for Boost.Filesystem. For the documentation of PREFERRED-RT-OPT, see # the documentation of BOOST_FIND_LIB above. # Do not check for boost/filesystem.hpp because this file was introduced in # 1.34. AC_DEFUN([BOOST_FILESYSTEM], [# Do we have to check for Boost.System? This link-time dependency was # added as of 1.35.0. If we have a version <1.35, we must not attempt to # find Boost.System as it didn't exist by then. if test $boost_major_version -ge 135; then BOOST_SYSTEM([$1]) fi # end of the Boost.System check. boost_filesystem_save_LIBS=$LIBS boost_filesystem_save_LDFLAGS=$LDFLAGS m4_pattern_allow([^BOOST_SYSTEM_(LIBS|LDFLAGS)$])dnl LIBS="$LIBS $BOOST_SYSTEM_LIBS" LDFLAGS="$LDFLAGS $BOOST_SYSTEM_LDFLAGS" BOOST_FIND_LIB([filesystem], [$1], [boost/filesystem/path.hpp], [boost::filesystem::path p;]) LIBS=$boost_filesystem_save_LIBS LDFLAGS=$boost_filesystem_save_LDFLAGS ])# BOOST_FILESYSTEM # BOOST_FOREACH() # --------------- # Look for Boost.Foreach AC_DEFUN([BOOST_FOREACH], [BOOST_FIND_HEADER([boost/foreach.hpp])]) # BOOST_FORMAT() # -------------- # Look for Boost.Format # Note: we can't check for boost/format/format_fwd.hpp because the header isn't # standalone. It can't be compiled because it triggers the following error: # boost/format/detail/config_macros.hpp:88: error: 'locale' in namespace 'std' # does not name a type AC_DEFUN([BOOST_FORMAT], [BOOST_FIND_HEADER([boost/format.hpp])]) # BOOST_FUNCTION() # ---------------- # Look for Boost.Function AC_DEFUN([BOOST_FUNCTION], [BOOST_FIND_HEADER([boost/function.hpp])]) # BOOST_GRAPH([PREFERRED-RT-OPT]) # ------------------------------- # Look for Boost.Graphs. For the documentation of PREFERRED-RT-OPT, see the # documentation of BOOST_FIND_LIB above. AC_DEFUN([BOOST_GRAPH], [BOOST_FIND_LIB([graph], [$1], [boost/graph/adjacency_list.hpp], [boost::adjacency_list<> g;]) ])# BOOST_GRAPH # BOOST_IOSTREAMS([PREFERRED-RT-OPT]) # ------------------------------- # Look for Boost.IOStreams. For the documentation of PREFERRED-RT-OPT, see the # documentation of BOOST_FIND_LIB above. AC_DEFUN([BOOST_IOSTREAMS], [BOOST_FIND_LIB([iostreams], [$1], [boost/iostreams/device/file_descriptor.hpp], [boost::iostreams::file_descriptor fd(0); fd.close();]) ])# BOOST_IOSTREAMS # BOOST_HASH() # ------------ # Look for Boost.Functional/Hash AC_DEFUN([BOOST_HASH], [BOOST_FIND_HEADER([boost/functional/hash.hpp])]) # BOOST_LAMBDA() # -------------- # Look for Boost.Lambda AC_DEFUN([BOOST_LAMBDA], [BOOST_FIND_HEADER([boost/lambda/lambda.hpp])]) # BOOST_MATH() # ------------ # Look for Boost.Math # TODO: This library isn't header-only but it comes in multiple different # flavors that don't play well with BOOST_FIND_LIB (e.g, libboost_math_c99, # libboost_math_c99f, libboost_math_c99l, libboost_math_tr1, # libboost_math_tr1f, libboost_math_tr1l). This macro must be fixed to do the # right thing anyway. AC_DEFUN([BOOST_MATH], [BOOST_FIND_HEADER([boost/math/special_functions.hpp])]) # BOOST_MULTIARRAY() # ------------------ # Look for Boost.MultiArray AC_DEFUN([BOOST_MULTIARRAY], [BOOST_FIND_HEADER([boost/multi_array.hpp])]) # BOOST_NUMERIC_CONVERSION() # -------------------------- # Look for Boost.NumericConversion (policy-based numeric conversion) AC_DEFUN([BOOST_NUMERIC_CONVERSION], [BOOST_FIND_HEADER([boost/numeric/conversion/converter.hpp]) ])# BOOST_NUMERIC_CONVERSION # BOOST_OPTIONAL() # ---------------- # Look for Boost.Optional AC_DEFUN([BOOST_OPTIONAL], [BOOST_FIND_HEADER([boost/optional.hpp])]) # BOOST_PREPROCESSOR() # -------------------- # Look for Boost.Preprocessor AC_DEFUN([BOOST_PREPROCESSOR], [BOOST_FIND_HEADER([boost/preprocessor/repeat.hpp])]) # BOOST_PROGRAM_OPTIONS([PREFERRED-RT-OPT]) # ----------------------------------------- # Look for Boost.Program_options. For the documentation of PREFERRED-RT-OPT, see # the documentation of BOOST_FIND_LIB above. AC_DEFUN([BOOST_PROGRAM_OPTIONS], [BOOST_FIND_LIB([program_options], [$1], [boost/program_options.hpp], [boost::program_options::options_description d("test");]) ])# BOOST_PROGRAM_OPTIONS # BOOST_REF() # ----------- # Look for Boost.Ref AC_DEFUN([BOOST_REF], [BOOST_FIND_HEADER([boost/ref.hpp])]) # BOOST_REGEX([PREFERRED-RT-OPT]) # ------------------------------- # Look for Boost.Regex. For the documentation of PREFERRED-RT-OPT, see the # documentation of BOOST_FIND_LIB above. AC_DEFUN([BOOST_REGEX], [BOOST_FIND_LIB([regex], [$1], [boost/regex.hpp], [boost::regex exp("*"); boost::regex_match("foo", exp);]) ])# BOOST_REGEX # BOOST_SERIALIZATION([PREFERRED-RT-OPT]) # --------------------------------------- # Look for Boost.Serialization. For the documentation of PREFERRED-RT-OPT, see # the documentation of BOOST_FIND_LIB above. AC_DEFUN([BOOST_SERIALIZATION], [BOOST_FIND_LIB([serialization], [$1], [boost/archive/text_oarchive.hpp], [std::ostream* o = 0; // Cheap way to get an ostream... boost::archive::text_oarchive t(*o);]) ])# BOOST_SIGNALS # BOOST_SIGNALS([PREFERRED-RT-OPT]) # --------------------------------- # Look for Boost.Signals. For the documentation of PREFERRED-RT-OPT, see the # documentation of BOOST_FIND_LIB above. AC_DEFUN([BOOST_SIGNALS], [BOOST_FIND_LIB([signals], [$1], [boost/signal.hpp], [boost::signal s;]) ])# BOOST_SIGNALS # BOOST_SMART_PTR() # ----------------- # Look for Boost.SmartPtr AC_DEFUN([BOOST_SMART_PTR], [BOOST_FIND_HEADER([boost/scoped_ptr.hpp]) BOOST_FIND_HEADER([boost/shared_ptr.hpp]) ]) # BOOST_STATICASSERT() # -------------------- # Look for Boost.StaticAssert AC_DEFUN([BOOST_STATICASSERT], [BOOST_FIND_HEADER([boost/static_assert.hpp])]) # BOOST_STRING_ALGO() # ------------------- # Look for Boost.StringAlgo AC_DEFUN([BOOST_STRING_ALGO], [BOOST_FIND_HEADER([boost/algorithm/string.hpp]) ]) # BOOST_SYSTEM([PREFERRED-RT-OPT]) # -------------------------------- # Look for Boost.System. For the documentation of PREFERRED-RT-OPT, see the # documentation of BOOST_FIND_LIB above. This library was introduced in Boost # 1.35.0. AC_DEFUN([BOOST_SYSTEM], [BOOST_FIND_LIB([system], [$1], [boost/system/error_code.hpp], [boost::system::error_code e; e.clear();]) ])# BOOST_SYSTEM # BOOST_TEST([PREFERRED-RT-OPT]) # ------------------------------ # Look for Boost.Test. For the documentation of PREFERRED-RT-OPT, see the # documentation of BOOST_FIND_LIB above. AC_DEFUN([BOOST_TEST], [m4_pattern_allow([^BOOST_CHECK$])dnl BOOST_FIND_LIB([unit_test_framework], [$1], [boost/test/unit_test.hpp], [BOOST_CHECK(2 == 2);], [using boost::unit_test::test_suite; test_suite* init_unit_test_suite(int argc, char ** argv) { return NULL; }]) ])# BOOST_TEST # BOOST_THREADS([PREFERRED-RT-OPT]) # --------------------------------- # Look for Boost.Thread. For the documentation of PREFERRED-RT-OPT, see the # documentation of BOOST_FIND_LIB above. # FIXME: Provide an alias "BOOST_THREAD". AC_DEFUN([BOOST_THREADS], [dnl Having the pthread flag is required at least on GCC3 where dnl boost/thread.hpp would complain if we try to compile without dnl -pthread on GNU/Linux. AC_REQUIRE([_BOOST_PTHREAD_FLAG])dnl boost_threads_save_LIBS=$LIBS boost_threads_save_CPPFLAGS=$CPPFLAGS LIBS="$LIBS $boost_cv_pthread_flag" # Yes, we *need* to put the -pthread thing in CPPFLAGS because with GCC3, # boost/thread.hpp will trigger a #error if -pthread isn't used: # boost/config/requires_threads.hpp:47:5: #error "Compiler threading support # is not turned on. Please set the correct command line options for # threading: -pthread (Linux), -pthreads (Solaris) or -mthreads (Mingw32)" CPPFLAGS="$CPPFLAGS $boost_cv_pthread_flag" BOOST_FIND_LIB([thread], [$1], [boost/thread.hpp], [boost::thread t; boost::mutex m;]) BOOST_THREAD_LIBS="$BOOST_THREAD_LIBS $boost_cv_pthread_flag" BOOST_CPPFLAGS="$BOOST_CPPFLAGS $boost_cv_pthread_flag" LIBS=$boost_threads_save_LIBS CPPFLAGS=$boost_threads_save_CPPFLAGS ])# BOOST_THREADS # BOOST_TOKENIZER() # ----------------- # Look for Boost.Tokenizer AC_DEFUN([BOOST_TOKENIZER], [BOOST_FIND_HEADER([boost/tokenizer.hpp])]) # BOOST_TRIBOOL() # --------------- # Look for Boost.Tribool AC_DEFUN([BOOST_TRIBOOL], [BOOST_FIND_HEADER([boost/logic/tribool_fwd.hpp]) BOOST_FIND_HEADER([boost/logic/tribool.hpp]) ]) # BOOST_TUPLE() # ------------- # Look for Boost.Tuple AC_DEFUN([BOOST_TUPLE], [BOOST_FIND_HEADER([boost/tuple/tuple.hpp])]) # BOOST_TYPETRAITS() # -------------------- # Look for Boost.TypeTraits AC_DEFUN([BOOST_TYPETRAITS], [BOOST_FIND_HEADER([boost/type_traits.hpp])]) # BOOST_UNORDERED() # --------------- # Look for Boost.Unordered (unordered_map, unordered_set # etc.) AC_DEFUN([BOOST_UNORDERED], [BOOST_FIND_HEADER([boost/unordered_map.hpp]) BOOST_FIND_HEADER([boost/unordered_set.hpp])]) # BOOST_UTILITY() # --------------- # Look for Boost.Utility (noncopyable, result_of, base-from-member idiom, # etc.) AC_DEFUN([BOOST_UTILITY], [BOOST_FIND_HEADER([boost/utility.hpp])]) # BOOST_UUID() # ----------------- # Look for Boost.Uuid AC_DEFUN([BOOST_UUID], [BOOST_FIND_HEADER([boost/uuid/uuid.hpp]) BOOST_FIND_HEADER([boost/uuid/uuid_generators.hpp]) BOOST_FIND_HEADER([boost/uuid/uuid_io.hpp]) BOOST_FIND_HEADER([boost/uuid/uuid_serialize.hpp]) ]) # BOOST_VARIANT() # --------------- # Look for Boost.Variant. AC_DEFUN([BOOST_VARIANT], [BOOST_FIND_HEADER([boost/variant/variant_fwd.hpp]) BOOST_FIND_HEADER([boost/variant.hpp])]) # BOOST_WAVE([PREFERRED-RT-OPT]) # ------------------------------ # NOTE: If you intend to use Wave/Spirit with thread support, make sure you # call BOOST_THREADS first. # Look for Boost.Wave. For the documentation of PREFERRED-RT-OPT, see the # documentation of BOOST_FIND_LIB above. AC_DEFUN([BOOST_WAVE], [AC_REQUIRE([BOOST_FILESYSTEM])dnl AC_REQUIRE([BOOST_DATE_TIME])dnl boost_wave_save_LIBS=$LIBS boost_wave_save_LDFLAGS=$LDFLAGS m4_pattern_allow([^BOOST_((FILE)?SYSTEM|DATE_TIME|THREAD)_(LIBS|LDFLAGS)$])dnl LIBS="$LIBS $BOOST_SYSTEM_LIBS $BOOST_FILESYSTEM_LIBS $BOOST_DATE_TIME_LIBS\ $BOOST_THREAD_LIBS" LDFLAGS="$LDFLAGS $BOOST_SYSTEM_LDFLAGS $BOOST_FILESYSTEM_LDFLAGS\ $BOOST_DATE_TIME_LDFLAGS $BOOST_THREAD_LDFLAGS" BOOST_FIND_LIB([wave], [$1], [boost/wave.hpp], [boost::wave::token_id id; get_token_name(id);]) LIBS=$boost_wave_save_LIBS LDFLAGS=$boost_wave_save_LDFLAGS ])# BOOST_WAVE # BOOST_XPRESSIVE() # ----------------- # Look for Boost.Xpressive (new since 1.36.0). AC_DEFUN([BOOST_XPRESSIVE], [BOOST_FIND_HEADER([boost/xpressive/xpressive.hpp])]) # ----------------- # # Internal helpers. # # ----------------- # # _BOOST_PTHREAD_FLAG() # --------------------- # Internal helper for BOOST_THREADS. Based on ACX_PTHREAD: # http://autoconf-archive.cryp.to/acx_pthread.html AC_DEFUN([_BOOST_PTHREAD_FLAG], [AC_REQUIRE([AC_PROG_CXX])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_LANG_PUSH([C++])dnl AC_CACHE_CHECK([for the flags needed to use pthreads], [boost_cv_pthread_flag], [ boost_cv_pthread_flag= # The ordering *is* (sometimes) important. Some notes on the # individual items follow: # (none): in case threads are in libc; should be tried before -Kthread and # other compiler flags to prevent continual compiler warnings # -lpthreads: AIX (must check this before -lpthread) # -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h) # -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able) # -llthread: LinuxThreads port on FreeBSD (also preferred to -pthread) # -pthread: GNU Linux/GCC (kernel threads), BSD/GCC (userland threads) # -pthreads: Solaris/GCC # -mthreads: MinGW32/GCC, Lynx/GCC # -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it # doesn't hurt to check since this sometimes defines pthreads too; # also defines -D_REENTRANT) # ... -mt is also the pthreads flag for HP/aCC # -lpthread: GNU Linux, etc. # --thread-safe: KAI C++ case $host_os in #( *solaris*) # On Solaris (at least, for some versions), libc contains stubbed # (non-functional) versions of the pthreads routines, so link-based # tests will erroneously succeed. (We need to link with -pthreads/-mt/ # -lpthread.) (The stubs are missing pthread_cleanup_push, or rather # a function called by this macro, so we could check for that, but # who knows whether they'll stub that too in a future libc.) So, # we'll just look for -pthreads and -lpthread first: boost_pthread_flags="-pthreads -lpthread -mt -pthread";; #( *) boost_pthread_flags="-lpthreads -Kthread -kthread -llthread -pthread \ -pthreads -mthreads -lpthread --thread-safe -mt";; esac # Generate the test file. AC_LANG_CONFTEST([AC_LANG_PROGRAM([#include ], [pthread_t th; pthread_join(th, 0); pthread_attr_init(0); pthread_cleanup_push(0, 0); pthread_create(0,0,0,0); pthread_cleanup_pop(0);])]) for boost_pthread_flag in '' $boost_pthread_flags; do boost_pthread_ok=false dnl Re-use the test file already generated. boost_pthreads__save_LIBS=$LIBS LIBS="$LIBS $boost_pthread_flag" AC_LINK_IFELSE([], [if grep ".*$boost_pthread_flag" conftest.err; then echo "This flag seems to have triggered warnings" >&AS_MESSAGE_LOG_FD else boost_pthread_ok=:; boost_cv_pthread_flag=$boost_pthread_flag fi]) LIBS=$boost_pthreads__save_LIBS $boost_pthread_ok && break done ]) AC_LANG_POP([C++])dnl ])# _BOOST_PTHREAD_FLAG # _BOOST_gcc_test(MAJOR, MINOR) # ----------------------------- # Internal helper for _BOOST_FIND_COMPILER_TAG. m4_define([_BOOST_gcc_test], ["defined __GNUC__ && __GNUC__ == $1 && __GNUC_MINOR__ == $2 && !defined __ICC @ gcc$1$2"])dnl # _BOOST_FIND_COMPILER_TAG() # -------------------------- # Internal. When Boost is installed without --layout=system, each library # filename will hold a suffix that encodes the compiler used during the # build. The Boost build system seems to call this a `tag'. AC_DEFUN([_BOOST_FIND_COMPILER_TAG], [AC_REQUIRE([AC_PROG_CXX])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_CACHE_CHECK([for the toolset name used by Boost for $CXX], [boost_cv_lib_tag], [boost_cv_lib_tag=unknown if test x$boost_cv_inc_path != xno; then AC_LANG_PUSH([C++])dnl # The following tests are mostly inspired by boost/config/auto_link.hpp # The list is sorted to most recent/common to oldest compiler (in order # to increase the likelihood of finding the right compiler with the # least number of compilation attempt). # Beware that some tests are sensible to the order (for instance, we must # look for MinGW before looking for GCC3). # I used one compilation test per compiler with a #error to recognize # each compiler so that it works even when cross-compiling (let me know # if you know a better approach). # Known missing tags (known from Boost's tools/build/v2/tools/common.jam): # como, edg, kcc, bck, mp, sw, tru, xlc # I'm not sure about my test for `il' (be careful: Intel's ICC pre-defines # the same defines as GCC's). # TODO: Move the test on GCC 4.4 up once it's released. for i in \ _BOOST_gcc_test(4, 3) \ _BOOST_gcc_test(4, 2) \ _BOOST_gcc_test(4, 1) \ _BOOST_gcc_test(4, 0) \ "defined __GNUC__ && __GNUC__ == 3 && !defined __ICC \ && (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \ || defined __WIN32__ || defined __WINNT || defined __WINNT__) @ mgw" \ _BOOST_gcc_test(3, 4) \ _BOOST_gcc_test(3, 3) \ "defined _MSC_VER && _MSC_VER >= 1500 @ vc90" \ "defined _MSC_VER && _MSC_VER == 1400 @ vc80" \ _BOOST_gcc_test(3, 2) \ "defined _MSC_VER && _MSC_VER == 1310 @ vc71" \ _BOOST_gcc_test(3, 1) \ _BOOST_gcc_test(3, 0) \ "defined __BORLANDC__ @ bcb" \ "defined __ICC && (defined __unix || defined __unix__) @ il" \ "defined __ICL @ iw" \ "defined _MSC_VER && _MSC_VER == 1300 @ vc7" \ _BOOST_gcc_test(4, 4) \ _BOOST_gcc_test(2, 95) \ "defined __MWERKS__ && __MWERKS__ <= 0x32FF @ cw9" \ "defined _MSC_VER && _MSC_VER < 1300 && !defined UNDER_CE @ vc6" \ "defined _MSC_VER && _MSC_VER < 1300 && defined UNDER_CE @ evc4" \ "defined __MWERKS__ && __MWERKS__ <= 0x31FF @ cw8" do boost_tag_test=`expr "X$i" : 'X\([[^@]]*\) @ '` boost_tag=`expr "X$i" : 'X[[^@]]* @ \(.*\)'` AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #if $boost_tag_test /* OK */ #else # error $boost_tag_test #endif ]])], [boost_cv_lib_tag=$boost_tag; break], []) done AC_LANG_POP([C++])dnl case $boost_cv_lib_tag in #( # Some newer (>= 1.35?) versions of Boost seem to only use "gcc" as opposed # to "gcc41" for instance. *-gcc | *'-gcc ') :;; #( Don't re-add -gcc: it's already in there. gcc*) boost_tag_x= case $host_os in #( darwin*) if test $boost_major_version -ge 136; then # The `x' added in r46793 of Boost. boost_tag_x=x fi;; esac # We can specify multiple tags in this variable because it's used by # BOOST_FIND_LIB that does a `for tag in -$boost_cv_lib_tag' ... boost_cv_lib_tag="$boost_tag_x$boost_cv_lib_tag -${boost_tag_x}gcc" ;; #( unknown) AC_MSG_WARN([[could not figure out which toolset name to use for $CXX]]) boost_cv_lib_tag= ;; esac fi])dnl end of AC_CACHE_CHECK ])# _BOOST_FIND_COMPILER_TAG # _BOOST_GUESS_WHETHER_TO_USE_MT() # -------------------------------- # Compile a small test to try to guess whether we should favor MT (Multi # Thread) flavors of Boost. Sets boost_guess_use_mt accordingly. AC_DEFUN([_BOOST_GUESS_WHETHER_TO_USE_MT], [# Check whether we do better use `mt' even though we weren't ask to. AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #if defined _REENTRANT || defined _MT || defined __MT__ /* use -mt */ #else # error MT not needed #endif ]])], [boost_guess_use_mt=:], [boost_guess_use_mt=false]) ]) # _BOOST_AC_LINK_IFELSE(PROGRAM, [ACTION-IF-TRUE], [ACTION-IF-FALSE]) # ------------------------------------------------------------------- # Fork of _AC_LINK_IFELSE that preserves conftest.o across calls. Fragile, # will break when Autoconf changes its internals. Requires that you manually # rm -f conftest.$ac_objext in between to really different tests, otherwise # you will try to link a conftest.o left behind by a previous test. # Used to aggressively optimize BOOST_FIND_LIB (see the big comment in this # macro). # # Don't use "break" in the actions, as it would short-circuit some code # this macro runs after the actions. m4_define([_BOOST_AC_LINK_IFELSE], [m4_ifvaln([$1], [AC_LANG_CONFTEST([$1])])dnl rm -f conftest$ac_exeext boost_save_ac_ext=$ac_ext boost_use_source=: # If we already have a .o, re-use it. We change $ac_ext so that $ac_link # tries to link the existing object file instead of compiling from source. test -f conftest.$ac_objext && ac_ext=$ac_objext && boost_use_source=false && _AS_ECHO_LOG([re-using the existing conftest.$ac_objext]) AS_IF([_AC_DO_STDERR($ac_link) && { test -z "$ac_[]_AC_LANG_ABBREV[]_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_executable_p conftest$ac_exeext dnl FIXME: use AS_TEST_X instead when 2.61 is widespread enough. }], [$2], [if $boost_use_source; then _AC_MSG_LOG_CONFTEST fi $3]) ac_objext=$boost_save_ac_objext ac_ext=$boost_save_ac_ext dnl Delete also the IPA/IPO (Inter Procedural Analysis/Optimization) dnl information created by the PGI compiler (conftest_ipa8_conftest.oo), dnl as it would interfere with the next link command. rm -f core conftest.err conftest_ipa8_conftest.oo \ conftest$ac_exeext m4_ifval([$1], [conftest.$ac_ext])[]dnl ])# _BOOST_AC_LINK_IFELSE # Local Variables: # mode: autoconf # End: libcmis-0.4.1/m4/libtool.m40000644000175000001440000105721612166466061012325 00000000000000# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. m4_define([_LT_COPYING], [dnl # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. # # GNU Libtool is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of # the License, or (at your option) any later version. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, or # obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ]) # serial 57 LT_INIT # LT_PREREQ(VERSION) # ------------------ # Complain and exit if this libtool version is less that VERSION. m4_defun([LT_PREREQ], [m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, [m4_default([$3], [m4_fatal([Libtool version $1 or higher is required], 63)])], [$2])]) # _LT_CHECK_BUILDDIR # ------------------ # Complain if the absolute build directory name contains unusual characters m4_defun([_LT_CHECK_BUILDDIR], [case `pwd` in *\ * | *\ *) AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; esac ]) # LT_INIT([OPTIONS]) # ------------------ AC_DEFUN([LT_INIT], [AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl AC_BEFORE([$0], [LT_LANG])dnl AC_BEFORE([$0], [LT_OUTPUT])dnl AC_BEFORE([$0], [LTDL_INIT])dnl m4_require([_LT_CHECK_BUILDDIR])dnl dnl Autoconf doesn't catch unexpanded LT_ macros by default: m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 dnl unless we require an AC_DEFUNed macro: AC_REQUIRE([LTOPTIONS_VERSION])dnl AC_REQUIRE([LTSUGAR_VERSION])dnl AC_REQUIRE([LTVERSION_VERSION])dnl AC_REQUIRE([LTOBSOLETE_VERSION])dnl m4_require([_LT_PROG_LTMAIN])dnl _LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}]) dnl Parse OPTIONS _LT_SET_OPTIONS([$0], [$1]) # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ltmain" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' AC_SUBST(LIBTOOL)dnl _LT_SETUP # Only expand once: m4_define([LT_INIT]) ])# LT_INIT # Old names: AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PROG_LIBTOOL], []) dnl AC_DEFUN([AM_PROG_LIBTOOL], []) # _LT_CC_BASENAME(CC) # ------------------- # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. m4_defun([_LT_CC_BASENAME], [for cc_temp in $1""; do case $cc_temp in compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` ]) # _LT_FILEUTILS_DEFAULTS # ---------------------- # It is okay to use these file commands and assume they have been set # sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'. m4_defun([_LT_FILEUTILS_DEFAULTS], [: ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} ])# _LT_FILEUTILS_DEFAULTS # _LT_SETUP # --------- m4_defun([_LT_SETUP], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl _LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl dnl _LT_DECL([], [host_alias], [0], [The host system])dnl _LT_DECL([], [host], [0])dnl _LT_DECL([], [host_os], [0])dnl dnl _LT_DECL([], [build_alias], [0], [The build system])dnl _LT_DECL([], [build], [0])dnl _LT_DECL([], [build_os], [0])dnl dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl dnl AC_REQUIRE([AC_PROG_LN_S])dnl test -z "$LN_S" && LN_S="ln -s" _LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl dnl AC_REQUIRE([LT_CMD_MAX_LEN])dnl _LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl _LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl m4_require([_LT_CMD_RELOAD])dnl m4_require([_LT_CHECK_MAGIC_METHOD])dnl m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl m4_require([_LT_CMD_OLD_ARCHIVE])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_WITH_SYSROOT])dnl _LT_CONFIG_LIBTOOL_INIT([ # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi ]) if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi _LT_CHECK_OBJDIR m4_require([_LT_TAG_COMPILER])dnl case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld="$lt_cv_prog_gnu_ld" old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o _LT_CC_BASENAME([$compiler]) # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then _LT_PATH_MAGIC fi ;; esac # Use C for the default configuration in the libtool script LT_SUPPORTED_TAG([CC]) _LT_LANG_C_CONFIG _LT_LANG_DEFAULT_CONFIG _LT_CONFIG_COMMANDS ])# _LT_SETUP # _LT_PREPARE_SED_QUOTE_VARS # -------------------------- # Define a few sed substitution that help us do robust quoting. m4_defun([_LT_PREPARE_SED_QUOTE_VARS], [# Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\([["`\\]]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ]) # _LT_PROG_LTMAIN # --------------- # Note that this code is called both from `configure', and `config.status' # now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, # `config.status' has no value for ac_aux_dir unless we are using Automake, # so we pass a copy along to make sure it has a sensible value anyway. m4_defun([_LT_PROG_LTMAIN], [m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl _LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) ltmain="$ac_aux_dir/ltmain.sh" ])# _LT_PROG_LTMAIN ## ------------------------------------- ## ## Accumulate code for creating libtool. ## ## ------------------------------------- ## # So that we can recreate a full libtool script including additional # tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS # in macros and then make a single call at the end using the `libtool' # label. # _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) # ---------------------------------------- # Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL_INIT], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_INIT], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_INIT]) # _LT_CONFIG_LIBTOOL([COMMANDS]) # ------------------------------ # Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) # _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) # ----------------------------------------------------- m4_defun([_LT_CONFIG_SAVE_COMMANDS], [_LT_CONFIG_LIBTOOL([$1]) _LT_CONFIG_LIBTOOL_INIT([$2]) ]) # _LT_FORMAT_COMMENT([COMMENT]) # ----------------------------- # Add leading comment marks to the start of each line, and a trailing # full-stop to the whole comment if one is not present already. m4_define([_LT_FORMAT_COMMENT], [m4_ifval([$1], [ m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) )]) ## ------------------------ ## ## FIXME: Eliminate VARNAME ## ## ------------------------ ## # _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) # ------------------------------------------------------------------- # CONFIGNAME is the name given to the value in the libtool script. # VARNAME is the (base) name used in the configure script. # VALUE may be 0, 1 or 2 for a computed quote escaped value based on # VARNAME. Any other value will be used directly. m4_define([_LT_DECL], [lt_if_append_uniq([lt_decl_varnames], [$2], [, ], [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], [m4_ifval([$1], [$1], [$2])]) lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) m4_ifval([$4], [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) lt_dict_add_subkey([lt_decl_dict], [$2], [tagged?], [m4_ifval([$5], [yes], [no])])]) ]) # _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) # -------------------------------------------------------- m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) # lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_tag_varnames], [_lt_decl_filter([tagged?], [yes], $@)]) # _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) # --------------------------------------------------------- m4_define([_lt_decl_filter], [m4_case([$#], [0], [m4_fatal([$0: too few arguments: $#])], [1], [m4_fatal([$0: too few arguments: $#: $1])], [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], [lt_dict_filter([lt_decl_dict], $@)])[]dnl ]) # lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) # -------------------------------------------------- m4_define([lt_decl_quote_varnames], [_lt_decl_filter([value], [1], $@)]) # lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_dquote_varnames], [_lt_decl_filter([value], [2], $@)]) # lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_varnames_tagged], [m4_assert([$# <= 2])dnl _$0(m4_quote(m4_default([$1], [[, ]])), m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) m4_define([_lt_decl_varnames_tagged], [m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) # lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_all_varnames], [_$0(m4_quote(m4_default([$1], [[, ]])), m4_if([$2], [], m4_quote(lt_decl_varnames), m4_quote(m4_shift($@))))[]dnl ]) m4_define([_lt_decl_all_varnames], [lt_join($@, lt_decl_varnames_tagged([$1], lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl ]) # _LT_CONFIG_STATUS_DECLARE([VARNAME]) # ------------------------------------ # Quote a variable value, and forward it to `config.status' so that its # declaration there will have the same value as in `configure'. VARNAME # must have a single quote delimited value for this to work. m4_define([_LT_CONFIG_STATUS_DECLARE], [$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`']) # _LT_CONFIG_STATUS_DECLARATIONS # ------------------------------ # We delimit libtool config variables with single quotes, so when # we write them to config.status, we have to be sure to quote all # embedded single quotes properly. In configure, this macro expands # each variable declared with _LT_DECL (and _LT_TAGDECL) into: # # ='`$ECHO "$" | $SED "$delay_single_quote_subst"`' m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], [m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAGS # ---------------- # Output comment and list of tags supported by the script m4_defun([_LT_LIBTOOL_TAGS], [_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl available_tags="_LT_TAGS"dnl ]) # _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) # ----------------------------------- # Extract the dictionary values for VARNAME (optionally with TAG) and # expand to a commented shell variable setting: # # # Some comment about what VAR is for. # visible_name=$lt_internal_name m4_define([_LT_LIBTOOL_DECLARE], [_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [description])))[]dnl m4_pushdef([_libtool_name], m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), [0], [_libtool_name=[$]$1], [1], [_libtool_name=$lt_[]$1], [2], [_libtool_name=$lt_[]$1], [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl ]) # _LT_LIBTOOL_CONFIG_VARS # ----------------------- # Produce commented declarations of non-tagged libtool config variables # suitable for insertion in the LIBTOOL CONFIG section of the `libtool' # script. Tagged libtool config variables (even for the LIBTOOL CONFIG # section) are produced by _LT_LIBTOOL_TAG_VARS. m4_defun([_LT_LIBTOOL_CONFIG_VARS], [m4_foreach([_lt_var], m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAG_VARS(TAG) # ------------------------- m4_define([_LT_LIBTOOL_TAG_VARS], [m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) # _LT_TAGVAR(VARNAME, [TAGNAME]) # ------------------------------ m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) # _LT_CONFIG_COMMANDS # ------------------- # Send accumulated output to $CONFIG_STATUS. Thanks to the lists of # variables for single and double quote escaping we saved from calls # to _LT_DECL, we can put quote escaped variables declarations # into `config.status', and then the shell code to quote escape them in # for loops in `config.status'. Finally, any additional code accumulated # from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. m4_defun([_LT_CONFIG_COMMANDS], [AC_PROVIDE_IFELSE([LT_OUTPUT], dnl If the libtool generation code has been placed in $CONFIG_LT, dnl instead of duplicating it all over again into config.status, dnl then we will have config.status run $CONFIG_LT later, so it dnl needs to know what name is stored there: [AC_CONFIG_COMMANDS([libtool], [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], dnl If the libtool generation code is destined for config.status, dnl expand the accumulated commands and init code now: [AC_CONFIG_COMMANDS([libtool], [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) ])#_LT_CONFIG_COMMANDS # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], [ # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' _LT_CONFIG_STATUS_DECLARATIONS LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$[]1 _LTECHO_EOF' } # Quote evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_quote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_dquote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done _LT_OUTPUT_LIBTOOL_INIT ]) # _LT_GENERATED_FILE_INIT(FILE, [COMMENT]) # ------------------------------------ # Generate a child script FILE with all initialization necessary to # reuse the environment learned by the parent script, and make the # file executable. If COMMENT is supplied, it is inserted after the # `#!' sequence but before initialization text begins. After this # macro, additional text can be appended to FILE to form the body of # the child script. The macro ends with non-zero status if the # file could not be fully written (such as if the disk is full). m4_ifdef([AS_INIT_GENERATED], [m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])], [m4_defun([_LT_GENERATED_FILE_INIT], [m4_require([AS_PREPARE])]dnl [m4_pushdef([AS_MESSAGE_LOG_FD])]dnl [lt_write_fail=0 cat >$1 <<_ASEOF || lt_write_fail=1 #! $SHELL # Generated by $as_me. $2 SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$1 <<\_ASEOF || lt_write_fail=1 AS_SHELL_SANITIZE _AS_PREPARE exec AS_MESSAGE_FD>&1 _ASEOF test $lt_write_fail = 0 && chmod +x $1[]dnl m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT # LT_OUTPUT # --------- # This macro allows early generation of the libtool script (before # AC_OUTPUT is called), incase it is used in configure for compilation # tests. AC_DEFUN([LT_OUTPUT], [: ${CONFIG_LT=./config.lt} AC_MSG_NOTICE([creating $CONFIG_LT]) _LT_GENERATED_FILE_INIT(["$CONFIG_LT"], [# Run this file to recreate a libtool stub with the current configuration.]) cat >>"$CONFIG_LT" <<\_LTEOF lt_cl_silent=false exec AS_MESSAGE_LOG_FD>>config.log { echo AS_BOX([Running $as_me.]) } >&AS_MESSAGE_LOG_FD lt_cl_help="\ \`$as_me' creates a local libtool stub from the current configuration, for use in further configure time tests before the real libtool is generated. Usage: $[0] [[OPTIONS]] -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files Report bugs to ." lt_cl_version="\ m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) configured by $[0], generated by m4_PACKAGE_STRING. Copyright (C) 2011 Free Software Foundation, Inc. This config.lt script is free software; the Free Software Foundation gives unlimited permision to copy, distribute and modify it." while test $[#] != 0 do case $[1] in --version | --v* | -V ) echo "$lt_cl_version"; exit 0 ;; --help | --h* | -h ) echo "$lt_cl_help"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --quiet | --q* | --silent | --s* | -q ) lt_cl_silent=: ;; -*) AC_MSG_ERROR([unrecognized option: $[1] Try \`$[0] --help' for more information.]) ;; *) AC_MSG_ERROR([unrecognized argument: $[1] Try \`$[0] --help' for more information.]) ;; esac shift done if $lt_cl_silent; then exec AS_MESSAGE_FD>/dev/null fi _LTEOF cat >>"$CONFIG_LT" <<_LTEOF _LT_OUTPUT_LIBTOOL_COMMANDS_INIT _LTEOF cat >>"$CONFIG_LT" <<\_LTEOF AC_MSG_NOTICE([creating $ofile]) _LT_OUTPUT_LIBTOOL_COMMANDS AS_EXIT(0) _LTEOF chmod +x "$CONFIG_LT" # configure is writing to config.log, but config.lt does its own redirection, # appending to config.log, which fails on DOS, as config.log is still kept # open by configure. Here we exec the FD to /dev/null, effectively closing # config.log, so it can be properly (re)opened and appended to by config.lt. lt_cl_success=: test "$silent" = yes && lt_config_lt_args="$lt_config_lt_args --quiet" exec AS_MESSAGE_LOG_FD>/dev/null $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false exec AS_MESSAGE_LOG_FD>>config.log $lt_cl_success || AS_EXIT(1) ])# LT_OUTPUT # _LT_CONFIG(TAG) # --------------- # If TAG is the built-in tag, create an initial libtool script with a # default configuration from the untagged config vars. Otherwise add code # to config.status for appending the configuration named by TAG from the # matching tagged config vars. m4_defun([_LT_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_CONFIG_SAVE_COMMANDS([ m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl m4_if(_LT_TAG, [C], [ # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi cfgfile="${ofile}T" trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # _LT_COPYING _LT_LIBTOOL_TAGS # ### BEGIN LIBTOOL CONFIG _LT_LIBTOOL_CONFIG_VARS _LT_LIBTOOL_TAG_VARS # ### END LIBTOOL CONFIG _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac _LT_PROG_LTMAIN # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) _LT_PROG_REPLACE_SHELLFNS mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ], [cat <<_LT_EOF >> "$ofile" dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded dnl in a comment (ie after a #). # ### BEGIN LIBTOOL TAG CONFIG: $1 _LT_LIBTOOL_TAG_VARS(_LT_TAG) # ### END LIBTOOL TAG CONFIG: $1 _LT_EOF ])dnl /m4_if ], [m4_if([$1], [], [ PACKAGE='$PACKAGE' VERSION='$VERSION' TIMESTAMP='$TIMESTAMP' RM='$RM' ofile='$ofile'], []) ])dnl /_LT_CONFIG_SAVE_COMMANDS ])# _LT_CONFIG # LT_SUPPORTED_TAG(TAG) # --------------------- # Trace this macro to discover what tags are supported by the libtool # --tag option, using: # autoconf --trace 'LT_SUPPORTED_TAG:$1' AC_DEFUN([LT_SUPPORTED_TAG], []) # C support is built-in for now m4_define([_LT_LANG_C_enabled], []) m4_define([_LT_TAGS], []) # LT_LANG(LANG) # ------------- # Enable libtool support for the given language if not already enabled. AC_DEFUN([LT_LANG], [AC_BEFORE([$0], [LT_OUTPUT])dnl m4_case([$1], [C], [_LT_LANG(C)], [C++], [_LT_LANG(CXX)], [Go], [_LT_LANG(GO)], [Java], [_LT_LANG(GCJ)], [Fortran 77], [_LT_LANG(F77)], [Fortran], [_LT_LANG(FC)], [Windows Resource], [_LT_LANG(RC)], [m4_ifdef([_LT_LANG_]$1[_CONFIG], [_LT_LANG($1)], [m4_fatal([$0: unsupported language: "$1"])])])dnl ])# LT_LANG # _LT_LANG(LANGNAME) # ------------------ m4_defun([_LT_LANG], [m4_ifdef([_LT_LANG_]$1[_enabled], [], [LT_SUPPORTED_TAG([$1])dnl m4_append([_LT_TAGS], [$1 ])dnl m4_define([_LT_LANG_]$1[_enabled], [])dnl _LT_LANG_$1_CONFIG($1)])dnl ])# _LT_LANG m4_ifndef([AC_PROG_GO], [ ############################################################ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_GO. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # ############################################################ m4_defun([AC_PROG_GO], [AC_LANG_PUSH(Go)dnl AC_ARG_VAR([GOC], [Go compiler command])dnl AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl _AC_ARG_VAR_LDFLAGS()dnl AC_CHECK_TOOL(GOC, gccgo) if test -z "$GOC"; then if test -n "$ac_tool_prefix"; then AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo]) fi fi if test -z "$GOC"; then AC_CHECK_PROG(GOC, gccgo, gccgo, false) fi ])#m4_defun ])#m4_ifndef # _LT_LANG_DEFAULT_CONFIG # ----------------------- m4_defun([_LT_LANG_DEFAULT_CONFIG], [AC_PROVIDE_IFELSE([AC_PROG_CXX], [LT_LANG(CXX)], [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])]) AC_PROVIDE_IFELSE([AC_PROG_F77], [LT_LANG(F77)], [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])]) AC_PROVIDE_IFELSE([AC_PROG_FC], [LT_LANG(FC)], [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])]) dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal dnl pulling things in needlessly. AC_PROVIDE_IFELSE([AC_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([LT_PROG_GCJ], [LT_LANG(GCJ)], [m4_ifdef([AC_PROG_GCJ], [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([A][M_PROG_GCJ], [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([LT_PROG_GCJ], [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) AC_PROVIDE_IFELSE([AC_PROG_GO], [LT_LANG(GO)], [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])]) AC_PROVIDE_IFELSE([LT_PROG_RC], [LT_LANG(RC)], [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) ])# _LT_LANG_DEFAULT_CONFIG # Obsolete macros: AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_CXX], []) dnl AC_DEFUN([AC_LIBTOOL_F77], []) dnl AC_DEFUN([AC_LIBTOOL_FC], []) dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) dnl AC_DEFUN([AC_LIBTOOL_RC], []) # _LT_TAG_COMPILER # ---------------- m4_defun([_LT_TAG_COMPILER], [AC_REQUIRE([AC_PROG_CC])dnl _LT_DECL([LTCC], [CC], [1], [A C compiler])dnl _LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl _LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl _LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC ])# _LT_TAG_COMPILER # _LT_COMPILER_BOILERPLATE # ------------------------ # Check for compiler boilerplate output or warnings with # the simple compiler test code. m4_defun([_LT_COMPILER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ])# _LT_COMPILER_BOILERPLATE # _LT_LINKER_BOILERPLATE # ---------------------- # Check for linker boilerplate output or warnings with # the simple link test code. m4_defun([_LT_LINKER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ])# _LT_LINKER_BOILERPLATE # _LT_REQUIRED_DARWIN_CHECKS # ------------------------- m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ case $host_os in rhapsody* | darwin*) AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) AC_CHECK_TOOL([LIPO], [lipo], [:]) AC_CHECK_TOOL([OTOOL], [otool], [:]) AC_CHECK_TOOL([OTOOL64], [otool64], [:]) _LT_DECL([], [DSYMUTIL], [1], [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) _LT_DECL([], [NMEDIT], [1], [Tool to change global to local symbols on Mac OS X]) _LT_DECL([], [LIPO], [1], [Tool to manipulate fat objects and archives on Mac OS X]) _LT_DECL([], [OTOOL], [1], [ldd/readelf like tool for Mach-O binaries on Mac OS X]) _LT_DECL([], [OTOOL64], [1], [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], [lt_cv_apple_cc_single_mod=no if test -z "${LT_MULTI_MODULE}"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # If there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&AS_MESSAGE_LOG_FD # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test $_lt_result -eq 0; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -rf libconftest.dylib* rm -f conftest.* fi]) AC_CACHE_CHECK([for -exported_symbols_list linker flag], [lt_cv_ld_exported_symbols_list], [lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [lt_cv_ld_exported_symbols_list=yes], [lt_cv_ld_exported_symbols_list=no]) LDFLAGS="$save_LDFLAGS" ]) AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], [lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&AS_MESSAGE_LOG_FD elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then lt_cv_ld_force_load=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM ]) case $host_os in rhapsody* | darwin1.[[012]]) _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; 10.[[012]]*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test "$lt_cv_apple_cc_single_mod" = "yes"; then _lt_dar_single_mod='$single_module' fi if test "$lt_cv_ld_exported_symbols_list" = "yes"; then _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' fi if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac ]) # _LT_DARWIN_LINKER_FEATURES([TAG]) # --------------------------------- # Checks for linker and compiler features on darwin m4_defun([_LT_DARWIN_LINKER_FEATURES], [ m4_require([_LT_REQUIRED_DARWIN_CHECKS]) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported if test "$lt_cv_ld_force_load" = "yes"; then _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes], [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes]) else _LT_TAGVAR(whole_archive_flag_spec, $1)='' fi _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined" case $cc_basename in ifort*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then output_verbose_link_cmd=func_echo_all _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" m4_if([$1], [CXX], [ if test "$lt_cv_apple_cc_single_mod" != "yes"; then _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" fi ],[]) else _LT_TAGVAR(ld_shlibs, $1)=no fi ]) # _LT_SYS_MODULE_PATH_AIX([TAGNAME]) # ---------------------------------- # Links a minimal program and checks the executable # for the system default hardcoded library path. In most cases, # this is /usr/lib:/lib, but when the MPI compilers are used # the location of the communication and MPI libs are included too. # If we don't find anything, use the default library path according # to the aix ld manual. # Store the results from the different compilers for each TAGNAME. # Allow to override them for all tags through lt_cv_aix_libpath. m4_defun([_LT_SYS_MODULE_PATH_AIX], [m4_require([_LT_DECL_SED])dnl if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])], [AC_LINK_IFELSE([AC_LANG_PROGRAM],[ lt_aix_libpath_sed='[ /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }]' _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi],[]) if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib" fi ]) aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1]) fi ])# _LT_SYS_MODULE_PATH_AIX # _LT_SHELL_INIT(ARG) # ------------------- m4_define([_LT_SHELL_INIT], [m4_divert_text([M4SH-INIT], [$1 ])])# _LT_SHELL_INIT # _LT_PROG_ECHO_BACKSLASH # ----------------------- # Find how we can fake an echo command that does not interpret backslash. # In particular, with Autoconf 2.60 or later we add some code to the start # of the generated configure script which will find a shell with a builtin # printf (which we can use as an echo command). m4_defun([_LT_PROG_ECHO_BACKSLASH], [ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO AC_MSG_CHECKING([how to print strings]) # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $[]1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } case "$ECHO" in printf*) AC_MSG_RESULT([printf]) ;; print*) AC_MSG_RESULT([print -r]) ;; *) AC_MSG_RESULT([cat]) ;; esac m4_ifdef([_AS_DETECT_SUGGESTED], [_AS_DETECT_SUGGESTED([ test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test "X`printf %s $ECHO`" = "X$ECHO" \ || test "X`print -r -- $ECHO`" = "X$ECHO" )])]) _LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) _LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) ])# _LT_PROG_ECHO_BACKSLASH # _LT_WITH_SYSROOT # ---------------- AC_DEFUN([_LT_WITH_SYSROOT], [AC_MSG_CHECKING([for sysroot]) AC_ARG_WITH([sysroot], [ --with-sysroot[=DIR] Search for dependent libraries within DIR (or the compiler's sysroot if not specified).], [], [with_sysroot=no]) dnl lt_sysroot will always be passed unquoted. We quote it here dnl in case the user passed a directory name. lt_sysroot= case ${with_sysroot} in #( yes) if test "$GCC" = yes; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) AC_MSG_RESULT([${with_sysroot}]) AC_MSG_ERROR([The sysroot must be an absolute path.]) ;; esac AC_MSG_RESULT([${lt_sysroot:-no}]) _LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl [dependent libraries, and in which our libraries should be installed.])]) # _LT_ENABLE_LOCK # --------------- m4_defun([_LT_ENABLE_LOCK], [AC_ARG_ENABLE([libtool-lock], [AS_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; ppc*-*linux*|powerpc*-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, [AC_LANG_PUSH(C) AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) AC_LANG_POP]) if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; *-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD="${LD-ld}_sol2" fi ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks="$enable_libtool_lock" ])# _LT_ENABLE_LOCK # _LT_PROG_AR # ----------- m4_defun([_LT_PROG_AR], [AC_CHECK_TOOLS(AR, [ar], false) : ${AR=ar} : ${AR_FLAGS=cru} _LT_DECL([], [AR], [1], [The archiver]) _LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive]) AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], [lt_cv_ar_at_file=no AC_COMPILE_IFELSE([AC_LANG_PROGRAM], [echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD' AC_TRY_EVAL([lt_ar_try]) if test "$ac_status" -eq 0; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a AC_TRY_EVAL([lt_ar_try]) if test "$ac_status" -ne 0; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a ]) ]) if test "x$lt_cv_ar_at_file" = xno; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi _LT_DECL([], [archiver_list_spec], [1], [How to feed a file listing to the archiver]) ])# _LT_PROG_AR # _LT_CMD_OLD_ARCHIVE # ------------------- m4_defun([_LT_CMD_OLD_ARCHIVE], [_LT_PROG_AR AC_CHECK_TOOL(STRIP, strip, :) test -z "$STRIP" && STRIP=: _LT_DECL([], [STRIP], [1], [A symbol stripping program]) AC_CHECK_TOOL(RANLIB, ranlib, :) test -z "$RANLIB" && RANLIB=: _LT_DECL([], [RANLIB], [1], [Commands used to install an old-style archive]) # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac _LT_DECL([], [old_postinstall_cmds], [2]) _LT_DECL([], [old_postuninstall_cmds], [2]) _LT_TAGDECL([], [old_archive_cmds], [2], [Commands used to build an old-style archive]) _LT_DECL([], [lock_old_archive_extraction], [0], [Whether to use a lock for old archive extraction]) ])# _LT_CMD_OLD_ARCHIVE # _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------------------- # Check whether the given compiler option works AC_DEFUN([_LT_COMPILER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$3" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi fi $RM conftest* ]) if test x"[$]$2" = xyes; then m4_if([$5], , :, [$5]) else m4_if([$6], , :, [$6]) fi ])# _LT_COMPILER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) # _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------- # Check whether the given linker option works AC_DEFUN([_LT_LINKER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $3" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&AS_MESSAGE_LOG_FD $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi else $2=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" ]) if test x"[$]$2" = xyes; then m4_if([$4], , :, [$4]) else m4_if([$5], , :, [$5]) fi ])# _LT_LINKER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) # LT_CMD_MAX_LEN #--------------- AC_DEFUN([LT_CMD_MAX_LEN], [AC_REQUIRE([AC_CANONICAL_HOST])dnl # find the maximum length of command line arguments AC_MSG_CHECKING([the maximum length of command line arguments]) AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl i=0 teststring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8 ; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac ]) if test -n $lt_cv_sys_max_cmd_len ; then AC_MSG_RESULT($lt_cv_sys_max_cmd_len) else AC_MSG_RESULT(none) fi max_cmd_len=$lt_cv_sys_max_cmd_len _LT_DECL([], [max_cmd_len], [0], [What is the maximum length of a command?]) ])# LT_CMD_MAX_LEN # Old name: AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) # _LT_HEADER_DLFCN # ---------------- m4_defun([_LT_HEADER_DLFCN], [AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl ])# _LT_HEADER_DLFCN # _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) # ---------------------------------------------------------------- m4_defun([_LT_TRY_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test "$cross_compiling" = yes; then : [$4] else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF [#line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; }] _LT_EOF if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) $1 ;; x$lt_dlneed_uscore) $2 ;; x$lt_dlunknown|x*) $3 ;; esac else : # compilation failed $3 fi fi rm -fr conftest* ])# _LT_TRY_DLOPEN_SELF # LT_SYS_DLOPEN_SELF # ------------------ AC_DEFUN([LT_SYS_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ]) ;; *) AC_CHECK_FUNC([shl_load], [lt_cv_dlopen="shl_load"], [AC_CHECK_LIB([dld], [shl_load], [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"], [AC_CHECK_FUNC([dlopen], [lt_cv_dlopen="dlopen"], [AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], [AC_CHECK_LIB([svld], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], [AC_CHECK_LIB([dld], [dld_link], [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"]) ]) ]) ]) ]) ]) ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" AC_CACHE_CHECK([whether a program can dlopen itself], lt_cv_dlopen_self, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) ]) if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" AC_CACHE_CHECK([whether a statically linked program can dlopen itself], lt_cv_dlopen_self_static, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) ]) fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi _LT_DECL([dlopen_support], [enable_dlopen], [0], [Whether dlopen is supported]) _LT_DECL([dlopen_self], [enable_dlopen_self], [0], [Whether dlopen of programs is supported]) _LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], [Whether dlopen of statically linked programs is supported]) ])# LT_SYS_DLOPEN_SELF # Old name: AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) # _LT_COMPILER_C_O([TAGNAME]) # --------------------------- # Check to see if options -c and -o are simultaneously supported by compiler. # This macro does not hard code the compiler like AC_PROG_CC_C_O. m4_defun([_LT_COMPILER_C_O], [m4_require([_LT_DECL_SED])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes fi fi chmod u+w . 2>&AS_MESSAGE_LOG_FD $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* ]) _LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], [Does compiler simultaneously support -c and -o options?]) ])# _LT_COMPILER_C_O # _LT_COMPILER_FILE_LOCKS([TAGNAME]) # ---------------------------------- # Check to see if we can do hard links to lock some files if needed m4_defun([_LT_COMPILER_FILE_LOCKS], [m4_require([_LT_ENABLE_LOCK])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_COMPILER_C_O([$1]) hard_links="nottested" if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user AC_MSG_CHECKING([if we can lock with hard links]) hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no AC_MSG_RESULT([$hard_links]) if test "$hard_links" = no; then AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) need_locks=warn fi else need_locks=no fi _LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) ])# _LT_COMPILER_FILE_LOCKS # _LT_CHECK_OBJDIR # ---------------- m4_defun([_LT_CHECK_OBJDIR], [AC_CACHE_CHECK([for objdir], [lt_cv_objdir], [rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null]) objdir=$lt_cv_objdir _LT_DECL([], [objdir], [0], [The name of the directory that contains temporary libtool files])dnl m4_pattern_allow([LT_OBJDIR])dnl AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/", [Define to the sub-directory in which libtool stores uninstalled libraries.]) ])# _LT_CHECK_OBJDIR # _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) # -------------------------------------- # Check hardcoding attributes. m4_defun([_LT_LINKER_HARDCODE_LIBPATH], [AC_MSG_CHECKING([how to hardcode library paths into programs]) _LT_TAGVAR(hardcode_action, $1)= if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || test -n "$_LT_TAGVAR(runpath_var, $1)" || test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then # We can hardcode non-existent directories. if test "$_LT_TAGVAR(hardcode_direct, $1)" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no && test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then # Linking always hardcodes the temporary library directory. _LT_TAGVAR(hardcode_action, $1)=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. _LT_TAGVAR(hardcode_action, $1)=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. _LT_TAGVAR(hardcode_action, $1)=unsupported fi AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) if test "$_LT_TAGVAR(hardcode_action, $1)" = relink || test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi _LT_TAGDECL([], [hardcode_action], [0], [How to hardcode a shared library path into an executable]) ])# _LT_LINKER_HARDCODE_LIBPATH # _LT_CMD_STRIPLIB # ---------------- m4_defun([_LT_CMD_STRIPLIB], [m4_require([_LT_DECL_EGREP]) striplib= old_striplib= AC_MSG_CHECKING([whether stripping libraries is possible]) if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" AC_MSG_RESULT([yes]) else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" old_striplib="$STRIP -S" AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi ;; *) AC_MSG_RESULT([no]) ;; esac fi _LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) _LT_DECL([], [striplib], [1]) ])# _LT_CMD_STRIPLIB # _LT_SYS_DYNAMIC_LINKER([TAG]) # ----------------------------- # PORTME Fill in your ld.so characteristics m4_defun([_LT_SYS_DYNAMIC_LINKER], [AC_REQUIRE([AC_CANONICAL_HOST])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_OBJDUMP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl AC_MSG_CHECKING([dynamic linker characteristics]) m4_if([$1], [], [ if test "$GCC" = yes; then case $host_os in darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;; *) lt_sed_strip_eq="s,=/,/,g" ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path/$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" else test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo="/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[[lt_foo]]++; } if (lt_freq[[lt_foo]] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's,/\([[A-Za-z]]:\),\1,g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi]) library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix[[4-9]]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[[01]] | aix4.[[01]].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[[45]]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' library_names_spec='${libname}.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec="$LIB" if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[[23]].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[[01]]* | freebsdelf3.[[01]]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=yes sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[[3-9]]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath], [lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], [lt_cv_shlibpath_overrides_runpath=yes])]) LDFLAGS=$save_LDFLAGS libdir=$save_libdir ]) shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[[89]] | openbsd2.[[89]].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac AC_MSG_RESULT([$dynamic_linker]) test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" fi _LT_DECL([], [variables_saved_for_relink], [1], [Variables whose values should be saved in libtool wrapper scripts and restored at link time]) _LT_DECL([], [need_lib_prefix], [0], [Do we need the "lib" prefix for modules?]) _LT_DECL([], [need_version], [0], [Do we need a version for libraries?]) _LT_DECL([], [version_type], [0], [Library versioning type]) _LT_DECL([], [runpath_var], [0], [Shared library runtime path variable]) _LT_DECL([], [shlibpath_var], [0],[Shared library path variable]) _LT_DECL([], [shlibpath_overrides_runpath], [0], [Is shlibpath searched before the hard-coded library search path?]) _LT_DECL([], [libname_spec], [1], [Format of library name prefix]) _LT_DECL([], [library_names_spec], [1], [[List of archive names. First name is the real one, the rest are links. The last name is the one that the linker finds with -lNAME]]) _LT_DECL([], [soname_spec], [1], [[The coded name of the library, if different from the real name]]) _LT_DECL([], [install_override_mode], [1], [Permission mode override for installation of shared libraries]) _LT_DECL([], [postinstall_cmds], [2], [Command to use after installation of a shared archive]) _LT_DECL([], [postuninstall_cmds], [2], [Command to use after uninstallation of a shared archive]) _LT_DECL([], [finish_cmds], [2], [Commands used to finish a libtool library installation in a directory]) _LT_DECL([], [finish_eval], [1], [[As "finish_cmds", except a single script fragment to be evaled but not shown]]) _LT_DECL([], [hardcode_into_libs], [0], [Whether we should hardcode library paths into libraries]) _LT_DECL([], [sys_lib_search_path_spec], [2], [Compile-time system search path for libraries]) _LT_DECL([], [sys_lib_dlsearch_path_spec], [2], [Run-time system search path for libraries]) ])# _LT_SYS_DYNAMIC_LINKER # _LT_PATH_TOOL_PREFIX(TOOL) # -------------------------- # find a file program which can recognize shared library AC_DEFUN([_LT_PATH_TOOL_PREFIX], [m4_require([_LT_DECL_EGREP])dnl AC_MSG_CHECKING([for $1]) AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, [case $MAGIC_CMD in [[\\/*] | ?:[\\/]*]) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR dnl $ac_dummy forces splitting on constant user-supplied paths. dnl POSIX.2 word splitting is done only on the output of word expansions, dnl not every word. This closes a longstanding sh security hole. ac_dummy="m4_if([$2], , $PATH, [$2])" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$1; then lt_cv_path_MAGIC_CMD="$ac_dir/$1" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac]) MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then AC_MSG_RESULT($MAGIC_CMD) else AC_MSG_RESULT(no) fi _LT_DECL([], [MAGIC_CMD], [0], [Used to examine libraries when file_magic_cmd begins with "file"])dnl ])# _LT_PATH_TOOL_PREFIX # Old name: AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) # _LT_PATH_MAGIC # -------------- # find a file program which can recognize a shared library m4_defun([_LT_PATH_MAGIC], [_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) else MAGIC_CMD=: fi fi ])# _LT_PATH_MAGIC # LT_PATH_LD # ---------- # find the pathname to the GNU or non-GNU linker AC_DEFUN([LT_PATH_LD], [AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PROG_ECHO_BACKSLASH])dnl AC_ARG_WITH([gnu-ld], [AS_HELP_STRING([--with-gnu-ld], [assume the C compiler uses GNU ld @<:@default=no@:>@])], [test "$withval" = no || with_gnu_ld=yes], [with_gnu_ld=no])dnl ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by $CC]) case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [[\\/]]* | ?:[[\\/]]*) re_direlt='/[[^/]][[^/]]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL(lt_cv_path_LD, [if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &1 /dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; gnu*) lt_cv_deplibs_check_method=pass_all ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'] lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[[3-9]]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) lt_cv_deplibs_check_method=pass_all ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; esac ]) file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown _LT_DECL([], [deplibs_check_method], [1], [Method to check whether dependent libraries are shared objects]) _LT_DECL([], [file_magic_cmd], [1], [Command to use when deplibs_check_method = "file_magic"]) _LT_DECL([], [file_magic_glob], [1], [How to find potential files when deplibs_check_method = "file_magic"]) _LT_DECL([], [want_nocaseglob], [1], [Find potential files using nocaseglob when deplibs_check_method = "file_magic"]) ])# _LT_CHECK_MAGIC_METHOD # LT_PATH_NM # ---------- # find the pathname to a BSD- or MS-compatible name lister AC_DEFUN([LT_PATH_NM], [AC_REQUIRE([AC_PROG_CC])dnl AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, [if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else lt_nm_to_check="${ac_tool_prefix}nm" if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. tmp_nm="$ac_dir/$lt_tmp_nm" if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS="$lt_save_ifs" done : ${lt_cv_path_NM=no} fi]) if test "$lt_cv_path_NM" != "no"; then NM="$lt_cv_path_NM" else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols" ;; *) DUMPBIN=: ;; esac fi AC_SUBST([DUMPBIN]) if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" fi fi test -z "$NM" && NM=nm AC_SUBST([NM]) _LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], [lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD) cat conftest.out >&AS_MESSAGE_LOG_FD if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest*]) ])# LT_PATH_NM # Old names: AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_PROG_NM], []) dnl AC_DEFUN([AC_PROG_NM], []) # _LT_CHECK_SHAREDLIB_FROM_LINKLIB # -------------------------------- # how to determine the name of the shared library # associated with a specific link library. # -- PORTME fill in with the dynamic library characteristics m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB], [m4_require([_LT_DECL_EGREP]) m4_require([_LT_DECL_OBJDUMP]) m4_require([_LT_DECL_DLLTOOL]) AC_CACHE_CHECK([how to associate runtime and link libraries], lt_cv_sharedlib_from_linklib_cmd, [lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh # decide which to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd="$ECHO" ;; esac ]) sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO _LT_DECL([], [sharedlib_from_linklib_cmd], [1], [Command to associate shared and link libraries]) ])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB # _LT_PATH_MANIFEST_TOOL # ---------------------- # locate the manifest tool m4_defun([_LT_PATH_MANIFEST_TOOL], [AC_CHECK_TOOL(MANIFEST_TOOL, mt, :) test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool], [lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&AS_MESSAGE_LOG_FD if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest*]) if test "x$lt_cv_path_mainfest_tool" != xyes; then MANIFEST_TOOL=: fi _LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl ])# _LT_PATH_MANIFEST_TOOL # LT_LIB_M # -------- # check for math library AC_DEFUN([LT_LIB_M], [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case $host in *-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*) # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") ;; *) AC_CHECK_LIB(m, cos, LIBM="-lm") ;; esac AC_SUBST([LIBM]) ])# LT_LIB_M # Old name: AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_CHECK_LIBM], []) # _LT_COMPILER_NO_RTTI([TAGNAME]) # ------------------------------- m4_defun([_LT_COMPILER_NO_RTTI], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= if test "$GCC" = yes; then case $cc_basename in nvcc*) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;; *) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;; esac _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], lt_cv_prog_compiler_rtti_exceptions, [-fno-rtti -fno-exceptions], [], [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) fi _LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], [Compiler flag to turn off builtin functions]) ])# _LT_COMPILER_NO_RTTI # _LT_CMD_GLOBAL_SYMBOLS # ---------------------- m4_defun([_LT_CMD_GLOBAL_SYMBOLS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([LT_PATH_NM])dnl AC_REQUIRE([LT_PATH_LD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_TAG_COMPILER])dnl # Check for command to grab the raw symbol name followed by C symbol from nm. AC_MSG_CHECKING([command to parse $NM output from $compiler object]) AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [ # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[[BCDEGRST]]' # Regexp to match symbols that can be accessed directly from C. sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[[BCDT]]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[[ABCDGISTW]]' ;; hpux*) if test "$host_cpu" = ia64; then symcode='[[ABCDEGRST]]' fi ;; irix* | nonstopux*) symcode='[[BCDEGRST]]' ;; osf*) symcode='[[BCDEGQRST]]' ;; solaris*) symcode='[[BDRT]]' ;; sco3.2v5*) symcode='[[DT]]' ;; sysv4.2uw2*) symcode='[[DT]]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[[ABDT]]' ;; sysv4) symcode='[[DFNSTU]]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[[ABCDGIRSTW]]' ;; esac # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'" lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function # and D for any global variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK ['"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ " {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ " s[1]~/^[@?]/{print s[1], s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx]" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if AC_TRY_EVAL(ac_compile); then # Now try to grab the symbols. nlist=conftest.nm if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT@&t@_DLSYM_CONST #elif defined(__osf__) /* This system does not cope well with relocations in const data. */ # define LT@&t@_DLSYM_CONST #else # define LT@&t@_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT@&t@_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[[]] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD fi else echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done ]) if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then AC_MSG_RESULT(failed) else AC_MSG_RESULT(ok) fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then nm_file_list_spec='@' fi _LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], [Take the output of nm and produce a listing of raw symbols and C names]) _LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], [Transform the output of nm in a proper C declaration]) _LT_DECL([global_symbol_to_c_name_address], [lt_cv_sys_global_symbol_to_c_name_address], [1], [Transform the output of nm in a C name address pair]) _LT_DECL([global_symbol_to_c_name_address_lib_prefix], [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], [Transform the output of nm in a C name address pair when lib prefix is needed]) _LT_DECL([], [nm_file_list_spec], [1], [Specify filename containing input files for $NM]) ]) # _LT_CMD_GLOBAL_SYMBOLS # _LT_COMPILER_PIC([TAGNAME]) # --------------------------- m4_defun([_LT_COMPILER_PIC], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_wl, $1)= _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)= m4_if([$1], [CXX], [ # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else case $host_os in aix[[4-9]]*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; dgux*) case $cc_basename in ec++*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; ghcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; freebsd* | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' if test "$host_cpu" != ia64; then _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' fi ;; aCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in KCC*) # KAI C++ Compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; ecpc* ) # old Intel C++ for x86_64 which still supported -KPIC. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; icpc* ) # Intel C++, used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgCC* | pgcpp*) # Portland Group C++ compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL 8.0, 9.0 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' ;; *) ;; esac ;; netbsd*) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; cxx*) # Digital/Compaq C++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; lcc*) # Lucid _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; *) ;; esac ;; vxworks*) ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ], [ if test "$GCC" = yes; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker ' if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; hpux9* | hpux10* | hpux11*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC (with -KPIC) is the default. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # Lahey Fortran 8.1. lf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' ;; nagfor*) # NAG Fortran compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; ccc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All Alpha code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='' ;; *Sun\ F* | *Sun*Fortran*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; *Intel*\ [[CF]]*Compiler*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; *Portland\ Group*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; esac ;; newsos6) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All OSF/1 code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; rdos*) _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; solaris*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; *) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; esac ;; sunos4*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; unicos*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; uts4*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ]) case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" ;; esac AC_CACHE_CHECK([for $compiler option to produce PIC], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) _LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1) # # Check to make sure the PIC flag actually works. # if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works], [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)], [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [], [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in "" | " "*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;; esac], [_LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) fi _LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], [Additional compiler flags for building library objects]) _LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], [How to pass a linker flag through the compiler]) # # Check to make sure the static flag actually works. # wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\" _LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1), $lt_tmp_static_flag, [], [_LT_TAGVAR(lt_prog_compiler_static, $1)=]) _LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], [Compiler flag to prevent dynamic linking]) ])# _LT_COMPILER_PIC # _LT_LINKER_SHLIBS([TAGNAME]) # ---------------------------- # See if the linker supports building shared libraries. m4_defun([_LT_LINKER_SHLIBS], [AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) m4_if([$1], [CXX], [ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] case $host_os in aix[[4-9]]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm # Also, AIX nm treats weak defined symbols like other global defined # symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" ;; cygwin* | mingw* | cegcc*) case $cc_basename in cl*) _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] ;; esac ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac ], [ runpath_var= _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_cmds, $1)= _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(old_archive_from_new_cmds, $1)= _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)= _LT_TAGVAR(thread_safe_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list _LT_TAGVAR(include_expsyms, $1)= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. dnl Note also adjust exclude_expsyms for C++ above. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; esac _LT_TAGVAR(ld_shlibs, $1)=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test "$with_gnu_ld" = yes; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;; *\ \(GNU\ Binutils\)\ [[3-9]]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test "$lt_use_gnu_ld_interface" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi supports_anon_versioning=no case `$LD -v 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[[3-9]]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test "$tmp_diet" = no then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 _LT_TAGVAR(whole_archive_flag_spec, $1)= tmp_sharedflag='--shared' ;; xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi case $cc_basename in xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; sunos4*) _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then runpath_var= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. _LT_TAGVAR(hardcode_minus_L, $1)=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. _LT_TAGVAR(hardcode_direct, $1)=unsupported fi ;; aix[[4-9]]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm # Also, AIX nm treats weak defined symbols like other global # defined symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' if test "$GCC" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; bsdi[[45]]*) _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl*) # Native MSVC _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile="$lt_outputfile.exe" lt_tool_outputfile="$lt_tool_outputfile.exe" ;; esac~ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC wrapper _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' # FIXME: Should let the user specify the lib program. _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; hpux9*) if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; hpux10*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes fi ;; hpux11*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) m4_if($1, [], [ # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) _LT_LINKER_OPTION([if $CC understands -b], _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b], [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])], [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags']) ;; esac fi if test "$with_gnu_ld" = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol], [lt_cv_irix_exported_symbol], [save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" AC_LINK_IFELSE( [AC_LANG_SOURCE( [AC_LANG_CASE([C], [[int foo (void) { return 0; }]], [C++], [[int foo (void) { return 0; }]], [Fortran 77], [[ subroutine foo end]], [Fortran], [[ subroutine foo end]])])], [lt_cv_irix_exported_symbol=yes], [lt_cv_irix_exported_symbol=no]) LDFLAGS="$save_LDFLAGS"]) if test "$lt_cv_irix_exported_symbol" = yes; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' fi else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes _LT_TAGVAR(link_all_deplibs, $1)=yes ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; newsos6) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *nto* | *qnx*) ;; openbsd*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' else case $host_os in openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' ;; esac fi else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; solaris*) _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' if test "$GCC" = yes; then wlarc='${wl}' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='${wl}' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. GCC discards it without `$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test "$GCC" = yes; then _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' fi ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4) case $host_vendor in sni) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' _LT_TAGVAR(hardcode_direct, $1)=no ;; motorola) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4.3*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes _LT_TAGVAR(ld_shlibs, $1)=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(ld_shlibs, $1)=no ;; esac if test x$host_vendor = xsni; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym' ;; esac fi fi ]) AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld _LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl _LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl _LT_DECL([], [extract_expsyms_cmds], [2], [The commands to extract the exported symbol list from a shared archive]) # # Do we need to explicitly link libc? # case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in x|xyes) # Assume -lc should be added _LT_TAGVAR(archive_cmds_need_lc, $1)=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $_LT_TAGVAR(archive_cmds, $1) in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. AC_CACHE_CHECK([whether -lc should be explicitly linked in], [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1), [$RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if AC_TRY_EVAL(ac_compile) 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) _LT_TAGVAR(allow_undefined_flag, $1)= if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) then lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no else lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes fi _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* ]) _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1) ;; esac fi ;; esac _LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], [Whether or not to add -lc for building shared libraries]) _LT_TAGDECL([allow_libtool_libs_with_static_runtimes], [enable_shared_with_static_runtimes], [0], [Whether or not to disallow shared libs when runtime libs are static]) _LT_TAGDECL([], [export_dynamic_flag_spec], [1], [Compiler flag to allow reflexive dlopens]) _LT_TAGDECL([], [whole_archive_flag_spec], [1], [Compiler flag to generate shared objects directly from archives]) _LT_TAGDECL([], [compiler_needs_object], [1], [Whether the compiler copes with passing no objects directly]) _LT_TAGDECL([], [old_archive_from_new_cmds], [2], [Create an old-style archive from a shared archive]) _LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], [Create a temporary old-style archive to link instead of a shared archive]) _LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) _LT_TAGDECL([], [archive_expsym_cmds], [2]) _LT_TAGDECL([], [module_cmds], [2], [Commands used to build a loadable module if different from building a shared archive.]) _LT_TAGDECL([], [module_expsym_cmds], [2]) _LT_TAGDECL([], [with_gnu_ld], [1], [Whether we are building with GNU ld or not]) _LT_TAGDECL([], [allow_undefined_flag], [1], [Flag that allows shared libraries with undefined symbols to be built]) _LT_TAGDECL([], [no_undefined_flag], [1], [Flag that enforces no undefined symbols]) _LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], [Flag to hardcode $libdir into a binary during linking. This must work even if $libdir does not exist]) _LT_TAGDECL([], [hardcode_libdir_separator], [1], [Whether we need a single "-rpath" flag with a separated argument]) _LT_TAGDECL([], [hardcode_direct], [0], [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_direct_absolute], [0], [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the resulting binary and the resulting library dependency is "absolute", i.e impossible to change by setting ${shlibpath_var} if the library is relocated]) _LT_TAGDECL([], [hardcode_minus_L], [0], [Set to "yes" if using the -LDIR flag during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_shlibpath_var], [0], [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_automatic], [0], [Set to "yes" if building a shared library automatically hardcodes DIR into the library and all subsequent libraries and executables linked against it]) _LT_TAGDECL([], [inherit_rpath], [0], [Set to yes if linker adds runtime paths of dependent libraries to runtime path list]) _LT_TAGDECL([], [link_all_deplibs], [0], [Whether libtool must link a program against all its dependency libraries]) _LT_TAGDECL([], [always_export_symbols], [0], [Set to "yes" if exported symbols are required]) _LT_TAGDECL([], [export_symbols_cmds], [2], [The commands to list exported symbols]) _LT_TAGDECL([], [exclude_expsyms], [1], [Symbols that should not be listed in the preloaded symbols]) _LT_TAGDECL([], [include_expsyms], [1], [Symbols that must always be exported]) _LT_TAGDECL([], [prelink_cmds], [2], [Commands necessary for linking programs (against libraries) with templates]) _LT_TAGDECL([], [postlink_cmds], [2], [Commands necessary for finishing linking programs]) _LT_TAGDECL([], [file_list_spec], [1], [Specify filename containing input files]) dnl FIXME: Not yet implemented dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], dnl [Compiler flag to generate thread safe objects]) ])# _LT_LINKER_SHLIBS # _LT_LANG_C_CONFIG([TAG]) # ------------------------ # Ensure that the configuration variables for a C compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to `libtool'. m4_defun([_LT_LANG_C_CONFIG], [m4_require([_LT_DECL_EGREP])dnl lt_save_CC="$CC" AC_LANG_PUSH(C) # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' _LT_TAG_COMPILER # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) LT_SYS_DLOPEN_SELF _LT_CMD_STRIPLIB # Report which library types will actually be built AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_CONFIG($1) fi AC_LANG_POP CC="$lt_save_CC" ])# _LT_LANG_C_CONFIG # _LT_LANG_CXX_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a C++ compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to `libtool'. m4_defun([_LT_LANG_CXX_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then AC_PROG_CXXCPP else _lt_caught_CXX_error=yes fi AC_LANG_PUSH(C++) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the CXX compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_caught_CXX_error" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} CFLAGS=$CXXFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then # We don't want -fno-exception when compiling C++ code, so set the # no_builtin_flag separately if test "$GXX" = yes; then _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' else _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= fi if test "$GXX" = yes; then # Set up default GNU C++ configuration LT_PATH_LD # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test "$with_gnu_ld" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='${wl}' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) _LT_TAGVAR(ld_shlibs, $1)=yes case $host_os in aix3*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aix[[4-9]]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' if test "$GXX" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to # export. _LT_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an empty # executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared # libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; cygwin* | mingw* | pw32* | cegcc*) case $GXX,$cc_basename in ,cl* | no,cl*) # Native MSVC # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile="$lt_outputfile.exe" lt_tool_outputfile="$lt_tool_outputfile.exe" ;; esac~ func_to_tool_file "$lt_outputfile"~ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # g++ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; freebsd2.*) # C++ shared libraries reported to be fairly broken before # switch to ELF _LT_TAGVAR(ld_shlibs, $1)=no ;; freebsd-elf*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; freebsd* | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions _LT_TAGVAR(ld_shlibs, $1)=yes ;; gnu*) ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; hpux9*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; hpux10*|hpux11*) if test $with_gnu_ld = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) ;; *) _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then if test $with_gnu_ld = no; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib' fi fi _LT_TAGVAR(link_all_deplibs, $1)=yes ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc* | ecpc* ) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; esac _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ;; pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*) _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ $RANLIB $oldlib' _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; *) # Version 6 and above use weak symbols _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' ;; cxx*) # Compaq C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' ;; xl* | mpixl* | bgxl*) # IBM XL 8.0 on PPC, with GNU ld _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; esac ;; esac ;; lynxos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; m88k*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; *nto* | *qnx*) _LT_TAGVAR(ld_shlibs, $1)=yes ;; openbsd2*) # C++ shared libraries are fairly broken _LT_TAGVAR(ld_shlibs, $1)=no ;; openbsd*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi output_verbose_link_cmd=func_echo_all else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # the KAI C++ compiler. case $host in osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; esac ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; cxx*) case $host in osf3*) _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' ;; *) _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~ $RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' ;; esac _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' case $host in osf3*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(archive_cmds_need_lc,$1)=yes _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. # Supported since Solaris 2.6 (maybe 2.5.1?) _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' ;; esac fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~ '"$_LT_TAGVAR(old_archive_cmds, $1)" _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~ '"$_LT_TAGVAR(reload_cmds, $1)" ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_TAGVAR(GCC, $1)="$GXX" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld fi # test "$_lt_caught_CXX_error" != yes AC_LANG_POP ])# _LT_LANG_CXX_CONFIG # _LT_FUNC_STRIPNAME_CNF # ---------------------- # func_stripname_cnf prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). # # This function is identical to the (non-XSI) version of func_stripname, # except this one can be used by m4 code that may be executed by configure, # rather than the libtool script. m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl AC_REQUIRE([_LT_DECL_SED]) AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH]) func_stripname_cnf () { case ${2} in .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; esac } # func_stripname_cnf ])# _LT_FUNC_STRIPNAME_CNF # _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) # --------------------------------- # Figure out "hidden" library dependencies from verbose # compiler output when linking a shared library. # Parse the compiler output and extract the necessary # objects, libraries and library flags. m4_defun([_LT_SYS_HIDDEN_LIBDEPS], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl # Dependencies to place before and after the object being linked: _LT_TAGVAR(predep_objects, $1)= _LT_TAGVAR(postdep_objects, $1)= _LT_TAGVAR(predeps, $1)= _LT_TAGVAR(postdeps, $1)= _LT_TAGVAR(compiler_lib_search_path, $1)= dnl we can't use the lt_simple_compile_test_code here, dnl because it contains code intended for an executable, dnl not a library. It's possible we should let each dnl tag define a new lt_????_link_test_code variable, dnl but it's only used here... m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF int a; void foo (void) { a = 0; } _LT_EOF ], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF class Foo { public: Foo (void) { a = 0; } private: int a; }; _LT_EOF ], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer*4 a a=0 return end _LT_EOF ], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer a a=0 return end _LT_EOF ], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF public class foo { private int a; public void bar (void) { a = 0; } }; _LT_EOF ], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF package foo func foo() { } _LT_EOF ]) _lt_libdeps_save_CFLAGS=$CFLAGS case "$CC $CFLAGS " in #( *\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; *\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; *\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; esac dnl Parse the compiler output and extract the necessary dnl objects, libraries and library flags. if AC_TRY_EVAL(ac_compile); then # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do case ${prev}${p} in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test $p = "-L" || test $p = "-R"; then prev=$p continue fi # Expand the sysroot to ease extracting the directories later. if test -z "$prev"; then case $p in -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; esac fi case $p in =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; esac if test "$pre_test_object_deps_done" = no; then case ${prev} in -L | -R) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}" else _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}" fi ;; # The "-l" case would never come before the object being # linked, so don't bother handling this case. esac else if test -z "$_LT_TAGVAR(postdeps, $1)"; then _LT_TAGVAR(postdeps, $1)="${prev}${p}" else _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}" fi fi prev= ;; *.lto.$objext) ;; # Ignore GCC LTO objects *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test "$pre_test_object_deps_done" = no; then if test -z "$_LT_TAGVAR(predep_objects, $1)"; then _LT_TAGVAR(predep_objects, $1)="$p" else _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" fi else if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then _LT_TAGVAR(postdep_objects, $1)="$p" else _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling $1 test program" fi $RM -f confest.$objext CFLAGS=$_lt_libdeps_save_CFLAGS # PORTME: override above test on systems where it is broken m4_if([$1], [CXX], [case $host_os in interix[[3-9]]*) # Interix 3.5 installs completely hosed .la files for C++, so rather than # hack all around it, let's just trust "g++" to DTRT. _LT_TAGVAR(predep_objects,$1)= _LT_TAGVAR(postdep_objects,$1)= _LT_TAGVAR(postdeps,$1)= ;; linux*) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac if test "$solaris_use_stlport4" != yes; then _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' fi ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac # Adding this requires a known-good setup of shared libraries for # Sun compiler versions before 5.6, else PIC objects from an old # archive will be linked into the output, leading to subtle bugs. if test "$solaris_use_stlport4" != yes; then _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' fi ;; esac ;; esac ]) case " $_LT_TAGVAR(postdeps, $1) " in *" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; esac _LT_TAGVAR(compiler_lib_search_dirs, $1)= if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` fi _LT_TAGDECL([], [compiler_lib_search_dirs], [1], [The directories searched by this compiler when creating a shared library]) _LT_TAGDECL([], [predep_objects], [1], [Dependencies to place before and after the objects being linked to create a shared library]) _LT_TAGDECL([], [postdep_objects], [1]) _LT_TAGDECL([], [predeps], [1]) _LT_TAGDECL([], [postdeps], [1]) _LT_TAGDECL([], [compiler_lib_search_path], [1], [The library search path used internally by the compiler when linking a shared library]) ])# _LT_SYS_HIDDEN_LIBDEPS # _LT_LANG_F77_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a Fortran 77 compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_F77_CONFIG], [AC_LANG_PUSH(Fortran 77) if test -z "$F77" || test "X$F77" = "Xno"; then _lt_disable_F77=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for f77 test sources. ac_ext=f # Object file extension for compiled f77 test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the F77 compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_disable_F77" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${F77-"f77"} CFLAGS=$FFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) GCC=$G77 if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)="$G77" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC="$lt_save_CC" CFLAGS="$lt_save_CFLAGS" fi # test "$_lt_disable_F77" != yes AC_LANG_POP ])# _LT_LANG_F77_CONFIG # _LT_LANG_FC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for a Fortran compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_FC_CONFIG], [AC_LANG_PUSH(Fortran) if test -z "$FC" || test "X$FC" = "Xno"; then _lt_disable_FC=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for fc test sources. ac_ext=${ac_fc_srcext-f} # Object file extension for compiled fc test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the FC compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_disable_FC" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${FC-"f95"} CFLAGS=$FCFLAGS compiler=$CC GCC=$ac_cv_fc_compiler_gnu _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS fi # test "$_lt_disable_FC" != yes AC_LANG_POP ])# _LT_LANG_FC_CONFIG # _LT_LANG_GCJ_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Java Compiler compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_GCJ_CONFIG], [AC_REQUIRE([LT_PROG_GCJ])dnl AC_LANG_SAVE # Source file extension for Java test sources. ac_ext=java # Object file extension for compiled Java test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="class foo {}" # Code to be used in simple link tests lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GCJ-"gcj"} CFLAGS=$GCJFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)="$LD" _LT_CC_BASENAME([$compiler]) # GCJ did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GCJ_CONFIG # _LT_LANG_GO_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Go compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_GO_CONFIG], [AC_REQUIRE([LT_PROG_GO])dnl AC_LANG_SAVE # Source file extension for Go test sources. ac_ext=go # Object file extension for compiled Go test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="package main; func main() { }" # Code to be used in simple link tests lt_simple_link_test_code='package main; func main() { }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GOC-"gccgo"} CFLAGS=$GOFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)="$LD" _LT_CC_BASENAME([$compiler]) # Go did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GO_CONFIG # _LT_LANG_RC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for the Windows resource compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_RC_CONFIG], [AC_REQUIRE([LT_PROG_RC])dnl AC_LANG_SAVE # Source file extension for RC test sources. ac_ext=rc # Object file extension for compiled RC test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' # Code to be used in simple link tests lt_simple_link_test_code="$lt_simple_compile_test_code" # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC= CC=${RC-"windres"} CFLAGS= compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes if test -n "$compiler"; then : _LT_CONFIG($1) fi GCC=$lt_save_GCC AC_LANG_RESTORE CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_RC_CONFIG # LT_PROG_GCJ # ----------- AC_DEFUN([LT_PROG_GCJ], [m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], [AC_CHECK_TOOL(GCJ, gcj,) test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" AC_SUBST(GCJFLAGS)])])[]dnl ]) # Old name: AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_GCJ], []) # LT_PROG_GO # ---------- AC_DEFUN([LT_PROG_GO], [AC_CHECK_TOOL(GOC, gccgo,) ]) # LT_PROG_RC # ---------- AC_DEFUN([LT_PROG_RC], [AC_CHECK_TOOL(RC, windres,) ]) # Old name: AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_RC], []) # _LT_DECL_EGREP # -------------- # If we don't have a new enough Autoconf to choose the best grep # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_EGREP], [AC_REQUIRE([AC_PROG_EGREP])dnl AC_REQUIRE([AC_PROG_FGREP])dnl test -z "$GREP" && GREP=grep _LT_DECL([], [GREP], [1], [A grep program that handles long lines]) _LT_DECL([], [EGREP], [1], [An ERE matcher]) _LT_DECL([], [FGREP], [1], [A literal string matcher]) dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too AC_SUBST([GREP]) ]) # _LT_DECL_OBJDUMP # -------------- # If we don't have a new enough Autoconf to choose the best objdump # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_OBJDUMP], [AC_CHECK_TOOL(OBJDUMP, objdump, false) test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) AC_SUBST([OBJDUMP]) ]) # _LT_DECL_DLLTOOL # ---------------- # Ensure DLLTOOL variable is set. m4_defun([_LT_DECL_DLLTOOL], [AC_CHECK_TOOL(DLLTOOL, dlltool, false) test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program]) AC_SUBST([DLLTOOL]) ]) # _LT_DECL_SED # ------------ # Check for a fully-functional sed program, that truncates # as few characters as possible. Prefer GNU sed if found. m4_defun([_LT_DECL_SED], [AC_PROG_SED test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" _LT_DECL([], [SED], [1], [A sed program that does not truncate output]) _LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"], [Sed that helps us avoid accidentally triggering echo(1) options like -n]) ])# _LT_DECL_SED m4_ifndef([AC_PROG_SED], [ ############################################################ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_SED. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # ############################################################ m4_defun([AC_PROG_SED], [AC_MSG_CHECKING([for a sed that does not truncate output]) AC_CACHE_VAL(lt_cv_path_SED, [# Loop through the user's path and test for sed and gsed. # Then use that list of sed's as ones to test for truncation. as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for lt_ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" fi done done done IFS=$as_save_IFS lt_ac_max=0 lt_ac_count=0 # Add /usr/xpg4/bin/sed as it is typically found on Solaris # along with /bin/sed that truncates output. for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do test ! -f $lt_ac_sed && continue cat /dev/null > conftest.in lt_ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >conftest.in # Check for GNU sed and select it if it is found. if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then lt_cv_path_SED=$lt_ac_sed break fi while true; do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo >>conftest.nl $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break cmp -s conftest.out conftest.nl || break # 10000 chars as input seems more than enough test $lt_ac_count -gt 10 && break lt_ac_count=`expr $lt_ac_count + 1` if test $lt_ac_count -gt $lt_ac_max; then lt_ac_max=$lt_ac_count lt_cv_path_SED=$lt_ac_sed fi done done ]) SED=$lt_cv_path_SED AC_SUBST([SED]) AC_MSG_RESULT([$SED]) ])#AC_PROG_SED ])#m4_ifndef # Old name: AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_SED], []) # _LT_CHECK_SHELL_FEATURES # ------------------------ # Find out whether the shell is Bourne or XSI compatible, # or has some other useful features. m4_defun([_LT_CHECK_SHELL_FEATURES], [AC_MSG_CHECKING([whether the shell understands some XSI constructs]) # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c" test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ = c,a/b,b/c, \ && eval 'test $(( 1 + 1 )) -eq 2 \ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ && xsi_shell=yes AC_MSG_RESULT([$xsi_shell]) _LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell']) AC_MSG_CHECKING([whether the shell understands "+="]) lt_shell_append=no ( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \ >/dev/null 2>&1 \ && lt_shell_append=yes AC_MSG_RESULT([$lt_shell_append]) _LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append']) if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi _LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac _LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl _LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl ])# _LT_CHECK_SHELL_FEATURES # _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY) # ------------------------------------------------------ # In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and # '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY. m4_defun([_LT_PROG_FUNCTION_REPLACE], [dnl { sed -e '/^$1 ()$/,/^} # $1 /c\ $1 ()\ {\ m4_bpatsubsts([$2], [$], [\\], [^\([ ]\)], [\\\1]) } # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: ]) # _LT_PROG_REPLACE_SHELLFNS # ------------------------- # Replace existing portable implementations of several shell functions with # equivalent extended shell implementations where those features are available.. m4_defun([_LT_PROG_REPLACE_SHELLFNS], [if test x"$xsi_shell" = xyes; then _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac]) _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl func_basename_result="${1##*/}"]) _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac func_basename_result="${1##*/}"]) _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are # positional parameters, so assign one to ordinary parameter first. func_stripname_result=${3} func_stripname_result=${func_stripname_result#"${1}"} func_stripname_result=${func_stripname_result%"${2}"}]) _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl func_split_long_opt_name=${1%%=*} func_split_long_opt_arg=${1#*=}]) _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl func_split_short_opt_arg=${1#??} func_split_short_opt_name=${1%"$func_split_short_opt_arg"}]) _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl case ${1} in *.lo) func_lo2o_result=${1%.lo}.${objext} ;; *) func_lo2o_result=${1} ;; esac]) _LT_PROG_FUNCTION_REPLACE([func_xform], [ func_xform_result=${1%.*}.lo]) _LT_PROG_FUNCTION_REPLACE([func_arith], [ func_arith_result=$(( $[*] ))]) _LT_PROG_FUNCTION_REPLACE([func_len], [ func_len_result=${#1}]) fi if test x"$lt_shell_append" = xyes; then _LT_PROG_FUNCTION_REPLACE([func_append], [ eval "${1}+=\\${2}"]) _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl func_quote_for_eval "${2}" dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \ eval "${1}+=\\\\ \\$func_quote_for_eval_result"]) # Save a `func_append' function call where possible by direct use of '+=' sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: else # Save a `func_append' function call even when '+=' is not available sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: fi if test x"$_lt_function_replace_fail" = x":"; then AC_MSG_WARN([Unable to substitute extended shell functions in $ofile]) fi ]) # _LT_PATH_CONVERSION_FUNCTIONS # ----------------------------- # Determine which file name conversion functions should be used by # func_to_host_file (and, implicitly, by func_to_host_path). These are needed # for certain cross-compile configurations and native mingw. m4_defun([_LT_PATH_CONVERSION_FUNCTIONS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_MSG_CHECKING([how to convert $build file names to $host format]) AC_CACHE_VAL(lt_cv_to_host_file_cmd, [case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac ]) to_host_file_cmd=$lt_cv_to_host_file_cmd AC_MSG_RESULT([$lt_cv_to_host_file_cmd]) _LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd], [0], [convert $build file names to $host format])dnl AC_MSG_CHECKING([how to convert $build file names to toolchain format]) AC_CACHE_VAL(lt_cv_to_tool_file_cmd, [#assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac ]) to_tool_file_cmd=$lt_cv_to_tool_file_cmd AC_MSG_RESULT([$lt_cv_to_tool_file_cmd]) _LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd], [0], [convert $build files to toolchain format])dnl ])# _LT_PATH_CONVERSION_FUNCTIONS libcmis-0.4.1/configure0000755000175000001440000225360212200457433011774 00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69 for libcmis 0.4.1. # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 as_fn_exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" SHELL=${CONFIG_SHELL-/bin/sh} test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME='libcmis' PACKAGE_TARNAME='libcmis' PACKAGE_VERSION='0.4.1' PACKAGE_STRING='libcmis 0.4.1' PACKAGE_BUGREPORT='' PACKAGE_URL='' # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS BOOST_PROGRAM_OPTIONS_LIBS BOOST_PROGRAM_OPTIONS_LDFLAGS BOOST_DATE_TIME_LIBS BOOST_DATE_TIME_LDFLAGS BOOST_CPPFLAGS DISTCHECK_CONFIGURE_FLAGS BOOST_ROOT CPPUNIT_LIBS CPPUNIT_CFLAGS XML2_LIBS XML2_CFLAGS CURL_LIBS CURL_CFLAGS PKG_CONFIG_LIBDIR PKG_CONFIG_PATH PKG_CONFIG ENABLE_CPPCHECK_FALSE ENABLE_CPPCHECK_TRUE CPPCHECK WITH_LIBCMIS_MAN_FALSE WITH_LIBCMIS_MAN_TRUE DOCBOOK2MAN OS_WIN32_FALSE OS_WIN32_TRUE CXXCPP OTOOL64 OTOOL LIPO NMEDIT DSYMUTIL MANIFEST_TOOL RANLIB ac_ct_AR AR DLLTOOL OBJDUMP NM ac_ct_DUMPBIN DUMPBIN LD FGREP EGREP GREP SED host_os host_vendor host_cpu host build_os build_vendor build_cpu build LIBTOOL LN_S am__fastdepCXX_FALSE am__fastdepCXX_TRUE CXXDEPMODE ac_ct_CXX CXXFLAGS CXX CPP am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__quote am__include DEPDIR OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC SRCDIR LIBCMIS_API_VERSION ENABLE_LONG_TESTS_FALSE ENABLE_LONG_TESTS_TRUE ENABLE_TESTS_FALSE ENABLE_TESTS_TRUE ENABLE_CLIENT_FALSE ENABLE_CLIENT_TRUE AM_BACKSLASH AM_DEFAULT_VERBOSITY AM_DEFAULT_V AM_V am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking enable_silent_rules enable_client enable_tests enable_long_tests enable_dependency_tracking enable_shared enable_static with_pic enable_fast_install with_gnu_ld with_sysroot enable_libtool_lock with_man enable_werror with_boost enable_static_boost ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP CXX CXXFLAGS CCC CXXCPP PKG_CONFIG PKG_CONFIG_PATH PKG_CONFIG_LIBDIR CURL_CFLAGS CURL_LIBS XML2_CFLAGS XML2_LIBS CPPUNIT_CFLAGS CPPUNIT_LIBS BOOST_ROOT' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures libcmis 0.4.1 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/libcmis] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of libcmis 0.4.1:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-silent-rules less verbose build output (undo: "make V=1") --disable-silent-rules verbose build output (undo: "make V=0") --disable-client Compile only the library, not the client tool --disable-tests Do not build the unit tests --disable-long-tests Do not build the unit tests needing to start a server --enable-dependency-tracking do not reject slow dependency extractors --disable-dependency-tracking speeds up one-time build --enable-shared[=PKGS] build shared libraries [default=yes] --enable-static[=PKGS] build static libraries [default=yes] --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) --disable-werror Treat all warnings as errors, usefull for development --enable-static-boost Prefer the static boost libraries over the shared ones [no] Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use both] --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-sysroot=DIR Search for dependent libraries within DIR (or the compiler's sysroot if not specified). --without-man Do not build manpage --with-boost=DIR prefix of Boost [guess] Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor CXX C++ compiler command CXXFLAGS C++ compiler flags CXXCPP C++ preprocessor PKG_CONFIG path to pkg-config utility PKG_CONFIG_PATH directories to add to pkg-config's search path PKG_CONFIG_LIBDIR path overriding pkg-config's built-in search path CURL_CFLAGS C compiler flags for CURL, overriding pkg-config CURL_LIBS linker flags for CURL, overriding pkg-config XML2_CFLAGS C compiler flags for XML2, overriding pkg-config XML2_LIBS linker flags for XML2, overriding pkg-config CPPUNIT_CFLAGS C compiler flags for CPPUNIT, overriding pkg-config CPPUNIT_LIBS linker flags for CPPUNIT, overriding pkg-config BOOST_ROOT Location of Boost installation Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to the package provider. _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF libcmis configure 0.4.1 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp # ac_fn_cxx_try_compile LINENO # ---------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_compile # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile # ac_fn_c_try_run LINENO # ---------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes # that executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $2 /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $2 (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$2 || defined __stub___$2 choke me #endif int main () { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func # ac_fn_cxx_try_cpp LINENO # ------------------------ # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_cpp # ac_fn_cxx_try_link LINENO # ------------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_link # ac_fn_cxx_check_header_mongrel LINENO HEADER VAR INCLUDES # --------------------------------------------------------- # Tests whether HEADER exists, giving a warning if it cannot be compiled using # the include files in INCLUDES and setting the cache variable VAR # accordingly. ac_fn_cxx_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if eval \${$3+:} false; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 $as_echo_n "checking $2 usability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_header_compiler=yes else ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 $as_echo_n "checking $2 presence... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <$2> _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : ac_header_preproc=yes else ac_header_preproc=no fi rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in #(( yes:no: ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; no:yes:* ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_cxx_check_header_mongrel # ac_fn_cxx_check_type LINENO TYPE VAR INCLUDES # --------------------------------------------- # Tests whether TYPE exists after having included INCLUDES, setting cache # variable VAR accordingly. ac_fn_cxx_check_type () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=no" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { if (sizeof ($2)) return 0; ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { if (sizeof (($2))) return 0; ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : else eval "$3=yes" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_cxx_check_type cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by libcmis $as_me 0.4.1, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu am__api_version='1.13' ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in #(( ./ | .// | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 $as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi if test "$2" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$2" = conftest.file ) then # Ok. : else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi rm -f conftest.file test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} fi if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if ${ac_cv_path_mkdir+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi test -d ./--version && rmdir ./--version if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. MKDIR_P="$ac_install_sh -d" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AWK+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null # Check whether --enable-silent-rules was given. if test "${enable_silent_rules+set}" = set; then : enableval=$enable_silent_rules; fi case $enable_silent_rules in # ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=1;; esac am_make=${MAKE-make} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 $as_echo_n "checking whether $am_make supports nested variables... " >&6; } if ${am_cv_make_support_nested_variables+:} false; then : $as_echo_n "(cached) " >&6 else if $as_echo 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 $as_echo "$am_cv_make_support_nested_variables" >&6; } if test $am_cv_make_support_nested_variables = yes; then AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AM_BACKSLASH='\' if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='libcmis' VERSION='0.4.1' cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # mkdir_p='$(MKDIR_P)' # We need awk for the "check" target. The system "awk" is bad on # some platforms. # Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AMTAR='$${TAR-tar}' # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar pax cpio none' am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' # Check whether --enable-silent-rules was given. if test "${enable_silent_rules+set}" = set; then : enableval=$enable_silent_rules; fi case $enable_silent_rules in # ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=0;; esac am_make=${MAKE-make} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 $as_echo_n "checking whether $am_make supports nested variables... " >&6; } if ${am_cv_make_support_nested_variables+:} false; then : $as_echo_n "(cached) " >&6 else if $as_echo 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 $as_echo "$am_cv_make_support_nested_variables" >&6; } if test $am_cv_make_support_nested_variables = yes; then AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AM_BACKSLASH='\' # Check whether --enable-client was given. if test "${enable_client+set}" = set; then : enableval=$enable_client; enable_client=$enableval else enable_client=yes fi if test "x$enable_client" != "xno"; then ENABLE_CLIENT_TRUE= ENABLE_CLIENT_FALSE='#' else ENABLE_CLIENT_TRUE='#' ENABLE_CLIENT_FALSE= fi # Check whether --enable-tests was given. if test "${enable_tests+set}" = set; then : enableval=$enable_tests; enable_tests="$enableval" else enable_tests=yes fi if test "x$enable_tests" != "xno"; then ENABLE_TESTS_TRUE= ENABLE_TESTS_FALSE='#' else ENABLE_TESTS_TRUE='#' ENABLE_TESTS_FALSE= fi if test "x$enable_tests" != "xno"; then : # Check whether --enable-long-tests was given. if test "${enable_long_tests+set}" = set; then : enableval=$enable_long_tests; enable_long_tests="$enableval" else enable_long_tests=yes fi else enable_long_tests=no fi if test "x$enable_long_tests" != "xno"; then ENABLE_LONG_TESTS_TRUE= ENABLE_LONG_TESTS_FALSE='#' else ENABLE_LONG_TESTS_TRUE='#' ENABLE_LONG_TESTS_FALSE= fi LIBCMIS_API_VERSION=0.4 for top_builddir in . .. ../.. $ac_auxdir $ac_auxdir/..; do test -f $top_builddir/configure && break done SRCDIR=$srcdir ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu # Checks for programs. ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi if test -z "$ac_file"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 $as_echo_n "checking for style of include used by $am_make... " >&6; } am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from 'make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 $as_echo "$_am_result" >&6; } rm -f confinc confmf # Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then : enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test -z "$CXX"; then if test -n "$CCC"; then CXX=$CCC else if test -n "$ac_tool_prefix"; then for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CXX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 $as_echo "$CXX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CXX" && break done fi if test -z "$CXX"; then ac_ct_CXX=$CXX for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CXX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CXX="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 $as_echo "$ac_ct_CXX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CXX" && break done if test "x$ac_ct_CXX" = x; then CXX="g++" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CXX=$ac_ct_CXX fi fi fi fi # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 $as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } if ${ac_cv_cxx_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 $as_echo "$ac_cv_cxx_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GXX=yes else GXX= fi ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 $as_echo_n "checking whether $CXX accepts -g... " >&6; } if ${ac_cv_prog_cxx_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_cxx_werror_flag=$ac_cxx_werror_flag ac_cxx_werror_flag=yes ac_cv_prog_cxx_g=no CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_prog_cxx_g=yes else CXXFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : else ac_cxx_werror_flag=$ac_save_cxx_werror_flag CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_prog_cxx_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cxx_werror_flag=$ac_save_cxx_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 $as_echo "$ac_cv_prog_cxx_g" >&6; } if test "$ac_test_CXXFLAGS" = set; then CXXFLAGS=$ac_save_CXXFLAGS elif test $ac_cv_prog_cxx_g = yes; then if test "$GXX" = yes; then CXXFLAGS="-g -O2" else CXXFLAGS="-g" fi else if test "$GXX" = yes; then CXXFLAGS="-O2" else CXXFLAGS= fi fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu depcc="$CXX" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CXX_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CXX_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CXX_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CXX_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5 $as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; } CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then am__fastdepCXX_TRUE= am__fastdepCXX_FALSE='#' else am__fastdepCXX_TRUE='#' am__fastdepCXX_FALSE= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 $as_echo_n "checking whether ln -s works... " >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 $as_echo "no, using $LN_S" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi case `pwd` in *\ * | *\ *) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 $as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; esac macro_version='2.4.2' macro_revision='1.3337' ltmain="$ac_aux_dir/ltmain.sh" # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 $as_echo_n "checking build system type... " >&6; } if ${ac_cv_build+:} false; then : $as_echo_n "(cached) " >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 $as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 $as_echo_n "checking host system type... " >&6; } if ${ac_cv_host+:} false; then : $as_echo_n "(cached) " >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 $as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac # Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\(["`$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 $as_echo_n "checking how to print strings... " >&6; } # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "" } case "$ECHO" in printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 $as_echo "printf" >&6; } ;; print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 $as_echo "print -r" >&6; } ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 $as_echo "cat" >&6; } ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 $as_echo_n "checking for a sed that does not truncate output... " >&6; } if ${ac_cv_path_SED+:} false; then : $as_echo_n "(cached) " >&6 else ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" done echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed { ac_script=; unset ac_script;} if test -z "$SED"; then ac_path_SED_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_SED" || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED case `"$ac_path_SED" --version 2>&1` in *GNU*) ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo '' >> "conftest.nl" "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_SED_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_SED="$ac_path_SED" ac_path_SED_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_SED_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_SED"; then as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 fi else ac_cv_path_SED=$SED fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 $as_echo "$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 $as_echo_n "checking for fgrep... " >&6; } if ${ac_cv_path_FGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 then ac_cv_path_FGREP="$GREP -F" else if test -z "$FGREP"; then ac_path_FGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in fgrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_FGREP" || continue # Check for GNU ac_path_FGREP and select it if it is found. # Check for GNU $ac_path_FGREP case `"$ac_path_FGREP" --version 2>&1` in *GNU*) ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'FGREP' >> "conftest.nl" "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_FGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_FGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_FGREP"; then as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_FGREP=$FGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 $as_echo "$ac_cv_path_FGREP" >&6; } FGREP="$ac_cv_path_FGREP" test -z "$GREP" && GREP=grep # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then : withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 $as_echo_n "checking for ld used by $CC... " >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi if ${lt_cv_path_LD+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 $as_echo "$LD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if ${lt_cv_prog_gnu_ld+:} false; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 $as_echo "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 $as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } if ${lt_cv_path_NM+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else lt_nm_to_check="${ac_tool_prefix}nm" if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. tmp_nm="$ac_dir/$lt_tmp_nm" if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS="$lt_save_ifs" done : ${lt_cv_path_NM=no} fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 $as_echo "$lt_cv_path_NM" >&6; } if test "$lt_cv_path_NM" != "no"; then NM="$lt_cv_path_NM" else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else if test -n "$ac_tool_prefix"; then for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DUMPBIN"; then ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DUMPBIN=$ac_cv_prog_DUMPBIN if test -n "$DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 $as_echo "$DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$DUMPBIN" && break done fi if test -z "$DUMPBIN"; then ac_ct_DUMPBIN=$DUMPBIN for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DUMPBIN"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN if test -n "$ac_ct_DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 $as_echo "$ac_ct_DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_DUMPBIN" && break done if test "x$ac_ct_DUMPBIN" = x; then DUMPBIN=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DUMPBIN=$ac_ct_DUMPBIN fi fi case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols" ;; *) DUMPBIN=: ;; esac fi if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" fi fi test -z "$NM" && NM=nm { $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 $as_echo_n "checking the name lister ($NM) interface... " >&6; } if ${lt_cv_nm_interface+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 $as_echo "$lt_cv_nm_interface" >&6; } # find the maximum length of command line arguments { $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 $as_echo_n "checking the maximum length of command line arguments... " >&6; } if ${lt_cv_sys_max_cmd_len+:} false; then : $as_echo_n "(cached) " >&6 else i=0 teststring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8 ; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac fi if test -n $lt_cv_sys_max_cmd_len ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 $as_echo "$lt_cv_sys_max_cmd_len" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 $as_echo "none" >&6; } fi max_cmd_len=$lt_cv_sys_max_cmd_len : ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5 $as_echo_n "checking whether the shell understands some XSI constructs... " >&6; } # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c" test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ = c,a/b,b/c, \ && eval 'test $(( 1 + 1 )) -eq 2 \ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ && xsi_shell=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5 $as_echo "$xsi_shell" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5 $as_echo_n "checking whether the shell understands \"+=\"... " >&6; } lt_shell_append=no ( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \ >/dev/null 2>&1 \ && lt_shell_append=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5 $as_echo "$lt_shell_append" >&6; } if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 $as_echo_n "checking how to convert $build file names to $host format... " >&6; } if ${lt_cv_to_host_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac fi to_host_file_cmd=$lt_cv_to_host_file_cmd { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 $as_echo "$lt_cv_to_host_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 $as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } if ${lt_cv_to_tool_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else #assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac fi to_tool_file_cmd=$lt_cv_to_tool_file_cmd { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 $as_echo "$lt_cv_to_tool_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 $as_echo_n "checking for $LD option to reload object files... " >&6; } if ${lt_cv_ld_reload_flag+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_reload_flag='-r' fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 $as_echo "$lt_cv_ld_reload_flag" >&6; } reload_flag=$lt_cv_ld_reload_flag case $reload_flag in "" | " "*) ;; *) reload_flag=" $reload_flag" ;; esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in cygwin* | mingw* | pw32* | cegcc*) if test "$GCC" != yes; then reload_cmds=false fi ;; darwin*) if test "$GCC" = yes; then reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' else reload_cmds='$LD$reload_flag -o $output$reload_objs' fi ;; esac if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. set dummy ${ac_tool_prefix}objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OBJDUMP"; then ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 $as_echo "$OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OBJDUMP"; then ac_ct_OBJDUMP=$OBJDUMP # Extract the first word of "objdump", so it can be a program name with args. set dummy objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OBJDUMP"; then ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OBJDUMP="objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 $as_echo "$ac_ct_OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OBJDUMP" = x; then OBJDUMP="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OBJDUMP=$ac_ct_OBJDUMP fi else OBJDUMP="$ac_cv_prog_OBJDUMP" fi test -z "$OBJDUMP" && OBJDUMP=objdump { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 $as_echo_n "checking how to recognize dependent libraries... " >&6; } if ${lt_cv_deplibs_check_method+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # `unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # which responds to the $file_magic_cmd with a given extended regex. # If you have `file' or equivalent on your system and you're not sure # whether `pass_all' will *always* work, you probably want this one. case $host_os in aix[4-9]*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi[45]*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='/usr/bin/file -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' ;; mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin. if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; gnu*) lt_cv_deplibs_check_method=pass_all ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]' lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[3-9]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) lt_cv_deplibs_check_method=pass_all ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 $as_echo "$lt_cv_deplibs_check_method" >&6; } file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ac_tool_prefix}dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DLLTOOL"; then ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 $as_echo "$DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DLLTOOL"; then ac_ct_DLLTOOL=$DLLTOOL # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DLLTOOL"; then ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DLLTOOL="dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL if test -n "$ac_ct_DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 $as_echo "$ac_ct_DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DLLTOOL" = x; then DLLTOOL="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DLLTOOL=$ac_ct_DLLTOOL fi else DLLTOOL="$ac_cv_prog_DLLTOOL" fi test -z "$DLLTOOL" && DLLTOOL=dlltool { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 $as_echo_n "checking how to associate runtime and link libraries... " >&6; } if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh # decide which to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd="$ECHO" ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 $as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO if test -n "$ac_tool_prefix"; then for ac_prog in ar do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AR="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 $as_echo "$AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AR" && break done fi if test -z "$AR"; then ac_ct_AR=$AR for ac_prog in ar do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 $as_echo "$ac_ct_AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_AR" && break done if test "x$ac_ct_AR" = x; then AR="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR fi fi : ${AR=ar} : ${AR_FLAGS=cru} { $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 $as_echo_n "checking for archiver @FILE support... " >&6; } if ${lt_cv_ar_at_file+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ar_at_file=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test "$ac_status" -eq 0; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test "$ac_status" -ne 0; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 $as_echo "$lt_cv_ar_at_file" >&6; } if test "x$lt_cv_ar_at_file" = xno; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi test -z "$STRIP" && STRIP=: if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 $as_echo "$RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 $as_echo "$ac_ct_RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi test -z "$RANLIB" && RANLIB=: # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Check for command to grab the raw symbol name followed by C symbol from nm. { $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 $as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } if ${lt_cv_sys_global_symbol_pipe+:} false; then : $as_echo_n "(cached) " >&6 else # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[BCDEGRST]' # Regexp to match symbols that can be accessed directly from C. sympat='\([_A-Za-z][_A-Za-z0-9]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[BCDT]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[ABCDGISTW]' ;; hpux*) if test "$host_cpu" = ia64; then symcode='[ABCDEGRST]' fi ;; irix* | nonstopux*) symcode='[BCDEGRST]' ;; osf*) symcode='[BCDEGQRST]' ;; solaris*) symcode='[BDRT]' ;; sco3.2v5*) symcode='[DT]' ;; sysv4.2uw2*) symcode='[DT]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[ABDT]' ;; sysv4) symcode='[DFNSTU]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[ABCDGIRSTW]' ;; esac # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function # and D for any global variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK '"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ " {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ " s[1]~/^[@?]/{print s[1], s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Now try to grab the symbols. nlist=conftest.nm if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined(__osf__) /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&5 fi else echo "cannot find nm_test_var in $nlist" >&5 fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 fi else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done fi if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 $as_echo "failed" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "ok" >&6; } fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then nm_file_list_spec='@' fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 $as_echo_n "checking for sysroot... " >&6; } # Check whether --with-sysroot was given. if test "${with_sysroot+set}" = set; then : withval=$with_sysroot; else with_sysroot=no fi lt_sysroot= case ${with_sysroot} in #( yes) if test "$GCC" = yes; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5 $as_echo "${with_sysroot}" >&6; } as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 $as_echo "${lt_sysroot:-no}" >&6; } # Check whether --enable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then : enableval=$enable_libtool_lock; fi test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '#line '$LINENO' "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; ppc*-*linux*|powerpc*-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 $as_echo_n "checking whether the C compiler needs -belf... " >&6; } if ${lt_cv_cc_needs_belf+:} false; then : $as_echo_n "(cached) " >&6 else ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_cc_needs_belf=yes else lt_cv_cc_needs_belf=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 $as_echo "$lt_cv_cc_needs_belf" >&6; } if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; *-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD="${LD-ld}_sol2" fi ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks="$enable_libtool_lock" if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. set dummy ${ac_tool_prefix}mt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$MANIFEST_TOOL"; then ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL if test -n "$MANIFEST_TOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 $as_echo "$MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_MANIFEST_TOOL"; then ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL # Extract the first word of "mt", so it can be a program name with args. set dummy mt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_MANIFEST_TOOL"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL if test -n "$ac_ct_MANIFEST_TOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 $as_echo "$ac_ct_MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_MANIFEST_TOOL" = x; then MANIFEST_TOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL fi else MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" fi test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 $as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } if ${lt_cv_path_mainfest_tool+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&5 if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 $as_echo "$lt_cv_path_mainfest_tool" >&6; } if test "x$lt_cv_path_mainfest_tool" != xyes; then MANIFEST_TOOL=: fi case $host_os in rhapsody* | darwin*) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DSYMUTIL"; then ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DSYMUTIL=$ac_cv_prog_DSYMUTIL if test -n "$DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 $as_echo "$DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DSYMUTIL"; then ac_ct_DSYMUTIL=$DSYMUTIL # Extract the first word of "dsymutil", so it can be a program name with args. set dummy dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DSYMUTIL"; then ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL if test -n "$ac_ct_DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 $as_echo "$ac_ct_DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DSYMUTIL" = x; then DSYMUTIL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DSYMUTIL=$ac_ct_DSYMUTIL fi else DSYMUTIL="$ac_cv_prog_DSYMUTIL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. set dummy ${ac_tool_prefix}nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NMEDIT"; then ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi NMEDIT=$ac_cv_prog_NMEDIT if test -n "$NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 $as_echo "$NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_NMEDIT"; then ac_ct_NMEDIT=$NMEDIT # Extract the first word of "nmedit", so it can be a program name with args. set dummy nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_NMEDIT"; then ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_NMEDIT="nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT if test -n "$ac_ct_NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 $as_echo "$ac_ct_NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_NMEDIT" = x; then NMEDIT=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac NMEDIT=$ac_ct_NMEDIT fi else NMEDIT="$ac_cv_prog_NMEDIT" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. set dummy ${ac_tool_prefix}lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$LIPO"; then ac_cv_prog_LIPO="$LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_LIPO="${ac_tool_prefix}lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi LIPO=$ac_cv_prog_LIPO if test -n "$LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 $as_echo "$LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_LIPO"; then ac_ct_LIPO=$LIPO # Extract the first word of "lipo", so it can be a program name with args. set dummy lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_LIPO"; then ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_LIPO="lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO if test -n "$ac_ct_LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 $as_echo "$ac_ct_LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_LIPO" = x; then LIPO=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac LIPO=$ac_ct_LIPO fi else LIPO="$ac_cv_prog_LIPO" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. set dummy ${ac_tool_prefix}otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL"; then ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL="${ac_tool_prefix}otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL=$ac_cv_prog_OTOOL if test -n "$OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 $as_echo "$OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL"; then ac_ct_OTOOL=$OTOOL # Extract the first word of "otool", so it can be a program name with args. set dummy otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL"; then ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL="otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL if test -n "$ac_ct_OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 $as_echo "$ac_ct_OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL" = x; then OTOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL=$ac_ct_OTOOL fi else OTOOL="$ac_cv_prog_OTOOL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. set dummy ${ac_tool_prefix}otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL64"; then ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL64=$ac_cv_prog_OTOOL64 if test -n "$OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 $as_echo "$OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL64"; then ac_ct_OTOOL64=$OTOOL64 # Extract the first word of "otool64", so it can be a program name with args. set dummy otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL64"; then ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL64="otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 if test -n "$ac_ct_OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 $as_echo "$ac_ct_OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL64" = x; then OTOOL64=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL64=$ac_ct_OTOOL64 fi else OTOOL64="$ac_cv_prog_OTOOL64" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 $as_echo_n "checking for -single_module linker flag... " >&6; } if ${lt_cv_apple_cc_single_mod+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_apple_cc_single_mod=no if test -z "${LT_MULTI_MODULE}"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&5 $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # If there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&5 # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test $_lt_result -eq 0; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&5 fi rm -rf libconftest.dylib* rm -f conftest.* fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 $as_echo "$lt_cv_apple_cc_single_mod" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 $as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } if ${lt_cv_ld_exported_symbols_list+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_ld_exported_symbols_list=yes else lt_cv_ld_exported_symbols_list=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 $as_echo "$lt_cv_ld_exported_symbols_list" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 $as_echo_n "checking for -force_load linker flag... " >&6; } if ${lt_cv_ld_force_load+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 echo "$AR cru libconftest.a conftest.o" >&5 $AR cru libconftest.a conftest.o 2>&5 echo "$RANLIB libconftest.a" >&5 $RANLIB libconftest.a 2>&5 cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&5 elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then lt_cv_ld_force_load=yes else cat conftest.err >&5 fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 $as_echo "$lt_cv_ld_force_load" >&6; } case $host_os in rhapsody* | darwin1.[012]) _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[91]*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; 10.[012]*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test "$lt_cv_apple_cc_single_mod" = "yes"; then _lt_dar_single_mod='$single_module' fi if test "$lt_cv_ld_exported_symbols_list" = "yes"; then _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' fi if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in dlfcn.h do : ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default " if test "x$ac_cv_header_dlfcn_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_DLFCN_H 1 _ACEOF fi done func_stripname_cnf () { case ${2} in .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; esac } # func_stripname_cnf # Set options enable_dlopen=no enable_win32_dll=no # Check whether --enable-shared was given. if test "${enable_shared+set}" = set; then : enableval=$enable_shared; p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac else enable_shared=yes fi # Check whether --enable-static was given. if test "${enable_static+set}" = set; then : enableval=$enable_static; p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac else enable_static=yes fi # Check whether --with-pic was given. if test "${with_pic+set}" = set; then : withval=$with_pic; lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for lt_pkg in $withval; do IFS="$lt_save_ifs" if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS="$lt_save_ifs" ;; esac else pic_mode=default fi test -z "$pic_mode" && pic_mode=default # Check whether --enable-fast-install was given. if test "${enable_fast_install+set}" = set; then : enableval=$enable_fast_install; p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac else enable_fast_install=yes fi # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ltmain" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' test -z "$LN_S" && LN_S="ln -s" if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 $as_echo_n "checking for objdir... " >&6; } if ${lt_cv_objdir+:} false; then : $as_echo_n "(cached) " >&6 else rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 $as_echo "$lt_cv_objdir" >&6; } objdir=$lt_cv_objdir cat >>confdefs.h <<_ACEOF #define LT_OBJDIR "$lt_cv_objdir/" _ACEOF case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld="$lt_cv_prog_gnu_ld" old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 $as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/${ac_tool_prefix}file; then lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 $as_echo_n "checking for file... " >&6; } if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/file; then lt_cv_path_MAGIC_CMD="$ac_dir/file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi else MAGIC_CMD=: fi fi fi ;; esac # Use C for the default configuration in the libtool script lt_save_CC="$CC" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o objext=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then lt_prog_compiler_no_builtin_flag= if test "$GCC" = yes; then case $cc_basename in nvcc*) lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; *) lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 $as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_rtti_exceptions=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 $as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" else : fi fi lt_prog_compiler_wl= lt_prog_compiler_pic= lt_prog_compiler_static= if test "$GCC" = yes; then lt_prog_compiler_wl='-Wl,' lt_prog_compiler_static='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. lt_prog_compiler_static= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) lt_prog_compiler_pic='-fPIC' ;; esac ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic=-Kconform_pic fi ;; *) lt_prog_compiler_pic='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 lt_prog_compiler_wl='-Xlinker ' if test -n "$lt_prog_compiler_pic"; then lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' else lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' fi ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; # Lahey Fortran 8.1. lf95*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='--shared' lt_prog_compiler_static='--static' ;; nagfor*) # NAG Fortran compiler lt_prog_compiler_wl='-Wl,-Wl,,' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; ccc*) lt_prog_compiler_wl='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-qpic' lt_prog_compiler_static='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='' ;; *Sun\ F* | *Sun*Fortran*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Wl,' ;; *Intel*\ [CF]*Compiler*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; *Portland\ Group*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; esac ;; esac ;; newsos6) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static='-non_shared' ;; rdos*) lt_prog_compiler_static='-non_shared' ;; solaris*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) lt_prog_compiler_wl='-Qoption ld ';; *) lt_prog_compiler_wl='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl='-Qoption ld ' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_prog_compiler_pic='-Kconform_pic' lt_prog_compiler_static='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; unicos*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_can_build_shared=no ;; uts4*) lt_prog_compiler_pic='-pic' lt_prog_compiler_static='-Bstatic' ;; *) lt_prog_compiler_can_build_shared=no ;; esac fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic= ;; *) lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 $as_echo_n "checking for $compiler option to produce PIC... " >&6; } if ${lt_cv_prog_compiler_pic+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic=$lt_prog_compiler_pic fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 $as_echo "$lt_cv_prog_compiler_pic" >&6; } lt_prog_compiler_pic=$lt_cv_prog_compiler_pic # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } if ${lt_cv_prog_compiler_pic_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic -DPIC" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 $as_echo "$lt_cv_prog_compiler_pic_works" >&6; } if test x"$lt_cv_prog_compiler_pic_works" = xyes; then case $lt_prog_compiler_pic in "" | " "*) ;; *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; esac else lt_prog_compiler_pic= lt_prog_compiler_can_build_shared=no fi fi # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if ${lt_cv_prog_compiler_static_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_static_works=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works=yes fi else lt_cv_prog_compiler_static_works=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 $as_echo "$lt_cv_prog_compiler_static_works" >&6; } if test x"$lt_cv_prog_compiler_static_works" = xyes; then : else lt_prog_compiler_static= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } hard_links="nottested" if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 $as_echo_n "checking if we can lock with hard links... " >&6; } hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 $as_echo "$hard_links" >&6; } if test "$hard_links" = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 $as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } runpath_var= allow_undefined_flag= always_export_symbols=no archive_cmds= archive_expsym_cmds= compiler_needs_object=no enable_shared_with_static_runtimes=no export_dynamic_flag_spec= export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' hardcode_automatic=no hardcode_direct=no hardcode_direct_absolute=no hardcode_libdir_flag_spec= hardcode_libdir_separator= hardcode_minus_L=no hardcode_shlibpath_var=unsupported inherit_rpath=no link_all_deplibs=unknown module_cmds= module_expsym_cmds= old_archive_from_new_cmds= old_archive_from_expsyms_cmds= thread_safe_flag_spec= whole_archive_flag_spec= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; esac ld_shlibs=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test "$with_gnu_ld" = yes; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; *\ \(GNU\ Binutils\)\ [3-9]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test "$lt_use_gnu_ld_interface" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' export_dynamic_flag_spec='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec= fi supports_anon_versioning=no case `$LD -v 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[3-9]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then allow_undefined_flag=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' export_dynamic_flag_spec='${wl}--export-all-symbols' allow_undefined_flag=unsupported always_export_symbols=no enable_shared_with_static_runtimes=yes export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs=no fi ;; haiku*) archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' link_all_deplibs=yes ;; interix[3-9]*) hardcode_direct=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test "$tmp_diet" = no then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 whole_archive_flag_spec= tmp_sharedflag='--shared' ;; xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi case $cc_basename in xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else ld_shlibs=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac ;; sunos4*) archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct=yes hardcode_shlibpath_var=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac if test "$ld_shlibs" = no; then runpath_var= hardcode_libdir_flag_spec= export_dynamic_flag_spec= whole_archive_flag_spec= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag=unsupported always_export_symbols=yes archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix[4-9]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm # Also, AIX nm treats weak defined symbols like other global # defined symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds='' hardcode_direct=yes hardcode_direct_absolute=yes hardcode_libdir_separator=':' link_all_deplibs=yes file_list_spec='${wl}-f,' if test "$GCC" = yes; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi export_dynamic_flag_spec='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag='-berok' # Determine the default libpath from the value encoded in an # empty executable. if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_="/usr/lib:/lib" fi fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag="-z nodefs" archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_="/usr/lib:/lib" fi fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag=' ${wl}-bernotok' allow_undefined_flag=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec='$convenience' fi archive_cmds_need_lc=yes # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; bsdi[45]*) export_dynamic_flag_spec=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl*) # Native MSVC hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported always_export_symbols=yes file_list_spec='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, )='true' enable_shared_with_static_runtimes=yes exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib old_postinstall_cmds='chmod 644 $oldlib' postlink_cmds='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile="$lt_outputfile.exe" lt_tool_outputfile="$lt_tool_outputfile.exe" ;; esac~ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC wrapper hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_from_new_cmds='true' # FIXME: Should let the user specify the lib program. old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' enable_shared_with_static_runtimes=yes ;; esac ;; darwin* | rhapsody*) archive_cmds_need_lc=no hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported if test "$lt_cv_ld_force_load" = "yes"; then whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' else whole_archive_flag_spec='' fi link_all_deplibs=yes allow_undefined_flag="$_lt_dar_allow_undefined" case $cc_basename in ifort*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then output_verbose_link_cmd=func_echo_all archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" else ld_shlibs=no fi ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; hpux9*) if test "$GCC" = yes; then archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes export_dynamic_flag_spec='${wl}-E' ;; hpux10*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes fi ;; hpux11*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 $as_echo_n "checking if $CC understands -b... " >&6; } if ${lt_cv_prog_compiler__b+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler__b=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -b" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler__b=yes fi else lt_cv_prog_compiler__b=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 $as_echo "$lt_cv_prog_compiler__b" >&6; } if test x"$lt_cv_prog_compiler__b" = xyes; then archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi ;; esac fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: case $host_cpu in hppa*64*|ia64*) hardcode_direct=no hardcode_shlibpath_var=no ;; *) hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 $as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } if ${lt_cv_irix_exported_symbol+:} false; then : $as_echo_n "(cached) " >&6 else save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int foo (void) { return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_irix_exported_symbol=yes else lt_cv_irix_exported_symbol=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 $as_echo "$lt_cv_irix_exported_symbol" >&6; } if test "$lt_cv_irix_exported_symbol" = yes; then archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' fi else archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: inherit_rpath=yes link_all_deplibs=yes ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; newsos6) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: hardcode_shlibpath_var=no ;; *nto* | *qnx*) ;; openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct=yes hardcode_shlibpath_var=no hardcode_direct_absolute=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' else case $host_os in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-R$libdir' ;; *) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; esac fi else ld_shlibs=no fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi archive_cmds_need_lc='no' hardcode_libdir_separator=: ;; solaris*) no_undefined_flag=' -z defs' if test "$GCC" = yes; then wlarc='${wl}' archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='${wl}' archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi hardcode_libdir_flag_spec='-R$libdir' hardcode_shlibpath_var=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. GCC discards it without `$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test "$GCC" = yes; then whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else whole_archive_flag_spec='-z allextract$convenience -z defaultextract' fi ;; esac link_all_deplibs=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; sysv4) case $host_vendor in sni) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds='$CC -r -o $output$reload_objs' hardcode_direct=no ;; motorola) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; sysv4.3*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no export_dynamic_flag_spec='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag='${wl}-z,text' archive_cmds_need_lc=no hardcode_shlibpath_var=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag='${wl}-z,text' allow_undefined_flag='${wl}-z,nodefs' archive_cmds_need_lc=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='${wl}-R,$libdir' hardcode_libdir_separator=':' link_all_deplibs=yes export_dynamic_flag_spec='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; *) ld_shlibs=no ;; esac if test x$host_vendor = xsni; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) export_dynamic_flag_spec='${wl}-Blargedynsym' ;; esac fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 $as_echo "$ld_shlibs" >&6; } test "$ld_shlibs" = no && can_build_shared=no with_gnu_ld=$with_gnu_ld # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc" in x|xyes) # Assume -lc should be added archive_cmds_need_lc=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } if ${lt_cv_archive_cmds_need_lc+:} false; then : $as_echo_n "(cached) " >&6 else $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl pic_flag=$lt_prog_compiler_pic compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag allow_undefined_flag= if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then lt_cv_archive_cmds_need_lc=no else lt_cv_archive_cmds_need_lc=yes fi allow_undefined_flag=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 $as_echo "$lt_cv_archive_cmds_need_lc" >&6; } archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc ;; esac fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 $as_echo_n "checking dynamic linker characteristics... " >&6; } if test "$GCC" = yes; then case $host_os in darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;; *) lt_sed_strip_eq="s,=/,/,g" ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path/$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" else test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo="/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[lt_foo]++; } if (lt_freq[lt_foo] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's,/\([A-Za-z]:\),\1,g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix[4-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' library_names_spec='${libname}.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec="$LIB" if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[23].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=yes sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[3-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH if ${lt_cv_shlibpath_overrides_runpath+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : lt_cv_shlibpath_overrides_runpath=yes fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir fi shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 $as_echo "$dynamic_linker" >&6; } test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 $as_echo_n "checking how to hardcode library paths into programs... " >&6; } hardcode_action= if test -n "$hardcode_libdir_flag_spec" || test -n "$runpath_var" || test "X$hardcode_automatic" = "Xyes" ; then # We can hardcode non-existent directories. if test "$hardcode_direct" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no && test "$hardcode_minus_L" != no; then # Linking always hardcodes the temporary library directory. hardcode_action=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action=unsupported fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 $as_echo "$hardcode_action" >&6; } if test "$hardcode_action" = relink || test "$inherit_rpath" = yes; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes fi ;; *) ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" if test "x$ac_cv_func_shl_load" = xyes; then : lt_cv_dlopen="shl_load" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 $as_echo_n "checking for shl_load in -ldld... " >&6; } if ${ac_cv_lib_dld_shl_load+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shl_load (); int main () { return shl_load (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_shl_load=yes else ac_cv_lib_dld_shl_load=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 $as_echo "$ac_cv_lib_dld_shl_load" >&6; } if test "x$ac_cv_lib_dld_shl_load" = xyes; then : lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" else ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" if test "x$ac_cv_func_dlopen" = xyes; then : lt_cv_dlopen="dlopen" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 $as_echo_n "checking for dlopen in -lsvld... " >&6; } if ${ac_cv_lib_svld_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_svld_dlopen=yes else ac_cv_lib_svld_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 $as_echo "$ac_cv_lib_svld_dlopen" >&6; } if test "x$ac_cv_lib_svld_dlopen" = xyes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 $as_echo_n "checking for dld_link in -ldld... " >&6; } if ${ac_cv_lib_dld_dld_link+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dld_link (); int main () { return dld_link (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_dld_link=yes else ac_cv_lib_dld_dld_link=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 $as_echo "$ac_cv_lib_dld_dld_link" >&6; } if test "x$ac_cv_lib_dld_dld_link" = xyes; then : lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" fi fi fi fi fi fi ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 $as_echo_n "checking whether a program can dlopen itself... " >&6; } if ${lt_cv_dlopen_self+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed lt_cv_dlopen_self=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 $as_echo "$lt_cv_dlopen_self" >&6; } if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 $as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } if ${lt_cv_dlopen_self_static+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed lt_cv_dlopen_self_static=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 $as_echo "$lt_cv_dlopen_self_static" >&6; } fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi striplib= old_striplib= { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 $as_echo_n "checking whether stripping libraries is possible... " >&6; } if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" old_striplib="$STRIP -S" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ;; esac fi # Report which library types will actually be built { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 $as_echo_n "checking if libtool supports shared libraries... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 $as_echo "$can_build_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 $as_echo_n "checking whether to build shared libraries... " >&6; } test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[4-9]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 $as_echo "$enable_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 $as_echo_n "checking whether to build static libraries... " >&6; } # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 $as_echo "$enable_static" >&6; } fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu CC="$lt_save_CC" if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5 $as_echo_n "checking how to run the C++ preprocessor... " >&6; } if test -z "$CXXCPP"; then if ${ac_cv_prog_CXXCPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CXXCPP needs to be expanded for CXXCPP in "$CXX -E" "/lib/cpp" do ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CXXCPP=$CXXCPP fi CXXCPP=$ac_cv_prog_CXXCPP else ac_cv_prog_CXXCPP=$CXXCPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5 $as_echo "$CXXCPP" >&6; } ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu else _lt_caught_CXX_error=yes fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu archive_cmds_need_lc_CXX=no allow_undefined_flag_CXX= always_export_symbols_CXX=no archive_expsym_cmds_CXX= compiler_needs_object_CXX=no export_dynamic_flag_spec_CXX= hardcode_direct_CXX=no hardcode_direct_absolute_CXX=no hardcode_libdir_flag_spec_CXX= hardcode_libdir_separator_CXX= hardcode_minus_L_CXX=no hardcode_shlibpath_var_CXX=unsupported hardcode_automatic_CXX=no inherit_rpath_CXX=no module_cmds_CXX= module_expsym_cmds_CXX= link_all_deplibs_CXX=unknown old_archive_cmds_CXX=$old_archive_cmds reload_flag_CXX=$reload_flag reload_cmds_CXX=$reload_cmds no_undefined_flag_CXX= whole_archive_flag_spec_CXX= enable_shared_with_static_runtimes_CXX=no # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o objext_CXX=$objext # No sense in running all these tests if we already determined that # the CXX compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_caught_CXX_error" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[]) { return(0); }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} CFLAGS=$CXXFLAGS compiler=$CC compiler_CXX=$CC for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` if test -n "$compiler"; then # We don't want -fno-exception when compiling C++ code, so set the # no_builtin_flag separately if test "$GXX" = yes; then lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin' else lt_prog_compiler_no_builtin_flag_CXX= fi if test "$GXX" = yes; then # Set up default GNU C++ configuration # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then : withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 $as_echo_n "checking for ld used by $CC... " >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi if ${lt_cv_path_LD+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 $as_echo "$LD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if ${lt_cv_prog_gnu_ld+:} false; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 $as_echo "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test "$with_gnu_ld" = yes; then archive_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='${wl}' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | $GREP 'no-whole-archive' > /dev/null; then whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec_CXX= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } ld_shlibs_CXX=yes case $host_os in aix3*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aix[4-9]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds_CXX='' hardcode_direct_CXX=yes hardcode_direct_absolute_CXX=yes hardcode_libdir_separator_CXX=':' link_all_deplibs_CXX=yes file_list_spec_CXX='${wl}-f,' if test "$GXX" = yes; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct_CXX=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L_CXX=yes hardcode_libdir_flag_spec_CXX='-L$libdir' hardcode_libdir_separator_CXX= fi esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi export_dynamic_flag_spec_CXX='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to # export. always_export_symbols_CXX=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag_CXX='-berok' # Determine the default libpath from the value encoded in an empty # executable. if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath__CXX+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX="/usr/lib:/lib" fi fi aix_libpath=$lt_cv_aix_libpath__CXX fi hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag_CXX="-z nodefs" archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath__CXX+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX="/usr/lib:/lib" fi fi aix_libpath=$lt_cv_aix_libpath__CXX fi hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag_CXX=' ${wl}-bernotok' allow_undefined_flag_CXX=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec_CXX='$convenience' fi archive_cmds_need_lc_CXX=yes # This is similar to how AIX traditionally builds its shared # libraries. archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then allow_undefined_flag_CXX=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs_CXX=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; cygwin* | mingw* | pw32* | cegcc*) case $GXX,$cc_basename in ,cl* | no,cl*) # Native MSVC # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec_CXX=' ' allow_undefined_flag_CXX=unsupported always_export_symbols_CXX=yes file_list_spec_CXX='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, CXX)='true' enable_shared_with_static_runtimes_CXX=yes # Don't use ranlib old_postinstall_cmds_CXX='chmod 644 $oldlib' postlink_cmds_CXX='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile="$lt_outputfile.exe" lt_tool_outputfile="$lt_tool_outputfile.exe" ;; esac~ func_to_tool_file "$lt_outputfile"~ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # g++ # _LT_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec_CXX='-L$libdir' export_dynamic_flag_spec_CXX='${wl}--export-all-symbols' allow_undefined_flag_CXX=unsupported always_export_symbols_CXX=no enable_shared_with_static_runtimes_CXX=yes if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs_CXX=no fi ;; esac ;; darwin* | rhapsody*) archive_cmds_need_lc_CXX=no hardcode_direct_CXX=no hardcode_automatic_CXX=yes hardcode_shlibpath_var_CXX=unsupported if test "$lt_cv_ld_force_load" = "yes"; then whole_archive_flag_spec_CXX='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' else whole_archive_flag_spec_CXX='' fi link_all_deplibs_CXX=yes allow_undefined_flag_CXX="$_lt_dar_allow_undefined" case $cc_basename in ifort*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then output_verbose_link_cmd=func_echo_all archive_cmds_CXX="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" module_cmds_CXX="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" module_expsym_cmds_CXX="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" if test "$lt_cv_apple_cc_single_mod" != "yes"; then archive_cmds_CXX="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" fi else ld_shlibs_CXX=no fi ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; freebsd2.*) # C++ shared libraries reported to be fairly broken before # switch to ELF ld_shlibs_CXX=no ;; freebsd-elf*) archive_cmds_need_lc_CXX=no ;; freebsd* | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions ld_shlibs_CXX=yes ;; gnu*) ;; haiku*) archive_cmds_CXX='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' link_all_deplibs_CXX=yes ;; hpux9*) hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' hardcode_libdir_separator_CXX=: export_dynamic_flag_spec_CXX='${wl}-E' hardcode_direct_CXX=yes hardcode_minus_L_CXX=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aCC*) archive_cmds_CXX='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then archive_cmds_CXX='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; hpux10*|hpux11*) if test $with_gnu_ld = no; then hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' hardcode_libdir_separator_CXX=: case $host_cpu in hppa*64*|ia64*) ;; *) export_dynamic_flag_spec_CXX='${wl}-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) hardcode_direct_CXX=no hardcode_shlibpath_var_CXX=no ;; *) hardcode_direct_CXX=yes hardcode_direct_absolute_CXX=yes hardcode_minus_L_CXX=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aCC*) case $host_cpu in hppa*64*) archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then if test $with_gnu_ld = no; then case $host_cpu in hppa*64*) archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) archive_cmds_CXX='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) archive_cmds_CXX='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; interix[3-9]*) hardcode_direct_CXX=no hardcode_shlibpath_var_CXX=no hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' export_dynamic_flag_spec_CXX='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds_CXX='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib' fi fi link_all_deplibs_CXX=yes ;; esac hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: inherit_rpath_CXX=yes ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc* | ecpc* ) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; esac archive_cmds_need_lc_CXX=no hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ;; pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in *pgCC\ [1-5].* | *pgcpp\ [1-5].*) prelink_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' old_archive_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ $RANLIB $oldlib' archive_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' archive_expsym_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; *) # Version 6 and above use weak symbols archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; esac hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' whole_archive_flag_spec_CXX='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' ;; cxx*) # Compaq C++ archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec_CXX='-rpath $libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' ;; xl* | mpixl* | bgxl*) # IBM XL 8.0 on PPC, with GNU ld hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' archive_cmds_CXX='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds_CXX='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 no_undefined_flag_CXX=' -zdefs' archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' archive_expsym_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' hardcode_libdir_flag_spec_CXX='-R$libdir' whole_archive_flag_spec_CXX='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object_CXX=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' ;; esac ;; esac ;; lynxos*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; m88k*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= hardcode_libdir_flag_spec_CXX='-R$libdir' hardcode_direct_CXX=yes hardcode_shlibpath_var_CXX=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; *nto* | *qnx*) ld_shlibs_CXX=yes ;; openbsd2*) # C++ shared libraries are fairly broken ld_shlibs_CXX=no ;; openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct_CXX=yes hardcode_shlibpath_var_CXX=no hardcode_direct_absolute_CXX=yes archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' export_dynamic_flag_spec_CXX='${wl}-E' whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi output_verbose_link_cmd=func_echo_all else ld_shlibs_CXX=no fi ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' hardcode_libdir_separator_CXX=: # Archives containing C++ object files must be created using # the KAI C++ compiler. case $host in osf3*) old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; *) old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' ;; esac ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; cxx*) case $host in osf3*) allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' ;; *) allow_undefined_flag_CXX=' -expect_unresolved \*' archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~ $RM $lib.exp' hardcode_libdir_flag_spec_CXX='-rpath $libdir' ;; esac hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' case $host in osf3*) archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; *) archive_cmds_CXX='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; esac hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ archive_cmds_need_lc_CXX=yes no_undefined_flag_CXX=' -zdefs' archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' hardcode_libdir_flag_spec_CXX='-R$libdir' hardcode_shlibpath_var_CXX=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. # Supported since Solaris 2.6 (maybe 2.5.1?) whole_archive_flag_spec_CXX='-z allextract$convenience -z defaultextract' ;; esac link_all_deplibs_CXX=yes output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test "$GXX" = yes && test "$with_gnu_ld" = no; then no_undefined_flag_CXX=' ${wl}-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' fi hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir' case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' ;; esac fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag_CXX='${wl}-z,text' archive_cmds_need_lc_CXX=no hardcode_shlibpath_var_CXX=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag_CXX='${wl}-z,text' allow_undefined_flag_CXX='${wl}-z,nodefs' archive_cmds_need_lc_CXX=no hardcode_shlibpath_var_CXX=no hardcode_libdir_flag_spec_CXX='${wl}-R,$libdir' hardcode_libdir_separator_CXX=':' link_all_deplibs_CXX=yes export_dynamic_flag_spec_CXX='${wl}-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' old_archive_cmds_CXX='$CC -Tprelink_objects $oldobjs~ '"$old_archive_cmds_CXX" reload_cmds_CXX='$CC -Tprelink_objects $reload_objs~ '"$reload_cmds_CXX" ;; *) archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 $as_echo "$ld_shlibs_CXX" >&6; } test "$ld_shlibs_CXX" = no && can_build_shared=no GCC_CXX="$GXX" LD_CXX="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... # Dependencies to place before and after the object being linked: predep_objects_CXX= postdep_objects_CXX= predeps_CXX= postdeps_CXX= compiler_lib_search_path_CXX= cat > conftest.$ac_ext <<_LT_EOF class Foo { public: Foo (void) { a = 0; } private: int a; }; _LT_EOF _lt_libdeps_save_CFLAGS=$CFLAGS case "$CC $CFLAGS " in #( *\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; *\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; *\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; esac if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do case ${prev}${p} in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test $p = "-L" || test $p = "-R"; then prev=$p continue fi # Expand the sysroot to ease extracting the directories later. if test -z "$prev"; then case $p in -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; esac fi case $p in =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; esac if test "$pre_test_object_deps_done" = no; then case ${prev} in -L | -R) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$compiler_lib_search_path_CXX"; then compiler_lib_search_path_CXX="${prev}${p}" else compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${prev}${p}" fi ;; # The "-l" case would never come before the object being # linked, so don't bother handling this case. esac else if test -z "$postdeps_CXX"; then postdeps_CXX="${prev}${p}" else postdeps_CXX="${postdeps_CXX} ${prev}${p}" fi fi prev= ;; *.lto.$objext) ;; # Ignore GCC LTO objects *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test "$pre_test_object_deps_done" = no; then if test -z "$predep_objects_CXX"; then predep_objects_CXX="$p" else predep_objects_CXX="$predep_objects_CXX $p" fi else if test -z "$postdep_objects_CXX"; then postdep_objects_CXX="$p" else postdep_objects_CXX="$postdep_objects_CXX $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling CXX test program" fi $RM -f confest.$objext CFLAGS=$_lt_libdeps_save_CFLAGS # PORTME: override above test on systems where it is broken case $host_os in interix[3-9]*) # Interix 3.5 installs completely hosed .la files for C++, so rather than # hack all around it, let's just trust "g++" to DTRT. predep_objects_CXX= postdep_objects_CXX= postdeps_CXX= ;; linux*) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac if test "$solaris_use_stlport4" != yes; then postdeps_CXX='-library=Cstd -library=Crun' fi ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac # Adding this requires a known-good setup of shared libraries for # Sun compiler versions before 5.6, else PIC objects from an old # archive will be linked into the output, leading to subtle bugs. if test "$solaris_use_stlport4" != yes; then postdeps_CXX='-library=Cstd -library=Crun' fi ;; esac ;; esac case " $postdeps_CXX " in *" -lc "*) archive_cmds_need_lc_CXX=no ;; esac compiler_lib_search_dirs_CXX= if test -n "${compiler_lib_search_path_CXX}"; then compiler_lib_search_dirs_CXX=`echo " ${compiler_lib_search_path_CXX}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` fi lt_prog_compiler_wl_CXX= lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX= # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_CXX='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic_CXX='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic_CXX='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic_CXX='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all lt_prog_compiler_pic_CXX= ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. lt_prog_compiler_static_CXX= ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic_CXX=-Kconform_pic fi ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) ;; *) lt_prog_compiler_pic_CXX='-fPIC' ;; esac ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic_CXX='-fPIC -shared' ;; *) lt_prog_compiler_pic_CXX='-fPIC' ;; esac else case $host_os in aix[4-9]*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_CXX='-Bstatic' else lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_CXX='-DDLL_EXPORT' ;; dgux*) case $cc_basename in ec++*) lt_prog_compiler_pic_CXX='-KPIC' ;; ghcx*) # Green Hills C++ Compiler lt_prog_compiler_pic_CXX='-pic' ;; *) ;; esac ;; freebsd* | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='${wl}-a ${wl}archive' if test "$host_cpu" != ia64; then lt_prog_compiler_pic_CXX='+Z' fi ;; aCC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='${wl}-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_CXX='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in KCC*) # KAI C++ Compiler lt_prog_compiler_wl_CXX='--backend -Wl,' lt_prog_compiler_pic_CXX='-fPIC' ;; ecpc* ) # old Intel C++ for x86_64 which still supported -KPIC. lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-static' ;; icpc* ) # Intel C++, used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-fPIC' lt_prog_compiler_static_CXX='-static' ;; pgCC* | pgcpp*) # Portland Group C++ compiler lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-fpic' lt_prog_compiler_static_CXX='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX='-non_shared' ;; xlc* | xlC* | bgxl[cC]* | mpixl[cC]*) # IBM XL 8.0, 9.0 on PPC and BlueGene lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-qpic' lt_prog_compiler_static_CXX='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' lt_prog_compiler_wl_CXX='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) lt_prog_compiler_pic_CXX='-W c,exportall' ;; *) ;; esac ;; netbsd*) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic_CXX='-fPIC -shared' ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) lt_prog_compiler_wl_CXX='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 lt_prog_compiler_pic_CXX='-pic' ;; cxx*) # Digital/Compaq C++ lt_prog_compiler_wl_CXX='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' lt_prog_compiler_wl_CXX='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler lt_prog_compiler_pic_CXX='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x lt_prog_compiler_pic_CXX='-pic' lt_prog_compiler_static_CXX='-Bstatic' ;; lcc*) # Lucid lt_prog_compiler_pic_CXX='-pic' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 lt_prog_compiler_pic_CXX='-KPIC' ;; *) ;; esac ;; vxworks*) ;; *) lt_prog_compiler_can_build_shared_CXX=no ;; esac fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic_CXX= ;; *) lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC" ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 $as_echo_n "checking for $compiler option to produce PIC... " >&6; } if ${lt_cv_prog_compiler_pic_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_CXX=$lt_prog_compiler_pic_CXX fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_CXX" >&5 $as_echo "$lt_cv_prog_compiler_pic_CXX" >&6; } lt_prog_compiler_pic_CXX=$lt_cv_prog_compiler_pic_CXX # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic_CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... " >&6; } if ${lt_cv_prog_compiler_pic_works_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_works_CXX=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works_CXX=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works_CXX" >&5 $as_echo "$lt_cv_prog_compiler_pic_works_CXX" >&6; } if test x"$lt_cv_prog_compiler_pic_works_CXX" = xyes; then case $lt_prog_compiler_pic_CXX in "" | " "*) ;; *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;; esac else lt_prog_compiler_pic_CXX= lt_prog_compiler_can_build_shared_CXX=no fi fi # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if ${lt_cv_prog_compiler_static_works_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_static_works_CXX=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works_CXX=yes fi else lt_cv_prog_compiler_static_works_CXX=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works_CXX" >&5 $as_echo "$lt_cv_prog_compiler_static_works_CXX" >&6; } if test x"$lt_cv_prog_compiler_static_works_CXX" = xyes; then : else lt_prog_compiler_static_CXX= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o_CXX=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_CXX=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5 $as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o_CXX=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_CXX=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5 $as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; } hard_links="nottested" if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 $as_echo_n "checking if we can lock with hard links... " >&6; } hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 $as_echo "$hard_links" >&6; } if test "$hard_links" = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 $as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' case $host_os in aix[4-9]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm # Also, AIX nm treats weak defined symbols like other global defined # symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) export_symbols_cmds_CXX="$ltdll_cmds" ;; cygwin* | mingw* | cegcc*) case $cc_basename in cl*) exclude_expsyms_CXX='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' ;; *) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms_CXX='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' ;; esac ;; *) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 $as_echo "$ld_shlibs_CXX" >&6; } test "$ld_shlibs_CXX" = no && can_build_shared=no with_gnu_ld_CXX=$with_gnu_ld # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc_CXX" in x|xyes) # Assume -lc should be added archive_cmds_need_lc_CXX=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds_CXX in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } if ${lt_cv_archive_cmds_need_lc_CXX+:} false; then : $as_echo_n "(cached) " >&6 else $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl_CXX pic_flag=$lt_prog_compiler_pic_CXX compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag_CXX allow_undefined_flag_CXX= if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then lt_cv_archive_cmds_need_lc_CXX=no else lt_cv_archive_cmds_need_lc_CXX=yes fi allow_undefined_flag_CXX=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc_CXX" >&5 $as_echo "$lt_cv_archive_cmds_need_lc_CXX" >&6; } archive_cmds_need_lc_CXX=$lt_cv_archive_cmds_need_lc_CXX ;; esac fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 $as_echo_n "checking dynamic linker characteristics... " >&6; } library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix[4-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' library_names_spec='${libname}.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec="$LIB" if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[23].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=yes sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[3-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH if ${lt_cv_shlibpath_overrides_runpath+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl_CXX\"; \ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec_CXX\"" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : lt_cv_shlibpath_overrides_runpath=yes fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir fi shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 $as_echo "$dynamic_linker" >&6; } test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 $as_echo_n "checking how to hardcode library paths into programs... " >&6; } hardcode_action_CXX= if test -n "$hardcode_libdir_flag_spec_CXX" || test -n "$runpath_var_CXX" || test "X$hardcode_automatic_CXX" = "Xyes" ; then # We can hardcode non-existent directories. if test "$hardcode_direct_CXX" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_TAGVAR(hardcode_shlibpath_var, CXX)" != no && test "$hardcode_minus_L_CXX" != no; then # Linking always hardcodes the temporary library directory. hardcode_action_CXX=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action_CXX=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action_CXX=unsupported fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action_CXX" >&5 $as_echo "$hardcode_action_CXX" >&6; } if test "$hardcode_action_CXX" = relink || test "$inherit_rpath_CXX" = yes; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi fi # test -n "$compiler" CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld fi # test "$_lt_caught_CXX_error" != yes ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ac_config_commands="$ac_config_commands libtool" # Only expand once: # ========================== # Platform check for windows # ========================== { $as_echo "$as_me:${as_lineno-$LINENO}: checking for native Win32" >&5 $as_echo_n "checking for native Win32... " >&6; } case $host in #( *-*-mingw*) : native_win32=yes ;; #( *) : native_win32=no ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $native_win32" >&5 $as_echo "$native_win32" >&6; } if test "x$native_win32" = "xyes"; then OS_WIN32_TRUE= OS_WIN32_FALSE='#' else OS_WIN32_TRUE='#' OS_WIN32_FALSE= fi # TODO Check for docbook-to-man # ============= # Documentation # ============= # Check whether --with-man was given. if test "${with_man+set}" = set; then : withval=$with_man; with_man="$withval" else with_man=yes fi if test "x$with_man" != "xno"; then : build_man=yes if test -z "$DOCBOOK2MAN"; then : # Extract the first word of "docbook2x-man", so it can be a program name with args. set dummy docbook2x-man; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_DOCBOOK2MAN+:} false; then : $as_echo_n "(cached) " >&6 else case $DOCBOOK2MAN in [\\/]* | ?:[\\/]*) ac_cv_path_DOCBOOK2MAN="$DOCBOOK2MAN" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_DOCBOOK2MAN="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi DOCBOOK2MAN=$ac_cv_path_DOCBOOK2MAN if test -n "$DOCBOOK2MAN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DOCBOOK2MAN" >&5 $as_echo "$DOCBOOK2MAN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test -z "$DOCBOOK2MAN"; then : # Extract the first word of "docbook-to-man", so it can be a program name with args. set dummy docbook-to-man; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_DOCBOOK2MAN+:} false; then : $as_echo_n "(cached) " >&6 else case $DOCBOOK2MAN in [\\/]* | ?:[\\/]*) ac_cv_path_DOCBOOK2MAN="$DOCBOOK2MAN" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_DOCBOOK2MAN="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi DOCBOOK2MAN=$ac_cv_path_DOCBOOK2MAN if test -n "$DOCBOOK2MAN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DOCBOOK2MAN" >&5 $as_echo "$DOCBOOK2MAN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test -z "$DOCBOOK2MAN"; then : # Extract the first word of "docbook2man.pl", so it can be a program name with args. set dummy docbook2man.pl; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_DOCBOOK2MAN+:} false; then : $as_echo_n "(cached) " >&6 else case $DOCBOOK2MAN in [\\/]* | ?:[\\/]*) ac_cv_path_DOCBOOK2MAN="$DOCBOOK2MAN" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_DOCBOOK2MAN="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi DOCBOOK2MAN=$ac_cv_path_DOCBOOK2MAN if test -n "$DOCBOOK2MAN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DOCBOOK2MAN" >&5 $as_echo "$DOCBOOK2MAN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test -z "$DOCBOOK2MAN"; then : as_fn_error $? "docbook-to-man is missing. Install docbook2X package." "$LINENO" 5 fi fi fi fi else build_man=no fi if test "x$build_man" != "xno"; then WITH_LIBCMIS_MAN_TRUE= WITH_LIBCMIS_MAN_FALSE='#' else WITH_LIBCMIS_MAN_TRUE='#' WITH_LIBCMIS_MAN_FALSE= fi # ======== # Cppcheck # ======== # Extract the first word of "cppcheck", so it can be a program name with args. set dummy cppcheck; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_CPPCHECK+:} false; then : $as_echo_n "(cached) " >&6 else case $CPPCHECK in [\\/]* | ?:[\\/]*) ac_cv_path_CPPCHECK="$CPPCHECK" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_CPPCHECK="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi CPPCHECK=$ac_cv_path_CPPCHECK if test -n "$CPPCHECK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPPCHECK" >&5 $as_echo "$CPPCHECK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_cv_path_CPPCHECK" != "x"; then : enable_cppcheck=yes else enable_cppcheck=no fi if test "x$ac_cv_path_CPPCHECK" != "x"; then ENABLE_CPPCHECK_TRUE= ENABLE_CPPCHECK_FALSE='#' else ENABLE_CPPCHECK_TRUE='#' ENABLE_CPPCHECK_FALSE= fi # Check whether --enable-werror was given. if test "${enable_werror+set}" = set; then : enableval=$enable_werror; enable_werror="$enableval" else enable_werror=yes fi if test x"$enable_werror" != "xno"; then : CFLAGS="$CFLAGS -Werror" CXXFLAGS="$CXXFLAGS -Werror" fi if test x"$GCC" = xyes; then : # Be tough with warnings and produce less careless code CFLAGS="$CFLAGS -Wall -pedantic -Wshadow -Wendif-labels -Wextra" CXXFLAGS="$CXXFLAGS -Wall -pedantic -Weffc++ -Wshadow -Wendif-labels -Wextra -Wsign-promo -Woverloaded-virtual -Wnon-virtual-dtor -Wsign-promo" fi # Check for curl if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG if test -n "$PKG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 $as_echo "$PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_path_PKG_CONFIG"; then ac_pt_PKG_CONFIG=$PKG_CONFIG # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $ac_pt_PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG if test -n "$ac_pt_PKG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 $as_echo "$ac_pt_PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_pt_PKG_CONFIG" = x; then PKG_CONFIG="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac PKG_CONFIG=$ac_pt_PKG_CONFIG fi else PKG_CONFIG="$ac_cv_path_PKG_CONFIG" fi fi if test -n "$PKG_CONFIG"; then _pkg_min_version=0.9.0 { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 $as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; } if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } PKG_CONFIG="" fi fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CURL" >&5 $as_echo_n "checking for CURL... " >&6; } if test -n "$CURL_CFLAGS"; then pkg_cv_CURL_CFLAGS="$CURL_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \" libcurl \""; } >&5 ($PKG_CONFIG --exists --print-errors " libcurl ") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_CURL_CFLAGS=`$PKG_CONFIG --cflags " libcurl " 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$CURL_LIBS"; then pkg_cv_CURL_LIBS="$CURL_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \" libcurl \""; } >&5 ($PKG_CONFIG --exists --print-errors " libcurl ") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_CURL_LIBS=`$PKG_CONFIG --libs " libcurl " 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then CURL_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs " libcurl " 2>&1` else CURL_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs " libcurl " 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$CURL_PKG_ERRORS" >&5 as_fn_error $? "Package requirements ( libcurl ) were not met: $CURL_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables CURL_CFLAGS and CURL_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables CURL_CFLAGS and CURL_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else CURL_CFLAGS=$pkg_cv_CURL_CFLAGS CURL_LIBS=$pkg_cv_CURL_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi # Check for lixml2 pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XML2" >&5 $as_echo_n "checking for XML2... " >&6; } if test -n "$XML2_CFLAGS"; then pkg_cv_XML2_CFLAGS="$XML2_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \" libxml-2.0 \""; } >&5 ($PKG_CONFIG --exists --print-errors " libxml-2.0 ") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_XML2_CFLAGS=`$PKG_CONFIG --cflags " libxml-2.0 " 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$XML2_LIBS"; then pkg_cv_XML2_LIBS="$XML2_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \" libxml-2.0 \""; } >&5 ($PKG_CONFIG --exists --print-errors " libxml-2.0 ") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_XML2_LIBS=`$PKG_CONFIG --libs " libxml-2.0 " 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then XML2_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs " libxml-2.0 " 2>&1` else XML2_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs " libxml-2.0 " 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$XML2_PKG_ERRORS" >&5 as_fn_error $? "Package requirements ( libxml-2.0 ) were not met: $XML2_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables XML2_CFLAGS and XML2_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables XML2_CFLAGS and XML2_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else XML2_CFLAGS=$pkg_cv_XML2_CFLAGS XML2_LIBS=$pkg_cv_XML2_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi # Check for cppunit if test "x$enable_tests" != "xno"; then : pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CPPUNIT" >&5 $as_echo_n "checking for CPPUNIT... " >&6; } if test -n "$CPPUNIT_CFLAGS"; then pkg_cv_CPPUNIT_CFLAGS="$CPPUNIT_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"cppunit >= 1.12 \""; } >&5 ($PKG_CONFIG --exists --print-errors "cppunit >= 1.12 ") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_CPPUNIT_CFLAGS=`$PKG_CONFIG --cflags "cppunit >= 1.12 " 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$CPPUNIT_LIBS"; then pkg_cv_CPPUNIT_LIBS="$CPPUNIT_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"cppunit >= 1.12 \""; } >&5 ($PKG_CONFIG --exists --print-errors "cppunit >= 1.12 ") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_CPPUNIT_LIBS=`$PKG_CONFIG --libs "cppunit >= 1.12 " 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then CPPUNIT_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "cppunit >= 1.12 " 2>&1` else CPPUNIT_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "cppunit >= 1.12 " 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$CPPUNIT_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (cppunit >= 1.12 ) were not met: $CPPUNIT_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables CPPUNIT_CFLAGS and CPPUNIT_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables CPPUNIT_CFLAGS and CPPUNIT_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else CPPUNIT_CFLAGS=$pkg_cv_CPPUNIT_CFLAGS CPPUNIT_LIBS=$pkg_cv_CPPUNIT_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi fi # Check for boost echo "$as_me: this is boost.m4 serial 12" >&5 boost_save_IFS=$IFS boost_version_req= IFS=. set x $boost_version_req 0 0 0 IFS=$boost_save_IFS shift boost_version_req=`expr "$1" '*' 100000 + "$2" '*' 100 + "$3"` # Check whether --with-boost was given. if test "${with_boost+set}" = set; then : withval=$with_boost; fi # If BOOST_ROOT is set and the user has not provided a value to # --with-boost, then treat BOOST_ROOT as if it the user supplied it. if test x"$BOOST_ROOT" != x; then if test x"$with_boost" = x; then { $as_echo "$as_me:${as_lineno-$LINENO}: Detected BOOST_ROOT; continuing with --with-boost=$BOOST_ROOT" >&5 $as_echo "$as_me: Detected BOOST_ROOT; continuing with --with-boost=$BOOST_ROOT" >&6;} with_boost=$BOOST_ROOT else { $as_echo "$as_me:${as_lineno-$LINENO}: Detected BOOST_ROOT=$BOOST_ROOT, but overridden by --with-boost=$with_boost" >&5 $as_echo "$as_me: Detected BOOST_ROOT=$BOOST_ROOT, but overridden by --with-boost=$with_boost" >&6;} fi fi DISTCHECK_CONFIGURE_FLAGS="$DISTCHECK_CONFIGURE_FLAGS '--with-boost=$with_boost'" boost_save_CPPFLAGS=$CPPFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boost headers version >= $boost_version_req" >&5 $as_echo_n "checking for Boost headers version >= $boost_version_req... " >&6; } if ${boost_cv_inc_path+:} false; then : $as_echo_n "(cached) " >&6 else boost_cv_inc_path=no ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #if !defined BOOST_VERSION # error BOOST_VERSION is not defined #elif BOOST_VERSION < $boost_version_req # error Boost headers version < $boost_version_req #endif int main () { ; return 0; } _ACEOF # If the user provided a value to --with-boost, use it and only it. case $with_boost in #( ''|yes) set x '' /opt/local/include /usr/local/include /opt/include \ /usr/include C:/Boost/include;; #( *) set x "$with_boost/include" "$with_boost";; esac shift for boost_dir do # Without --layout=system, Boost (or at least some versions) installs # itself in /include/boost-. This inner loop helps to # find headers in such directories. # # Any ${boost_dir}/boost-x_xx directories are searched in reverse version # order followed by ${boost_dir}. The final '.' is a sentinel for # searching $boost_dir" itself. Entries are whitespace separated. # # I didn't indent this loop on purpose (to avoid over-indented code) boost_layout_system_search_list=`cd "$boost_dir" 2>/dev/null \ && ls -1 | "${GREP}" '^boost-' | sort -rn -t- -k2 \ && echo .` for boost_inc in $boost_layout_system_search_list do if test x"$boost_inc" != x.; then boost_inc="$boost_dir/$boost_inc" else boost_inc="$boost_dir" # Uses sentinel in boost_layout_system_search_list fi if test x"$boost_inc" != x; then # We are going to check whether the version of Boost installed # in $boost_inc is usable by running a compilation that # #includes it. But if we pass a -I/some/path in which Boost # is not installed, the compiler will just skip this -I and # use other locations (either from CPPFLAGS, or from its list # of system include directories). As a result we would use # header installed on the machine instead of the /some/path # specified by the user. So in that precise case (trying # $boost_inc), make sure the version.hpp exists. # # Use test -e as there can be symlinks. test -e "$boost_inc/boost/version.hpp" || continue CPPFLAGS="$CPPFLAGS -I$boost_inc" fi if ac_fn_cxx_try_compile "$LINENO"; then : boost_cv_inc_path=yes else boost_cv_version=no fi rm -f core conftest.err conftest.$ac_objext if test x"$boost_cv_inc_path" = xyes; then if test x"$boost_inc" != x; then boost_cv_inc_path=$boost_inc fi break 2 fi done done ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $boost_cv_inc_path" >&5 $as_echo "$boost_cv_inc_path" >&6; } case $boost_cv_inc_path in #( no) boost_errmsg="cannot find Boost headers version >= $boost_version_req" as_fn_error $? "$boost_errmsg" "$LINENO" 5 ;;#( yes) BOOST_CPPFLAGS= ;;#( *) BOOST_CPPFLAGS="-I$boost_cv_inc_path" ;; esac if test x"$boost_cv_inc_path" != xno; then $as_echo "#define HAVE_BOOST 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boost's header version" >&5 $as_echo_n "checking for Boost's header version... " >&6; } if ${boost_cv_lib_version+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include boost-lib-version = BOOST_LIB_VERSION _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | tr -d '\r' | $SED -n -e "/^boost-lib-version = /{s///;s/\"//g;p;g;}" >conftest.i 2>&1; then : boost_cv_lib_version=`cat conftest.i` fi rm -rf conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $boost_cv_lib_version" >&5 $as_echo "$boost_cv_lib_version" >&6; } # e.g. "134" for 1_34_1 or "135" for 1_35 boost_major_version=`echo "$boost_cv_lib_version" | sed 's/_//;s/_.*//'` case $boost_major_version in #( '' | *[!0-9]*) as_fn_error $? "invalid value: boost_major_version=$boost_major_version" "$LINENO" 5 ;; esac fi CPPFLAGS=$boost_save_CPPFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the toolset name used by Boost for $CXX" >&5 $as_echo_n "checking for the toolset name used by Boost for $CXX... " >&6; } if ${boost_cv_lib_tag+:} false; then : $as_echo_n "(cached) " >&6 else boost_cv_lib_tag=unknown if test x$boost_cv_inc_path != xno; then ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu # The following tests are mostly inspired by boost/config/auto_link.hpp # The list is sorted to most recent/common to oldest compiler (in order # to increase the likelihood of finding the right compiler with the # least number of compilation attempt). # Beware that some tests are sensible to the order (for instance, we must # look for MinGW before looking for GCC3). # I used one compilation test per compiler with a #error to recognize # each compiler so that it works even when cross-compiling (let me know # if you know a better approach). # Known missing tags (known from Boost's tools/build/v2/tools/common.jam): # como, edg, kcc, bck, mp, sw, tru, xlc # I'm not sure about my test for `il' (be careful: Intel's ICC pre-defines # the same defines as GCC's). # TODO: Move the test on GCC 4.4 up once it's released. for i in \ "defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ == 3 && !defined __ICC @ gcc43" \ "defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && !defined __ICC @ gcc42" \ "defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ == 1 && !defined __ICC @ gcc41" \ "defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ == 0 && !defined __ICC @ gcc40" \ "defined __GNUC__ && __GNUC__ == 3 && !defined __ICC \ && (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \ || defined __WIN32__ || defined __WINNT || defined __WINNT__) @ mgw" \ "defined __GNUC__ && __GNUC__ == 3 && __GNUC_MINOR__ == 4 && !defined __ICC @ gcc34" \ "defined __GNUC__ && __GNUC__ == 3 && __GNUC_MINOR__ == 3 && !defined __ICC @ gcc33" \ "defined _MSC_VER && _MSC_VER >= 1500 @ vc90" \ "defined _MSC_VER && _MSC_VER == 1400 @ vc80" \ "defined __GNUC__ && __GNUC__ == 3 && __GNUC_MINOR__ == 2 && !defined __ICC @ gcc32" \ "defined _MSC_VER && _MSC_VER == 1310 @ vc71" \ "defined __GNUC__ && __GNUC__ == 3 && __GNUC_MINOR__ == 1 && !defined __ICC @ gcc31" \ "defined __GNUC__ && __GNUC__ == 3 && __GNUC_MINOR__ == 0 && !defined __ICC @ gcc30" \ "defined __BORLANDC__ @ bcb" \ "defined __ICC && (defined __unix || defined ) @ il" \ "defined __ICL @ iw" \ "defined _MSC_VER && _MSC_VER == 1300 @ vc7" \ "defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ == 4 && !defined __ICC @ gcc44" \ "defined __GNUC__ && __GNUC__ == 2 && __GNUC_MINOR__ == 95 && !defined __ICC @ gcc295" \ "defined __MWERKS__ && __MWERKS__ <= 0x32FF @ cw9" \ "defined _MSC_VER && _MSC_VER < 1300 && !defined UNDER_CE @ vc6" \ "defined _MSC_VER && _MSC_VER < 1300 && defined UNDER_CE @ evc4" \ "defined __MWERKS__ && __MWERKS__ <= 0x31FF @ cw8" do boost_tag_test=`expr "X$i" : 'X\([^@]*\) @ '` boost_tag=`expr "X$i" : 'X[^@]* @ \(.*\)'` cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #if $boost_tag_test /* OK */ #else # error $boost_tag_test #endif int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : boost_cv_lib_tag=$boost_tag; break fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu case $boost_cv_lib_tag in #( # Some newer (>= 1.35?) versions of Boost seem to only use "gcc" as opposed # to "gcc41" for instance. *-gcc | *'-gcc ') :;; #( Don't re-add -gcc: it's already in there. gcc*) boost_tag_x= case $host_os in #( darwin*) if test $boost_major_version -ge 136; then # The `x' added in r46793 of Boost. boost_tag_x=x fi;; esac # We can specify multiple tags in this variable because it's used by # BOOST_FIND_LIB that does a `for tag in -$boost_cv_lib_tag' ... boost_cv_lib_tag="$boost_tag_x$boost_cv_lib_tag -${boost_tag_x}gcc" ;; #( unknown) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: could not figure out which toolset name to use for $CXX" >&5 $as_echo "$as_me: WARNING: could not figure out which toolset name to use for $CXX" >&2;} boost_cv_lib_tag= ;; esac fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $boost_cv_lib_tag" >&5 $as_echo "$boost_cv_lib_tag" >&6; } # Check whether --enable-static-boost was given. if test "${enable_static_boost+set}" = set; then : enableval=$enable_static_boost; enable_static_boost=yes else enable_static_boost=no fi # Check whether we do better use `mt' even though we weren't ask to. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #if defined _REENTRANT || defined _MT || defined __MT__ /* use -mt */ #else # error MT not needed #endif int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : boost_guess_use_mt=: else boost_guess_use_mt=false fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test x"$boost_cv_inc_path" = xno; then { $as_echo "$as_me:${as_lineno-$LINENO}: Boost not available, not searching for the Boost date_time library" >&5 $as_echo "$as_me: Boost not available, not searching for the Boost date_time library" >&6;} else ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test x"$boost_cv_inc_path" = xno; then { $as_echo "$as_me:${as_lineno-$LINENO}: Boost not available, not searching for boost/date_time/posix_time/posix_time.hpp" >&5 $as_echo "$as_me: Boost not available, not searching for boost/date_time/posix_time/posix_time.hpp" >&6;} else ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu boost_save_CPPFLAGS=$CPPFLAGS CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" ac_fn_cxx_check_header_mongrel "$LINENO" "boost/date_time/posix_time/posix_time.hpp" "ac_cv_header_boost_date_time_posix_time_posix_time_hpp" "$ac_includes_default" if test "x$ac_cv_header_boost_date_time_posix_time_posix_time_hpp" = xyes; then : $as_echo "#define HAVE_BOOST_DATE_TIME_POSIX_TIME_POSIX_TIME_HPP 1" >>confdefs.h else as_fn_error $? "cannot find boost/date_time/posix_time/posix_time.hpp" "$LINENO" 5 fi CPPFLAGS=$boost_save_CPPFLAGS ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu fi boost_save_CPPFLAGS=$CPPFLAGS CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" # Now let's try to find the library. The algorithm is as follows: first look # for a given library name according to the user's PREFERRED-RT-OPT. For each # library name, we prefer to use the ones that carry the tag (toolset name). # Each library is searched through the various standard paths were Boost is # usually installed. If we can't find the standard variants, we try to # enforce -mt (for instance on MacOSX, libboost_threads.dylib doesn't exist # but there's -obviously- libboost_threads-mt.dylib). { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the Boost date_time library" >&5 $as_echo_n "checking for the Boost date_time library... " >&6; } if ${boost_cv_lib_date_time+:} false; then : $as_echo_n "(cached) " >&6 else boost_cv_lib_date_time=no case "" in #( mt | mt-) boost_mt=-mt; boost_rtopt=;; #( mt* | mt-*) boost_mt=-mt; boost_rtopt=`expr "X" : 'Xmt-*\(.*\)'`;; #( *) boost_mt=; boost_rtopt=;; esac if test $enable_static_boost = yes; then boost_rtopt="s$boost_rtopt" fi # Find the proper debug variant depending on what we've been asked to find. case $boost_rtopt in #( *d*) boost_rt_d=$boost_rtopt;; #( *[sgpn]*) # Insert the `d' at the right place (in between `sg' and `pn') boost_rt_d=`echo "$boost_rtopt" | sed 's/\(s*g*\)\(p*n*\)/\1\2/'`;; #( *) boost_rt_d='-d';; esac # If the PREFERRED-RT-OPT are not empty, prepend a `-'. test -n "$boost_rtopt" && boost_rtopt="-$boost_rtopt" $boost_guess_use_mt && boost_mt=-mt # Look for the abs path the static archive. # $libext is computed by Libtool but let's make sure it's non empty. test -z "$libext" && as_fn_error $? "the libext variable is empty, did you invoke Libtool?" "$LINENO" 5 boost_save_ac_objext=$ac_objext # Generate the test file. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { boost::posix_time::ptime t; ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_objext=do_not_rm_me_plz else as_fn_error $? "cannot compile a test that uses Boost date_time" "$LINENO" 5 fi rm -f core conftest.err conftest.$ac_objext ac_objext=$boost_save_ac_objext boost_failed_libs= # Don't bother to ident the 6 nested for loops, only the 2 innermost ones # matter. for boost_tag_ in -$boost_cv_lib_tag ''; do for boost_ver_ in -$boost_cv_lib_version ''; do for boost_mt_ in $boost_mt -mt ''; do for boost_rtopt_ in $boost_rtopt '' -d; do for boost_lib in \ boost_date_time$boost_tag_$boost_mt_$boost_rtopt_$boost_ver_ \ boost_date_time$boost_tag_$boost_rtopt_$boost_ver_ \ boost_date_time$boost_tag_$boost_mt_$boost_ver_ \ boost_date_time$boost_tag_$boost_ver_ do # Avoid testing twice the same lib case $boost_failed_libs in #( *@$boost_lib@*) continue;; esac # If with_boost is empty, we'll search in /lib first, which is not quite # right so instead we'll try to a location based on where the headers are. boost_tmp_lib=$with_boost test x"$with_boost" = x && boost_tmp_lib=${boost_cv_inc_path%/include} for boost_ldpath in "$boost_tmp_lib/lib" '' \ /opt/local/lib /usr/local/lib /opt/lib /usr/lib \ "$with_boost" C:/Boost/lib /lib /usr/lib64 /lib64 do test -e "$boost_ldpath" || continue boost_save_LDFLAGS=$LDFLAGS # Are we looking for a static library? case $boost_ldpath:$boost_rtopt_ in #( *?*:*s*) # Yes (Non empty boost_ldpath + s in rt opt) boost_cv_lib_date_time_LIBS="$boost_ldpath/lib$boost_lib.$libext" test -e "$boost_cv_lib_date_time_LIBS" || continue;; #( *) # No: use -lboost_foo to find the shared library. boost_cv_lib_date_time_LIBS="-l$boost_lib";; esac boost_save_LIBS=$LIBS LIBS="$boost_cv_lib_date_time_LIBS $LIBS" test x"$boost_ldpath" != x && LDFLAGS="$LDFLAGS -L$boost_ldpath" rm -f conftest$ac_exeext boost_save_ac_ext=$ac_ext boost_use_source=: # If we already have a .o, re-use it. We change $ac_ext so that $ac_link # tries to link the existing object file instead of compiling from source. test -f conftest.$ac_objext && ac_ext=$ac_objext && boost_use_source=false && $as_echo "$as_me:${as_lineno-$LINENO}: re-using the existing conftest.$ac_objext" >&5 if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_executable_p conftest$ac_exeext }; then : boost_cv_lib_date_time=yes else if $boost_use_source; then $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi boost_cv_lib_date_time=no fi ac_objext=$boost_save_ac_objext ac_ext=$boost_save_ac_ext rm -f core conftest.err conftest_ipa8_conftest.oo \ conftest$ac_exeext ac_objext=$boost_save_ac_objext LDFLAGS=$boost_save_LDFLAGS LIBS=$boost_save_LIBS if test x"$boost_cv_lib_date_time" = xyes; then boost_cv_lib_date_time_LDFLAGS="-L$boost_ldpath -R$boost_ldpath" break 6 else boost_failed_libs="$boost_failed_libs@$boost_lib@" fi done done done done done done rm -f conftest.$ac_objext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $boost_cv_lib_date_time" >&5 $as_echo "$boost_cv_lib_date_time" >&6; } case $boost_cv_lib_date_time in #( no) $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 as_fn_error $? "cannot not find the flags to link with Boost date_time" "$LINENO" 5 ;; esac BOOST_DATE_TIME_LDFLAGS=$boost_cv_lib_date_time_LDFLAGS BOOST_DATE_TIME_LIBS=$boost_cv_lib_date_time_LIBS CPPFLAGS=$boost_save_CPPFLAGS ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu fi if test x"$boost_cv_inc_path" = xno; then { $as_echo "$as_me:${as_lineno-$LINENO}: Boost not available, not searching for boost/scoped_ptr.hpp" >&5 $as_echo "$as_me: Boost not available, not searching for boost/scoped_ptr.hpp" >&6;} else ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu boost_save_CPPFLAGS=$CPPFLAGS CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" ac_fn_cxx_check_header_mongrel "$LINENO" "boost/scoped_ptr.hpp" "ac_cv_header_boost_scoped_ptr_hpp" "$ac_includes_default" if test "x$ac_cv_header_boost_scoped_ptr_hpp" = xyes; then : $as_echo "#define HAVE_BOOST_SCOPED_PTR_HPP 1" >>confdefs.h else as_fn_error $? "cannot find boost/scoped_ptr.hpp" "$LINENO" 5 fi CPPFLAGS=$boost_save_CPPFLAGS ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu fi if test x"$boost_cv_inc_path" = xno; then { $as_echo "$as_me:${as_lineno-$LINENO}: Boost not available, not searching for boost/shared_ptr.hpp" >&5 $as_echo "$as_me: Boost not available, not searching for boost/shared_ptr.hpp" >&6;} else ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu boost_save_CPPFLAGS=$CPPFLAGS CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" ac_fn_cxx_check_header_mongrel "$LINENO" "boost/shared_ptr.hpp" "ac_cv_header_boost_shared_ptr_hpp" "$ac_includes_default" if test "x$ac_cv_header_boost_shared_ptr_hpp" = xyes; then : $as_echo "#define HAVE_BOOST_SHARED_PTR_HPP 1" >>confdefs.h else as_fn_error $? "cannot find boost/shared_ptr.hpp" "$LINENO" 5 fi CPPFLAGS=$boost_save_CPPFLAGS ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu fi if test x"$boost_cv_inc_path" = xno; then { $as_echo "$as_me:${as_lineno-$LINENO}: Boost not available, not searching for boost/uuid/uuid.hpp" >&5 $as_echo "$as_me: Boost not available, not searching for boost/uuid/uuid.hpp" >&6;} else ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu boost_save_CPPFLAGS=$CPPFLAGS CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" ac_fn_cxx_check_header_mongrel "$LINENO" "boost/uuid/uuid.hpp" "ac_cv_header_boost_uuid_uuid_hpp" "$ac_includes_default" if test "x$ac_cv_header_boost_uuid_uuid_hpp" = xyes; then : $as_echo "#define HAVE_BOOST_UUID_UUID_HPP 1" >>confdefs.h else as_fn_error $? "cannot find boost/uuid/uuid.hpp" "$LINENO" 5 fi CPPFLAGS=$boost_save_CPPFLAGS ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu fi if test x"$boost_cv_inc_path" = xno; then { $as_echo "$as_me:${as_lineno-$LINENO}: Boost not available, not searching for boost/uuid/uuid_generators.hpp" >&5 $as_echo "$as_me: Boost not available, not searching for boost/uuid/uuid_generators.hpp" >&6;} else ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu boost_save_CPPFLAGS=$CPPFLAGS CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" ac_fn_cxx_check_header_mongrel "$LINENO" "boost/uuid/uuid_generators.hpp" "ac_cv_header_boost_uuid_uuid_generators_hpp" "$ac_includes_default" if test "x$ac_cv_header_boost_uuid_uuid_generators_hpp" = xyes; then : $as_echo "#define HAVE_BOOST_UUID_UUID_GENERATORS_HPP 1" >>confdefs.h else as_fn_error $? "cannot find boost/uuid/uuid_generators.hpp" "$LINENO" 5 fi CPPFLAGS=$boost_save_CPPFLAGS ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu fi if test x"$boost_cv_inc_path" = xno; then { $as_echo "$as_me:${as_lineno-$LINENO}: Boost not available, not searching for boost/uuid/uuid_io.hpp" >&5 $as_echo "$as_me: Boost not available, not searching for boost/uuid/uuid_io.hpp" >&6;} else ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu boost_save_CPPFLAGS=$CPPFLAGS CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" ac_fn_cxx_check_header_mongrel "$LINENO" "boost/uuid/uuid_io.hpp" "ac_cv_header_boost_uuid_uuid_io_hpp" "$ac_includes_default" if test "x$ac_cv_header_boost_uuid_uuid_io_hpp" = xyes; then : $as_echo "#define HAVE_BOOST_UUID_UUID_IO_HPP 1" >>confdefs.h else as_fn_error $? "cannot find boost/uuid/uuid_io.hpp" "$LINENO" 5 fi CPPFLAGS=$boost_save_CPPFLAGS ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu fi if test x"$boost_cv_inc_path" = xno; then { $as_echo "$as_me:${as_lineno-$LINENO}: Boost not available, not searching for boost/uuid/uuid_serialize.hpp" >&5 $as_echo "$as_me: Boost not available, not searching for boost/uuid/uuid_serialize.hpp" >&6;} else ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu boost_save_CPPFLAGS=$CPPFLAGS CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" ac_fn_cxx_check_header_mongrel "$LINENO" "boost/uuid/uuid_serialize.hpp" "ac_cv_header_boost_uuid_uuid_serialize_hpp" "$ac_includes_default" if test "x$ac_cv_header_boost_uuid_uuid_serialize_hpp" = xyes; then : $as_echo "#define HAVE_BOOST_UUID_UUID_SERIALIZE_HPP 1" >>confdefs.h else as_fn_error $? "cannot find boost/uuid/uuid_serialize.hpp" "$LINENO" 5 fi CPPFLAGS=$boost_save_CPPFLAGS ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu fi if test "x$enable_client" != "xno"; then : if test x"$boost_cv_inc_path" = xno; then { $as_echo "$as_me:${as_lineno-$LINENO}: Boost not available, not searching for the Boost program_options library" >&5 $as_echo "$as_me: Boost not available, not searching for the Boost program_options library" >&6;} else ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test x"$boost_cv_inc_path" = xno; then { $as_echo "$as_me:${as_lineno-$LINENO}: Boost not available, not searching for boost/program_options.hpp" >&5 $as_echo "$as_me: Boost not available, not searching for boost/program_options.hpp" >&6;} else ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu boost_save_CPPFLAGS=$CPPFLAGS CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" ac_fn_cxx_check_header_mongrel "$LINENO" "boost/program_options.hpp" "ac_cv_header_boost_program_options_hpp" "$ac_includes_default" if test "x$ac_cv_header_boost_program_options_hpp" = xyes; then : $as_echo "#define HAVE_BOOST_PROGRAM_OPTIONS_HPP 1" >>confdefs.h else as_fn_error $? "cannot find boost/program_options.hpp" "$LINENO" 5 fi CPPFLAGS=$boost_save_CPPFLAGS ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu fi boost_save_CPPFLAGS=$CPPFLAGS CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" # Now let's try to find the library. The algorithm is as follows: first look # for a given library name according to the user's PREFERRED-RT-OPT. For each # library name, we prefer to use the ones that carry the tag (toolset name). # Each library is searched through the various standard paths were Boost is # usually installed. If we can't find the standard variants, we try to # enforce -mt (for instance on MacOSX, libboost_threads.dylib doesn't exist # but there's -obviously- libboost_threads-mt.dylib). { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the Boost program_options library" >&5 $as_echo_n "checking for the Boost program_options library... " >&6; } if ${boost_cv_lib_program_options+:} false; then : $as_echo_n "(cached) " >&6 else boost_cv_lib_program_options=no case "" in #( mt | mt-) boost_mt=-mt; boost_rtopt=;; #( mt* | mt-*) boost_mt=-mt; boost_rtopt=`expr "X" : 'Xmt-*\(.*\)'`;; #( *) boost_mt=; boost_rtopt=;; esac if test $enable_static_boost = yes; then boost_rtopt="s$boost_rtopt" fi # Find the proper debug variant depending on what we've been asked to find. case $boost_rtopt in #( *d*) boost_rt_d=$boost_rtopt;; #( *[sgpn]*) # Insert the `d' at the right place (in between `sg' and `pn') boost_rt_d=`echo "$boost_rtopt" | sed 's/\(s*g*\)\(p*n*\)/\1\2/'`;; #( *) boost_rt_d='-d';; esac # If the PREFERRED-RT-OPT are not empty, prepend a `-'. test -n "$boost_rtopt" && boost_rtopt="-$boost_rtopt" $boost_guess_use_mt && boost_mt=-mt # Look for the abs path the static archive. # $libext is computed by Libtool but let's make sure it's non empty. test -z "$libext" && as_fn_error $? "the libext variable is empty, did you invoke Libtool?" "$LINENO" 5 boost_save_ac_objext=$ac_objext # Generate the test file. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { boost::program_options::options_description d("test"); ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_objext=do_not_rm_me_plz else as_fn_error $? "cannot compile a test that uses Boost program_options" "$LINENO" 5 fi rm -f core conftest.err conftest.$ac_objext ac_objext=$boost_save_ac_objext boost_failed_libs= # Don't bother to ident the 6 nested for loops, only the 2 innermost ones # matter. for boost_tag_ in -$boost_cv_lib_tag ''; do for boost_ver_ in -$boost_cv_lib_version ''; do for boost_mt_ in $boost_mt -mt ''; do for boost_rtopt_ in $boost_rtopt '' -d; do for boost_lib in \ boost_program_options$boost_tag_$boost_mt_$boost_rtopt_$boost_ver_ \ boost_program_options$boost_tag_$boost_rtopt_$boost_ver_ \ boost_program_options$boost_tag_$boost_mt_$boost_ver_ \ boost_program_options$boost_tag_$boost_ver_ do # Avoid testing twice the same lib case $boost_failed_libs in #( *@$boost_lib@*) continue;; esac # If with_boost is empty, we'll search in /lib first, which is not quite # right so instead we'll try to a location based on where the headers are. boost_tmp_lib=$with_boost test x"$with_boost" = x && boost_tmp_lib=${boost_cv_inc_path%/include} for boost_ldpath in "$boost_tmp_lib/lib" '' \ /opt/local/lib /usr/local/lib /opt/lib /usr/lib \ "$with_boost" C:/Boost/lib /lib /usr/lib64 /lib64 do test -e "$boost_ldpath" || continue boost_save_LDFLAGS=$LDFLAGS # Are we looking for a static library? case $boost_ldpath:$boost_rtopt_ in #( *?*:*s*) # Yes (Non empty boost_ldpath + s in rt opt) boost_cv_lib_program_options_LIBS="$boost_ldpath/lib$boost_lib.$libext" test -e "$boost_cv_lib_program_options_LIBS" || continue;; #( *) # No: use -lboost_foo to find the shared library. boost_cv_lib_program_options_LIBS="-l$boost_lib";; esac boost_save_LIBS=$LIBS LIBS="$boost_cv_lib_program_options_LIBS $LIBS" test x"$boost_ldpath" != x && LDFLAGS="$LDFLAGS -L$boost_ldpath" rm -f conftest$ac_exeext boost_save_ac_ext=$ac_ext boost_use_source=: # If we already have a .o, re-use it. We change $ac_ext so that $ac_link # tries to link the existing object file instead of compiling from source. test -f conftest.$ac_objext && ac_ext=$ac_objext && boost_use_source=false && $as_echo "$as_me:${as_lineno-$LINENO}: re-using the existing conftest.$ac_objext" >&5 if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_executable_p conftest$ac_exeext }; then : boost_cv_lib_program_options=yes else if $boost_use_source; then $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi boost_cv_lib_program_options=no fi ac_objext=$boost_save_ac_objext ac_ext=$boost_save_ac_ext rm -f core conftest.err conftest_ipa8_conftest.oo \ conftest$ac_exeext ac_objext=$boost_save_ac_objext LDFLAGS=$boost_save_LDFLAGS LIBS=$boost_save_LIBS if test x"$boost_cv_lib_program_options" = xyes; then boost_cv_lib_program_options_LDFLAGS="-L$boost_ldpath -R$boost_ldpath" break 6 else boost_failed_libs="$boost_failed_libs@$boost_lib@" fi done done done done done done rm -f conftest.$ac_objext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $boost_cv_lib_program_options" >&5 $as_echo "$boost_cv_lib_program_options" >&6; } case $boost_cv_lib_program_options in #( no) $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 as_fn_error $? "cannot not find the flags to link with Boost program_options" "$LINENO" 5 ;; esac BOOST_PROGRAM_OPTIONS_LDFLAGS=$boost_cv_lib_program_options_LDFLAGS BOOST_PROGRAM_OPTIONS_LIBS=$boost_cv_lib_program_options_LIBS CPPFLAGS=$boost_save_CPPFLAGS ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu fi fi # Checks for header files. for ac_header in stdlib.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_cxx_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done # Checks for typedefs, structures, and compiler characteristics. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5 $as_echo_n "checking for stdbool.h that conforms to C99... " >&6; } if ${ac_cv_header_stdbool_h+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #ifndef bool "error: bool is not defined" #endif #ifndef false "error: false is not defined" #endif #if false "error: false is not 0" #endif #ifndef true "error: true is not defined" #endif #if true != 1 "error: true is not 1" #endif #ifndef __bool_true_false_are_defined "error: __bool_true_false_are_defined is not defined" #endif struct s { _Bool s: 1; _Bool t; } s; char a[true == 1 ? 1 : -1]; char b[false == 0 ? 1 : -1]; char c[__bool_true_false_are_defined == 1 ? 1 : -1]; char d[(bool) 0.5 == true ? 1 : -1]; /* See body of main program for 'e'. */ char f[(_Bool) 0.0 == false ? 1 : -1]; char g[true]; char h[sizeof (_Bool)]; char i[sizeof s.t]; enum { j = false, k = true, l = false * true, m = true * 256 }; /* The following fails for HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */ _Bool n[m]; char o[sizeof n == m * sizeof n[0] ? 1 : -1]; char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1]; /* Catch a bug in an HP-UX C compiler. See http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html */ _Bool q = true; _Bool *pq = &q; int main () { bool e = &s; *pq |= q; *pq |= ! q; /* Refer to every declared value, to avoid compiler optimizations. */ return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l + !m + !n + !o + !p + !q + !pq); ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_header_stdbool_h=yes else ac_cv_header_stdbool_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdbool_h" >&5 $as_echo "$ac_cv_header_stdbool_h" >&6; } ac_fn_cxx_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default" if test "x$ac_cv_type__Bool" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE__BOOL 1 _ACEOF fi if test $ac_cv_header_stdbool_h = yes; then $as_echo "#define HAVE_STDBOOL_H 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 $as_echo_n "checking for inline... " >&6; } if ${ac_cv_c_inline+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifndef __cplusplus typedef int foo_t; static $ac_kw foo_t static_foo () {return 0; } $ac_kw foo_t foo () {return 0; } #endif _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_c_inline=$ac_kw fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext test "$ac_cv_c_inline" != no && break done fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 $as_echo "$ac_cv_c_inline" >&6; } case $ac_cv_c_inline in inline | yes) ;; *) case $ac_cv_c_inline in no) ac_val=;; *) ac_val=$ac_cv_c_inline;; esac cat >>confdefs.h <<_ACEOF #ifndef __cplusplus #define inline $ac_val #endif _ACEOF ;; esac ac_fn_cxx_check_type "$LINENO" "mode_t" "ac_cv_type_mode_t" "$ac_includes_default" if test "x$ac_cv_type_mode_t" = xyes; then : else cat >>confdefs.h <<_ACEOF #define mode_t int _ACEOF fi ac_fn_cxx_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" if test "x$ac_cv_type_size_t" = xyes; then : else cat >>confdefs.h <<_ACEOF #define size_t unsigned int _ACEOF fi # Checks for library functions. ac_config_files="$ac_config_files Makefile libcmis.pc libcmis-c.pc run-test.sh cppcheck-test.sh src/Makefile src/libcmis/Makefile src/libcmis-c/Makefile qa/Makefile qa/mockup/Makefile qa/libcmis/Makefile qa/libcmis-c/Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. # # If the first sed substitution is executed (which looks for macros that # take arguments), then branch to the quote section. Otherwise, # look for a macro that doesn't take arguments. ac_script=' :mline /\\$/{ N s,\\\n,, b mline } t clear :clear s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g t quote s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g t quote b any :quote s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g s/\[/\\&/g s/\]/\\&/g s/\$/$$/g H :any ${ g s/^\n// s/\n/ /g p } ' DEFS=`sed -n "$ac_script" confdefs.h` ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs { $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 $as_echo_n "checking that generated files are newer than configure... " >&6; } if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 $as_echo "done" >&6; } if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi if test -z "${ENABLE_CLIENT_TRUE}" && test -z "${ENABLE_CLIENT_FALSE}"; then as_fn_error $? "conditional \"ENABLE_CLIENT\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_TESTS_TRUE}" && test -z "${ENABLE_TESTS_FALSE}"; then as_fn_error $? "conditional \"ENABLE_TESTS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_LONG_TESTS_TRUE}" && test -z "${ENABLE_LONG_TESTS_FALSE}"; then as_fn_error $? "conditional \"ENABLE_LONG_TESTS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${OS_WIN32_TRUE}" && test -z "${OS_WIN32_FALSE}"; then as_fn_error $? "conditional \"OS_WIN32\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${WITH_LIBCMIS_MAN_TRUE}" && test -z "${WITH_LIBCMIS_MAN_FALSE}"; then as_fn_error $? "conditional \"WITH_LIBCMIS_MAN\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_CPPCHECK_TRUE}" && test -z "${ENABLE_CPPCHECK_FALSE}"; then as_fn_error $? "conditional \"ENABLE_CPPCHECK\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by libcmis $as_me 0.4.1, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE Configuration files: $config_files Configuration commands: $config_commands Report bugs to the package provider." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ libcmis config.status 0.4.1 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --he | --h | --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`' host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`' hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' compiler_lib_search_dirs='`$ECHO "$compiler_lib_search_dirs" | $SED "$delay_single_quote_subst"`' predep_objects='`$ECHO "$predep_objects" | $SED "$delay_single_quote_subst"`' postdep_objects='`$ECHO "$postdep_objects" | $SED "$delay_single_quote_subst"`' predeps='`$ECHO "$predeps" | $SED "$delay_single_quote_subst"`' postdeps='`$ECHO "$postdeps" | $SED "$delay_single_quote_subst"`' compiler_lib_search_path='`$ECHO "$compiler_lib_search_path" | $SED "$delay_single_quote_subst"`' LD_CXX='`$ECHO "$LD_CXX" | $SED "$delay_single_quote_subst"`' reload_flag_CXX='`$ECHO "$reload_flag_CXX" | $SED "$delay_single_quote_subst"`' reload_cmds_CXX='`$ECHO "$reload_cmds_CXX" | $SED "$delay_single_quote_subst"`' old_archive_cmds_CXX='`$ECHO "$old_archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' compiler_CXX='`$ECHO "$compiler_CXX" | $SED "$delay_single_quote_subst"`' GCC_CXX='`$ECHO "$GCC_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag_CXX='`$ECHO "$lt_prog_compiler_no_builtin_flag_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_pic_CXX='`$ECHO "$lt_prog_compiler_pic_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_wl_CXX='`$ECHO "$lt_prog_compiler_wl_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_static_CXX='`$ECHO "$lt_prog_compiler_static_CXX" | $SED "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o_CXX='`$ECHO "$lt_cv_prog_compiler_c_o_CXX" | $SED "$delay_single_quote_subst"`' archive_cmds_need_lc_CXX='`$ECHO "$archive_cmds_need_lc_CXX" | $SED "$delay_single_quote_subst"`' enable_shared_with_static_runtimes_CXX='`$ECHO "$enable_shared_with_static_runtimes_CXX" | $SED "$delay_single_quote_subst"`' export_dynamic_flag_spec_CXX='`$ECHO "$export_dynamic_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' whole_archive_flag_spec_CXX='`$ECHO "$whole_archive_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' compiler_needs_object_CXX='`$ECHO "$compiler_needs_object_CXX" | $SED "$delay_single_quote_subst"`' old_archive_from_new_cmds_CXX='`$ECHO "$old_archive_from_new_cmds_CXX" | $SED "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds_CXX='`$ECHO "$old_archive_from_expsyms_cmds_CXX" | $SED "$delay_single_quote_subst"`' archive_cmds_CXX='`$ECHO "$archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' archive_expsym_cmds_CXX='`$ECHO "$archive_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' module_cmds_CXX='`$ECHO "$module_cmds_CXX" | $SED "$delay_single_quote_subst"`' module_expsym_cmds_CXX='`$ECHO "$module_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' with_gnu_ld_CXX='`$ECHO "$with_gnu_ld_CXX" | $SED "$delay_single_quote_subst"`' allow_undefined_flag_CXX='`$ECHO "$allow_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' no_undefined_flag_CXX='`$ECHO "$no_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec_CXX='`$ECHO "$hardcode_libdir_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' hardcode_libdir_separator_CXX='`$ECHO "$hardcode_libdir_separator_CXX" | $SED "$delay_single_quote_subst"`' hardcode_direct_CXX='`$ECHO "$hardcode_direct_CXX" | $SED "$delay_single_quote_subst"`' hardcode_direct_absolute_CXX='`$ECHO "$hardcode_direct_absolute_CXX" | $SED "$delay_single_quote_subst"`' hardcode_minus_L_CXX='`$ECHO "$hardcode_minus_L_CXX" | $SED "$delay_single_quote_subst"`' hardcode_shlibpath_var_CXX='`$ECHO "$hardcode_shlibpath_var_CXX" | $SED "$delay_single_quote_subst"`' hardcode_automatic_CXX='`$ECHO "$hardcode_automatic_CXX" | $SED "$delay_single_quote_subst"`' inherit_rpath_CXX='`$ECHO "$inherit_rpath_CXX" | $SED "$delay_single_quote_subst"`' link_all_deplibs_CXX='`$ECHO "$link_all_deplibs_CXX" | $SED "$delay_single_quote_subst"`' always_export_symbols_CXX='`$ECHO "$always_export_symbols_CXX" | $SED "$delay_single_quote_subst"`' export_symbols_cmds_CXX='`$ECHO "$export_symbols_cmds_CXX" | $SED "$delay_single_quote_subst"`' exclude_expsyms_CXX='`$ECHO "$exclude_expsyms_CXX" | $SED "$delay_single_quote_subst"`' include_expsyms_CXX='`$ECHO "$include_expsyms_CXX" | $SED "$delay_single_quote_subst"`' prelink_cmds_CXX='`$ECHO "$prelink_cmds_CXX" | $SED "$delay_single_quote_subst"`' postlink_cmds_CXX='`$ECHO "$postlink_cmds_CXX" | $SED "$delay_single_quote_subst"`' file_list_spec_CXX='`$ECHO "$file_list_spec_CXX" | $SED "$delay_single_quote_subst"`' hardcode_action_CXX='`$ECHO "$hardcode_action_CXX" | $SED "$delay_single_quote_subst"`' compiler_lib_search_dirs_CXX='`$ECHO "$compiler_lib_search_dirs_CXX" | $SED "$delay_single_quote_subst"`' predep_objects_CXX='`$ECHO "$predep_objects_CXX" | $SED "$delay_single_quote_subst"`' postdep_objects_CXX='`$ECHO "$postdep_objects_CXX" | $SED "$delay_single_quote_subst"`' predeps_CXX='`$ECHO "$predeps_CXX" | $SED "$delay_single_quote_subst"`' postdeps_CXX='`$ECHO "$postdeps_CXX" | $SED "$delay_single_quote_subst"`' compiler_lib_search_path_CXX='`$ECHO "$compiler_lib_search_path_CXX" | $SED "$delay_single_quote_subst"`' LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } # Quote evaled strings. for var in SHELL \ ECHO \ PATH_SEPARATOR \ SED \ GREP \ EGREP \ FGREP \ LD \ NM \ LN_S \ lt_SP2NL \ lt_NL2SP \ reload_flag \ OBJDUMP \ deplibs_check_method \ file_magic_cmd \ file_magic_glob \ want_nocaseglob \ DLLTOOL \ sharedlib_from_linklib_cmd \ AR \ AR_FLAGS \ archiver_list_spec \ STRIP \ RANLIB \ CC \ CFLAGS \ compiler \ lt_cv_sys_global_symbol_pipe \ lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ nm_file_list_spec \ lt_prog_compiler_no_builtin_flag \ lt_prog_compiler_pic \ lt_prog_compiler_wl \ lt_prog_compiler_static \ lt_cv_prog_compiler_c_o \ need_locks \ MANIFEST_TOOL \ DSYMUTIL \ NMEDIT \ LIPO \ OTOOL \ OTOOL64 \ shrext_cmds \ export_dynamic_flag_spec \ whole_archive_flag_spec \ compiler_needs_object \ with_gnu_ld \ allow_undefined_flag \ no_undefined_flag \ hardcode_libdir_flag_spec \ hardcode_libdir_separator \ exclude_expsyms \ include_expsyms \ file_list_spec \ variables_saved_for_relink \ libname_spec \ library_names_spec \ soname_spec \ install_override_mode \ finish_eval \ old_striplib \ striplib \ compiler_lib_search_dirs \ predep_objects \ postdep_objects \ predeps \ postdeps \ compiler_lib_search_path \ LD_CXX \ reload_flag_CXX \ compiler_CXX \ lt_prog_compiler_no_builtin_flag_CXX \ lt_prog_compiler_pic_CXX \ lt_prog_compiler_wl_CXX \ lt_prog_compiler_static_CXX \ lt_cv_prog_compiler_c_o_CXX \ export_dynamic_flag_spec_CXX \ whole_archive_flag_spec_CXX \ compiler_needs_object_CXX \ with_gnu_ld_CXX \ allow_undefined_flag_CXX \ no_undefined_flag_CXX \ hardcode_libdir_flag_spec_CXX \ hardcode_libdir_separator_CXX \ exclude_expsyms_CXX \ include_expsyms_CXX \ file_list_spec_CXX \ compiler_lib_search_dirs_CXX \ predep_objects_CXX \ postdep_objects_CXX \ predeps_CXX \ postdeps_CXX \ compiler_lib_search_path_CXX; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in reload_cmds \ old_postinstall_cmds \ old_postuninstall_cmds \ old_archive_cmds \ extract_expsyms_cmds \ old_archive_from_new_cmds \ old_archive_from_expsyms_cmds \ archive_cmds \ archive_expsym_cmds \ module_cmds \ module_expsym_cmds \ export_symbols_cmds \ prelink_cmds \ postlink_cmds \ postinstall_cmds \ postuninstall_cmds \ finish_cmds \ sys_lib_search_path_spec \ sys_lib_dlsearch_path_spec \ reload_cmds_CXX \ old_archive_cmds_CXX \ old_archive_from_new_cmds_CXX \ old_archive_from_expsyms_cmds_CXX \ archive_cmds_CXX \ archive_expsym_cmds_CXX \ module_cmds_CXX \ module_expsym_cmds_CXX \ export_symbols_cmds_CXX \ prelink_cmds_CXX \ postlink_cmds_CXX; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done ac_aux_dir='$ac_aux_dir' xsi_shell='$xsi_shell' lt_shell_append='$lt_shell_append' # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi PACKAGE='$PACKAGE' VERSION='$VERSION' TIMESTAMP='$TIMESTAMP' RM='$RM' ofile='$ofile' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "libcmis.pc") CONFIG_FILES="$CONFIG_FILES libcmis.pc" ;; "libcmis-c.pc") CONFIG_FILES="$CONFIG_FILES libcmis-c.pc" ;; "run-test.sh") CONFIG_FILES="$CONFIG_FILES run-test.sh" ;; "cppcheck-test.sh") CONFIG_FILES="$CONFIG_FILES cppcheck-test.sh" ;; "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; "src/libcmis/Makefile") CONFIG_FILES="$CONFIG_FILES src/libcmis/Makefile" ;; "src/libcmis-c/Makefile") CONFIG_FILES="$CONFIG_FILES src/libcmis-c/Makefile" ;; "qa/Makefile") CONFIG_FILES="$CONFIG_FILES qa/Makefile" ;; "qa/mockup/Makefile") CONFIG_FILES="$CONFIG_FILES qa/mockup/Makefile" ;; "qa/libcmis/Makefile") CONFIG_FILES="$CONFIG_FILES qa/libcmis/Makefile" ;; "qa/libcmis-c/Makefile") CONFIG_FILES="$CONFIG_FILES qa/libcmis-c/Makefile" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" eval set X " :F $CONFIG_FILES :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 $as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named 'Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running 'make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "$am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`$as_dirname -- "$file" || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir=$dirpart/$fdir; as_fn_mkdir_p # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ;; "libtool":C) # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi cfgfile="${ofile}T" trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. # # GNU Libtool is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of # the License, or (at your option) any later version. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, or # obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # The names of the tagged configurations supported by this script. available_tags="CXX " # ### BEGIN LIBTOOL CONFIG # Which release of libtool.m4 was used? macro_version=$macro_version macro_revision=$macro_revision # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # What type of objects to build. pic_mode=$pic_mode # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # An echo program that protects backslashes. ECHO=$lt_ECHO # The PATH separator for the build system. PATH_SEPARATOR=$lt_PATH_SEPARATOR # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # A sed program that does not truncate output. SED=$lt_SED # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="\$SED -e 1s/^X//" # A grep program that handles long lines. GREP=$lt_GREP # An ERE matcher. EGREP=$lt_EGREP # A literal string matcher. FGREP=$lt_FGREP # A BSD- or MS-compatible name lister. NM=$lt_NM # Whether we need soft or hard links. LN_S=$lt_LN_S # What is the maximum length of a command? max_cmd_len=$max_cmd_len # Object file suffix (normally "o"). objext=$ac_objext # Executable file suffix (normally ""). exeext=$exeext # whether the shell understands "unset". lt_unset=$lt_unset # turn spaces into newlines. SP2NL=$lt_lt_SP2NL # turn newlines into spaces. NL2SP=$lt_lt_NL2SP # convert \$build file names to \$host format. to_host_file_cmd=$lt_cv_to_host_file_cmd # convert \$build files to toolchain format. to_tool_file_cmd=$lt_cv_to_tool_file_cmd # An object symbol dumper. OBJDUMP=$lt_OBJDUMP # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method = "file_magic". file_magic_cmd=$lt_file_magic_cmd # How to find potential files when deplibs_check_method = "file_magic". file_magic_glob=$lt_file_magic_glob # Find potential files using nocaseglob when deplibs_check_method = "file_magic". want_nocaseglob=$lt_want_nocaseglob # DLL creation program. DLLTOOL=$lt_DLLTOOL # Command to associate shared and link libraries. sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd # The archiver. AR=$lt_AR # Flags to create an archive. AR_FLAGS=$lt_AR_FLAGS # How to feed a file listing to the archiver. archiver_list_spec=$lt_archiver_list_spec # A symbol stripping program. STRIP=$lt_STRIP # Commands used to install an old-style archive. RANLIB=$lt_RANLIB old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Whether to use a lock for old archive extraction. lock_old_archive_extraction=$lock_old_archive_extraction # A C compiler. LTCC=$lt_CC # LTCC compiler flags. LTCFLAGS=$lt_CFLAGS # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration. global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair. global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # Transform the output of nm in a C name address pair when lib prefix is needed. global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix # Specify filename containing input files for \$NM. nm_file_list_spec=$lt_nm_file_list_spec # The root where to search for dependent libraries,and in which our libraries should be installed. lt_sysroot=$lt_sysroot # The name of the directory that contains temporary libtool files. objdir=$objdir # Used to examine libraries when file_magic_cmd begins with "file". MAGIC_CMD=$MAGIC_CMD # Must we lock files when doing compilation? need_locks=$lt_need_locks # Manifest tool. MANIFEST_TOOL=$lt_MANIFEST_TOOL # Tool to manipulate archived DWARF debug symbol files on Mac OS X. DSYMUTIL=$lt_DSYMUTIL # Tool to change global to local symbols on Mac OS X. NMEDIT=$lt_NMEDIT # Tool to manipulate fat objects and archives on Mac OS X. LIPO=$lt_LIPO # ldd/readelf like tool for Mach-O binaries on Mac OS X. OTOOL=$lt_OTOOL # ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. OTOOL64=$lt_OTOOL64 # Old archive suffix (normally "a"). libext=$libext # Shared library suffix (normally ".so"). shrext_cmds=$lt_shrext_cmds # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Variables whose values should be saved in libtool wrapper scripts and # restored at link time. variables_saved_for_relink=$lt_variables_saved_for_relink # Do we need the "lib" prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Library versioning type. version_type=$version_type # Shared library runtime path variable. runpath_var=$runpath_var # Shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Permission mode override for installation of shared libraries. install_override_mode=$lt_install_override_mode # Command to use after installation of a shared archive. postinstall_cmds=$lt_postinstall_cmds # Command to use after uninstallation of a shared archive. postuninstall_cmds=$lt_postuninstall_cmds # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # As "finish_cmds", except a single script fragment to be evaled but # not shown. finish_eval=$lt_finish_eval # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Compile-time system search path for libraries. sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries. sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # The linker used to build libraries. LD=$lt_LD # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds # A language specific compiler. CC=$lt_compiler # Is the compiler the GNU compiler? with_gcc=$GCC # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc # Whether or not to disallow shared libs when runtime libs are static. allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds # Commands used to build a shared archive. archive_cmds=$lt_archive_cmds archive_expsym_cmds=$lt_archive_expsym_cmds # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds module_expsym_cmds=$lt_module_expsym_cmds # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary. hardcode_direct=$hardcode_direct # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary and the resulting library dependency is # "absolute",i.e impossible to change by setting \${shlibpath_var} if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute # Set to "yes" if using the -LDIR flag during linking hardcodes DIR # into the resulting binary. hardcode_minus_L=$hardcode_minus_L # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR # into the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var # Set to "yes" if building a shared library automatically hardcodes DIR # into the library and all subsequent libraries and executables linked # against it. hardcode_automatic=$hardcode_automatic # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms # Symbols that must always be exported. include_expsyms=$lt_include_expsyms # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds # Commands necessary for finishing linking programs. postlink_cmds=$lt_postlink_cmds # Specify filename containing input files. file_list_spec=$lt_file_list_spec # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action # The directories searched by this compiler when creating a shared library. compiler_lib_search_dirs=$lt_compiler_lib_search_dirs # Dependencies to place before and after the objects being linked to # create a shared library. predep_objects=$lt_predep_objects postdep_objects=$lt_postdep_objects predeps=$lt_predeps postdeps=$lt_postdeps # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path # ### END LIBTOOL CONFIG _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac ltmain="$ac_aux_dir/ltmain.sh" # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) if test x"$xsi_shell" = xyes; then sed -e '/^func_dirname ()$/,/^} # func_dirname /c\ func_dirname ()\ {\ \ case ${1} in\ \ */*) func_dirname_result="${1%/*}${2}" ;;\ \ * ) func_dirname_result="${3}" ;;\ \ esac\ } # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_basename ()$/,/^} # func_basename /c\ func_basename ()\ {\ \ func_basename_result="${1##*/}"\ } # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\ func_dirname_and_basename ()\ {\ \ case ${1} in\ \ */*) func_dirname_result="${1%/*}${2}" ;;\ \ * ) func_dirname_result="${3}" ;;\ \ esac\ \ func_basename_result="${1##*/}"\ } # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_stripname ()$/,/^} # func_stripname /c\ func_stripname ()\ {\ \ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\ \ # positional parameters, so assign one to ordinary parameter first.\ \ func_stripname_result=${3}\ \ func_stripname_result=${func_stripname_result#"${1}"}\ \ func_stripname_result=${func_stripname_result%"${2}"}\ } # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\ func_split_long_opt ()\ {\ \ func_split_long_opt_name=${1%%=*}\ \ func_split_long_opt_arg=${1#*=}\ } # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\ func_split_short_opt ()\ {\ \ func_split_short_opt_arg=${1#??}\ \ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\ } # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\ func_lo2o ()\ {\ \ case ${1} in\ \ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\ \ *) func_lo2o_result=${1} ;;\ \ esac\ } # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_xform ()$/,/^} # func_xform /c\ func_xform ()\ {\ func_xform_result=${1%.*}.lo\ } # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_arith ()$/,/^} # func_arith /c\ func_arith ()\ {\ func_arith_result=$(( $* ))\ } # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_len ()$/,/^} # func_len /c\ func_len ()\ {\ func_len_result=${#1}\ } # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: fi if test x"$lt_shell_append" = xyes; then sed -e '/^func_append ()$/,/^} # func_append /c\ func_append ()\ {\ eval "${1}+=\\${2}"\ } # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\ func_append_quoted ()\ {\ \ func_quote_for_eval "${2}"\ \ eval "${1}+=\\\\ \\$func_quote_for_eval_result"\ } # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: # Save a `func_append' function call where possible by direct use of '+=' sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: else # Save a `func_append' function call even when '+=' is not available sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: fi if test x"$_lt_function_replace_fail" = x":"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5 $as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;} fi mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" cat <<_LT_EOF >> "$ofile" # ### BEGIN LIBTOOL TAG CONFIG: CXX # The linker used to build libraries. LD=$lt_LD_CXX # How to create reloadable object files. reload_flag=$lt_reload_flag_CXX reload_cmds=$lt_reload_cmds_CXX # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds_CXX # A language specific compiler. CC=$lt_compiler_CXX # Is the compiler the GNU compiler? with_gcc=$GCC_CXX # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_CXX # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_CXX # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_CXX # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_CXX # Whether or not to disallow shared libs when runtime libs are static. allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object_CXX # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX # Commands used to build a shared archive. archive_cmds=$lt_archive_cmds_CXX archive_expsym_cmds=$lt_archive_expsym_cmds_CXX # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds_CXX module_expsym_cmds=$lt_module_expsym_cmds_CXX # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld_CXX # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_CXX # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_CXX # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary. hardcode_direct=$hardcode_direct_CXX # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary and the resulting library dependency is # "absolute",i.e impossible to change by setting \${shlibpath_var} if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute_CXX # Set to "yes" if using the -LDIR flag during linking hardcodes DIR # into the resulting binary. hardcode_minus_L=$hardcode_minus_L_CXX # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR # into the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX # Set to "yes" if building a shared library automatically hardcodes DIR # into the library and all subsequent libraries and executables linked # against it. hardcode_automatic=$hardcode_automatic_CXX # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath_CXX # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_CXX # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols_CXX # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_CXX # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_CXX # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_CXX # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds_CXX # Commands necessary for finishing linking programs. postlink_cmds=$lt_postlink_cmds_CXX # Specify filename containing input files. file_list_spec=$lt_file_list_spec_CXX # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_CXX # The directories searched by this compiler when creating a shared library. compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_CXX # Dependencies to place before and after the objects being linked to # create a shared library. predep_objects=$lt_predep_objects_CXX postdep_objects=$lt_postdep_objects_CXX predeps=$lt_predeps_CXX postdeps=$lt_postdeps_CXX # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path_CXX # ### END LIBTOOL TAG CONFIG: CXX _LT_EOF ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi { $as_echo "$as_me:${as_lineno-$LINENO}: libcmis $VERSION: Prefix: ${prefix} Compiler flags: ${CXXFLAGS} client: ${enable_client} werror: ${enable_werror} tests: ${enable_tests} long tests: ${enable_long_tests} cppcheck tests: ${enable_cppcheck} mans: ${build_man} " >&5 $as_echo "$as_me: libcmis $VERSION: Prefix: ${prefix} Compiler flags: ${CXXFLAGS} client: ${enable_client} werror: ${enable_werror} tests: ${enable_tests} long tests: ${enable_long_tests} cppcheck tests: ${enable_cppcheck} mans: ${build_man} " >&6;} libcmis-0.4.1/run-test.sh0000644000175000001440000000474312200457454012203 00000000000000#!/usr/bin/env sh LIBCMIS_DIR=$PWD/`dirname $0` TEST_SERVER=${LIBCMIS_DIR}/test-server TEST_SERVER_SCRIPT=${TEST_SERVER}/bin/jetty.sh TEST_SERVER_URL=http://localhost:8080/inmemory REST_URL=${TEST_SERVER_URL}/atom SOAP_URL=${TEST_SERVER_URL}/RepositoryService JETTY_VERSION=8.0.1 JETTY_NAME=jetty-hightide-${JETTY_VERSION}.v20110908 CHEMISTRY_VERSION=0.7.0 CHEMISTRY_WEBAPPS=chemistry-opencmis-dist-${CHEMISTRY_VERSION}-server-webapps.tar.gz INMEMORY_WAR=chemistry-opencmis-server-inmemory-${CHEMISTRY_VERSION}.war function setup_server() { # Downloads if test ! -e ${LIBCMIS_DIR}/${JETTY_NAME}.tar.gz; then echo "Downloading Jetty" curl -o ${LIBCMIS_DIR}/${JETTY_NAME}.tar.gz \ http://dist.codehaus.org/jetty/jetty-hightide-${JETTY_VERSION}/${JETTY_NAME}.tar.gz fi if test ! -e ${LIBCMIS_DIR}/${CHEMISTRY_WEBAPPS}; then echo "Downloading apache chemistry webapps" curl -o ${LIBCMIS_DIR}/${CHEMISTRY_WEBAPPS} \ http://archive.apache.org/dist/chemistry/opencmis/${CHEMISTRY_VERSION}/${CHEMISTRY_WEBAPPS} fi # Untar it all echo "Uncompressing ${JETTY_NAME}.tar.gz" tar xzf ${LIBCMIS_DIR}/${JETTY_NAME}.tar.gz -C ${LIBCMIS_DIR} mv ${LIBCMIS_DIR}/${JETTY_NAME} ${TEST_SERVER} echo "Uncompressing ${CHEMISTRY_WEBAPPS}" tar xzf ${LIBCMIS_DIR}/${CHEMISTRY_WEBAPPS} -C ${LIBCMIS_DIR} ${INMEMORY_WAR} mv ${LIBCMIS_DIR}/${INMEMORY_WAR} ${TEST_SERVER}/webapps/inmemory.war } function server() { case $1 in start) ${TEST_SERVER_SCRIPT} start >/dev/null 2>&1 # Wait for the server to be actually up and running i="0" started="no" echo -n "Waiting for test web server to be started" while test $i -lt 120; do sleep 1s curl --silent ${TEST_SERVER_URL} >/dev/null if test $? -eq 0; then break fi i=`expr $i + 1` echo -n "." done echo "Started" ;; stop) ${TEST_SERVER_SCRIPT} stop >/dev/null ;; esac } case `basename $1` in test-nosrv*) ;; *) if test ! -e ${TEST_SERVER}/webapps/inmemory.war; then setup_server fi server "start" ;; esac #Run the test $1 $REST_URL $SOAP_URL result=$? case `basename $1` in test-nosrv*) ;; *) server "stop" ;; esac exit $result libcmis-0.4.1/libcmis.pc.in0000644000175000001440000000044111763653216012437 00000000000000prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ Name: libcmis Description: CMIS protocol client library Version: @VERSION@ Requires: libcurl libxml-2.0 Libs: -L${libdir} -lcmis-@LIBCMIS_API_VERSION@ Cflags: -I${includedir}/libcmis-@LIBCMIS_API_VERSION@ libcmis-0.4.1/qa/0000755000175000001440000000000012200457455010540 500000000000000libcmis-0.4.1/qa/Makefile.in0000644000175000001440000004465612200457433012540 00000000000000# Makefile.in generated by automake 1.13.4 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = qa DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/boost.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BOOST_CPPFLAGS = @BOOST_CPPFLAGS@ BOOST_DATE_TIME_LDFLAGS = @BOOST_DATE_TIME_LDFLAGS@ BOOST_DATE_TIME_LIBS = @BOOST_DATE_TIME_LIBS@ BOOST_PROGRAM_OPTIONS_LDFLAGS = @BOOST_PROGRAM_OPTIONS_LDFLAGS@ BOOST_PROGRAM_OPTIONS_LIBS = @BOOST_PROGRAM_OPTIONS_LIBS@ BOOST_ROOT = @BOOST_ROOT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPCHECK = @CPPCHECK@ CPPFLAGS = @CPPFLAGS@ CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ CPPUNIT_LIBS = @CPPUNIT_LIBS@ CURL_CFLAGS = @CURL_CFLAGS@ CURL_LIBS = @CURL_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISTCHECK_CONFIGURE_FLAGS = @DISTCHECK_CONFIGURE_FLAGS@ DLLTOOL = @DLLTOOL@ DOCBOOK2MAN = @DOCBOOK2MAN@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBCMIS_API_VERSION = @LIBCMIS_API_VERSION@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SRCDIR = @SRCDIR@ STRIP = @STRIP@ VERSION = @VERSION@ XML2_CFLAGS = @XML2_CFLAGS@ XML2_LIBS = @XML2_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = mockup libcmis libcmis-c all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign qa/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign qa/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags tags-am uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: libcmis-0.4.1/qa/Makefile.am0000644000175000001440000000004312156277657012527 00000000000000SUBDIRS = mockup libcmis libcmis-c libcmis-0.4.1/qa/libcmis/0000755000175000001440000000000012200457455012162 500000000000000libcmis-0.4.1/qa/libcmis/test-ws.cxx0000644000175000001440000006414612156277657014265 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2011 SUSE * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #include #include #include #include "document.hxx" #include "ws-requests.hxx" #include "ws-session.hxx" #include "test-helpers.hxx" #define SERVER_WSDL_URL string( "http://localhost:8080/inmemory/services/RepositoryService" ) #define SERVER_REPOSITORIES_COUNT list< string >::size_type( 1 ) #define SERVER_REPOSITORY string( "A1" ) #define SERVER_USERNAME string( "tester" ) #define SERVER_PASSWORD string( "somepass" ) using namespace std; using libcmis::PropertyPtrMap; namespace { string lcl_getStreamAsString( boost::shared_ptr< istream > is ) { is->seekg( 0, ios::end ); long size = is->tellg( ); is->seekg( 0, ios::beg ); char* buf = new char[ size ]; is->read( buf, size ); string content( buf, size ); delete[ ] buf; return content; } } class WSTest : public CppUnit::TestFixture { public: // Generic session factory tests void getRepositoriesTest( ); void sessionCreationTest( ); void getRepositoryTest( ); void getRepositoryBadTest( ); // Types tests void getTypeDefinitionTest( ); void getTypeDefinitionErrorTest( ); void getTypeChildrenTest( ); // Object tests void getObjectTest( ); void getObjectDocumentTest( ); void getObjectParentsTest( ); void getChildrenTest( ); void getByPathValidTest( ); void getByPathInvalidTest( ); void updatePropertiesTest( ); void createFolderTest( ); void createFolderBadTypeTest( ); void createDocumentTest( ); void deleteObjectTest( ); void deleteTreeTest( ); void moveTest( ); void getContentStreamTest( ); void setContentStreamTest( ); void checkOutTest( ); void cancelCheckOutTest( ); void checkInTest( ); void getAllVersionsTest( ); CPPUNIT_TEST_SUITE( WSTest ); CPPUNIT_TEST( getRepositoriesTest ); CPPUNIT_TEST( sessionCreationTest ); CPPUNIT_TEST( getRepositoryTest ); CPPUNIT_TEST( getRepositoryBadTest ); CPPUNIT_TEST( getTypeDefinitionTest ); CPPUNIT_TEST( getTypeDefinitionErrorTest ); CPPUNIT_TEST( getTypeChildrenTest ); CPPUNIT_TEST( getObjectTest ); CPPUNIT_TEST( getObjectDocumentTest ); CPPUNIT_TEST( getObjectParentsTest ); CPPUNIT_TEST( getChildrenTest ); CPPUNIT_TEST( getByPathValidTest ); CPPUNIT_TEST( getByPathInvalidTest ); CPPUNIT_TEST( updatePropertiesTest ); CPPUNIT_TEST( createFolderTest ); CPPUNIT_TEST( createFolderBadTypeTest ); CPPUNIT_TEST( createDocumentTest ); CPPUNIT_TEST( deleteObjectTest ); CPPUNIT_TEST( moveTest ); CPPUNIT_TEST( getContentStreamTest ); CPPUNIT_TEST( setContentStreamTest ); CPPUNIT_TEST( checkOutTest ); CPPUNIT_TEST( cancelCheckOutTest ); CPPUNIT_TEST( checkInTest ); CPPUNIT_TEST( getAllVersionsTest ); CPPUNIT_TEST_SUITE_END( ); }; void WSTest::getRepositoriesTest() { WSSession session( SERVER_WSDL_URL, "", SERVER_USERNAME, SERVER_PASSWORD ); vector< libcmis::RepositoryPtr > actual = session.getRepositories( ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong number of repositories", size_t( 1 ), actual.size( ) ); } void WSTest::sessionCreationTest( ) { WSSession session( SERVER_WSDL_URL, "", SERVER_USERNAME, SERVER_PASSWORD ); CPPUNIT_ASSERT_MESSAGE( "No RepositoryService URL", !session.getServiceUrl( "RepositoryService" ).empty( ) ); } void WSTest::getRepositoryTest( ) { WSSession session( SERVER_WSDL_URL, "A1", SERVER_USERNAME, SERVER_PASSWORD ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Repository info badly retrieved", string( "100" ), session.getRepository()->getRootId( ) ); } void WSTest::getRepositoryBadTest( ) { WSSession session( SERVER_WSDL_URL, "", SERVER_USERNAME, SERVER_PASSWORD ); try { session.getRepositoryService( ).getRepositoryInfo( "bad" ); CPPUNIT_FAIL( "Should have thrown SoapFault" ); } catch( const libcmis::Exception& e ) { CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong exception type", string( "invalidArgument" ), e.getType( ) ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong exception message", string( "Unknown repository id: bad" ), string( e.what( ) ) ); } } void WSTest::getTypeDefinitionTest( ) { WSSession session( SERVER_WSDL_URL, "A1", SERVER_USERNAME, SERVER_PASSWORD ); string id( "ComplexType" ); libcmis::ObjectTypePtr actual = session.getType( id ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong id", id, actual->getId( ) ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong parent type", string( "cmis:document" ), actual->getParentType( )->getId( ) ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong base type", string( "cmis:document" ), actual->getBaseType( )->getId( ) ); } void WSTest::getTypeDefinitionErrorTest( ) { WSSession session( SERVER_WSDL_URL, "A1", SERVER_USERNAME, SERVER_PASSWORD ); string id( "bad_type" ); try { session.getType( id ); CPPUNIT_FAIL( "Exception should be raised: invalid ID" ); } catch ( const libcmis::Exception& e ) { CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong exception type", string( "objectNotFound" ), e.getType( ) ); CPPUNIT_ASSERT_MESSAGE( "Empty exception message", !string( e.what() ).empty( ) ); } } void WSTest::getTypeChildrenTest( ) { WSSession session( SERVER_WSDL_URL, "A1", SERVER_USERNAME, SERVER_PASSWORD ); libcmis::ObjectTypePtr actual = session.getType( "cmis:document" ); vector< libcmis::ObjectTypePtr > children = actual->getChildren( ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong number of children imported", size_t( 10 ), children.size() ); } void WSTest::getObjectTest( ) { WSSession session( SERVER_WSDL_URL, "A1", SERVER_USERNAME, SERVER_PASSWORD ); string id( "101" ); libcmis::ObjectPtr actual = session.getObject( id ); CPPUNIT_ASSERT_MESSAGE( "getTypeDescription doesn't work: properties are likely to be empty", NULL != actual->getTypeDescription( ).get( ) ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong id", id, actual->getId( ) ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong base type", string( "cmis:folder" ), actual->getBaseType( ) ); CPPUNIT_ASSERT_MESSAGE( "Not a libcmis::Folder instance", boost::dynamic_pointer_cast< libcmis::Folder >( actual ).get( ) != NULL ); CPPUNIT_ASSERT( 0 != actual->getRefreshTimestamp( ) ); } void WSTest::getObjectDocumentTest( ) { WSSession session( SERVER_WSDL_URL, "A1", SERVER_USERNAME, SERVER_PASSWORD ); string id( "114" ); libcmis::ObjectPtr actual = session.getObject( id ); CPPUNIT_ASSERT_MESSAGE( "getTypeDescription doesn't work: properties are likely to be empty", NULL != actual->getTypeDescription( ).get( ) ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong id", id, actual->getId( ) ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong base type", string( "cmis:document" ), actual->getBaseType( ) ); CPPUNIT_ASSERT_MESSAGE( "Not a libcmis::Document instance", boost::dynamic_pointer_cast< libcmis::Document >( actual ).get( ) != NULL ); CPPUNIT_ASSERT( 0 != actual->getRefreshTimestamp( ) ); } void WSTest::getObjectParentsTest( ) { WSSession session( SERVER_WSDL_URL, "A1", SERVER_USERNAME, SERVER_PASSWORD ); libcmis::ObjectPtr object = session.getObject( "116" ); libcmis::Document* document = dynamic_cast< libcmis::Document* >( object.get() ); CPPUNIT_ASSERT_MESSAGE( "Document expected", document != NULL ); vector< libcmis::FolderPtr > actual = document->getParents( ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Bad number of parents", size_t( 1 ), actual.size() ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong parent ID", string( "101" ), actual.front( )->getId( ) ); } void WSTest::getChildrenTest( ) { WSSession session( SERVER_WSDL_URL, "A1", SERVER_USERNAME, SERVER_PASSWORD ); libcmis::FolderPtr folder = session.getRootFolder( ); vector< libcmis::ObjectPtr > children = folder->getChildren( ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong number of children", size_t( 5 ), children.size() ); int folderCount = 0; int documentCount = 0; for ( vector< libcmis::ObjectPtr >::iterator it = children.begin( ); it != children.end( ); ++it ) { if ( boost::dynamic_pointer_cast< libcmis::Folder >( *it ).get( ) != NULL ) ++folderCount; else if ( boost::dynamic_pointer_cast< libcmis::Document >( *it ).get( ) != NULL ) ++documentCount; } CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong number of folder children", 2, folderCount ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong number of document children", 3, documentCount ); } void WSTest::getByPathValidTest( ) { WSSession session( SERVER_WSDL_URL, "A1", SERVER_USERNAME, SERVER_PASSWORD ); try { libcmis::ObjectPtr object = session.getObjectByPath( "/My_Folder-0-0/My_Document-1-2" ); CPPUNIT_ASSERT_MESSAGE( "Missing return object", object.get() ); } catch ( const libcmis::Exception& e ) { string msg = "Unexpected exception: "; msg += e.what(); CPPUNIT_FAIL( msg.c_str() ); } } void WSTest::getByPathInvalidTest( ) { WSSession session( SERVER_WSDL_URL, "A1", SERVER_USERNAME, SERVER_PASSWORD ); try { libcmis::ObjectPtr object = session.getObjectByPath( "/some/dummy/path" ); CPPUNIT_FAIL( "Exception should be thrown: invalid Path" ); } catch ( const libcmis::Exception& e ) { CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong error type", string( "objectNotFound" ), e.getType() ); CPPUNIT_ASSERT_MESSAGE( "Empty error message", !string( e.what() ).empty( ) ); } } void WSTest::updatePropertiesTest( ) { WSSession session( SERVER_WSDL_URL, "A1", SERVER_USERNAME, SERVER_PASSWORD ); // Values for the test libcmis::ObjectPtr object = session.getObject( "114" ); string propertyName( "cmis:name" ); string expectedValue( "New name" ); // Fill the map of properties to change PropertyPtrMap newProperties; libcmis::ObjectTypePtr objectType = object->getTypeDescription( ); map< string, libcmis::PropertyTypePtr >::iterator it = objectType->getPropertiesTypes( ).find( propertyName ); vector< string > values; values.push_back( expectedValue ); libcmis::PropertyPtr property( new libcmis::Property( it->second, values ) ); newProperties[ propertyName ] = property; // Update the properties (method to test) libcmis::ObjectPtr updated = object->updateProperties( newProperties ); // Checks PropertyPtrMap::iterator propIt = updated->getProperties( ).find( propertyName ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong value after refresh", expectedValue, propIt->second->getStrings().front( ) ); } void WSTest::createFolderTest( ) { WSSession session( SERVER_WSDL_URL, "A1", SERVER_USERNAME, SERVER_PASSWORD ); libcmis::FolderPtr parent = session.getFolder( session.getRootId( ) ); // Prepare the properties for the new object, object type is cmis:folder PropertyPtrMap props; libcmis::ObjectTypePtr type = session.getType( "cmis:folder" ); map< string, libcmis::PropertyTypePtr > propTypes = type->getPropertiesTypes( ); // Set the object name map< string, libcmis::PropertyTypePtr >::iterator it = propTypes.find( string( "cmis:name" ) ); CPPUNIT_ASSERT_MESSAGE( "cmis:name property type not found on parent type", it != propTypes.end( ) ); vector< string > nameValues; nameValues.push_back( "createFolderTest" ); libcmis::PropertyPtr nameProperty( new libcmis::Property( it->second, nameValues ) ); props.insert( pair< string, libcmis::PropertyPtr >( string( "cmis:name" ), nameProperty ) ); // set the object type it = propTypes.find( string( "cmis:objectTypeId" ) ); CPPUNIT_ASSERT_MESSAGE( "cmis:objectTypeId property type not found on parent type", it != propTypes.end( ) ); vector< string > typeValues; typeValues.push_back( "cmis:folder" ); libcmis::PropertyPtr typeProperty( new libcmis::Property( it->second, typeValues ) ); props.insert( pair< string, libcmis::PropertyPtr >( string( "cmis:objectTypeId" ), typeProperty ) ); // Actually send the folder creation request libcmis::FolderPtr created = parent->createFolder( props ); // Check that something came back CPPUNIT_ASSERT_MESSAGE( "Change token shouldn't be empty: object should have been refreshed", !created->getChangeToken( ).empty() ); } void WSTest::createFolderBadTypeTest( ) { WSSession session( SERVER_WSDL_URL, "A1", SERVER_USERNAME, SERVER_PASSWORD ); libcmis::FolderPtr parent = session.getFolder( session.getRootId( ) ); // Prepare the properties for the new object, object type is cmis:document to trigger the exception PropertyPtrMap props; libcmis::ObjectTypePtr type = session.getType( "cmis:document" ); map< string, libcmis::PropertyTypePtr > propTypes = type->getPropertiesTypes( ); // Set the object name map< string, libcmis::PropertyTypePtr >::iterator it = propTypes.find( string( "cmis:name" ) ); CPPUNIT_ASSERT_MESSAGE( "cmis:name property type not found on parent type", it != propTypes.end( ) ); vector< string > nameValues; nameValues.push_back( "createFolderBadTypeTest" ); libcmis::PropertyPtr nameProperty( new libcmis::Property( it->second, nameValues ) ); props.insert( pair< string, libcmis::PropertyPtr >( string( "cmis:name" ), nameProperty ) ); // Set the object type it = propTypes.find( string( "cmis:objectTypeId" ) ); CPPUNIT_ASSERT_MESSAGE( "cmis:objectTypeId property type not found on parent type", it != propTypes.end( ) ); vector< string > typeValues; typeValues.push_back( "cmis:document" ); libcmis::PropertyPtr typeProperty( new libcmis::Property( it->second, typeValues ) ); props.insert( pair< string, libcmis::PropertyPtr >( string( "cmis:objectTypeId" ), typeProperty ) ); // Actually send the folder creation request try { libcmis::FolderPtr created = parent->createFolder( props ); CPPUNIT_FAIL( "Should not succeed to return a folder" ); } catch ( libcmis::Exception& e ) { CPPUNIT_ASSERT_MESSAGE( "Empty exception message", !string( e.what( ) ).empty( ) ); } } void WSTest::createDocumentTest( ) { WSSession session( SERVER_WSDL_URL, "A1", SERVER_USERNAME, SERVER_PASSWORD ); libcmis::FolderPtr parent = session.getFolder( session.getRootId( ) ); // Prepare the properties for the new object, object type is cmis:folder PropertyPtrMap props; libcmis::ObjectTypePtr type = session.getType( "cmis:document" ); map< string, libcmis::PropertyTypePtr > propTypes = type->getPropertiesTypes( ); // Set the object name map< string, libcmis::PropertyTypePtr >::iterator it = propTypes.find( string( "cmis:name" ) ); CPPUNIT_ASSERT_MESSAGE( "cmis:name property type not found on parent type", it != propTypes.end( ) ); vector< string > nameValues; nameValues.push_back( "createDocumentTest" ); libcmis::PropertyPtr nameProperty( new libcmis::Property( it->second, nameValues ) ); props.insert( pair< string, libcmis::PropertyPtr >( string( "cmis:name" ), nameProperty ) ); // set the object type it = propTypes.find( string( "cmis:objectTypeId" ) ); CPPUNIT_ASSERT_MESSAGE( "cmis:objectTypeId property type not found on parent type", it != propTypes.end( ) ); vector< string > typeValues; typeValues.push_back( "cmis:document" ); libcmis::PropertyPtr typeProperty( new libcmis::Property( it->second, typeValues ) ); props.insert( pair< string, libcmis::PropertyPtr >( string( "cmis:objectTypeId" ), typeProperty ) ); // Actually send the document creation request string contentStr = "Some content"; boost::shared_ptr< ostream > os ( new stringstream( contentStr ) ); string contentType = "text/plain"; string filename( "name.txt" ); libcmis::DocumentPtr created = parent->createDocument( props, os, contentType, filename ); // Check that something came back CPPUNIT_ASSERT_MESSAGE( "Change token shouldn't be empty: object should have been refreshed", !created->getChangeToken( ).empty() ); // Check that the content is properly set boost::shared_ptr< istream > is = created->getContentStream( ); string content = lcl_getStreamAsString( is ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong content set", contentStr, content ); } void WSTest::deleteObjectTest( ) { WSSession session( SERVER_WSDL_URL, "A1", SERVER_USERNAME, SERVER_PASSWORD ); // Get the object to remove string id( "130" ); libcmis::ObjectPtr object = session.getObject( id ); // Remove the object (method to test) object->remove( false ); // Check that the node doesn't exist anymore try { libcmis::ObjectPtr newObject = session.getObject( id ); CPPUNIT_FAIL( "Should be removed, exception should have been thrown" ); } catch ( const libcmis::Exception& e ) { CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong exception type", string( "objectNotFound" ), e.getType( ) ); } } void WSTest::deleteTreeTest( ) { WSSession session( SERVER_WSDL_URL, "A1", SERVER_USERNAME, SERVER_PASSWORD ); string id( "117" ); libcmis::ObjectPtr object = session.getObject( id ); libcmis::Folder* folder = dynamic_cast< libcmis::Folder* >( object.get() ); CPPUNIT_ASSERT_MESSAGE( "Document to remove is missing", folder != NULL ); folder->removeTree( ); try { libcmis::ObjectPtr newObject = session.getObject( id ); CPPUNIT_FAIL( "Should be removed, exception should have been thrown" ); } catch ( const libcmis::Exception& e ) { CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong exception message", string( "No such node: " + id ) , string( e.what() ) ); } } void WSTest::moveTest( ) { WSSession session( SERVER_WSDL_URL, "A1", SERVER_USERNAME, SERVER_PASSWORD ); string id( "135" ); libcmis::ObjectPtr object = session.getObject( id ); libcmis::Document* document = dynamic_cast< libcmis::Document* >( object.get() ); CPPUNIT_ASSERT_MESSAGE( "Document to move is missing", document != NULL ); libcmis::FolderPtr src = document->getParents( ).front( ); libcmis::FolderPtr dest = session.getFolder( "101" ); document->move( src, dest ); vector< libcmis::FolderPtr > parents = document->getParents( ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong parents size", size_t( 1 ), parents.size( ) ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong parent", string( "101" ), parents.front( )->getId( ) ); } void WSTest::getContentStreamTest( ) { WSSession session( SERVER_WSDL_URL, "A1", SERVER_USERNAME, SERVER_PASSWORD ); libcmis::ObjectPtr object = session.getObject( "116" ); libcmis::Document* document = dynamic_cast< libcmis::Document* >( object.get() ); CPPUNIT_ASSERT_MESSAGE( "Document expected", document != NULL ); try { boost::shared_ptr< istream > is = document->getContentStream( ); string content = lcl_getStreamAsString( is ); CPPUNIT_ASSERT_MESSAGE( "Content stream should be returned", NULL != is.get() ); CPPUNIT_ASSERT_MESSAGE( "Non-empty content stream should be returned", !content.empty( ) ); } catch ( const libcmis::Exception& e ) { string msg = "Unexpected exception: "; msg += e.what(); CPPUNIT_FAIL( msg.c_str() ); } } void WSTest::setContentStreamTest( ) { WSSession session( SERVER_WSDL_URL, "A1", SERVER_USERNAME, SERVER_PASSWORD ); libcmis::ObjectPtr object = session.getObject( "116" ); libcmis::Document* document = dynamic_cast< libcmis::Document* >( object.get() ); CPPUNIT_ASSERT_MESSAGE( "Document expected", document != NULL ); string expectedContent( "Some content to upload" ); string expectedType( "text/plain" ); try { boost::shared_ptr< ostream > os ( new stringstream ( expectedContent ) ); string filename( "name.txt" ); document->setContentStream( os, expectedType, filename ); CPPUNIT_ASSERT_MESSAGE( "Object not refreshed during setContentStream", object->getRefreshTimestamp( ) > 0 ); // Get the new content to check is has been properly uploaded boost::shared_ptr< istream > newIs = document->getContentStream( ); string content = lcl_getStreamAsString( newIs ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Bad content uploaded", expectedContent, content ); // Testing other values like LastModifiedBy or LastModificationTime // is server dependent... don't do it. CPPUNIT_ASSERT_EQUAL_MESSAGE( "Node not properly refreshed", ( long )expectedContent.size(), document->getContentLength() ); } catch ( const libcmis::Exception& e ) { string msg = "Unexpected exception: "; msg += e.what(); CPPUNIT_FAIL( msg.c_str() ); } } void WSTest::checkOutTest( ) { WSSession session( SERVER_WSDL_URL, "A1", SERVER_USERNAME, SERVER_PASSWORD ); // First create a document of type VersionableType libcmis::DocumentPtr doc = test::createVersionableDocument( &session, "checkOutTest" ); CPPUNIT_ASSERT_MESSAGE( "Failed to create versionable document", doc.get() != NULL ); libcmis::DocumentPtr pwc = doc->checkOut( ); CPPUNIT_ASSERT_MESSAGE( "Missing returned Private Working Copy", pwc.get( ) != NULL ); PropertyPtrMap::iterator it = pwc->getProperties( ).find( string( "cmis:isVersionSeriesCheckedOut" ) ); CPPUNIT_ASSERT_MESSAGE( "cmis:isVersionSeriesCheckedOut property is missing", it != pwc->getProperties( ).end( ) ); vector< bool > values = it->second->getBools( ); CPPUNIT_ASSERT_MESSAGE( "cmis:isVersionSeriesCheckedOut isn't true", values.front( ) ); } void WSTest::cancelCheckOutTest( ) { WSSession session( SERVER_WSDL_URL, "A1", SERVER_USERNAME, SERVER_PASSWORD ); // First create a versionable document and check it out libcmis::DocumentPtr doc = test::createVersionableDocument( &session, "cancelCheckOutTest" ); libcmis::DocumentPtr pwc = doc->checkOut( ); CPPUNIT_ASSERT_MESSAGE( "Failed to create Private Working Copy document", pwc.get() != NULL ); string id = pwc->getId( ); pwc->cancelCheckout( ); // Check that the PWC doesn't exist any more try { session.getObject( id ); CPPUNIT_FAIL( "Private Working Copy object should no longer exist" ); } catch ( const libcmis::Exception& e ) { CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong exception type", string( "objectNotFound" ), e.getType() ); } } void WSTest::checkInTest( ) { WSSession session( SERVER_WSDL_URL, "A1", SERVER_USERNAME, SERVER_PASSWORD ); // First create a versionable document and check it out libcmis::DocumentPtr doc = test::createVersionableDocument( &session, "checkInTest" ); libcmis::DocumentPtr pwc = doc->checkOut( ); CPPUNIT_ASSERT_MESSAGE( "Failed to create Private Working Copy document", pwc.get() != NULL ); // Do the checkin bool isMajor = true; string comment( "Some check-in comment" ); PropertyPtrMap properties; string newContent = "Some New content to check in"; boost::shared_ptr< ostream > stream ( new stringstream( newContent ) ); pwc->checkIn( isMajor, comment, properties, stream, "text/plain", "filename.txt" ); PropertyPtrMap actualProperties = pwc->getProperties( ); { PropertyPtrMap::iterator it = actualProperties.find( "cmis:isLatestVersion" ); CPPUNIT_ASSERT_MESSAGE( "cmis:isLatestVersion isn't true", it->second->getBools().front( ) ); } { PropertyPtrMap::iterator it = actualProperties.find( "cmis:isMajorVersion" ); CPPUNIT_ASSERT_MESSAGE( "cmis:isMajorVersion isn't true", it->second->getBools().front( ) ); } { PropertyPtrMap::iterator it = actualProperties.find( "cmis:checkinComment" ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "cmis:checkinComment doesn't match", comment, it->second->getStrings().front( ) ); } } void WSTest::getAllVersionsTest( ) { WSSession session( SERVER_WSDL_URL, "A1", SERVER_USERNAME, SERVER_PASSWORD ); // First create a versionable document and check it out libcmis::DocumentPtr doc = test::createVersionableDocument( &session, "getAllVersionsTest" ); libcmis::DocumentPtr pwc = doc->checkOut( ); CPPUNIT_ASSERT_MESSAGE( "Failed to create Private Working Copy document", pwc.get() != NULL ); // Create a version bool isMajor = true; string comment( "Some check-in comment" ); PropertyPtrMap properties; string newContent = "Some New content to check in"; boost::shared_ptr< ostream > stream ( new stringstream( newContent ) ); libcmis::DocumentPtr newVersion = pwc->checkIn( isMajor, comment, properties, stream, "text/plain", "filename.txt" ); // Get all the versions (method to check) vector< libcmis::DocumentPtr > versions = newVersion->getAllVersions( ); // Checks CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong number of versions", size_t( 2 ), versions.size( ) ); } CPPUNIT_TEST_SUITE_REGISTRATION( WSTest ); libcmis-0.4.1/qa/libcmis/test-decoder.cxx0000644000175000001440000001400012156277657015221 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2011 SUSE * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #include #include #include #include #include "xml-utils.hxx" #define BASE64_ENCODING string( "base64" ) using namespace std; class DecoderTest : public CppUnit::TestFixture { private: libcmis::EncodedData* data; FILE* stream; string getActual( ); public: DecoderTest( ); DecoderTest( const DecoderTest& rCopy ); DecoderTest& operator=( const DecoderTest& rCopy ); void setUp( ); void tearDown( ); void noEncodingTest(); void base64DecodeSimpleBlockTest( ); void base64DecodePaddedBlockTest( ); void base64DecodeNoEqualsPaddedBlockTest( ); void base64DecodeSplitRunsTest( ); void base64EncodeSimpleBlockTest( ); void base64EncodePaddedBlockTest( ); void base64EncodeSplitRunsTest( ); void base64encodeTest( ); CPPUNIT_TEST_SUITE( DecoderTest ); CPPUNIT_TEST( noEncodingTest ); CPPUNIT_TEST( base64DecodeSimpleBlockTest ); CPPUNIT_TEST( base64DecodePaddedBlockTest ); CPPUNIT_TEST( base64DecodeNoEqualsPaddedBlockTest ); CPPUNIT_TEST( base64DecodeSplitRunsTest ); CPPUNIT_TEST( base64EncodeSimpleBlockTest ); CPPUNIT_TEST( base64EncodePaddedBlockTest ); CPPUNIT_TEST( base64EncodeSplitRunsTest ); CPPUNIT_TEST( base64encodeTest ); CPPUNIT_TEST_SUITE_END( ); }; DecoderTest::DecoderTest( ) : CppUnit::TestFixture( ), data( NULL ), stream( NULL ) { } DecoderTest::DecoderTest( const DecoderTest& rCopy ) : CppUnit::TestFixture( ), data( rCopy.data ), stream( rCopy.stream ) { } DecoderTest& DecoderTest::operator=( const DecoderTest& rCopy ) { if ( this != &rCopy ) { data = rCopy.data; stream = rCopy.stream; } return *this; } void DecoderTest::setUp( ) { stream = tmpfile(); data = new libcmis::EncodedData( stream ); } void DecoderTest::tearDown( ) { fclose( stream ); delete data; } string DecoderTest::getActual( ) { string actual; rewind( stream ); size_t bufSize = 100; char buf[100]; size_t readBytes = 0; do { readBytes = fread( buf, 1, bufSize, stream ); actual += string( buf, readBytes ); } while ( readBytes == bufSize ); return actual; } void DecoderTest::noEncodingTest() { data->decode( ( void* )"pleasure.", 1, 9 ); data->finish( ); CPPUNIT_ASSERT_EQUAL( string( "pleasure." ), getActual( ) ); } /* * All the test values for the Base64 have been taken from * the wikipedia article: http://en.wikipedia.org/wiki/Base64 */ void DecoderTest::base64DecodeSimpleBlockTest( ) { data->setEncoding( BASE64_ENCODING ); string input( "cGxlYXN1cmUu" ); data->decode( ( void* )input.c_str( ), 1, input.size() ); data->finish( ); CPPUNIT_ASSERT_EQUAL( string( "pleasure." ), getActual( ) ); } void DecoderTest::base64DecodePaddedBlockTest( ) { data->setEncoding( BASE64_ENCODING ); string input( "c3VyZS4=" ); data->decode( ( void* )input.c_str( ), 1, input.size( ) ); data->finish( ); CPPUNIT_ASSERT_EQUAL( string( "sure." ), getActual( ) ); } void DecoderTest::base64DecodeNoEqualsPaddedBlockTest( ) { data->setEncoding( BASE64_ENCODING ); string input( "c3VyZS4" ); data->decode( ( void* )input.c_str( ), 1, input.size( ) ); data->finish( ); CPPUNIT_ASSERT_EQUAL( string( "sure." ), getActual( ) ); } void DecoderTest::base64DecodeSplitRunsTest( ) { data->setEncoding( BASE64_ENCODING ); string input1( "cGxlYXN1c" ); data->decode( ( void* )input1.c_str( ), 1, input1.size( ) ); string input2( "mUu" ); data->decode( ( void* )input2.c_str( ), 1, input2.size( ) ); data->finish( ); CPPUNIT_ASSERT_EQUAL( string( "pleasure." ), getActual( ) ); } void DecoderTest::base64EncodeSimpleBlockTest( ) { data->setEncoding( BASE64_ENCODING ); string input( "pleasure." ); data->encode( ( void* )input.c_str(), 1, input.size() ); data->finish( ); CPPUNIT_ASSERT_EQUAL( string( "cGxlYXN1cmUu" ), getActual( ) ); } void DecoderTest::base64EncodePaddedBlockTest( ) { data->setEncoding( BASE64_ENCODING ); string input( "sure." ); data->encode( ( void* )input.c_str(), 1, input.size() ); data->finish( ); CPPUNIT_ASSERT_EQUAL( string( "c3VyZS4=" ), getActual( ) ); } void DecoderTest::base64EncodeSplitRunsTest( ) { data->setEncoding( BASE64_ENCODING ); string input1( "plea" ); data->encode( ( void* )input1.c_str(), 1, input1.size() ); string input2( "sure." ); data->encode( ( void* )input2.c_str(), 1, input2.size() ); data->finish( ); CPPUNIT_ASSERT_EQUAL( string( "cGxlYXN1cmUu" ), getActual( ) ); } void DecoderTest::base64encodeTest( ) { string actual = libcmis::base64encode( "sure." ); CPPUNIT_ASSERT_EQUAL( string( "c3VyZS4=" ), actual ); } CPPUNIT_TEST_SUITE_REGISTRATION( DecoderTest ); libcmis-0.4.1/qa/libcmis/test-helpers.cxx0000644000175000001440000001207112156277657015264 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2011 SUSE * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #include #include #include "test-helpers.hxx" #include "xml-utils.hxx" using namespace std; using libcmis::PropertyPtrMap; namespace test { xmlNodePtr getXmlNode( string str ) { xmlNodePtr node = NULL; xmlDocPtr doc = xmlReadMemory( str.c_str( ), str.size( ), "tester", NULL, 0 ); if ( NULL != doc ) node = xmlDocGetRootElement( doc ); return node; } const char* getXmlns( ) { return "xmlns:cmis=\"http://docs.oasis-open.org/ns/cmis/core/200908/\" xmlns:cmisra=\"http://docs.oasis-open.org/ns/cmis/restatom/200908/\" "; } string writeXml( boost::shared_ptr< libcmis::XmlSerializable > serializable ) { xmlBufferPtr buf = xmlBufferCreate( ); xmlTextWriterPtr writer = xmlNewTextWriterMemory( buf, 0 ); xmlTextWriterStartDocument( writer, NULL, NULL, NULL ); serializable->toXml( writer ); xmlTextWriterEndDocument( writer ); string str( ( const char * )xmlBufferContent( buf ) ); xmlFreeTextWriter( writer ); xmlBufferFree( buf ); return str; } string getXmlNodeAsString( const string& xmlDoc, const string& xpath ) { string result; xmlDocPtr doc = xmlReadMemory( xmlDoc.c_str(), xmlDoc.size(), "", NULL, 0 ); if ( NULL != doc ) { xmlXPathContextPtr xpathCtx = xmlXPathNewContext( doc ); libcmis::registerNamespaces( xpathCtx ); if ( NULL != xpathCtx ) { xmlXPathObjectPtr xpathObj = xmlXPathEvalExpression( BAD_CAST( xpath.c_str() ), xpathCtx ); if ( xpathObj != NULL ) { int nbResults = 0; if ( xpathObj->nodesetval ) nbResults = xpathObj->nodesetval->nodeNr; if ( nbResults > 0 ) { xmlNodePtr node = xpathObj->nodesetval->nodeTab[0]; xmlBufferPtr buf = xmlBufferCreate( ); xmlNodeDump( buf, doc, node, 0, 0 ); result = string( ( char * )xmlBufferContent( buf ) ); xmlBufferFree( buf ); } } } xmlXPathFreeContext( xpathCtx ); } else throw libcmis::Exception( "Failed to parse service document" ); xmlFreeDoc( doc ); return result; } libcmis::DocumentPtr createVersionableDocument( libcmis::Session* session, string docName ) { libcmis::FolderPtr parent = session->getRootFolder( ); // Prepare the properties for the new object, object type is cmis:folder PropertyPtrMap props; libcmis::ObjectTypePtr type = session->getType( "VersionableType" ); map< string, libcmis::PropertyTypePtr > propTypes = type->getPropertiesTypes( ); // Set the object name map< string, libcmis::PropertyTypePtr >::iterator it = propTypes.find( string( "cmis:name" ) ); vector< string > nameValues; nameValues.push_back( docName ); libcmis::PropertyPtr nameProperty( new libcmis::Property( it->second, nameValues ) ); props.insert( pair< string, libcmis::PropertyPtr >( string( "cmis:name" ), nameProperty ) ); // set the object type it = propTypes.find( string( "cmis:objectTypeId" ) ); vector< string > typeValues; typeValues.push_back( "VersionableType" ); libcmis::PropertyPtr typeProperty( new libcmis::Property( it->second, typeValues ) ); props.insert( pair< string, libcmis::PropertyPtr >( string( "cmis:objectTypeId" ), typeProperty ) ); // Actually send the document creation request string contentStr = "Some content"; boost::shared_ptr< ostream > os ( new stringstream( contentStr ) ); string contentType = "text/plain"; string filename( "name.txt" ); return parent->createDocument( props, os, contentType, filename ); } } libcmis-0.4.1/qa/libcmis/test-atom.cxx0000644000175000001440000015611512200225743014545 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2011 SUSE * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #include #include #include #include #define SERVER_URL string( "http://mockup/binding" ) #define SERVER_REPOSITORY string( "mock" ) #define SERVER_USERNAME "tester" #define SERVER_PASSWORD "somepass" #define private public #define protected public #include #include "test-helpers.hxx" #include "atom-session.hxx" #include "session-factory.hxx" #include "document.hxx" using namespace std; using libcmis::PropertyPtrMap; class AtomTest : public CppUnit::TestFixture { public: void sessionCreationTest( ); void sessionCreationBadAuthTest( ); void sessionCreationProxyTest( ); void authCallbackTest( ); void invalidSSLTest( ); void getRepositoriesTest( ); void getTypeTest( ); void getUnexistantTypeTest( ); void getTypeParentsTest( ); void getTypeChildrenTest( ); void getObjectTest( ); void getDocumentTest( ); void getUnexistantObjectTest( ); void getFolderTest( ); void getFolderBadTypeTest( ); void getByPathValidTest( ); void getByPathInvalidTest( ); void getRenditionsTest( ); void getAllowableActionsTest( ); void getAllowableActionsNotIncludedTest( ); void getChildrenTest( ); void getDocumentParentsTest( ); void getContentStreamTest( ); void setContentStreamTest( ); void updatePropertiesTest( ); void createFolderTest( ); void createFolderBadTypeTest( ); void createDocumentTest( ); void deleteDocumentTest( ); void deleteFolderTreeTest( ); void checkOutTest( ); void cancelCheckOutTest( ); void checkInTest( ); void getAllVersionsTest( ); void moveTest( ); CPPUNIT_TEST_SUITE( AtomTest ); CPPUNIT_TEST( sessionCreationTest ); CPPUNIT_TEST( sessionCreationBadAuthTest ); CPPUNIT_TEST( sessionCreationProxyTest ); CPPUNIT_TEST( authCallbackTest ); CPPUNIT_TEST( invalidSSLTest ); CPPUNIT_TEST( getRepositoriesTest ); CPPUNIT_TEST( getTypeTest ); CPPUNIT_TEST( getUnexistantTypeTest ); CPPUNIT_TEST( getTypeParentsTest ); CPPUNIT_TEST( getTypeChildrenTest ); CPPUNIT_TEST( getObjectTest ); CPPUNIT_TEST( getDocumentTest ); CPPUNIT_TEST( getUnexistantObjectTest ); CPPUNIT_TEST( getFolderTest ); CPPUNIT_TEST( getFolderBadTypeTest ); CPPUNIT_TEST( getByPathValidTest ); CPPUNIT_TEST( getByPathInvalidTest ); CPPUNIT_TEST( getRenditionsTest ); CPPUNIT_TEST( getAllowableActionsTest ); CPPUNIT_TEST( getAllowableActionsNotIncludedTest ); CPPUNIT_TEST( getChildrenTest ); CPPUNIT_TEST( getDocumentParentsTest ); CPPUNIT_TEST( getContentStreamTest ); CPPUNIT_TEST( setContentStreamTest ); CPPUNIT_TEST( updatePropertiesTest ); CPPUNIT_TEST( createFolderTest ); CPPUNIT_TEST( createFolderBadTypeTest ); CPPUNIT_TEST( createDocumentTest ); CPPUNIT_TEST( deleteDocumentTest ); CPPUNIT_TEST( deleteFolderTreeTest ); CPPUNIT_TEST( checkOutTest ); CPPUNIT_TEST( cancelCheckOutTest ); CPPUNIT_TEST( checkInTest ); CPPUNIT_TEST( getAllVersionsTest ); CPPUNIT_TEST( moveTest ); CPPUNIT_TEST_SUITE_END( ); AtomPubSession getTestSession( string username = string( ), string password = string( ) ); void loadFromFile( const char* path, string& buf ); }; class TestAuthProvider : public libcmis::AuthProvider { bool m_fail; public: TestAuthProvider( bool fail ) : m_fail( fail ) { } bool authenticationQuery( std::string&, std::string& password ) { password = SERVER_PASSWORD; return !m_fail; } }; class TestCertValidationHandler : public libcmis::CertValidationHandler { public: bool m_fail; vector< string > m_chain; TestCertValidationHandler( bool fail ) : m_fail( fail ), m_chain() { } bool validateCertificate( vector< string > chain ) { m_chain = chain; return !m_fail; } }; CPPUNIT_TEST_SUITE_REGISTRATION( AtomTest ); void AtomTest::sessionCreationTest( ) { // Response showing one mock repository curl_mockup_reset( ); curl_mockup_setResponse( DATA_DIR "/atom/workspaces.xml" ); curl_mockup_setCredentials( SERVER_USERNAME, SERVER_PASSWORD ); AtomPubSession session( SERVER_URL, SERVER_REPOSITORY, SERVER_USERNAME, SERVER_PASSWORD ); // Check for the mandatory collection URLs CPPUNIT_ASSERT_MESSAGE( "root collection URL missing", !session.getAtomRepository()->getCollectionUrl( Collection::Root ).empty() ); CPPUNIT_ASSERT_MESSAGE( "types collection URL missing", !session.getAtomRepository()->getCollectionUrl( Collection::Types ).empty() ); CPPUNIT_ASSERT_MESSAGE( "query collection URL missing", !session.getAtomRepository()->getCollectionUrl( Collection::Query ).empty() ); // The optional collection URLs are present on InMemory, so check them CPPUNIT_ASSERT_MESSAGE( "checkedout collection URL missing", !session.getAtomRepository()->getCollectionUrl( Collection::CheckedOut ).empty() ); CPPUNIT_ASSERT_MESSAGE( "unfiled collection URL missing", !session.getAtomRepository()->getCollectionUrl( Collection::Unfiled ).empty() ); // Check for the mandatory URI template URLs CPPUNIT_ASSERT_MESSAGE( "objectbyid URI template URL missing", !session.getAtomRepository()->getUriTemplate( UriTemplate::ObjectById ).empty() ); CPPUNIT_ASSERT_MESSAGE( "objectbypath URI template URL missing", !session.getAtomRepository()->getUriTemplate( UriTemplate::ObjectByPath ).empty() ); CPPUNIT_ASSERT_MESSAGE( "typebyid URI template URL missing", !session.getAtomRepository()->getUriTemplate( UriTemplate::TypeById ).empty() ); // The optional URI template URL is present on InMemory, so check it CPPUNIT_ASSERT_MESSAGE( "query URI template URL missing", !session.getAtomRepository()->getUriTemplate( UriTemplate::Query ).empty() ); // Check that the root id is defined CPPUNIT_ASSERT_MESSAGE( "Root node ID is missing", !session.getRootId().empty() ); } void AtomTest::sessionCreationBadAuthTest( ) { // Response showing one mock repository curl_mockup_reset( ); curl_mockup_setResponse( DATA_DIR "/atom/workspaces.xml" ); curl_mockup_setCredentials( SERVER_USERNAME, SERVER_PASSWORD ); try { AtomPubSession session( SERVER_URL, SERVER_REPOSITORY, "bad", "bad" ); CPPUNIT_FAIL( "Exception should have been thrown" ); } catch ( const libcmis::Exception& e ) { CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong error type", string( "permissionDenied" ), e.getType( ) ); } } void AtomTest::sessionCreationProxyTest( ) { // Response showing one mock repository curl_mockup_reset( ); curl_mockup_setResponse( DATA_DIR "/atom/workspaces.xml" ); curl_mockup_setCredentials( SERVER_USERNAME, SERVER_PASSWORD ); string proxy( "proxy" ); string noProxy( "noProxy" ); string proxyUser( "proxyUser" ); string proxyPass( "proxyPass" ); libcmis::SessionFactory::setProxySettings( proxy, noProxy, proxyUser, proxyPass ); AtomPubSession session( SERVER_URL, SERVER_REPOSITORY, SERVER_USERNAME, SERVER_PASSWORD ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Proxy not set", proxy, string( curl_mockup_getProxy( session.m_curlHandle ) ) ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "NoProxy not set", noProxy, string( curl_mockup_getNoProxy( session.m_curlHandle ) ) ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Proxy User not set", proxyUser, string( curl_mockup_getProxyUser( session.m_curlHandle ) ) ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Proxy Pass not set", proxyPass, string( curl_mockup_getProxyPass( session.m_curlHandle ) ) ); // Reset proxy settings to default for next tests libcmis::SessionFactory::setProxySettings( string(), string(), string(), string() ); } void AtomTest::authCallbackTest( ) { // Response showing one mock repository curl_mockup_reset( ); curl_mockup_setResponse( DATA_DIR "/atom/workspaces.xml" ); curl_mockup_setCredentials( SERVER_USERNAME, SERVER_PASSWORD ); // Test cancelled authentication { libcmis::AuthProviderPtr authProvider( new TestAuthProvider( true ) ); libcmis::SessionFactory::setAuthenticationProvider( authProvider ); try { AtomPubSession session( SERVER_URL, SERVER_REPOSITORY, SERVER_USERNAME, string( ) ); CPPUNIT_FAIL( "Should raise an exception saying the user cancelled the authentication" ); } catch ( const libcmis::Exception& e ) { CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong exception message", string( "User cancelled authentication request" ), string( e.what() ) ); } } // Test provided authentication { libcmis::AuthProviderPtr authProvider( new TestAuthProvider( false ) ); libcmis::SessionFactory::setAuthenticationProvider( authProvider ); AtomPubSession session( SERVER_URL, SERVER_REPOSITORY, SERVER_USERNAME, string( ) ); } } void AtomTest::invalidSSLTest( ) { // Response showing one mock repository curl_mockup_reset( ); curl_mockup_setResponse( DATA_DIR "/atom/workspaces.xml" ); curl_mockup_setCredentials( SERVER_USERNAME, SERVER_PASSWORD ); string badCert( "A really invalid SSL Certificate" ); curl_mockup_setSSLBadCertificate( badCert.c_str() ); // Test validated certificate case { libcmis::CertValidationHandlerPtr handler( new TestCertValidationHandler( false ) ); libcmis::SessionFactory::setCertificateValidationHandler( handler ); AtomPubSession session( SERVER_URL, SERVER_REPOSITORY, SERVER_USERNAME, SERVER_PASSWORD ); TestCertValidationHandler* handler_impl = static_cast< TestCertValidationHandler* >( handler.get( ) ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong number of certificates provided", size_t( 1 ), handler_impl->m_chain.size( ) ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Bad certificate provided", badCert, handler_impl->m_chain.front() ); } // Test cancelled validation case { libcmis::CertValidationHandlerPtr handler( new TestCertValidationHandler( true ) ); libcmis::SessionFactory::setCertificateValidationHandler( handler ); try { AtomPubSession session( SERVER_URL, SERVER_REPOSITORY, SERVER_USERNAME, SERVER_PASSWORD ); CPPUNIT_FAIL( "Should raise an exception saying the user didn't validate the SSL certificate" ); } catch ( const libcmis::Exception& e ) { CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong exception message", string( "Invalid SSL certificate" ), string( e.what() ) ); } } } void AtomTest::getRepositoriesTest( ) { // Response showing one mock repository curl_mockup_reset( ); curl_mockup_setResponse( DATA_DIR "/atom/workspaces.xml" ); AtomPubSession session( SERVER_URL, SERVER_REPOSITORY, SERVER_USERNAME, SERVER_PASSWORD ); vector< libcmis::RepositoryPtr > actual = session.getRepositories( ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong number of repositories", size_t( 1 ), actual.size( ) ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong repository found", SERVER_REPOSITORY, actual.front()->getId( ) ); } void AtomTest::getTypeTest( ) { curl_mockup_reset( ); curl_mockup_addResponse( "http://mockup/mock/type", "id=cmis:folder", "GET", DATA_DIR "/atom/type-folder.xml" ); curl_mockup_setCredentials( SERVER_USERNAME, SERVER_PASSWORD ); AtomPubSession session = getTestSession( SERVER_USERNAME, SERVER_PASSWORD ); string expectedId( "cmis:folder" ); libcmis::ObjectTypePtr actual = session.getType( expectedId ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong Id for fetched type", expectedId, actual->getId( ) ); } void AtomTest::getUnexistantTypeTest( ) { curl_mockup_reset( ); curl_mockup_setCredentials( SERVER_USERNAME, SERVER_PASSWORD ); AtomPubSession session = getTestSession( SERVER_USERNAME, SERVER_PASSWORD ); string expectedId( "bad_type" ); try { session.getType( expectedId ); CPPUNIT_FAIL( "Exception should be raised: invalid ID" ); } catch ( const libcmis::Exception& e ) { CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong error type", string( "objectNotFound" ), e.getType() ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong exception message", string( "No such type: bad_type" ), string( e.what() ) ); } } void AtomTest::getTypeParentsTest( ) { curl_mockup_reset( ); curl_mockup_addResponse( "http://mockup/mock/type", "id=DocumentLevel2", "GET", DATA_DIR "/atom/type-docLevel2.xml" ); curl_mockup_addResponse( "http://mockup/mock/type", "id=DocumentLevel1", "GET", DATA_DIR "/atom/type-docLevel1.xml" ); curl_mockup_addResponse( "http://mockup/mock/type", "id=cmis:document", "GET", DATA_DIR "/atom/type-document.xml" ); curl_mockup_setCredentials( SERVER_USERNAME, SERVER_PASSWORD ); AtomPubSession session = getTestSession( SERVER_USERNAME, SERVER_PASSWORD ); libcmis::ObjectTypePtr actual = session.getType( "DocumentLevel2" ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong Parent type", string( "DocumentLevel1" ), actual->getParentType( )->getId( ) ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong Base type", string( "cmis:document" ), actual->getBaseType( )->getId( ) ); } void AtomTest::getTypeChildrenTest( ) { curl_mockup_reset( ); curl_mockup_addResponse( "http://mockup/mock/type", "id=DocumentLevel1", "GET", DATA_DIR "/atom/type-docLevel1.xml" ); curl_mockup_addResponse( "http://mockup/mock/type", "id=cmis:document", "GET", DATA_DIR "/atom/type-document.xml" ); curl_mockup_addResponse( "http://mockup/mock/types", "typeId=cmis:document", "GET", DATA_DIR "/atom/typechildren-document.xml" ); curl_mockup_setCredentials( SERVER_USERNAME, SERVER_PASSWORD ); AtomPubSession session = getTestSession( SERVER_USERNAME, SERVER_PASSWORD ); libcmis::ObjectTypePtr actual = session.getType( "cmis:document" ); vector< libcmis::ObjectTypePtr > children = actual->getChildren( ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong number of children", size_t( 1 ), children.size( ) ); } void AtomTest::getObjectTest( ) { curl_mockup_reset( ); curl_mockup_addResponse( "http://mockup/mock/id", "id=valid-object", "GET", DATA_DIR "/atom/valid-object.xml" ); curl_mockup_addResponse( "http://mockup/mock/type", "id=cmis:folder", "GET", DATA_DIR "/atom/type-folder.xml" ); curl_mockup_setCredentials( SERVER_USERNAME, SERVER_PASSWORD ); AtomPubSession session = getTestSession( SERVER_USERNAME, SERVER_PASSWORD ); string expectedId( "valid-object" ); libcmis::ObjectPtr actual = session.getObject( expectedId ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong Id for fetched object", expectedId, actual->getId( ) ); } void AtomTest::getDocumentTest( ) { curl_mockup_reset( ); curl_mockup_addResponse( "http://mockup/mock/id", "id=test-document", "GET", DATA_DIR "/atom/test-document.xml" ); curl_mockup_addResponse( "http://mockup/mock/type", "id=DocumentLevel2", "GET", DATA_DIR "/atom/type-docLevel2.xml" ); curl_mockup_setCredentials( SERVER_USERNAME, SERVER_PASSWORD ); AtomPubSession session = getTestSession( SERVER_USERNAME, SERVER_PASSWORD ); string expectedId( "test-document" ); libcmis::ObjectPtr actual = session.getObject( expectedId ); // Do we have a document? libcmis::DocumentPtr document = boost::dynamic_pointer_cast< libcmis::Document >( actual ); CPPUNIT_ASSERT_MESSAGE( "Fetched object should be an instance of libcmis::DocumentPtr", NULL != document ); // Test the document properties CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong document ID", expectedId, document->getId( ) ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong document name", string( "Test Document" ), document->getName( ) ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong document type", string( "text/plain" ), document->getContentType( ) ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong base type", string( "cmis:document" ), document->getBaseType( ) ); CPPUNIT_ASSERT_MESSAGE( "CreatedBy is missing", !document->getCreatedBy( ).empty( ) ); CPPUNIT_ASSERT_MESSAGE( "CreationDate is missing", !document->getCreationDate( ).is_not_a_date_time() ); CPPUNIT_ASSERT_MESSAGE( "LastModifiedBy is missing", !document->getLastModifiedBy( ).empty( ) ); CPPUNIT_ASSERT_MESSAGE( "LastModificationDate is missing", !document->getLastModificationDate( ).is_not_a_date_time() ); CPPUNIT_ASSERT_MESSAGE( "ChangeToken is missing", !document->getChangeToken( ).empty( ) ); CPPUNIT_ASSERT_MESSAGE( "Content length is missing", 12345 == document->getContentLength( ) ); } void AtomTest::getFolderTest( ) { curl_mockup_reset( ); curl_mockup_addResponse( "http://mockup/mock/id", "id=valid-object", "GET", DATA_DIR "/atom/valid-object.xml" ); curl_mockup_addResponse( "http://mockup/mock/id", "id=root-folder", "GET", DATA_DIR "/atom/root-folder.xml" ); curl_mockup_addResponse( "http://mockup/mock/type", "id=cmis:folder", "GET", DATA_DIR "/atom/type-folder.xml" ); curl_mockup_setCredentials( SERVER_USERNAME, SERVER_PASSWORD ); AtomPubSession session = getTestSession( SERVER_USERNAME, SERVER_PASSWORD ); string expectedId( "valid-object" ); libcmis::FolderPtr actual = session.getFolder( expectedId ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong folder ID", expectedId, actual->getId( ) ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong folder name", string( "Valid Object" ), actual->getName( ) ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong folder path", string( "/Valid Object" ), actual->getPath( ) ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong base type", string( "cmis:folder" ), actual->getBaseType( ) ); CPPUNIT_ASSERT_MESSAGE( "Missing folder parent", actual->getFolderParent( ).get( ) ); CPPUNIT_ASSERT_MESSAGE( "Not a root folder", !actual->isRootFolder() ); CPPUNIT_ASSERT_MESSAGE( "CreatedBy is missing", !actual->getCreatedBy( ).empty( ) ); CPPUNIT_ASSERT_MESSAGE( "CreationDate is missing", !actual->getCreationDate( ).is_not_a_date_time() ); CPPUNIT_ASSERT_MESSAGE( "LastModifiedBy is missing", !actual->getLastModifiedBy( ).empty( ) ); CPPUNIT_ASSERT_MESSAGE( "LastModificationDate is missing", !actual->getLastModificationDate( ).is_not_a_date_time() ); CPPUNIT_ASSERT_MESSAGE( "ChangeToken is missing", !actual->getChangeToken( ).empty( ) ); } void AtomTest::getFolderBadTypeTest( ) { curl_mockup_reset( ); curl_mockup_addResponse( "http://mockup/mock/id", "id=test-document", "GET", DATA_DIR "/atom/test-document.xml" ); curl_mockup_addResponse( "http://mockup/mock/type", "id=DocumentLevel2", "GET", DATA_DIR "/atom/type-docLevel2.xml" ); curl_mockup_setCredentials( SERVER_USERNAME, SERVER_PASSWORD ); AtomPubSession session = getTestSession( SERVER_USERNAME, SERVER_PASSWORD ); libcmis::FolderPtr actual = session.getFolder( "test-document" ); CPPUNIT_ASSERT_MESSAGE( "returned folder should be an empty pointer", NULL == actual ); } void AtomTest::getUnexistantObjectTest( ) { curl_mockup_reset( ); curl_mockup_setCredentials( SERVER_USERNAME, SERVER_PASSWORD ); AtomPubSession session = getTestSession( SERVER_USERNAME, SERVER_PASSWORD ); string id( "bad_object" ); try { session.getObject( id ); CPPUNIT_FAIL( "Exception should be raised: invalid ID" ); } catch ( const libcmis::Exception& e ) { CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong CMIS exception type", string( "objectNotFound" ), e.getType() ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong exception message", string( "No such node: " ) + id, string( e.what() ) ); } } void AtomTest::getByPathValidTest( ) { curl_mockup_reset( ); curl_mockup_addResponse( "http://mockup/mock/path", "path=/Valid Object", "GET", DATA_DIR "/atom/valid-object.xml" ); curl_mockup_addResponse( "http://mockup/mock/type", "id=cmis:folder", "GET", DATA_DIR "/atom/type-folder.xml" ); curl_mockup_setCredentials( SERVER_USERNAME, SERVER_PASSWORD ); AtomPubSession session = getTestSession( SERVER_USERNAME, SERVER_PASSWORD ); libcmis::ObjectPtr actual = session.getObjectByPath( string( "/Valid Object" ) ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong Id for fetched object", string( "valid-object" ), actual->getId( ) ); } void AtomTest::getByPathInvalidTest( ) { curl_mockup_reset( ); curl_mockup_setCredentials( SERVER_USERNAME, SERVER_PASSWORD ); AtomPubSession session = getTestSession( SERVER_USERNAME, SERVER_PASSWORD ); try { session.getObjectByPath( string( "/some/invalid/path" ) ); CPPUNIT_FAIL( "Exception should be thrown: invalid Path" ); } catch ( const libcmis::Exception& e ) { CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong error type", string( "objectNotFound" ), e.getType() ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong exception message", string( "No node corresponding to path: /some/invalid/path" ), string( e.what() ) ); } } void AtomTest::getRenditionsTest( ) { curl_mockup_reset( ); curl_mockup_addResponse( "http://mockup/mock/id", "id=test-document", "GET", DATA_DIR "/atom/test-document.xml" ); curl_mockup_addResponse( "http://mockup/mock/type", "id=DocumentLevel2", "GET", DATA_DIR "/atom/type-docLevel2.xml" ); curl_mockup_setCredentials( SERVER_USERNAME, SERVER_PASSWORD ); AtomPubSession session = getTestSession( SERVER_USERNAME, SERVER_PASSWORD ); string expectedId( "test-document" ); libcmis::ObjectPtr actual = session.getObject( expectedId ); std::vector< libcmis::RenditionPtr > renditions = actual->getRenditions( ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Bad renditions count", size_t( 2 ), renditions.size( ) ); libcmis::RenditionPtr rendition = renditions[1]; CPPUNIT_ASSERT_EQUAL_MESSAGE( "Bad rendition mime type", string( "application/pdf" ), rendition->getMimeType( ) ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Bad rendition href", string( "http://mockup/mock/renditions?id=test-document-rendition2" ), rendition->getUrl() ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Bad rendition length - default case", long( -1 ), rendition->getLength( ) ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Bad rendition Title", string( "Doc as PDF" ), rendition->getTitle( ) ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Bad rendition kind", string( "pdf" ), rendition->getKind( ) ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Bad rendition length - filled case", long( 40385 ), renditions[0]->getLength( ) ); } void AtomTest::getAllowableActionsTest( ) { curl_mockup_reset( ); curl_mockup_addResponse( "http://mockup/mock/id", "id=valid-object", "GET", DATA_DIR "/atom/valid-object.xml" ); curl_mockup_addResponse( "http://mockup/mock/type", "id=cmis:folder", "GET", DATA_DIR "/atom/type-folder.xml" ); curl_mockup_setCredentials( SERVER_USERNAME, SERVER_PASSWORD ); AtomPubSession session = getTestSession( SERVER_USERNAME, SERVER_PASSWORD ); string expectedId( "valid-object" ); libcmis::FolderPtr actual = session.getFolder( expectedId ); boost::shared_ptr< libcmis::AllowableActions > toCheck = actual->getAllowableActions( ); CPPUNIT_ASSERT_MESSAGE( "ApplyACL allowable action not defined... are all the actions read?", toCheck->isDefined( libcmis::ObjectAction::ApplyACL ) ); CPPUNIT_ASSERT_MESSAGE( "GetChildren allowable action should be true", toCheck->isDefined( libcmis::ObjectAction::GetChildren ) && toCheck->isAllowed( libcmis::ObjectAction::GetChildren ) ); } void AtomTest::getAllowableActionsNotIncludedTest( ) { curl_mockup_reset( ); curl_mockup_addResponse( "http://mockup/mock/id", "id=valid-object", "GET", DATA_DIR "/atom/valid-object-noactions.xml" ); curl_mockup_addResponse( "http://mockup/mock/type", "id=cmis:folder", "GET", DATA_DIR "/atom/type-folder.xml" ); curl_mockup_addResponse( "http://mockup/mock/allowableactions", "id=valid-object", "GET", DATA_DIR "/atom/allowable-actions.xml" ); curl_mockup_setCredentials( SERVER_USERNAME, SERVER_PASSWORD ); AtomPubSession session = getTestSession( SERVER_USERNAME, SERVER_PASSWORD ); string expectedId( "valid-object" ); libcmis::FolderPtr actual = session.getFolder( expectedId ); // In some cases (mostly when getting folder children), we may not have the allowable actions // included in the object answer. Test that we are querying them when needed in those cases. boost::shared_ptr< libcmis::AllowableActions > toCheck = actual->getAllowableActions( ); CPPUNIT_ASSERT_MESSAGE( "ApplyACL allowable action not defined... are all the actions read?", toCheck->isDefined( libcmis::ObjectAction::ApplyACL ) ); CPPUNIT_ASSERT_MESSAGE( "GetChildren allowable action should be true", toCheck->isDefined( libcmis::ObjectAction::GetChildren ) && toCheck->isAllowed( libcmis::ObjectAction::GetChildren ) ); } void AtomTest::getChildrenTest( ) { curl_mockup_reset( ); curl_mockup_addResponse( "http://mockup/mock/children", "id=root-folder", "GET", DATA_DIR "/atom/root-children.xml" ); curl_mockup_addResponse( "http://mockup/mock/id", "id=root-folder", "GET", DATA_DIR "/atom/root-folder.xml" ); curl_mockup_addResponse( "http://mockup/mock/type", "id=cmis:folder", "GET", DATA_DIR "/atom/type-folder.xml" ); curl_mockup_addResponse( "http://mockup/mock/type", "id=DocumentLevel2", "GET", DATA_DIR "/atom/type-docLevel2.xml" ); curl_mockup_setCredentials( SERVER_USERNAME, SERVER_PASSWORD ); AtomPubSession session = getTestSession( SERVER_USERNAME, SERVER_PASSWORD ); vector< libcmis::ObjectPtr > children = session.getRootFolder()->getChildren( ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong number of children", size_t( 5 ), children.size() ); int folderCount = 0; int documentCount = 0; for ( vector< libcmis::ObjectPtr >::iterator it = children.begin( ); it != children.end( ); ++it ) { if ( NULL != boost::dynamic_pointer_cast< libcmis::Folder >( *it ) ) ++folderCount; else if ( NULL != boost::dynamic_pointer_cast< libcmis::Document >( *it ) ) ++documentCount; } CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong number of folder children", 2, folderCount ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong number of document children", 3, documentCount ); } void AtomTest::getDocumentParentsTest( ) { curl_mockup_reset( ); curl_mockup_addResponse( "http://mockup/mock/parents", "id=test-document", "GET", DATA_DIR "/atom/test-document-parents.xml" ); curl_mockup_addResponse( "http://mockup/mock/id", "id=test-document", "GET", DATA_DIR "/atom/test-document.xml" ); curl_mockup_addResponse( "http://mockup/mock/type", "id=cmis:folder", "GET", DATA_DIR "/atom/type-folder.xml" ); curl_mockup_addResponse( "http://mockup/mock/type", "id=DocumentLevel2", "GET", DATA_DIR "/atom/type-docLevel2.xml" ); curl_mockup_setCredentials( SERVER_USERNAME, SERVER_PASSWORD ); AtomPubSession session = getTestSession( SERVER_USERNAME, SERVER_PASSWORD ); libcmis::ObjectPtr object = session.getObject( "test-document" ); libcmis::DocumentPtr document = boost::dynamic_pointer_cast< libcmis::Document >( object ); CPPUNIT_ASSERT_MESSAGE( "Document expected", document != NULL ); vector< libcmis::FolderPtr > actual = document->getParents( ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Bad number of parents", size_t( 2 ), actual.size() ); } void AtomTest::getContentStreamTest( ) { curl_mockup_reset( ); curl_mockup_addResponse( "http://mockup/mock/id", "id=test-document", "GET", DATA_DIR "/atom/test-document.xml" ); curl_mockup_addResponse( "http://mockup/mock/type", "id=DocumentLevel2", "GET", DATA_DIR "/atom/type-docLevel2.xml" ); string expectedContent( "Some content stream" ); curl_mockup_addResponse( "http://mockup/mock/content/data.txt", "id=test-document", "GET", expectedContent.c_str( ), 0, false ); curl_mockup_setCredentials( SERVER_USERNAME, SERVER_PASSWORD ); AtomPubSession session = getTestSession( SERVER_USERNAME, SERVER_PASSWORD ); libcmis::ObjectPtr object = session.getObject( "test-document" ); libcmis::DocumentPtr document = boost::dynamic_pointer_cast< libcmis::Document >( object ); try { boost::shared_ptr< istream > is = document->getContentStream( ); ostringstream out; out << is->rdbuf(); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Content stream doesn't match", expectedContent, out.str( ) ); } catch ( const libcmis::Exception& e ) { string msg = "Unexpected exception: "; msg += e.what(); CPPUNIT_FAIL( msg.c_str() ); } } void AtomTest::setContentStreamTest( ) { curl_mockup_reset( ); curl_mockup_addResponse( "http://mockup/mock/id", "id=test-document", "GET", DATA_DIR "/atom/test-document.xml" ); curl_mockup_addResponse( "http://mockup/mock/type", "id=DocumentLevel2", "GET", DATA_DIR "/atom/type-docLevel2.xml" ); curl_mockup_addResponse( "http://mockup/mock/content/data.txt", "id=test-document", "PUT", "Updated", 0, false ); curl_mockup_setCredentials( SERVER_USERNAME, SERVER_PASSWORD ); AtomPubSession session = getTestSession( SERVER_USERNAME, SERVER_PASSWORD ); libcmis::ObjectPtr object = session.getObject( "test-document" ); libcmis::DocumentPtr document = boost::dynamic_pointer_cast< libcmis::Document >( object ); try { string expectedContent( "Some content stream to set" ); boost::shared_ptr< ostream > os ( new stringstream ( expectedContent ) ); string filename( "name.txt" ); document->setContentStream( os, "text/plain", filename ); CPPUNIT_ASSERT_MESSAGE( "Object not refreshed during setContentStream", object->getRefreshTimestamp( ) > 0 ); // Check the content has been properly uploaded const char* content = curl_mockup_getRequestBody( "http://mockup/mock/content/", "id=test-document", "PUT" ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Bad content uploaded", expectedContent, string( content ) ); } catch ( const libcmis::Exception& e ) { string msg = "Unexpected exception: "; msg += e.what(); CPPUNIT_FAIL( msg.c_str() ); } } void AtomTest::updatePropertiesTest( ) { curl_mockup_reset( ); curl_mockup_addResponse( "http://mockup/mock/id", "id=test-document", "GET", DATA_DIR "/atom/test-document.xml" ); curl_mockup_addResponse( "http://mockup/mock/type", "id=DocumentLevel2", "GET", DATA_DIR "/atom/type-docLevel2.xml" ); curl_mockup_addResponse( "http://mockup/mock/id", "id=test-document", "PUT", DATA_DIR "/atom/test-document-updated.xml" ); curl_mockup_setCredentials( SERVER_USERNAME, SERVER_PASSWORD ); AtomPubSession session = getTestSession( SERVER_USERNAME, SERVER_PASSWORD ); // Values for the test libcmis::ObjectPtr object = session.getObject( "test-document" ); string propertyName( "cmis:name" ); string expectedValue( "New name" ); // Fill the map of properties to change PropertyPtrMap newProperties; libcmis::ObjectTypePtr objectType = object->getTypeDescription( ); map< string, libcmis::PropertyTypePtr >::iterator it = objectType->getPropertiesTypes( ).find( propertyName ); vector< string > values; values.push_back( expectedValue ); libcmis::PropertyPtr property( new libcmis::Property( it->second, values ) ); newProperties[ propertyName ] = property; // Update the properties (method to test) libcmis::ObjectPtr updated = object->updateProperties( newProperties ); // Check that the proper request has been send // In order to avoid to check changing strings (containing a timestamp), // get the cmisra:object tree and compare it. string request( curl_mockup_getRequestBody( "http://mockup/mock/id", "id=test-document", "PUT" ) ); string actualObject = test::getXmlNodeAsString( request, "/atom:entry/cmisra:object" ); string expectedObject = "" "" "" "New name" "" "" ""; CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong request content sent", expectedObject, actualObject ); // Check that the properties are updated after the call PropertyPtrMap::iterator propIt = updated->getProperties( ).find( propertyName ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong value after refresh", expectedValue, propIt->second->getStrings().front( ) ); } void AtomTest::createFolderTest( ) { curl_mockup_reset( ); curl_mockup_addResponse( "http://mockup/mock/children", "id=root-folder", "POST", DATA_DIR "/atom/create-folder.xml" ); curl_mockup_addResponse( "http://mockup/mock/id", "id=root-folder", "GET", DATA_DIR "/atom/root-folder.xml" ); curl_mockup_addResponse( "http://mockup/mock/type", "id=cmis:folder", "GET", DATA_DIR "/atom/type-folder.xml" ); curl_mockup_setCredentials( SERVER_USERNAME, SERVER_PASSWORD ); AtomPubSession session = getTestSession( SERVER_USERNAME, SERVER_PASSWORD ); libcmis::FolderPtr parent = session.getRootFolder( ); // Prepare the properties for the new object, object type is cmis:folder PropertyPtrMap props; libcmis::ObjectTypePtr type = session.getType( "cmis:folder" ); map< string, libcmis::PropertyTypePtr > propTypes = type->getPropertiesTypes( ); // Set the object name string expectedName( "create folder" ); map< string, libcmis::PropertyTypePtr >::iterator it = propTypes.find( string( "cmis:name" ) ); vector< string > nameValues; nameValues.push_back( expectedName ); libcmis::PropertyPtr nameProperty( new libcmis::Property( it->second, nameValues ) ); props.insert( pair< string, libcmis::PropertyPtr >( string( "cmis:name" ), nameProperty ) ); // set the object type it = propTypes.find( string( "cmis:objectTypeId" ) ); vector< string > typeValues; typeValues.push_back( "cmis:folder" ); libcmis::PropertyPtr typeProperty( new libcmis::Property( it->second, typeValues ) ); props.insert( pair< string, libcmis::PropertyPtr >( string( "cmis:objectTypeId" ), typeProperty ) ); // Actually send the folder creation request libcmis::FolderPtr created = parent->createFolder( props ); // Check that something came back CPPUNIT_ASSERT_MESSAGE( "Change token shouldn't be empty: object should have been refreshed", !created->getChangeToken( ).empty() ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong name", expectedName, created->getName( ) ); // Check that the proper request has been sent string request( curl_mockup_getRequestBody( "http://mockup/mock/children", "id=root-folder", "POST" ) ); string actualObject = test::getXmlNodeAsString( request, "/atom:entry/cmisra:object" ); string expectedObject = "" "" "" "create folder" "" "" "cmis:folder" "" "" ""; CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong request content sent", expectedObject, actualObject ); } void AtomTest::createFolderBadTypeTest( ) { curl_mockup_reset( ); curl_mockup_addResponse( "http://mockup/mock/children", "id=root-folder", "POST", DATA_DIR "/atom/create-folder-bad-type.xml" ); curl_mockup_addResponse( "http://mockup/mock/id", "id=root-folder", "GET", DATA_DIR "/atom/root-folder.xml" ); curl_mockup_addResponse( "http://mockup/mock/type", "id=cmis:folder", "GET", DATA_DIR "/atom/type-folder.xml" ); curl_mockup_addResponse( "http://mockup/mock/type", "id=cmis:document", "GET", DATA_DIR "/atom/type-document.xml" ); curl_mockup_setCredentials( SERVER_USERNAME, SERVER_PASSWORD ); AtomPubSession session = getTestSession( SERVER_USERNAME, SERVER_PASSWORD ); libcmis::FolderPtr parent = session.getRootFolder( ); // Prepare the properties for the new object, object type is cmis:folder PropertyPtrMap props; libcmis::ObjectTypePtr type = session.getType( "cmis:folder" ); map< string, libcmis::PropertyTypePtr > propTypes = type->getPropertiesTypes( ); // Set the object name string expectedName( "create folder" ); map< string, libcmis::PropertyTypePtr >::iterator it = propTypes.find( string( "cmis:name" ) ); vector< string > nameValues; nameValues.push_back( expectedName ); libcmis::PropertyPtr nameProperty( new libcmis::Property( it->second, nameValues ) ); props.insert( pair< string, libcmis::PropertyPtr >( string( "cmis:name" ), nameProperty ) ); // set the object type it = propTypes.find( string( "cmis:objectTypeId" ) ); vector< string > typeValues; typeValues.push_back( "cmis:document" ); libcmis::PropertyPtr typeProperty( new libcmis::Property( it->second, typeValues ) ); props.insert( pair< string, libcmis::PropertyPtr >( string( "cmis:objectTypeId" ), typeProperty ) ); // Actually send the folder creation request try { parent->createFolder( props ); CPPUNIT_FAIL( "Should not succeed to return a folder" ); } catch ( libcmis::Exception& e ) { CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong error type", string( "constraint" ), e.getType() ); CPPUNIT_ASSERT_MESSAGE( "Bad exception message", string( e.what( ) ).find( "Created object is not a folder: " ) != string::npos ); } // Check that the proper request has been sent string request( curl_mockup_getRequestBody( "http://mockup/mock/children", "id=root-folder", "POST" ) ); string actualObject = test::getXmlNodeAsString( request, "/atom:entry/cmisra:object" ); string expectedObject = "" "" "" "create folder" "" "" "cmis:document" "" "" ""; CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong request content sent", expectedObject, actualObject ); } void AtomTest::createDocumentTest( ) { curl_mockup_reset( ); curl_mockup_addResponse( "http://mockup/mock/children", "id=root-folder", "POST", "Response body up to server", 201, false, "Location: http://mockup/mock/id?id=create-document\r\n" ); curl_mockup_addResponse( "http://mockup/mock/id", "id=create-document", "GET", DATA_DIR "/atom/create-document.xml" ); curl_mockup_addResponse( "http://mockup/mock/id", "id=root-folder", "GET", DATA_DIR "/atom/root-folder.xml" ); curl_mockup_addResponse( "http://mockup/mock/type", "id=cmis:folder", "GET", DATA_DIR "/atom/type-folder.xml" ); curl_mockup_addResponse( "http://mockup/mock/type", "id=cmis:document", "GET", DATA_DIR "/atom/type-document.xml" ); curl_mockup_setCredentials( SERVER_USERNAME, SERVER_PASSWORD ); AtomPubSession session = getTestSession( SERVER_USERNAME, SERVER_PASSWORD ); libcmis::FolderPtr parent = session.getRootFolder( ); // Prepare the properties for the new object, object type is cmis:folder PropertyPtrMap props; libcmis::ObjectTypePtr type = session.getType( "cmis:document" ); map< string, libcmis::PropertyTypePtr > propTypes = type->getPropertiesTypes( ); // Set the object name string expectedName( "create document" ); map< string, libcmis::PropertyTypePtr >::iterator it = propTypes.find( string( "cmis:name" ) ); vector< string > nameValues; nameValues.push_back( expectedName ); libcmis::PropertyPtr nameProperty( new libcmis::Property( it->second, nameValues ) ); props.insert( pair< string, libcmis::PropertyPtr >( string( "cmis:name" ), nameProperty ) ); // set the object type it = propTypes.find( string( "cmis:objectTypeId" ) ); vector< string > typeValues; typeValues.push_back( "cmis:document" ); libcmis::PropertyPtr typeProperty( new libcmis::Property( it->second, typeValues ) ); props.insert( pair< string, libcmis::PropertyPtr >( string( "cmis:objectTypeId" ), typeProperty ) ); // Actually send the document creation request string content = "Some content"; boost::shared_ptr< ostream > os ( new stringstream( content ) ); string contentType = "text/plain"; string filename( "name.txt" ); libcmis::DocumentPtr created = parent->createDocument( props, os, contentType, filename ); // Check that something came back CPPUNIT_ASSERT_MESSAGE( "Change token shouldn't be empty: object should have been refreshed", !created->getChangeToken( ).empty() ); // Check that the name is ok CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong name set", expectedName, created->getName( ) ); // Check that the request is the expected one string request( curl_mockup_getRequestBody( "http://mockup/mock/children", "id=root-folder", "POST" ) ); string actualContent = test::getXmlNodeAsString( request, "/atom:entry/cmisra:content" ); string expectedContent = "" "text/plain" "U29tZSBjb250ZW50" ""; CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong request content sent", expectedContent, actualContent ); string actualObject = test::getXmlNodeAsString( request, "/atom:entry/cmisra:object" ); string expectedObject = "" "" "" "create document" "" "" "cmis:document" "" "" ""; CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong request object sent", expectedObject, actualObject ); } void AtomTest::deleteDocumentTest( ) { curl_mockup_reset( ); curl_mockup_addResponse( "http://mockup/mock/id", "id=test-document", "GET", DATA_DIR "/atom/test-document.xml" ); curl_mockup_addResponse( "http://mockup/mock/type", "id=DocumentLevel2", "GET", DATA_DIR "/atom/type-docLevel2.xml" ); curl_mockup_addResponse( "http://mockup/mock/id", "id=test-document", "DELETE", "", 204, false ); curl_mockup_setCredentials( SERVER_USERNAME, SERVER_PASSWORD ); AtomPubSession session = getTestSession( SERVER_USERNAME, SERVER_PASSWORD ); libcmis::ObjectPtr object = session.getObject( "test-document" ); libcmis::Document* document = dynamic_cast< libcmis::Document* >( object.get() ); document->remove( ); // Test the sent request const char* request = curl_mockup_getRequestBody( "http://mockup/mock/id", "id=test-document", "DELETE" ); CPPUNIT_ASSERT_MESSAGE( "DELETE request not sent", request ); } void AtomTest::deleteFolderTreeTest( ) { curl_mockup_reset( ); curl_mockup_addResponse( "http://mockup/mock/id", "id=valid-object", "GET", DATA_DIR "/atom/valid-object.xml" ); curl_mockup_addResponse( "http://mockup/mock/descendants", "id=valid-object", "DELETE", "", 204, false ); curl_mockup_addResponse( "http://mockup/mock/type", "id=cmis:folder", "GET", DATA_DIR "/atom/type-folder.xml" ); curl_mockup_setCredentials( SERVER_USERNAME, SERVER_PASSWORD ); AtomPubSession session = getTestSession( SERVER_USERNAME, SERVER_PASSWORD ); libcmis::ObjectPtr object = session.getObject( "valid-object" ); libcmis::Folder* folder = dynamic_cast< libcmis::Folder* >( object.get() ); folder->removeTree( ); // Test the sent request const struct HttpRequest* request = curl_mockup_getRequest( "http://mockup/mock/descendants", "id=valid-object", "DELETE" ); CPPUNIT_ASSERT_MESSAGE( "DELETE request not sent", request ); delete request; } void AtomTest::checkOutTest( ) { curl_mockup_reset( ); curl_mockup_addResponse( "http://mockup/mock/id", "id=test-document", "GET", DATA_DIR "/atom/test-document.xml" ); curl_mockup_addResponse( "http://mockup/mock/type", "id=DocumentLevel2", "GET", DATA_DIR "/atom/type-docLevel2.xml" ); curl_mockup_addResponse( "http://mockup/mock/checkedout", "", "POST", DATA_DIR "/atom/working-copy.xml", 201 ); curl_mockup_setCredentials( SERVER_USERNAME, SERVER_PASSWORD ); AtomPubSession session = getTestSession( SERVER_USERNAME, SERVER_PASSWORD ); libcmis::ObjectPtr object = session.getObject( "test-document" ); libcmis::Document* document = dynamic_cast< libcmis::Document* >( object.get() ); libcmis::DocumentPtr pwc = document->checkOut( ); CPPUNIT_ASSERT_MESSAGE( "Missing returned Private Working Copy", pwc.get( ) != NULL ); PropertyPtrMap::iterator it = pwc->getProperties( ).find( string( "cmis:isVersionSeriesCheckedOut" ) ); vector< bool > values = it->second->getBools( ); CPPUNIT_ASSERT_MESSAGE( "cmis:isVersionSeriesCheckedOut isn't true", values.front( ) ); } void AtomTest::cancelCheckOutTest( ) { curl_mockup_reset( ); curl_mockup_addResponse( "http://mockup/mock/id", "id=working-copy", "GET", DATA_DIR "/atom/working-copy.xml" ); curl_mockup_addResponse( "http://mockup/mock/id", "id=working-copy", "DELETE", "", 204, false ); curl_mockup_addResponse( "http://mockup/mock/type", "id=DocumentLevel2", "GET", DATA_DIR "/atom/type-docLevel2.xml" ); curl_mockup_setCredentials( SERVER_USERNAME, SERVER_PASSWORD ); AtomPubSession session = getTestSession( SERVER_USERNAME, SERVER_PASSWORD ); // First get a checked out document libcmis::ObjectPtr object = session.getObject( "working-copy" ); libcmis::DocumentPtr pwc = boost::dynamic_pointer_cast< libcmis::Document >( object ); pwc->cancelCheckout( ); // Check that the DELETE request was sent out const struct HttpRequest* request = curl_mockup_getRequest( "http://mockup/mock/id", "id=working-copy", "DELETE" ); CPPUNIT_ASSERT_MESSAGE( "DELETE request not sent", request ); } void AtomTest::checkInTest( ) { curl_mockup_reset( ); curl_mockup_addResponse( "http://mockup/mock/type", "id=DocumentLevel2", "GET", DATA_DIR "/atom/type-docLevel2.xml" ); curl_mockup_addResponse( "http://mockup/mock/id", "id=working-copy", "GET", DATA_DIR "/atom/working-copy.xml" ); curl_mockup_addResponse( "http://mockup/mock/id", "id=working-copy", "PUT", DATA_DIR "/atom/test-document.xml", 200, true, "Location: http://mockup/mock/id?id=valid-object" ); curl_mockup_setCredentials( SERVER_USERNAME, SERVER_PASSWORD ); AtomPubSession session = getTestSession( SERVER_USERNAME, SERVER_PASSWORD ); // First get a checked out document libcmis::ObjectPtr object = session.getObject( "working-copy" ); libcmis::DocumentPtr pwc = boost::dynamic_pointer_cast< libcmis::Document >( object ); // Do the checkin bool isMajor = true; string comment( "Some check-in comment" ); PropertyPtrMap properties; string newContent = "Some New content to check in"; boost::shared_ptr< ostream > stream ( new stringstream( newContent ) ); pwc->checkIn( isMajor, comment, properties, stream, "text/plain", "filename.txt" ); // Make sure that the expected request has been sent const struct HttpRequest* request = curl_mockup_getRequest( "http://mockup/mock/id", "id=working-copy", "PUT" ); CPPUNIT_ASSERT_MESSAGE( "PUT request not sent", request ); string actualContent = test::getXmlNodeAsString( request->body, "/atom:entry/cmisra:content" ); string expectedContent = "text/plainU29tZSBOZXcgY29udGVudCB0byBjaGVjayBpbg=="; CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong content sent", expectedContent, actualContent ); // Still needs to test that checkin request parameters were OK string url( request->url ); CPPUNIT_ASSERT_MESSAGE( "Sent checkin request has wrong major parameter", url.find("major=true") != string::npos ); CPPUNIT_ASSERT_MESSAGE( "Sent checkin request has wrong checkinComment parameter", url.find( "checkinComment=" + comment ) != string::npos ); CPPUNIT_ASSERT_MESSAGE( "Sent checkin request has no checkin parameter", url.find("checkin=true") != string::npos ); } void AtomTest::getAllVersionsTest( ) { curl_mockup_reset( ); curl_mockup_addResponse( "http://mockup/mock/type", "id=DocumentLevel2", "GET", DATA_DIR "/atom/type-docLevel2.xml" ); curl_mockup_addResponse( "http://mockup/mock/id", "id=test-document", "GET", DATA_DIR "/atom/test-document.xml" ); curl_mockup_addResponse( "http://mockup/mock/versions", "id=test-document", "GET", DATA_DIR "/atom/get-versions.xml" ); curl_mockup_setCredentials( SERVER_USERNAME, SERVER_PASSWORD ); AtomPubSession session = getTestSession( SERVER_USERNAME, SERVER_PASSWORD ); // First get a document libcmis::ObjectPtr object = session.getObject( "test-document" ); libcmis::DocumentPtr doc = boost::dynamic_pointer_cast< libcmis::Document >( object ); // Get all the versions (method to check) vector< libcmis::DocumentPtr > versions = doc->getAllVersions( ); // Checks CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong number of versions", size_t( 2 ), versions.size( ) ); } void AtomTest::moveTest( ) { curl_mockup_reset( ); curl_mockup_addResponse( "http://mockup/mock/type", "id=DocumentLevel2", "GET", DATA_DIR "/atom/type-docLevel2.xml" ); curl_mockup_addResponse( "http://mockup/mock/id", "id=test-document", "GET", DATA_DIR "/atom/test-document.xml" ); curl_mockup_addResponse( "http://mockup/mock/parents", "id=test-document", "GET", DATA_DIR "/atom/test-document-parents.xml" ); curl_mockup_addResponse( "http://mockup/mock/id", "id=valid-object", "GET", DATA_DIR "/atom/valid-object.xml" ); curl_mockup_addResponse( "http://mockup/mock/type", "id=cmis:folder", "GET", DATA_DIR "/atom/type-folder.xml" ); curl_mockup_addResponse( "http://mockup/mock/children", "id=valid-object", "POST", DATA_DIR "/atom/test-document.xml" ); curl_mockup_setCredentials( SERVER_USERNAME, SERVER_PASSWORD ); AtomPubSession session = getTestSession( SERVER_USERNAME, SERVER_PASSWORD ); libcmis::ObjectPtr object = session.getObject( "test-document" ); libcmis::Document* document = dynamic_cast< libcmis::Document* >( object.get() ); string destFolderId = "valid-object"; libcmis::FolderPtr src = document->getParents( ).front( ); libcmis::FolderPtr dest = session.getFolder( destFolderId ); document->move( src, dest ); // Check that the sent request has the expected params const struct HttpRequest* request = curl_mockup_getRequest( "http://mockup/mock/children", "id=valid-object", "POST" ); string url( request->url ); CPPUNIT_ASSERT_MESSAGE( "Sent move request has wrong or missing sourceFolderId", url.find("sourceFolderId=parent1") != string::npos ); // Check that we had the atom entry in the request body string actualObject = test::getXmlNodeAsString( request->body, "/atom:entry/cmisra:object/cmis:properties/cmis:propertyId[@propertyDefinitionId='cmis:objectId']" ); string expectedObject = "" "test-document" ""; CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong request object sent", expectedObject, actualObject ); } AtomPubSession AtomTest::getTestSession( string username, string password ) { AtomPubSession session; string buf; loadFromFile( DATA_DIR "/atom/workspaces.xml", buf ); session.parseServiceDocument( buf ); session.m_username = username; session.m_password = password; return session; } void AtomTest::loadFromFile( const char* path, string& buf ) { ifstream in( path ); in.seekg( 0, ios::end ); int length = in.tellg( ); in.seekg( 0, ios::beg ); char* buffer = new char[length]; in.read( buffer, length ); in.close( ); buf = string( buffer, length ); delete[] buffer; } libcmis-0.4.1/qa/libcmis/test-xmlutils.cxx0000644000175000001440000005217712200143447015471 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2011 SUSE * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #include #include #include #include #include #include #include #define private public #include "object-type.hxx" #include "property.hxx" #include "property-type.hxx" #include "xml-utils.hxx" #include "test-helpers.hxx" using namespace boost; using namespace std; using namespace test; class XmlTest : public CppUnit::TestFixture { public: // Parser tests void parseDateTimeTest( ); void parseBoolTest( ); void parseIntegerTest( ); void parseDoubleTest( ); void parsePropertyStringTest( ); void parsePropertyIntegerTest( ); void parsePropertyDateTimeTest( ); void parsePropertyBoolTest( ); void parseEmptyPropertyTest( ); void parseRenditionTest( ); void parseRepositoryCapabilitiesTest( ); // Writer tests void propertyStringAsXmlTest( ); void propertyIntegerAsXmlTest( ); // Other utilities tests void sha1Test( ); CPPUNIT_TEST_SUITE( XmlTest ); CPPUNIT_TEST( parseDateTimeTest ); CPPUNIT_TEST( parseBoolTest ); CPPUNIT_TEST( parseIntegerTest ); CPPUNIT_TEST( parseDoubleTest ); CPPUNIT_TEST( parsePropertyStringTest ); CPPUNIT_TEST( parsePropertyIntegerTest ); CPPUNIT_TEST( parsePropertyDateTimeTest ); CPPUNIT_TEST( parsePropertyBoolTest ); CPPUNIT_TEST( parseEmptyPropertyTest ); CPPUNIT_TEST( parseRenditionTest ); CPPUNIT_TEST( parseRepositoryCapabilitiesTest ); CPPUNIT_TEST( propertyStringAsXmlTest ); CPPUNIT_TEST( propertyIntegerAsXmlTest ); CPPUNIT_TEST( sha1Test ); CPPUNIT_TEST_SUITE_END( ); }; /** Dummy ObjectType implementation used as a PropertyType factory. */ class ObjectTypeDummy : public libcmis::ObjectType { public: ObjectTypeDummy( ); virtual ~ObjectTypeDummy() { }; }; ObjectTypeDummy::ObjectTypeDummy( ) { // String Property { libcmis::PropertyTypePtr prop ( new libcmis::PropertyType( ) ); prop->setId( string( "STR-ID" ) ); prop->setLocalName( string( "LOCAL" ) ); prop->setDisplayName( string( "DISPLAY" ) ); prop->setQueryName( string( "QUERY" ) ); prop->setTypeFromXml( "string" ); m_propertiesTypes.insert( pair< string, libcmis::PropertyTypePtr >( prop->getId( ), prop ) ); } // Integer Property { libcmis::PropertyTypePtr prop ( new libcmis::PropertyType( ) ); prop->setId( string( "INT-ID" ) ); prop->setLocalName( string( "LOCAL" ) ); prop->setDisplayName( string( "DISPLAY" ) ); prop->setQueryName( string( "QUERY" ) ); prop->setTypeFromXml( "integer" ); m_propertiesTypes.insert( pair< string, libcmis::PropertyTypePtr >( prop->getId( ), prop ) ); } // DateTime Property { libcmis::PropertyTypePtr prop ( new libcmis::PropertyType( ) ); prop->setId( string( "DATE-ID" ) ); prop->setLocalName( string( "LOCAL" ) ); prop->setDisplayName( string( "DISPLAY" ) ); prop->setQueryName( string( "QUERY" ) ); prop->setTypeFromXml( "datetime" ); m_propertiesTypes.insert( pair< string, libcmis::PropertyTypePtr >( prop->getId( ), prop ) ); } // Boolean Property { libcmis::PropertyTypePtr prop ( new libcmis::PropertyType( ) ); prop->setId( string( "BOOL-ID" ) ); prop->setLocalName( string( "LOCAL" ) ); prop->setDisplayName( string( "DISPLAY" ) ); prop->setQueryName( string( "QUERY" ) ); prop->setTypeFromXml( "boolean" ); m_propertiesTypes.insert( pair< string, libcmis::PropertyTypePtr >( prop->getId( ), prop ) ); } } void XmlTest::parseDateTimeTest( ) { tm basis; basis.tm_year = 2011 - 1900; basis.tm_mon = 8; // Months are in 0..11 range basis.tm_mday = 28; basis.tm_hour = 12; basis.tm_min = 44; basis.tm_sec = 28; // No time zone test { char toParse[50]; strftime( toParse, sizeof( toParse ), "%FT%T", &basis ); posix_time::ptime t = libcmis::parseDateTime( string( toParse ) ); gregorian::date expDate( basis.tm_year + 1900, basis.tm_mon + 1, basis.tm_mday ); posix_time::time_duration expTime( basis.tm_hour, basis.tm_min, basis.tm_sec ); posix_time::ptime expected( expDate, expTime ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "No time zone case failed", expected, t ); } // Z time zone test { char toParse[50]; strftime( toParse, sizeof( toParse ), "%FT%TZ", &basis ); posix_time::ptime t = libcmis::parseDateTime( string( toParse ) ); gregorian::date expDate( basis.tm_year + 1900, basis.tm_mon + 1, basis.tm_mday ); posix_time::time_duration expTime( basis.tm_hour, basis.tm_min, basis.tm_sec ); posix_time::ptime expected( expDate, expTime ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Z time zone case failed", expected, t ); } // +XX:XX time zone test { char toParse[50]; strftime( toParse, sizeof( toParse ), "%FT%T+02:00", &basis ); posix_time::ptime t = libcmis::parseDateTime( string( toParse ) ); gregorian::date expDate( basis.tm_year + 1900, basis.tm_mon + 1, basis.tm_mday ); posix_time::time_duration expTime( basis.tm_hour + 2, basis.tm_min, basis.tm_sec ); posix_time::ptime expected( expDate, expTime ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "+XX:XX time zone case failed", expected, t ); } // -XX:XX time zone test { char toParse[50]; strftime( toParse, sizeof( toParse ), "%FT%T-02:00", &basis ); posix_time::ptime t = libcmis::parseDateTime( string( toParse ) ); gregorian::date expDate( basis.tm_year + 1900, basis.tm_mon + 1, basis.tm_mday ); posix_time::time_duration expTime( basis.tm_hour - 2, basis.tm_min, basis.tm_sec ); posix_time::ptime expected( expDate, expTime ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "+XX:XX time zone case failed", expected, t ); } // Error test { posix_time::ptime t = libcmis::parseDateTime( string( "Nothing interesting 9990" ) ); CPPUNIT_ASSERT_MESSAGE( "Error case failed", t.is_not_a_date_time( ) ); } } void XmlTest::parseBoolTest( ) { // 'true' test { bool result = libcmis::parseBool( string( "true" ) ); CPPUNIT_ASSERT_MESSAGE( "'true' can't be parsed properly", result ); } // '1' test { bool result = libcmis::parseBool( string( "1" ) ); CPPUNIT_ASSERT_MESSAGE( "'1' can't be parsed properly", result ); } // 'false' test { bool result = libcmis::parseBool( string( "false" ) ); CPPUNIT_ASSERT_MESSAGE( "'false' can't be parsed properly", !result ); } // '0' test { bool result = libcmis::parseBool( string( "0" ) ); CPPUNIT_ASSERT_MESSAGE( "'0' can't be parsed properly", !result ); } // Error test { try { libcmis::parseBool( string( "boolcheat" ) ); CPPUNIT_FAIL( "Exception should be thrown" ); } catch ( const libcmis::Exception& e ) { CPPUNIT_ASSERT_EQUAL_MESSAGE( "Bad exception message", string( "Invalid xsd:boolean input: boolcheat" ), string( e.what() ) ); } } } void XmlTest::parseIntegerTest( ) { // Positive value test { long result = libcmis::parseInteger( string( "123" ) ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Positive integer can't be parsed properly", 123L, result ); } // Negative value test { long result = libcmis::parseInteger( string( "-123" ) ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Negative integer can't be parsed properly", -123L, result ); } // Overflow error test { try { libcmis::parseInteger( string( "9999999999999999999" ) ); CPPUNIT_FAIL( "Exception should be thrown" ); } catch ( const libcmis::Exception& e ) { CPPUNIT_ASSERT_EQUAL_MESSAGE( "Bad exception message", string( "xsd:integer input can't fit to long: 9999999999999999999" ), string( e.what() ) ); } } // Non integer test { try { libcmis::parseInteger( string( "123bad" ) ); CPPUNIT_FAIL( "Exception should be thrown" ); } catch ( const libcmis::Exception& e ) { CPPUNIT_ASSERT_EQUAL_MESSAGE( "Bad exception message", string( "Invalid xsd:integer input: 123bad" ), string( e.what() ) ); } } } void XmlTest::parseDoubleTest( ) { // Positive value test { double result = libcmis::parseDouble( string( "123.456" ) ); CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE( "Positive decimal can't be parsed properly", 123.456, result, 0.000001 ); } // Negative value test { double result = libcmis::parseDouble( string( "-123.456" ) ); CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE( "Negative decimal can't be parsed properly", -123.456, result, 0.000001 ); } // Non integer test { try { libcmis::parseDouble( string( "123.456bad" ) ); CPPUNIT_FAIL( "Exception should be thrown" ); } catch ( const libcmis::Exception& e ) { CPPUNIT_ASSERT_EQUAL_MESSAGE( "Bad exception message", string( "Invalid xsd:decimal input: 123.456bad" ), string( e.what() ) ); } } } void XmlTest::parsePropertyStringTest( ) { stringstream buf; buf << "" << "VALUE 1" << "VALUE 2" << ""; libcmis::ObjectTypePtr dummy( new ObjectTypeDummy( ) ); libcmis::PropertyPtr actual = libcmis::parseProperty( getXmlNode( buf.str( ) ), dummy ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong id parsed", string( "STR-ID" ), actual->getPropertyType( )->getId( ) ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong number of values parsed", vector::size_type( 2 ), actual->getStrings( ).size( ) ); } void XmlTest::parsePropertyIntegerTest( ) { stringstream buf; buf << "" << "12345" << "67890" << ""; libcmis::ObjectTypePtr dummy( new ObjectTypeDummy( ) ); libcmis::PropertyPtr actual = libcmis::parseProperty( getXmlNode( buf.str( ) ), dummy ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong id parsed", string( "INT-ID" ), actual->getPropertyType()->getId( ) ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong number of values parsed", vector::size_type( 2 ), actual->getLongs( ).size( ) ); } void XmlTest::parsePropertyDateTimeTest( ) { stringstream buf; buf << "" << "2012-01-19T09:06:57.388Z" << "2011-01-19T09:06:57.388Z" << ""; libcmis::ObjectTypePtr dummy( new ObjectTypeDummy( ) ); libcmis::PropertyPtr actual = libcmis::parseProperty( getXmlNode( buf.str( ) ), dummy ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong id parsed", string( "DATE-ID" ), actual->getPropertyType()->getId( ) ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong number of values parsed", vector::size_type( 2 ), actual->getDateTimes( ).size( ) ); } void XmlTest::parsePropertyBoolTest( ) { stringstream buf; buf << "" << "true" << ""; libcmis::ObjectTypePtr dummy( new ObjectTypeDummy( ) ); libcmis::PropertyPtr actual = libcmis::parseProperty( getXmlNode( buf.str( ) ), dummy ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong id parsed", string( "BOOL-ID" ), actual->getPropertyType()->getId( ) ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong number of values parsed", vector::size_type( 1 ), actual->getBools( ).size( ) ); } void XmlTest::parseEmptyPropertyTest( ) { stringstream buf; buf << ""; libcmis::ObjectTypePtr dummy( new ObjectTypeDummy( ) ); libcmis::PropertyPtr actual = libcmis::parseProperty( getXmlNode( buf.str( ) ), dummy ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong id parsed", string( "STR-ID" ), actual->getPropertyType()->getId( ) ); CPPUNIT_ASSERT_MESSAGE( "Should have no value", actual->getStrings( ).empty( ) ); } void XmlTest::parseRenditionTest( ) { stringstream buf; buf << "" << "STREAM-ID" << "MIME" << "123456" << "KIND" << "TITLE" << "123" << "456" << "DOC-ID" << ""; libcmis::RenditionPtr actual( new libcmis::Rendition( getXmlNode( buf.str( ) ) ) ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong stream id parsed", string( "STREAM-ID" ), actual->getStreamId( ) ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong mime type parsed", string( "MIME" ), actual->getMimeType( ) ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong length parsed", long( 123456 ), actual->getLength( ) ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong kind parsed", string( "KIND" ), actual->getKind( ) ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong title parsed", string( "TITLE" ), actual->getTitle( ) ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong height parsed", long( 123 ), actual->getHeight( ) ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong width parsed", long( 456 ), actual->getWidth( ) ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong rendition doc id parsed", string( "DOC-ID" ), actual->getRenditionDocumentId( ) ); } string lcl_findCapability( map< libcmis::Repository::Capability, string > store, libcmis::Repository::Capability capability ) { string result; map< libcmis::Repository::Capability, string >::iterator it = store.find( capability ); if ( it != store.end( ) ) result = it->second; return result; } void XmlTest::parseRepositoryCapabilitiesTest( ) { stringstream buf; buf << "" << "manage" << "false" << "none" << "anytime" << "true" << "true" << "common" << "true" << "false" << "true" << "bothcombined" << "read" << "false" << "false" << "none" << ""; map< libcmis::Repository::Capability, string > capabilities = libcmis::Repository::parseCapabilities( getXmlNode( buf.str( ) ) ); CPPUNIT_ASSERT_EQUAL( string( "manage" ), lcl_findCapability( capabilities, libcmis::Repository::ACL ) ); CPPUNIT_ASSERT_EQUAL( string( "false" ), lcl_findCapability( capabilities, libcmis::Repository::AllVersionsSearchable ) ); CPPUNIT_ASSERT_EQUAL( string( "none" ), lcl_findCapability( capabilities, libcmis::Repository::Changes ) ); CPPUNIT_ASSERT_EQUAL( string( "anytime" ), lcl_findCapability( capabilities, libcmis::Repository::ContentStreamUpdatability ) ); CPPUNIT_ASSERT_EQUAL( string( "true" ), lcl_findCapability( capabilities, libcmis::Repository::GetDescendants ) ); CPPUNIT_ASSERT_EQUAL( string( "true" ), lcl_findCapability( capabilities, libcmis::Repository::GetFolderTree ) ); CPPUNIT_ASSERT_EQUAL( string( "common" ), lcl_findCapability( capabilities, libcmis::Repository::OrderBy ) ); CPPUNIT_ASSERT_EQUAL( string( "true" ), lcl_findCapability( capabilities, libcmis::Repository::Multifiling ) ); CPPUNIT_ASSERT_EQUAL( string( "false" ), lcl_findCapability( capabilities, libcmis::Repository::PWCSearchable ) ); CPPUNIT_ASSERT_EQUAL( string( "true" ), lcl_findCapability( capabilities, libcmis::Repository::PWCUpdatable ) ); CPPUNIT_ASSERT_EQUAL( string( "bothcombined" ), lcl_findCapability( capabilities, libcmis::Repository::Query ) ); CPPUNIT_ASSERT_EQUAL( string( "read" ), lcl_findCapability( capabilities, libcmis::Repository::Renditions ) ); CPPUNIT_ASSERT_EQUAL( string( "false" ), lcl_findCapability( capabilities, libcmis::Repository::Unfiling ) ); CPPUNIT_ASSERT_EQUAL( string( "false" ), lcl_findCapability( capabilities, libcmis::Repository::VersionSpecificFiling ) ); CPPUNIT_ASSERT_EQUAL( string( "none" ), lcl_findCapability( capabilities, libcmis::Repository::Join ) ); } void XmlTest::propertyStringAsXmlTest( ) { vector< string > values; values.push_back( string( "Value 1" ) ); values.push_back( string( "Value 2" ) ); ObjectTypeDummy factory; map< string, libcmis::PropertyTypePtr >::iterator it = factory.getPropertiesTypes( ).find( "STR-ID" ); CPPUNIT_ASSERT_MESSAGE( "Missing property type to setup fixture", it != factory.getPropertiesTypes( ).end() ); libcmis::PropertyPtr property( new libcmis::Property( it->second, values ) ); string actual = writeXml( property ); stringstream expected; expected << "\n" << "" << "Value 1" << "Value 2" << "\n"; CPPUNIT_ASSERT_EQUAL( expected.str( ), actual ); } void XmlTest::propertyIntegerAsXmlTest( ) { vector< string > values; values.push_back( string( "123" ) ); values.push_back( string( "456" ) ); ObjectTypeDummy factory; map< string, libcmis::PropertyTypePtr >::iterator it = factory.getPropertiesTypes( ).find( "INT-ID" ); CPPUNIT_ASSERT_MESSAGE( "Missing property type to setup fixture", it != factory.getPropertiesTypes( ).end() ); libcmis::PropertyPtr property( new libcmis::Property( it->second, values ) ); string actual = writeXml( property ); stringstream expected; expected << "\n" << "" << "123" << "456" << "\n"; CPPUNIT_ASSERT_EQUAL( expected.str( ), actual ); } void XmlTest::sha1Test( ) { { string actual = libcmis::sha1( "Hello" ); CPPUNIT_ASSERT_EQUAL( string( "f7ff9e8b7bb2e09b70935a5d785e0cc5d9d0abf0" ), actual ); } { // check correct width string actual = libcmis::sha1( "35969137" ); CPPUNIT_ASSERT_EQUAL( string( "0d93546909cfeb5c00089202104df3980000ec9f" ), actual ); } } CPPUNIT_TEST_SUITE_REGISTRATION( XmlTest ); libcmis-0.4.1/qa/libcmis/Makefile.in0000644000175000001440000020536612200457433014157 00000000000000# Makefile.in generated by automake 1.13.4 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ @ENABLE_TESTS_TRUE@check_PROGRAMS = test-nosrv-utils$(EXEEXT) \ @ENABLE_TESTS_TRUE@ test-nosrv-json$(EXEEXT) test-ws$(EXEEXT) \ @ENABLE_TESTS_TRUE@ $(am__EXEEXT_1) @ENABLE_TESTS_TRUE@TESTS = test-nosrv-utils$(EXEEXT) \ @ENABLE_TESTS_TRUE@ test-nosrv-json$(EXEEXT) $(am__EXEEXT_1) \ @ENABLE_TESTS_TRUE@ $(am__EXEEXT_2) subdir = qa/libcmis DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/boost.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = @ENABLE_TESTS_TRUE@@OS_WIN32_FALSE@am__EXEEXT_1 = \ @ENABLE_TESTS_TRUE@@OS_WIN32_FALSE@ test-nosrv-atom$(EXEEXT) \ @ENABLE_TESTS_TRUE@@OS_WIN32_FALSE@ test-nosrv-gdrive$(EXEEXT) am__test_nosrv_atom_SOURCES_DIST = test-atom.cxx test-helpers.cxx \ test-main.cxx @ENABLE_TESTS_TRUE@am_test_nosrv_atom_OBJECTS = \ @ENABLE_TESTS_TRUE@ test_nosrv_atom-test-atom.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ test_nosrv_atom-test-helpers.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ test_nosrv_atom-test-main.$(OBJEXT) test_nosrv_atom_OBJECTS = $(am_test_nosrv_atom_OBJECTS) am__DEPENDENCIES_1 = @ENABLE_TESTS_TRUE@test_nosrv_atom_DEPENDENCIES = $(top_builddir)/qa/mockup/libcmis-mockup.la \ @ENABLE_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ @ENABLE_TESTS_TRUE@ $(am__DEPENDENCIES_1) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = am__test_nosrv_gdrive_SOURCES_DIST = test-helpers.cxx test-main.cxx \ test-gdrive.cxx @ENABLE_TESTS_TRUE@am_test_nosrv_gdrive_OBJECTS = \ @ENABLE_TESTS_TRUE@ test_nosrv_gdrive-test-helpers.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ test_nosrv_gdrive-test-main.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ test_nosrv_gdrive-test-gdrive.$(OBJEXT) test_nosrv_gdrive_OBJECTS = $(am_test_nosrv_gdrive_OBJECTS) @ENABLE_TESTS_TRUE@test_nosrv_gdrive_DEPENDENCIES = $(top_builddir)/qa/mockup/libcmis-mockup.la \ @ENABLE_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ @ENABLE_TESTS_TRUE@ $(am__DEPENDENCIES_1) am__test_nosrv_json_SOURCES_DIST = test-helpers.cxx test-main.cxx \ test-jsonutils.cxx @ENABLE_TESTS_TRUE@am_test_nosrv_json_OBJECTS = \ @ENABLE_TESTS_TRUE@ test_nosrv_json-test-helpers.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ test_nosrv_json-test-main.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ test_nosrv_json-test-jsonutils.$(OBJEXT) test_nosrv_json_OBJECTS = $(am_test_nosrv_json_OBJECTS) @ENABLE_TESTS_TRUE@test_nosrv_json_DEPENDENCIES = $(top_builddir)/src/libcmis/libcmis-@LIBCMIS_API_VERSION@.la \ @ENABLE_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ @ENABLE_TESTS_TRUE@ $(am__DEPENDENCIES_1) am__test_nosrv_utils_SOURCES_DIST = test-decoder.cxx test-soap.cxx \ test-xmlutils.cxx test-helpers.hxx test-helpers.cxx \ test-main.cxx @ENABLE_TESTS_TRUE@am_test_nosrv_utils_OBJECTS = \ @ENABLE_TESTS_TRUE@ test_nosrv_utils-test-decoder.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ test_nosrv_utils-test-soap.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ test_nosrv_utils-test-xmlutils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ test_nosrv_utils-test-helpers.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ test_nosrv_utils-test-main.$(OBJEXT) test_nosrv_utils_OBJECTS = $(am_test_nosrv_utils_OBJECTS) @ENABLE_TESTS_TRUE@test_nosrv_utils_DEPENDENCIES = $(top_builddir)/src/libcmis/libcmis-@LIBCMIS_API_VERSION@.la \ @ENABLE_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ @ENABLE_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am__test_ws_SOURCES_DIST = test-ws.cxx test-helpers.hxx \ test-helpers.cxx test-main.cxx @ENABLE_TESTS_TRUE@am_test_ws_OBJECTS = test_ws-test-ws.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ test_ws-test-helpers.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ test_ws-test-main.$(OBJEXT) test_ws_OBJECTS = $(am_test_ws_OBJECTS) @ENABLE_TESTS_TRUE@test_ws_DEPENDENCIES = $(top_builddir)/src/libcmis/libcmis-@LIBCMIS_API_VERSION@.la \ @ENABLE_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ @ENABLE_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CXXFLAGS) $(CXXFLAGS) AM_V_CXX = $(am__v_CXX_@AM_V@) am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) am__v_CXX_0 = @echo " CXX " $@; am__v_CXX_1 = CXXLD = $(CXX) CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) am__v_CXXLD_0 = @echo " CXXLD " $@; am__v_CXXLD_1 = COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(test_nosrv_atom_SOURCES) $(test_nosrv_gdrive_SOURCES) \ $(test_nosrv_json_SOURCES) $(test_nosrv_utils_SOURCES) \ $(test_ws_SOURCES) DIST_SOURCES = $(am__test_nosrv_atom_SOURCES_DIST) \ $(am__test_nosrv_gdrive_SOURCES_DIST) \ $(am__test_nosrv_json_SOURCES_DIST) \ $(am__test_nosrv_utils_SOURCES_DIST) \ $(am__test_ws_SOURCES_DIST) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__tty_colors_dummy = \ mgn= red= grn= lgn= blu= brg= std=; \ am__color_tests=no am__tty_colors = { \ $(am__tty_colors_dummy); \ if test "X$(AM_COLOR_TESTS)" = Xno; then \ am__color_tests=no; \ elif test "X$(AM_COLOR_TESTS)" = Xalways; then \ am__color_tests=yes; \ elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \ am__color_tests=yes; \ fi; \ if test $$am__color_tests = yes; then \ red=''; \ grn=''; \ lgn=''; \ blu=''; \ mgn=''; \ brg=''; \ std=''; \ fi; \ } @ENABLE_LONG_TESTS_TRUE@@ENABLE_TESTS_TRUE@am__EXEEXT_2 = \ @ENABLE_LONG_TESTS_TRUE@@ENABLE_TESTS_TRUE@ test-ws$(EXEEXT) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BOOST_CPPFLAGS = @BOOST_CPPFLAGS@ BOOST_DATE_TIME_LDFLAGS = @BOOST_DATE_TIME_LDFLAGS@ BOOST_DATE_TIME_LIBS = @BOOST_DATE_TIME_LIBS@ BOOST_PROGRAM_OPTIONS_LDFLAGS = @BOOST_PROGRAM_OPTIONS_LDFLAGS@ BOOST_PROGRAM_OPTIONS_LIBS = @BOOST_PROGRAM_OPTIONS_LIBS@ BOOST_ROOT = @BOOST_ROOT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPCHECK = @CPPCHECK@ CPPFLAGS = @CPPFLAGS@ CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ CPPUNIT_LIBS = @CPPUNIT_LIBS@ CURL_CFLAGS = @CURL_CFLAGS@ CURL_LIBS = @CURL_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISTCHECK_CONFIGURE_FLAGS = @DISTCHECK_CONFIGURE_FLAGS@ DLLTOOL = @DLLTOOL@ DOCBOOK2MAN = @DOCBOOK2MAN@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBCMIS_API_VERSION = @LIBCMIS_API_VERSION@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SRCDIR = @SRCDIR@ STRIP = @STRIP@ VERSION = @VERSION@ XML2_CFLAGS = @XML2_CFLAGS@ XML2_LIBS = @XML2_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ # # Note that the test names are important here due to the environment test. # Some tests will need to have a running CMIS server while some others don't. # # In order to allow running the tests that don't need the server during the # packaging process, a simple naming convention wil distinguish between those # two kinds of tests: # # test-nosrv-* is a test that doesn't need a running server, # others will trigger a server start / stop @ENABLE_TESTS_TRUE@@OS_WIN32_FALSE@mockup_tests = \ @ENABLE_TESTS_TRUE@@OS_WIN32_FALSE@ test-nosrv-atom \ @ENABLE_TESTS_TRUE@@OS_WIN32_FALSE@ test-nosrv-gdrive @ENABLE_TESTS_TRUE@test_nosrv_utils_SOURCES = \ @ENABLE_TESTS_TRUE@ test-decoder.cxx \ @ENABLE_TESTS_TRUE@ test-soap.cxx \ @ENABLE_TESTS_TRUE@ test-xmlutils.cxx \ @ENABLE_TESTS_TRUE@ test-helpers.hxx \ @ENABLE_TESTS_TRUE@ test-helpers.cxx \ @ENABLE_TESTS_TRUE@ test-main.cxx @ENABLE_TESTS_TRUE@test_nosrv_utils_CPPFLAGS = \ @ENABLE_TESTS_TRUE@ -I$(top_srcdir)/src/libcmis \ @ENABLE_TESTS_TRUE@ $(XML2_CFLAGS) \ @ENABLE_TESTS_TRUE@ $(CURL_CFLAGS) \ @ENABLE_TESTS_TRUE@ $(BOOST_CPPFLAGS) \ @ENABLE_TESTS_TRUE@ -O0 @ENABLE_TESTS_TRUE@test_nosrv_utils_LDADD = \ @ENABLE_TESTS_TRUE@ $(top_builddir)/src/libcmis/libcmis-@LIBCMIS_API_VERSION@.la \ @ENABLE_TESTS_TRUE@ $(XML2_LIBS) \ @ENABLE_TESTS_TRUE@ $(CURL_LIBS) \ @ENABLE_TESTS_TRUE@ $(CPPUNIT_LIBS) \ @ENABLE_TESTS_TRUE@ $(BOOST_DATE_TIME_LIBS) @ENABLE_TESTS_TRUE@test_nosrv_atom_SOURCES = \ @ENABLE_TESTS_TRUE@ test-atom.cxx \ @ENABLE_TESTS_TRUE@ test-helpers.cxx \ @ENABLE_TESTS_TRUE@ test-main.cxx @ENABLE_TESTS_TRUE@test_nosrv_atom_CPPFLAGS = \ @ENABLE_TESTS_TRUE@ -I$(top_srcdir)/src/libcmis \ @ENABLE_TESTS_TRUE@ -I$(top_srcdir)/qa/mockup \ @ENABLE_TESTS_TRUE@ $(XML2_CFLAGS) \ @ENABLE_TESTS_TRUE@ $(BOOST_CPPFLAGS) \ @ENABLE_TESTS_TRUE@ -O0 \ @ENABLE_TESTS_TRUE@ -DDATA_DIR=\"$(top_srcdir)/qa/libcmis/data\" @ENABLE_TESTS_TRUE@test_nosrv_atom_LDADD = \ @ENABLE_TESTS_TRUE@ $(top_builddir)/qa/mockup/libcmis-mockup.la \ @ENABLE_TESTS_TRUE@ $(XML2_LIBS) \ @ENABLE_TESTS_TRUE@ $(CPPUNIT_LIBS) \ @ENABLE_TESTS_TRUE@ $(BOOST_DATE_TIME_LIBS) @ENABLE_TESTS_TRUE@test_nosrv_gdrive_SOURCES = \ @ENABLE_TESTS_TRUE@ test-helpers.cxx \ @ENABLE_TESTS_TRUE@ test-main.cxx \ @ENABLE_TESTS_TRUE@ test-gdrive.cxx @ENABLE_TESTS_TRUE@test_nosrv_gdrive_CPPFLAGS = \ @ENABLE_TESTS_TRUE@ -I$(top_srcdir)/src/libcmis \ @ENABLE_TESTS_TRUE@ -I$(top_srcdir)/qa/mockup \ @ENABLE_TESTS_TRUE@ $(XML2_CFLAGS) \ @ENABLE_TESTS_TRUE@ $(BOOST_CPPFLAGS) \ @ENABLE_TESTS_TRUE@ -O0 \ @ENABLE_TESTS_TRUE@ -DDATA_DIR=\"$(top_srcdir)/qa/libcmis/data\" @ENABLE_TESTS_TRUE@test_nosrv_gdrive_LDADD = \ @ENABLE_TESTS_TRUE@ $(top_builddir)/qa/mockup/libcmis-mockup.la \ @ENABLE_TESTS_TRUE@ $(XML2_LIBS) \ @ENABLE_TESTS_TRUE@ $(CPPUNIT_LIBS) \ @ENABLE_TESTS_TRUE@ $(BOOST_DATE_TIME_LIBS) @ENABLE_TESTS_TRUE@test_nosrv_json_SOURCES = \ @ENABLE_TESTS_TRUE@ test-helpers.cxx \ @ENABLE_TESTS_TRUE@ test-main.cxx \ @ENABLE_TESTS_TRUE@ test-jsonutils.cxx @ENABLE_TESTS_TRUE@test_nosrv_json_CPPFLAGS = \ @ENABLE_TESTS_TRUE@ -I$(top_srcdir)/src/libcmis \ @ENABLE_TESTS_TRUE@ $(XML2_CFLAGS) \ @ENABLE_TESTS_TRUE@ $(BOOST_CPPFLAGS) \ @ENABLE_TESTS_TRUE@ -O0 \ @ENABLE_TESTS_TRUE@ -DDATA_DIR=\"$(top_srcdir)/qa/libcmis/data\" @ENABLE_TESTS_TRUE@test_nosrv_json_LDADD = \ @ENABLE_TESTS_TRUE@ $(top_builddir)/src/libcmis/libcmis-@LIBCMIS_API_VERSION@.la \ @ENABLE_TESTS_TRUE@ $(XML2_LIBS) \ @ENABLE_TESTS_TRUE@ $(CPPUNIT_LIBS) \ @ENABLE_TESTS_TRUE@ $(BOOST_DATE_TIME_LIBS) @ENABLE_TESTS_TRUE@test_ws_SOURCES = \ @ENABLE_TESTS_TRUE@ test-ws.cxx \ @ENABLE_TESTS_TRUE@ test-helpers.hxx \ @ENABLE_TESTS_TRUE@ test-helpers.cxx \ @ENABLE_TESTS_TRUE@ test-main.cxx @ENABLE_TESTS_TRUE@test_ws_CPPFLAGS = \ @ENABLE_TESTS_TRUE@ -I$(top_srcdir)/src/libcmis \ @ENABLE_TESTS_TRUE@ $(XML2_CFLAGS) \ @ENABLE_TESTS_TRUE@ $(CURL_CFLAGS) \ @ENABLE_TESTS_TRUE@ $(BOOST_CPPFLAGS) \ @ENABLE_TESTS_TRUE@ -O0 @ENABLE_TESTS_TRUE@test_ws_LDADD = \ @ENABLE_TESTS_TRUE@ $(top_builddir)/src/libcmis/libcmis-@LIBCMIS_API_VERSION@.la \ @ENABLE_TESTS_TRUE@ $(XML2_LIBS) \ @ENABLE_TESTS_TRUE@ $(CURL_LIBS) \ @ENABLE_TESTS_TRUE@ $(CPPUNIT_LIBS) \ @ENABLE_TESTS_TRUE@ $(BOOST_DATE_TIME_LIBS) @ENABLE_LONG_TESTS_TRUE@@ENABLE_TESTS_TRUE@long_tests = \ @ENABLE_LONG_TESTS_TRUE@@ENABLE_TESTS_TRUE@ test-ws @ENABLE_TESTS_TRUE@TESTS_ENVIRONMENT = $(SHELL) $(top_builddir)/run-test.sh all: all-am .SUFFIXES: .SUFFIXES: .cxx .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign qa/libcmis/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign qa/libcmis/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-checkPROGRAMS: @list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list test-nosrv-atom$(EXEEXT): $(test_nosrv_atom_OBJECTS) $(test_nosrv_atom_DEPENDENCIES) $(EXTRA_test_nosrv_atom_DEPENDENCIES) @rm -f test-nosrv-atom$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(test_nosrv_atom_OBJECTS) $(test_nosrv_atom_LDADD) $(LIBS) test-nosrv-gdrive$(EXEEXT): $(test_nosrv_gdrive_OBJECTS) $(test_nosrv_gdrive_DEPENDENCIES) $(EXTRA_test_nosrv_gdrive_DEPENDENCIES) @rm -f test-nosrv-gdrive$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(test_nosrv_gdrive_OBJECTS) $(test_nosrv_gdrive_LDADD) $(LIBS) test-nosrv-json$(EXEEXT): $(test_nosrv_json_OBJECTS) $(test_nosrv_json_DEPENDENCIES) $(EXTRA_test_nosrv_json_DEPENDENCIES) @rm -f test-nosrv-json$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(test_nosrv_json_OBJECTS) $(test_nosrv_json_LDADD) $(LIBS) test-nosrv-utils$(EXEEXT): $(test_nosrv_utils_OBJECTS) $(test_nosrv_utils_DEPENDENCIES) $(EXTRA_test_nosrv_utils_DEPENDENCIES) @rm -f test-nosrv-utils$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(test_nosrv_utils_OBJECTS) $(test_nosrv_utils_LDADD) $(LIBS) test-ws$(EXEEXT): $(test_ws_OBJECTS) $(test_ws_DEPENDENCIES) $(EXTRA_test_ws_DEPENDENCIES) @rm -f test-ws$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(test_ws_OBJECTS) $(test_ws_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_nosrv_atom-test-atom.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_nosrv_atom-test-helpers.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_nosrv_atom-test-main.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_nosrv_gdrive-test-gdrive.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_nosrv_gdrive-test-helpers.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_nosrv_gdrive-test-main.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_nosrv_json-test-helpers.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_nosrv_json-test-jsonutils.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_nosrv_json-test-main.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_nosrv_utils-test-decoder.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_nosrv_utils-test-helpers.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_nosrv_utils-test-main.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_nosrv_utils-test-soap.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_nosrv_utils-test-xmlutils.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_ws-test-helpers.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_ws-test-main.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_ws-test-ws.Po@am__quote@ .cxx.o: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< .cxx.obj: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cxx.lo: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $< test_nosrv_atom-test-atom.o: test-atom.cxx @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_nosrv_atom_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_nosrv_atom-test-atom.o -MD -MP -MF $(DEPDIR)/test_nosrv_atom-test-atom.Tpo -c -o test_nosrv_atom-test-atom.o `test -f 'test-atom.cxx' || echo '$(srcdir)/'`test-atom.cxx @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_nosrv_atom-test-atom.Tpo $(DEPDIR)/test_nosrv_atom-test-atom.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test-atom.cxx' object='test_nosrv_atom-test-atom.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_nosrv_atom_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_nosrv_atom-test-atom.o `test -f 'test-atom.cxx' || echo '$(srcdir)/'`test-atom.cxx test_nosrv_atom-test-atom.obj: test-atom.cxx @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_nosrv_atom_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_nosrv_atom-test-atom.obj -MD -MP -MF $(DEPDIR)/test_nosrv_atom-test-atom.Tpo -c -o test_nosrv_atom-test-atom.obj `if test -f 'test-atom.cxx'; then $(CYGPATH_W) 'test-atom.cxx'; else $(CYGPATH_W) '$(srcdir)/test-atom.cxx'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_nosrv_atom-test-atom.Tpo $(DEPDIR)/test_nosrv_atom-test-atom.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test-atom.cxx' object='test_nosrv_atom-test-atom.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_nosrv_atom_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_nosrv_atom-test-atom.obj `if test -f 'test-atom.cxx'; then $(CYGPATH_W) 'test-atom.cxx'; else $(CYGPATH_W) '$(srcdir)/test-atom.cxx'; fi` test_nosrv_atom-test-helpers.o: test-helpers.cxx @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_nosrv_atom_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_nosrv_atom-test-helpers.o -MD -MP -MF $(DEPDIR)/test_nosrv_atom-test-helpers.Tpo -c -o test_nosrv_atom-test-helpers.o `test -f 'test-helpers.cxx' || echo '$(srcdir)/'`test-helpers.cxx @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_nosrv_atom-test-helpers.Tpo $(DEPDIR)/test_nosrv_atom-test-helpers.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test-helpers.cxx' object='test_nosrv_atom-test-helpers.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_nosrv_atom_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_nosrv_atom-test-helpers.o `test -f 'test-helpers.cxx' || echo '$(srcdir)/'`test-helpers.cxx test_nosrv_atom-test-helpers.obj: test-helpers.cxx @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_nosrv_atom_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_nosrv_atom-test-helpers.obj -MD -MP -MF $(DEPDIR)/test_nosrv_atom-test-helpers.Tpo -c -o test_nosrv_atom-test-helpers.obj `if test -f 'test-helpers.cxx'; then $(CYGPATH_W) 'test-helpers.cxx'; else $(CYGPATH_W) '$(srcdir)/test-helpers.cxx'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_nosrv_atom-test-helpers.Tpo $(DEPDIR)/test_nosrv_atom-test-helpers.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test-helpers.cxx' object='test_nosrv_atom-test-helpers.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_nosrv_atom_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_nosrv_atom-test-helpers.obj `if test -f 'test-helpers.cxx'; then $(CYGPATH_W) 'test-helpers.cxx'; else $(CYGPATH_W) '$(srcdir)/test-helpers.cxx'; fi` test_nosrv_atom-test-main.o: test-main.cxx @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_nosrv_atom_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_nosrv_atom-test-main.o -MD -MP -MF $(DEPDIR)/test_nosrv_atom-test-main.Tpo -c -o test_nosrv_atom-test-main.o `test -f 'test-main.cxx' || echo '$(srcdir)/'`test-main.cxx @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_nosrv_atom-test-main.Tpo $(DEPDIR)/test_nosrv_atom-test-main.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test-main.cxx' object='test_nosrv_atom-test-main.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_nosrv_atom_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_nosrv_atom-test-main.o `test -f 'test-main.cxx' || echo '$(srcdir)/'`test-main.cxx test_nosrv_atom-test-main.obj: test-main.cxx @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_nosrv_atom_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_nosrv_atom-test-main.obj -MD -MP -MF $(DEPDIR)/test_nosrv_atom-test-main.Tpo -c -o test_nosrv_atom-test-main.obj `if test -f 'test-main.cxx'; then $(CYGPATH_W) 'test-main.cxx'; else $(CYGPATH_W) '$(srcdir)/test-main.cxx'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_nosrv_atom-test-main.Tpo $(DEPDIR)/test_nosrv_atom-test-main.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test-main.cxx' object='test_nosrv_atom-test-main.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_nosrv_atom_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_nosrv_atom-test-main.obj `if test -f 'test-main.cxx'; then $(CYGPATH_W) 'test-main.cxx'; else $(CYGPATH_W) '$(srcdir)/test-main.cxx'; fi` test_nosrv_gdrive-test-helpers.o: test-helpers.cxx @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_nosrv_gdrive_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_nosrv_gdrive-test-helpers.o -MD -MP -MF $(DEPDIR)/test_nosrv_gdrive-test-helpers.Tpo -c -o test_nosrv_gdrive-test-helpers.o `test -f 'test-helpers.cxx' || echo '$(srcdir)/'`test-helpers.cxx @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_nosrv_gdrive-test-helpers.Tpo $(DEPDIR)/test_nosrv_gdrive-test-helpers.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test-helpers.cxx' object='test_nosrv_gdrive-test-helpers.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_nosrv_gdrive_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_nosrv_gdrive-test-helpers.o `test -f 'test-helpers.cxx' || echo '$(srcdir)/'`test-helpers.cxx test_nosrv_gdrive-test-helpers.obj: test-helpers.cxx @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_nosrv_gdrive_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_nosrv_gdrive-test-helpers.obj -MD -MP -MF $(DEPDIR)/test_nosrv_gdrive-test-helpers.Tpo -c -o test_nosrv_gdrive-test-helpers.obj `if test -f 'test-helpers.cxx'; then $(CYGPATH_W) 'test-helpers.cxx'; else $(CYGPATH_W) '$(srcdir)/test-helpers.cxx'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_nosrv_gdrive-test-helpers.Tpo $(DEPDIR)/test_nosrv_gdrive-test-helpers.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test-helpers.cxx' object='test_nosrv_gdrive-test-helpers.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_nosrv_gdrive_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_nosrv_gdrive-test-helpers.obj `if test -f 'test-helpers.cxx'; then $(CYGPATH_W) 'test-helpers.cxx'; else $(CYGPATH_W) '$(srcdir)/test-helpers.cxx'; fi` test_nosrv_gdrive-test-main.o: test-main.cxx @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_nosrv_gdrive_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_nosrv_gdrive-test-main.o -MD -MP -MF $(DEPDIR)/test_nosrv_gdrive-test-main.Tpo -c -o test_nosrv_gdrive-test-main.o `test -f 'test-main.cxx' || echo '$(srcdir)/'`test-main.cxx @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_nosrv_gdrive-test-main.Tpo $(DEPDIR)/test_nosrv_gdrive-test-main.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test-main.cxx' object='test_nosrv_gdrive-test-main.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_nosrv_gdrive_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_nosrv_gdrive-test-main.o `test -f 'test-main.cxx' || echo '$(srcdir)/'`test-main.cxx test_nosrv_gdrive-test-main.obj: test-main.cxx @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_nosrv_gdrive_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_nosrv_gdrive-test-main.obj -MD -MP -MF $(DEPDIR)/test_nosrv_gdrive-test-main.Tpo -c -o test_nosrv_gdrive-test-main.obj `if test -f 'test-main.cxx'; then $(CYGPATH_W) 'test-main.cxx'; else $(CYGPATH_W) '$(srcdir)/test-main.cxx'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_nosrv_gdrive-test-main.Tpo $(DEPDIR)/test_nosrv_gdrive-test-main.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test-main.cxx' object='test_nosrv_gdrive-test-main.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_nosrv_gdrive_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_nosrv_gdrive-test-main.obj `if test -f 'test-main.cxx'; then $(CYGPATH_W) 'test-main.cxx'; else $(CYGPATH_W) '$(srcdir)/test-main.cxx'; fi` test_nosrv_gdrive-test-gdrive.o: test-gdrive.cxx @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_nosrv_gdrive_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_nosrv_gdrive-test-gdrive.o -MD -MP -MF $(DEPDIR)/test_nosrv_gdrive-test-gdrive.Tpo -c -o test_nosrv_gdrive-test-gdrive.o `test -f 'test-gdrive.cxx' || echo '$(srcdir)/'`test-gdrive.cxx @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_nosrv_gdrive-test-gdrive.Tpo $(DEPDIR)/test_nosrv_gdrive-test-gdrive.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test-gdrive.cxx' object='test_nosrv_gdrive-test-gdrive.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_nosrv_gdrive_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_nosrv_gdrive-test-gdrive.o `test -f 'test-gdrive.cxx' || echo '$(srcdir)/'`test-gdrive.cxx test_nosrv_gdrive-test-gdrive.obj: test-gdrive.cxx @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_nosrv_gdrive_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_nosrv_gdrive-test-gdrive.obj -MD -MP -MF $(DEPDIR)/test_nosrv_gdrive-test-gdrive.Tpo -c -o test_nosrv_gdrive-test-gdrive.obj `if test -f 'test-gdrive.cxx'; then $(CYGPATH_W) 'test-gdrive.cxx'; else $(CYGPATH_W) '$(srcdir)/test-gdrive.cxx'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_nosrv_gdrive-test-gdrive.Tpo $(DEPDIR)/test_nosrv_gdrive-test-gdrive.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test-gdrive.cxx' object='test_nosrv_gdrive-test-gdrive.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_nosrv_gdrive_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_nosrv_gdrive-test-gdrive.obj `if test -f 'test-gdrive.cxx'; then $(CYGPATH_W) 'test-gdrive.cxx'; else $(CYGPATH_W) '$(srcdir)/test-gdrive.cxx'; fi` test_nosrv_json-test-helpers.o: test-helpers.cxx @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_nosrv_json_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_nosrv_json-test-helpers.o -MD -MP -MF $(DEPDIR)/test_nosrv_json-test-helpers.Tpo -c -o test_nosrv_json-test-helpers.o `test -f 'test-helpers.cxx' || echo '$(srcdir)/'`test-helpers.cxx @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_nosrv_json-test-helpers.Tpo $(DEPDIR)/test_nosrv_json-test-helpers.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test-helpers.cxx' object='test_nosrv_json-test-helpers.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_nosrv_json_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_nosrv_json-test-helpers.o `test -f 'test-helpers.cxx' || echo '$(srcdir)/'`test-helpers.cxx test_nosrv_json-test-helpers.obj: test-helpers.cxx @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_nosrv_json_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_nosrv_json-test-helpers.obj -MD -MP -MF $(DEPDIR)/test_nosrv_json-test-helpers.Tpo -c -o test_nosrv_json-test-helpers.obj `if test -f 'test-helpers.cxx'; then $(CYGPATH_W) 'test-helpers.cxx'; else $(CYGPATH_W) '$(srcdir)/test-helpers.cxx'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_nosrv_json-test-helpers.Tpo $(DEPDIR)/test_nosrv_json-test-helpers.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test-helpers.cxx' object='test_nosrv_json-test-helpers.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_nosrv_json_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_nosrv_json-test-helpers.obj `if test -f 'test-helpers.cxx'; then $(CYGPATH_W) 'test-helpers.cxx'; else $(CYGPATH_W) '$(srcdir)/test-helpers.cxx'; fi` test_nosrv_json-test-main.o: test-main.cxx @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_nosrv_json_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_nosrv_json-test-main.o -MD -MP -MF $(DEPDIR)/test_nosrv_json-test-main.Tpo -c -o test_nosrv_json-test-main.o `test -f 'test-main.cxx' || echo '$(srcdir)/'`test-main.cxx @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_nosrv_json-test-main.Tpo $(DEPDIR)/test_nosrv_json-test-main.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test-main.cxx' object='test_nosrv_json-test-main.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_nosrv_json_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_nosrv_json-test-main.o `test -f 'test-main.cxx' || echo '$(srcdir)/'`test-main.cxx test_nosrv_json-test-main.obj: test-main.cxx @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_nosrv_json_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_nosrv_json-test-main.obj -MD -MP -MF $(DEPDIR)/test_nosrv_json-test-main.Tpo -c -o test_nosrv_json-test-main.obj `if test -f 'test-main.cxx'; then $(CYGPATH_W) 'test-main.cxx'; else $(CYGPATH_W) '$(srcdir)/test-main.cxx'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_nosrv_json-test-main.Tpo $(DEPDIR)/test_nosrv_json-test-main.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test-main.cxx' object='test_nosrv_json-test-main.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_nosrv_json_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_nosrv_json-test-main.obj `if test -f 'test-main.cxx'; then $(CYGPATH_W) 'test-main.cxx'; else $(CYGPATH_W) '$(srcdir)/test-main.cxx'; fi` test_nosrv_json-test-jsonutils.o: test-jsonutils.cxx @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_nosrv_json_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_nosrv_json-test-jsonutils.o -MD -MP -MF $(DEPDIR)/test_nosrv_json-test-jsonutils.Tpo -c -o test_nosrv_json-test-jsonutils.o `test -f 'test-jsonutils.cxx' || echo '$(srcdir)/'`test-jsonutils.cxx @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_nosrv_json-test-jsonutils.Tpo $(DEPDIR)/test_nosrv_json-test-jsonutils.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test-jsonutils.cxx' object='test_nosrv_json-test-jsonutils.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_nosrv_json_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_nosrv_json-test-jsonutils.o `test -f 'test-jsonutils.cxx' || echo '$(srcdir)/'`test-jsonutils.cxx test_nosrv_json-test-jsonutils.obj: test-jsonutils.cxx @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_nosrv_json_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_nosrv_json-test-jsonutils.obj -MD -MP -MF $(DEPDIR)/test_nosrv_json-test-jsonutils.Tpo -c -o test_nosrv_json-test-jsonutils.obj `if test -f 'test-jsonutils.cxx'; then $(CYGPATH_W) 'test-jsonutils.cxx'; else $(CYGPATH_W) '$(srcdir)/test-jsonutils.cxx'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_nosrv_json-test-jsonutils.Tpo $(DEPDIR)/test_nosrv_json-test-jsonutils.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test-jsonutils.cxx' object='test_nosrv_json-test-jsonutils.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_nosrv_json_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_nosrv_json-test-jsonutils.obj `if test -f 'test-jsonutils.cxx'; then $(CYGPATH_W) 'test-jsonutils.cxx'; else $(CYGPATH_W) '$(srcdir)/test-jsonutils.cxx'; fi` test_nosrv_utils-test-decoder.o: test-decoder.cxx @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_nosrv_utils_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_nosrv_utils-test-decoder.o -MD -MP -MF $(DEPDIR)/test_nosrv_utils-test-decoder.Tpo -c -o test_nosrv_utils-test-decoder.o `test -f 'test-decoder.cxx' || echo '$(srcdir)/'`test-decoder.cxx @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_nosrv_utils-test-decoder.Tpo $(DEPDIR)/test_nosrv_utils-test-decoder.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test-decoder.cxx' object='test_nosrv_utils-test-decoder.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_nosrv_utils_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_nosrv_utils-test-decoder.o `test -f 'test-decoder.cxx' || echo '$(srcdir)/'`test-decoder.cxx test_nosrv_utils-test-decoder.obj: test-decoder.cxx @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_nosrv_utils_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_nosrv_utils-test-decoder.obj -MD -MP -MF $(DEPDIR)/test_nosrv_utils-test-decoder.Tpo -c -o test_nosrv_utils-test-decoder.obj `if test -f 'test-decoder.cxx'; then $(CYGPATH_W) 'test-decoder.cxx'; else $(CYGPATH_W) '$(srcdir)/test-decoder.cxx'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_nosrv_utils-test-decoder.Tpo $(DEPDIR)/test_nosrv_utils-test-decoder.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test-decoder.cxx' object='test_nosrv_utils-test-decoder.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_nosrv_utils_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_nosrv_utils-test-decoder.obj `if test -f 'test-decoder.cxx'; then $(CYGPATH_W) 'test-decoder.cxx'; else $(CYGPATH_W) '$(srcdir)/test-decoder.cxx'; fi` test_nosrv_utils-test-soap.o: test-soap.cxx @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_nosrv_utils_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_nosrv_utils-test-soap.o -MD -MP -MF $(DEPDIR)/test_nosrv_utils-test-soap.Tpo -c -o test_nosrv_utils-test-soap.o `test -f 'test-soap.cxx' || echo '$(srcdir)/'`test-soap.cxx @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_nosrv_utils-test-soap.Tpo $(DEPDIR)/test_nosrv_utils-test-soap.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test-soap.cxx' object='test_nosrv_utils-test-soap.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_nosrv_utils_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_nosrv_utils-test-soap.o `test -f 'test-soap.cxx' || echo '$(srcdir)/'`test-soap.cxx test_nosrv_utils-test-soap.obj: test-soap.cxx @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_nosrv_utils_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_nosrv_utils-test-soap.obj -MD -MP -MF $(DEPDIR)/test_nosrv_utils-test-soap.Tpo -c -o test_nosrv_utils-test-soap.obj `if test -f 'test-soap.cxx'; then $(CYGPATH_W) 'test-soap.cxx'; else $(CYGPATH_W) '$(srcdir)/test-soap.cxx'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_nosrv_utils-test-soap.Tpo $(DEPDIR)/test_nosrv_utils-test-soap.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test-soap.cxx' object='test_nosrv_utils-test-soap.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_nosrv_utils_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_nosrv_utils-test-soap.obj `if test -f 'test-soap.cxx'; then $(CYGPATH_W) 'test-soap.cxx'; else $(CYGPATH_W) '$(srcdir)/test-soap.cxx'; fi` test_nosrv_utils-test-xmlutils.o: test-xmlutils.cxx @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_nosrv_utils_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_nosrv_utils-test-xmlutils.o -MD -MP -MF $(DEPDIR)/test_nosrv_utils-test-xmlutils.Tpo -c -o test_nosrv_utils-test-xmlutils.o `test -f 'test-xmlutils.cxx' || echo '$(srcdir)/'`test-xmlutils.cxx @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_nosrv_utils-test-xmlutils.Tpo $(DEPDIR)/test_nosrv_utils-test-xmlutils.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test-xmlutils.cxx' object='test_nosrv_utils-test-xmlutils.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_nosrv_utils_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_nosrv_utils-test-xmlutils.o `test -f 'test-xmlutils.cxx' || echo '$(srcdir)/'`test-xmlutils.cxx test_nosrv_utils-test-xmlutils.obj: test-xmlutils.cxx @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_nosrv_utils_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_nosrv_utils-test-xmlutils.obj -MD -MP -MF $(DEPDIR)/test_nosrv_utils-test-xmlutils.Tpo -c -o test_nosrv_utils-test-xmlutils.obj `if test -f 'test-xmlutils.cxx'; then $(CYGPATH_W) 'test-xmlutils.cxx'; else $(CYGPATH_W) '$(srcdir)/test-xmlutils.cxx'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_nosrv_utils-test-xmlutils.Tpo $(DEPDIR)/test_nosrv_utils-test-xmlutils.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test-xmlutils.cxx' object='test_nosrv_utils-test-xmlutils.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_nosrv_utils_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_nosrv_utils-test-xmlutils.obj `if test -f 'test-xmlutils.cxx'; then $(CYGPATH_W) 'test-xmlutils.cxx'; else $(CYGPATH_W) '$(srcdir)/test-xmlutils.cxx'; fi` test_nosrv_utils-test-helpers.o: test-helpers.cxx @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_nosrv_utils_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_nosrv_utils-test-helpers.o -MD -MP -MF $(DEPDIR)/test_nosrv_utils-test-helpers.Tpo -c -o test_nosrv_utils-test-helpers.o `test -f 'test-helpers.cxx' || echo '$(srcdir)/'`test-helpers.cxx @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_nosrv_utils-test-helpers.Tpo $(DEPDIR)/test_nosrv_utils-test-helpers.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test-helpers.cxx' object='test_nosrv_utils-test-helpers.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_nosrv_utils_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_nosrv_utils-test-helpers.o `test -f 'test-helpers.cxx' || echo '$(srcdir)/'`test-helpers.cxx test_nosrv_utils-test-helpers.obj: test-helpers.cxx @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_nosrv_utils_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_nosrv_utils-test-helpers.obj -MD -MP -MF $(DEPDIR)/test_nosrv_utils-test-helpers.Tpo -c -o test_nosrv_utils-test-helpers.obj `if test -f 'test-helpers.cxx'; then $(CYGPATH_W) 'test-helpers.cxx'; else $(CYGPATH_W) '$(srcdir)/test-helpers.cxx'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_nosrv_utils-test-helpers.Tpo $(DEPDIR)/test_nosrv_utils-test-helpers.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test-helpers.cxx' object='test_nosrv_utils-test-helpers.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_nosrv_utils_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_nosrv_utils-test-helpers.obj `if test -f 'test-helpers.cxx'; then $(CYGPATH_W) 'test-helpers.cxx'; else $(CYGPATH_W) '$(srcdir)/test-helpers.cxx'; fi` test_nosrv_utils-test-main.o: test-main.cxx @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_nosrv_utils_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_nosrv_utils-test-main.o -MD -MP -MF $(DEPDIR)/test_nosrv_utils-test-main.Tpo -c -o test_nosrv_utils-test-main.o `test -f 'test-main.cxx' || echo '$(srcdir)/'`test-main.cxx @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_nosrv_utils-test-main.Tpo $(DEPDIR)/test_nosrv_utils-test-main.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test-main.cxx' object='test_nosrv_utils-test-main.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_nosrv_utils_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_nosrv_utils-test-main.o `test -f 'test-main.cxx' || echo '$(srcdir)/'`test-main.cxx test_nosrv_utils-test-main.obj: test-main.cxx @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_nosrv_utils_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_nosrv_utils-test-main.obj -MD -MP -MF $(DEPDIR)/test_nosrv_utils-test-main.Tpo -c -o test_nosrv_utils-test-main.obj `if test -f 'test-main.cxx'; then $(CYGPATH_W) 'test-main.cxx'; else $(CYGPATH_W) '$(srcdir)/test-main.cxx'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_nosrv_utils-test-main.Tpo $(DEPDIR)/test_nosrv_utils-test-main.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test-main.cxx' object='test_nosrv_utils-test-main.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_nosrv_utils_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_nosrv_utils-test-main.obj `if test -f 'test-main.cxx'; then $(CYGPATH_W) 'test-main.cxx'; else $(CYGPATH_W) '$(srcdir)/test-main.cxx'; fi` test_ws-test-ws.o: test-ws.cxx @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_ws_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_ws-test-ws.o -MD -MP -MF $(DEPDIR)/test_ws-test-ws.Tpo -c -o test_ws-test-ws.o `test -f 'test-ws.cxx' || echo '$(srcdir)/'`test-ws.cxx @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_ws-test-ws.Tpo $(DEPDIR)/test_ws-test-ws.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test-ws.cxx' object='test_ws-test-ws.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_ws_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_ws-test-ws.o `test -f 'test-ws.cxx' || echo '$(srcdir)/'`test-ws.cxx test_ws-test-ws.obj: test-ws.cxx @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_ws_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_ws-test-ws.obj -MD -MP -MF $(DEPDIR)/test_ws-test-ws.Tpo -c -o test_ws-test-ws.obj `if test -f 'test-ws.cxx'; then $(CYGPATH_W) 'test-ws.cxx'; else $(CYGPATH_W) '$(srcdir)/test-ws.cxx'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_ws-test-ws.Tpo $(DEPDIR)/test_ws-test-ws.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test-ws.cxx' object='test_ws-test-ws.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_ws_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_ws-test-ws.obj `if test -f 'test-ws.cxx'; then $(CYGPATH_W) 'test-ws.cxx'; else $(CYGPATH_W) '$(srcdir)/test-ws.cxx'; fi` test_ws-test-helpers.o: test-helpers.cxx @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_ws_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_ws-test-helpers.o -MD -MP -MF $(DEPDIR)/test_ws-test-helpers.Tpo -c -o test_ws-test-helpers.o `test -f 'test-helpers.cxx' || echo '$(srcdir)/'`test-helpers.cxx @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_ws-test-helpers.Tpo $(DEPDIR)/test_ws-test-helpers.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test-helpers.cxx' object='test_ws-test-helpers.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_ws_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_ws-test-helpers.o `test -f 'test-helpers.cxx' || echo '$(srcdir)/'`test-helpers.cxx test_ws-test-helpers.obj: test-helpers.cxx @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_ws_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_ws-test-helpers.obj -MD -MP -MF $(DEPDIR)/test_ws-test-helpers.Tpo -c -o test_ws-test-helpers.obj `if test -f 'test-helpers.cxx'; then $(CYGPATH_W) 'test-helpers.cxx'; else $(CYGPATH_W) '$(srcdir)/test-helpers.cxx'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_ws-test-helpers.Tpo $(DEPDIR)/test_ws-test-helpers.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test-helpers.cxx' object='test_ws-test-helpers.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_ws_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_ws-test-helpers.obj `if test -f 'test-helpers.cxx'; then $(CYGPATH_W) 'test-helpers.cxx'; else $(CYGPATH_W) '$(srcdir)/test-helpers.cxx'; fi` test_ws-test-main.o: test-main.cxx @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_ws_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_ws-test-main.o -MD -MP -MF $(DEPDIR)/test_ws-test-main.Tpo -c -o test_ws-test-main.o `test -f 'test-main.cxx' || echo '$(srcdir)/'`test-main.cxx @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_ws-test-main.Tpo $(DEPDIR)/test_ws-test-main.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test-main.cxx' object='test_ws-test-main.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_ws_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_ws-test-main.o `test -f 'test-main.cxx' || echo '$(srcdir)/'`test-main.cxx test_ws-test-main.obj: test-main.cxx @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_ws_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_ws-test-main.obj -MD -MP -MF $(DEPDIR)/test_ws-test-main.Tpo -c -o test_ws-test-main.obj `if test -f 'test-main.cxx'; then $(CYGPATH_W) 'test-main.cxx'; else $(CYGPATH_W) '$(srcdir)/test-main.cxx'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_ws-test-main.Tpo $(DEPDIR)/test_ws-test-main.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test-main.cxx' object='test_ws-test-main.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_ws_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_ws-test-main.obj `if test -f 'test-main.cxx'; then $(CYGPATH_W) 'test-main.cxx'; else $(CYGPATH_W) '$(srcdir)/test-main.cxx'; fi` mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags check-TESTS: $(TESTS) @failed=0; all=0; xfail=0; xpass=0; skip=0; \ srcdir=$(srcdir); export srcdir; \ list=' $(TESTS) '; \ $(am__tty_colors); \ if test -n "$$list"; then \ for tst in $$list; do \ if test -f ./$$tst; then dir=./; \ elif test -f $$tst; then dir=; \ else dir="$(srcdir)/"; fi; \ if $(TESTS_ENVIRONMENT) $${dir}$$tst $(AM_TESTS_FD_REDIRECT); then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$tst[\ \ ]*) \ xpass=`expr $$xpass + 1`; \ failed=`expr $$failed + 1`; \ col=$$red; res=XPASS; \ ;; \ *) \ col=$$grn; res=PASS; \ ;; \ esac; \ elif test $$? -ne 77; then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$tst[\ \ ]*) \ xfail=`expr $$xfail + 1`; \ col=$$lgn; res=XFAIL; \ ;; \ *) \ failed=`expr $$failed + 1`; \ col=$$red; res=FAIL; \ ;; \ esac; \ else \ skip=`expr $$skip + 1`; \ col=$$blu; res=SKIP; \ fi; \ echo "$${col}$$res$${std}: $$tst"; \ done; \ if test "$$all" -eq 1; then \ tests="test"; \ All=""; \ else \ tests="tests"; \ All="All "; \ fi; \ if test "$$failed" -eq 0; then \ if test "$$xfail" -eq 0; then \ banner="$$All$$all $$tests passed"; \ else \ if test "$$xfail" -eq 1; then failures=failure; else failures=failures; fi; \ banner="$$All$$all $$tests behaved as expected ($$xfail expected $$failures)"; \ fi; \ else \ if test "$$xpass" -eq 0; then \ banner="$$failed of $$all $$tests failed"; \ else \ if test "$$xpass" -eq 1; then passes=pass; else passes=passes; fi; \ banner="$$failed of $$all $$tests did not behave as expected ($$xpass unexpected $$passes)"; \ fi; \ fi; \ dashes="$$banner"; \ skipped=""; \ if test "$$skip" -ne 0; then \ if test "$$skip" -eq 1; then \ skipped="($$skip test was not run)"; \ else \ skipped="($$skip tests were not run)"; \ fi; \ test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \ dashes="$$skipped"; \ fi; \ report=""; \ if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \ report="Please report to $(PACKAGE_BUGREPORT)"; \ test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \ dashes="$$report"; \ fi; \ dashes=`echo "$$dashes" | sed s/./=/g`; \ if test "$$failed" -eq 0; then \ col="$$grn"; \ else \ col="$$red"; \ fi; \ echo "$${col}$$dashes$${std}"; \ echo "$${col}$$banner$${std}"; \ test -z "$$skipped" || echo "$${col}$$skipped$${std}"; \ test -z "$$report" || echo "$${col}$$report$${std}"; \ echo "$${col}$$dashes$${std}"; \ test "$$failed" -eq 0; \ else :; fi distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-checkPROGRAMS clean-generic clean-libtool \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: check-am install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-TESTS check-am clean \ clean-checkPROGRAMS clean-generic clean-libtool cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: libcmis-0.4.1/qa/libcmis/test-main.cxx0000644000175000001440000000264012156277657014547 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2011 SUSE * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #include #include int main( int, char** ) { CppUnit::TextUi::TestRunner runner; CppUnit::TestFactoryRegistry ®istry = CppUnit::TestFactoryRegistry::getRegistry(); runner.addTest( registry.makeTest() ); bool wasSuccess = runner.run( "", false ); return !wasSuccess; } libcmis-0.4.1/qa/libcmis/Makefile.am0000644000175000001440000000536212173212453014140 00000000000000if ENABLE_TESTS # # Note that the test names are important here due to the environment test. # Some tests will need to have a running CMIS server while some others don't. # # In order to allow running the tests that don't need the server during the # packaging process, a simple naming convention wil distinguish between those # two kinds of tests: # # test-nosrv-* is a test that doesn't need a running server, # others will trigger a server start / stop if !OS_WIN32 mockup_tests = \ test-nosrv-atom \ test-nosrv-gdrive endif check_PROGRAMS = \ test-nosrv-utils \ test-nosrv-json \ test-ws \ ${mockup_tests} test_nosrv_utils_SOURCES = \ test-decoder.cxx \ test-soap.cxx \ test-xmlutils.cxx \ test-helpers.hxx \ test-helpers.cxx \ test-main.cxx test_nosrv_utils_CPPFLAGS = \ -I$(top_srcdir)/src/libcmis \ $(XML2_CFLAGS) \ $(CURL_CFLAGS) \ $(BOOST_CPPFLAGS) \ -O0 test_nosrv_utils_LDADD = \ $(top_builddir)/src/libcmis/libcmis-@LIBCMIS_API_VERSION@.la \ $(XML2_LIBS) \ $(CURL_LIBS) \ $(CPPUNIT_LIBS) \ $(BOOST_DATE_TIME_LIBS) test_nosrv_atom_SOURCES = \ test-atom.cxx \ test-helpers.cxx \ test-main.cxx test_nosrv_atom_CPPFLAGS = \ -I$(top_srcdir)/src/libcmis \ -I$(top_srcdir)/qa/mockup \ $(XML2_CFLAGS) \ $(BOOST_CPPFLAGS) \ -O0 \ -DDATA_DIR=\"$(top_srcdir)/qa/libcmis/data\" test_nosrv_atom_LDADD = \ $(top_builddir)/qa/mockup/libcmis-mockup.la \ $(XML2_LIBS) \ $(CPPUNIT_LIBS) \ $(BOOST_DATE_TIME_LIBS) test_nosrv_gdrive_SOURCES = \ test-helpers.cxx \ test-main.cxx \ test-gdrive.cxx test_nosrv_gdrive_CPPFLAGS = \ -I$(top_srcdir)/src/libcmis \ -I$(top_srcdir)/qa/mockup \ $(XML2_CFLAGS) \ $(BOOST_CPPFLAGS) \ -O0 \ -DDATA_DIR=\"$(top_srcdir)/qa/libcmis/data\" test_nosrv_gdrive_LDADD = \ $(top_builddir)/qa/mockup/libcmis-mockup.la \ $(XML2_LIBS) \ $(CPPUNIT_LIBS) \ $(BOOST_DATE_TIME_LIBS) test_nosrv_json_SOURCES = \ test-helpers.cxx \ test-main.cxx \ test-jsonutils.cxx test_nosrv_json_CPPFLAGS = \ -I$(top_srcdir)/src/libcmis \ $(XML2_CFLAGS) \ $(BOOST_CPPFLAGS) \ -O0 \ -DDATA_DIR=\"$(top_srcdir)/qa/libcmis/data\" test_nosrv_json_LDADD = \ $(top_builddir)/src/libcmis/libcmis-@LIBCMIS_API_VERSION@.la \ $(XML2_LIBS) \ $(CPPUNIT_LIBS) \ $(BOOST_DATE_TIME_LIBS) test_ws_SOURCES = \ test-ws.cxx \ test-helpers.hxx \ test-helpers.cxx \ test-main.cxx test_ws_CPPFLAGS = \ -I$(top_srcdir)/src/libcmis \ $(XML2_CFLAGS) \ $(CURL_CFLAGS) \ $(BOOST_CPPFLAGS) \ -O0 test_ws_LDADD = \ $(top_builddir)/src/libcmis/libcmis-@LIBCMIS_API_VERSION@.la \ $(XML2_LIBS) \ $(CURL_LIBS) \ $(CPPUNIT_LIBS) \ $(BOOST_DATE_TIME_LIBS) if ENABLE_LONG_TESTS long_tests = \ test-ws endif TESTS_ENVIRONMENT = $(SHELL) $(top_builddir)/run-test.sh TESTS = test-nosrv-utils test-nosrv-json ${mockup_tests} ${long_tests} endif libcmis-0.4.1/qa/libcmis/data/0000755000175000001440000000000012156277657013111 500000000000000libcmis-0.4.1/qa/libcmis/data/gdrive/0000755000175000001440000000000012173212453014347 500000000000000libcmis-0.4.1/qa/libcmis/data/gdrive/document2.json0000644000175000001440000000244512173212453017067 00000000000000{ "kind": "drive#file", "id": "aFileId", "etag": "\"an example tag\"", "selfLink": "fileSelfLink", "title": "GDrive File", "mimeType": "application/vnd.google-apps.form", "labels": { "starred": false, "hidden": false, "trashed": false, "restricted": false, "viewed": true }, "createdDate": "2010-04-28T14:53:23.141Z", "modifiedDate": "2010-09-30T21:01:37.504Z", "lastViewedByMeDate": "2013-02-26T15:40:30.404Z", "fileSize": "123", "downloadUrl": "https://download/url", "parents": [ { "kind": "drive#parentReference", "id": "aFolderId", "selfLink": "parentSelfLink", "parentLink": "parentLink", "isRoot": true }, { "kind": "drive#parentReference", "id": "anotherFolderId", "selfLink": "parentSelfLink", "parentLink": "parentLink", "isRoot": true } ], "userPermission": { "kind": "drive#permission", "id": "me", "role": "owner", "type": "user" }, "quotaBytesUsed": "0", "ownerNames": [ "Owner Real Name" ], "owners": [ { "kind": "drive#user", "displayName": "Mock file owner", "isAuthenticatedUser": true } ], "lastModifyingUserName": "Mock user", "lastModifyingUser": { "kind": "drive#user", "displayName": "User name", "isAuthenticatedUser": false }, "editable": true, "writersCanShare": true, "shared": true } libcmis-0.4.1/qa/libcmis/data/gdrive/approve.html0000644000175000001440000000043412156277657016654 00000000000000
libcmis-0.4.1/qa/libcmis/data/gdrive/gdoc-file.json0000644000175000001440000000244012173212453017013 00000000000000{ "kind": "drive#file", "id": "aFileId", "etag": "\"an example tag\"", "selfLink": "fileSelfLink", "title": "a file title", "mimeType": "application/vnd.google-apps.form", "labels": { "starred": false, "hidden": false, "trashed": false, "restricted": false, "viewed": true }, "createdDate": "2010-04-28T14:53:23.141Z", "modifiedDate": "2010-09-30T21:01:37.504Z", "lastViewedByMeDate": "2013-02-26T15:40:30.404Z", "parents": [ { "kind": "drive#parentReference", "id": "parentId", "selfLink": "parentSelfLink", "parentLink": "parentLink", "isRoot": true } ], "exportLinks": { "application/pdf": "pdflink", "application/x-vnd.oasis.opendocument.spreadsheet": "opendocumentlinks", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": "xlslink" }, "userPermission": { "kind": "drive#permission", "id": "me", "role": "owner", "type": "user" }, "quotaBytesUsed": "0", "ownerNames": [ "Owner Real Name" ], "owners": [ { "kind": "drive#user", "displayName": "Mock file owner", "isAuthenticatedUser": true } ], "lastModifyingUserName": "Mock user", "lastModifyingUser": { "kind": "drive#user", "displayName": "User name", "isAuthenticatedUser": false }, "editable": true, "writersCanShare": true, "shared": true } libcmis-0.4.1/qa/libcmis/data/gdrive/folder_children.json0000644000175000001440000000064712173212453020314 00000000000000{ "kind": "drive#childrenList", "etag": "A children etag", "selfLink": "SelfLink", "items": [ { "kind": "drive#childrenReference", "id": "aChildFolder", "mimeType": "application/vnd.google-apps.folder", "selfLink": "aSelfLink", "childLink": "AchildrenLink" }, { "kind": "drive#childrenReference", "id": "aChildDocument", "selfLink": "aSelfLink2", "childLink": "AchildrenLink2" } ] } libcmis-0.4.1/qa/libcmis/data/gdrive/folder2.json0000644000175000001440000000200412173212453016513 00000000000000{ "kind": "drive#file", "id": "aNewFolderId", "etag": "a folder etag", "selfLink": "SelfLINK", "title": "testFolder", "mimeType": "application/vnd.google-apps.folder", "labels": { "starred": false, "hidden": false, "trashed": false, "restricted": false, "viewed": true }, "createdDate": "2013-03-22T17:53:10.290Z", "modifiedDate": "2013-03-22T17:53:44.212Z", "modifiedByMeDate": "2013-03-22T17:53:44.212Z", "lastViewedByMeDate": "2013-04-05T15:27:47.261Z", "parents": [ { "kind": "drive#parentReference", "id": "parentID", "isRoot": true } ], "quotaBytesUsed": "0", "ownerNames": [ "User" ], "owners": [ { "kind": "drive#user", "displayName": "User name", "isAuthenticatedUser": true } ], "lastModifyingUserName": "User name of the last person modify", "lastModifyingUser": { "kind": "drive#user", "displayName": "Last mofifying username", "isAuthenticatedUser": true }, "editable": true, "writersCanShare": true, "shared": false, "appDataContents": false } libcmis-0.4.1/qa/libcmis/data/gdrive/authcode.html0000644000175000001440000000014512156277657016773 00000000000000 libcmis-0.4.1/qa/libcmis/data/gdrive/jsontest-good.json0000644000175000001440000000251712173212453017766 00000000000000{ "kind": "drive#file", "id": "aFileId", "etag": "\"an example tag\"", "selfLink": "fileSelfLink", "title": "a file title", "mimeType": "application/vnd.google-apps.form", "labels": { "starred": false, "hidden": false, "trashed": false, "restricted": false, "viewed": true }, "createdDate": "2010-04-28T14:53:23.141Z", "modifiedDate": "2010-09-30T21:01:37.504Z", "lastViewedByMeDate": "2013-02-26T15:40:30.404Z", "intTest": "-123", "doubleTest": "-123.456", "parents": [ { "kind": "drive#parentReference", "id": "parentId", "selfLink": "parentSelfLink", "parentLink": "parentLink", "isRoot": true } ], "exportLinks": { "application/pdf": "pdflink", "application/x-vnd.oasis.opendocument.spreadsheet": "opendocumentlinks", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": "xlslink" }, "userPermission": { "kind": "drive#permission", "id": "me", "role": "owner", "type": "user" }, "quotaBytesUsed": "0", "ownerNames": [ "Owner Real Name" ], "owners": [ { "kind": "drive#user", "displayName": "Mock file owner", "isAuthenticatedUser": true } ], "lastModifyingUserName": "Mock user", "lastModifyingUser": { "kind": "drive#user", "displayName": "User name", "isAuthenticatedUser": false }, "editable": true, "writersCanShare": true, "shared": true } libcmis-0.4.1/qa/libcmis/data/gdrive/refresh_response.json0000644000175000001440000000012612156277657020557 00000000000000{ "access_token":"new-access-token", "expires_in":3920, "token_type":"Bearer" } libcmis-0.4.1/qa/libcmis/data/gdrive/login.html0000644000175000001440000000073712156277657016316 00000000000000
libcmis-0.4.1/qa/libcmis/data/gdrive/document.json0000644000175000001440000000277312173212453017011 00000000000000{ "kind": "drive#file", "id": "aFileId", "etag": "\"an example tag\"", "selfLink": "fileSelfLink", "title": "GDrive File", "mimeType": "application/vnd.google-apps.form", "labels": { "starred": false, "hidden": false, "trashed": false, "restricted": false, "viewed": true }, "createdDate": "2010-04-28T14:53:23.141Z", "modifiedDate": "2010-09-30T21:01:37.504Z", "lastViewedByMeDate": "2013-02-26T15:40:30.404Z", "fileSize": "123", "parents": [ { "kind": "drive#parentReference", "id": "aFolderId", "selfLink": "parentSelfLink", "parentLink": "parentLink", "isRoot": true }, { "kind": "drive#parentReference", "id": "aNewFolderId", "selfLink": "parentSelfLink", "parentLink": "parentLink", "isRoot": true } ], "exportLinks": { "application/pdf": "pdflink", "application/x-vnd.oasis.opendocument.spreadsheet": "https://downloadLink", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": "xlslink" }, "thumbnailLink": "https://aThumbnailLink", "userPermission": { "kind": "drive#permission", "id": "me", "role": "owner", "type": "user" }, "quotaBytesUsed": "0", "ownerNames": [ "Owner Real Name" ], "owners": [ { "kind": "drive#user", "displayName": "Mock file owner", "isAuthenticatedUser": true } ], "lastModifyingUserName": "Mock user", "lastModifyingUser": { "kind": "drive#user", "displayName": "User name", "isAuthenticatedUser": false }, "editable": true, "writersCanShare": true, "shared": true } libcmis-0.4.1/qa/libcmis/data/gdrive/token-response.json0000644000175000001440000000017612156277657020164 00000000000000{ "access_token":"mock-access-token", "expires_in":3920, "token_type":"Bearer", "refresh_token":"mock-refresh-token" }libcmis-0.4.1/qa/libcmis/data/gdrive/allVersions.json0000644000175000001440000000263412156277657017512 00000000000000{ "kind": "drive#revisionList", "etag": "revisionEtag", "selfLink": "revisionsLink", "items": [ { "kind": "drive#revision", "etag": "\"anEtag\"", "id": "versionId0", "selfLink": "aSelfLink", "mimeType": "application/vnd.google-apps.form", "modifiedDate": "2010-07-04T12:30:07.355Z", "published": false, "exportLinks": { "application/pdf": "pdfLink", "application/x-vnd.oasis.opendocument.spreadsheet": "ODFLinks", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": "msLink" } }, { "kind": "drive#revision", "etag": "\"anEtag\"", "id": "versionId1", "selfLink": "aSelfLink", "mimeType": "application/vnd.google-apps.form", "modifiedDate": "2010-07-04T12:30:07.355Z", "published": false, "exportLinks": { "application/pdf": "pdfLink", "application/x-vnd.oasis.opendocument.spreadsheet": "ODFLinks", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": "msLink" } }, { "kind": "drive#revision", "etag": "\"anEtag\"", "id": "versionId2", "selfLink": "aSelfLink", "mimeType": "application/vnd.google-apps.form", "modifiedDate": "2010-07-04T12:30:07.355Z", "published": false, "exportLinks": { "application/pdf": "pdfLink", "application/x-vnd.oasis.opendocument.spreadsheet": "ODFLinks", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": "msLink" } } ] } libcmis-0.4.1/qa/libcmis/data/gdrive/folder.json0000644000175000001440000000200112173212453016426 00000000000000{ "kind": "drive#file", "id": "aFolderId", "etag": "a folder etag", "selfLink": "SelfLINK", "title": "testFolder", "mimeType": "application/vnd.google-apps.folder", "labels": { "starred": false, "hidden": false, "trashed": false, "restricted": false, "viewed": true }, "createdDate": "2013-03-22T17:53:10.290Z", "modifiedDate": "2013-03-22T17:53:44.212Z", "modifiedByMeDate": "2013-03-22T17:53:44.212Z", "lastViewedByMeDate": "2013-04-05T15:27:47.261Z", "parents": [ { "kind": "drive#parentReference", "id": "parentID", "isRoot": true } ], "quotaBytesUsed": "0", "ownerNames": [ "User" ], "owners": [ { "kind": "drive#user", "displayName": "User name", "isAuthenticatedUser": true } ], "lastModifyingUserName": "User name of the last person modify", "lastModifyingUser": { "kind": "drive#user", "displayName": "Last mofifying username", "isAuthenticatedUser": true }, "editable": true, "writersCanShare": true, "shared": false, "appDataContents": false } libcmis-0.4.1/qa/libcmis/data/gdrive/document_parents.json0000644000175000001440000000036312156277657020560 00000000000000{ "kind": "drive#parentList", "etag": "A parent etag", "selfLink": "SelfLink", "items": [ { "kind": "drive#parentReference", "id": "aFolderId", "selfLink": "aSelfLink", "parentLink": "AParentLink", "isRoot": true } ] } libcmis-0.4.1/qa/libcmis/data/atom/0000755000175000001440000000000012177713352014037 500000000000000libcmis-0.4.1/qa/libcmis/data/atom/workspaces.xml0000644000175000001440000002672212156277657016705 00000000000000 A1 root Root Collection application/atom+xml;type=entry application/cmisatom+xml types Types Collection query Query Collection application/cmisquery+xml checkedout Checked Out Collection application/cmisatom+xml unfiled Unfiled Collection application/cmisatom+xml mock Mockup Repository sent by mockup server libcmis Libcmis mockup some-version root-folder 0 manage false none anytime true true true false true bothcombined none true false none basic objectonly cmis:read Read cmis:write Write cmis:all All canGetDescendents.Folder cmis:read canGetChildren.Folder cmis:read canGetParents.Folder cmis:read canGetFolderParent.Object cmis:read canCreateDocument.Folder cmis:write canCreateFolder.Folder cmis:write canCreateRelationship.Source cmis:read canCreateRelationship.Target cmis:read canGetProperties.Object cmis:read canViewContent.Object cmis:read canUpdateProperties.Object cmis:write canMove.Object cmis:write canMove.Target cmis:write canMove.Source cmis:write canDelete.Object cmis:write canDeleteTree.Folder cmis:write canSetContent.Document cmis:write canDeleteContent.Document cmis:write canAddToFolder.Object cmis:write canAddToFolder.Folder cmis:write canRemoveFromFolder.Object cmis:write canRemoveFromFolder.Folder cmis:write canCheckout.Document cmis:write canCancelCheckout.Document cmis:write canCheckin.Document cmis:write canGetAllVersions.VersionSeries cmis:read canGetObjectRelationships.Object cmis:read canAddPolicy.Object cmis:write canAddPolicy.Policy cmis:write canRemovePolicy.Object cmis:write canRemovePolicy.Policy cmis:write canGetAppliedPolicies.Object cmis:read canGetACL.Object cmis:read canApplyACL.Object cmis:all 1.0 true anonymous anyone http://mockup/mock/id?id={id}&filter={filter}&includeAllowableActions={includeAllowableActions}&includeACL={includeACL}&includePolicyIds={includePolicyIds}&includeRelationships={includeRelationships}&renditionFilter={renditionFilter} objectbyid application/atom+xml;type=entry http://mockup/mock/path?path={path}&filter={filter}&includeAllowableActions={includeAllowableActions}&includeACL={includeACL}&includePolicyIds={includePolicyIds}&includeRelationships={includeRelationships}&renditionFilter={renditionFilter} objectbypath application/atom+xml;type=entry http://mockup/mock/type?id={id} typebyid application/atom+xml;type=entry http://mockup/mock/query?q={q}&searchAllVersions={searchAllVersions}&includeAllowableActions={includeAllowableActions}&includeRelationships={includeRelationships}&maxItems={maxItems}&skipCount={skipCount} query application/atom+xml;type=feed libcmis-0.4.1/qa/libcmis/data/atom/get-versions.xml0000644000175000001440000005036312167024305017125 00000000000000 unknown Some obscure Id Test Document 2013-01-28T14:10:06Z 2013-01-28T14:10:06Z unknown Some obscure Id 2013-01-28T14:10:06Z Test Document 2013-01-28T14:10:06Z 2013-01-28T14:10:06Z 12345 DocumentLevel2 version-series true 1.0 false unknown unknown blue true Test Document text/plain My Doc StringProperty 6 2013-01-28T14:10:06.736Z 1359382206736 test-document-1 false true cmis:document data.txt 2013-01-28T14:10:06.736Z test-document-1 Test Document unknown Some obscure Id 2013-01-28T14:10:06Z Test Document 2013-01-28T14:10:06Z 2013-01-28T14:10:06Z 12345 DocumentLevel2 version-series false 0.1 false unknown unknown blue false Test Document text/plain My Doc StringProperty 6 2013-01-27T14:10:06.736Z 1359382206754 test-document-0 false false cmis:document data.txt 2013-01-27T14:10:06.736Z test-document-0 Test Document libcmis-0.4.1/qa/libcmis/data/atom/type-document.xml0000644000175000001440000005046212156277657017317 00000000000000 unknown http://mockup/mock/obscure id CMIS Document 2013-01-25T09:47:55Z 2013-01-25T09:47:55Z cmis:document cmis:document local CMIS Document cmis:document Description of CMIS Document Type cmis:document true true false false true false true cmis:isLatestMajorVersion cmis:isLatestMajorVersion local Is Latest Major Version cmis:isLatestMajorVersion This is a Is Latest Major Version property. boolean single readonly false false true true false cmis:contentStreamId cmis:contentStreamId local Stream Id cmis:contentStreamId This is a Stream Id property. id single readonly false false true true false cmis:contentStreamLength cmis:contentStreamLength local Content Length cmis:contentStreamLength This is a Content Length property. integer single readonly false false true true false cmis:versionSeriesCheckedOutBy cmis:versionSeriesCheckedOutBy local Checked Out By cmis:versionSeriesCheckedOutBy This is a Checked Out By property. string single readonly false false true true false cmis:objectTypeId cmis:objectTypeId local Type-Id cmis:objectTypeId This is a Type-Id property. id single oncreate false true true true false cmis:versionSeriesCheckedOutId cmis:versionSeriesCheckedOutId local Checked Out Id cmis:versionSeriesCheckedOutId This is a Checked Out Id property. id single readonly false false true true false cmis:name cmis:name local Name cmis:name This is a Name property. string single readwrite false true true true false cmis:contentStreamMimeType cmis:contentStreamMimeType local Mime Type cmis:contentStreamMimeType This is a Mime Type property. string single readonly false false true true false cmis:versionSeriesId cmis:versionSeriesId local Version Series Id cmis:versionSeriesId This is a Version Series Id property. id single readonly false false true true false cmis:creationDate cmis:creationDate local Creation Date cmis:creationDate This is a Creation Date property. datetime single readonly false false true true false cmis:changeToken cmis:changeToken local Change Token cmis:changeToken This is a Change Token property. string single readonly false false true true false cmis:versionLabel cmis:versionLabel local Version Label cmis:versionLabel This is a Version Label property. string single readonly false false true true false cmis:isLatestVersion cmis:isLatestVersion local Is Latest Version cmis:isLatestVersion This is a Is Latest Version property. boolean single readonly false false true true false cmis:isVersionSeriesCheckedOut cmis:isVersionSeriesCheckedOut local Checked Out cmis:isVersionSeriesCheckedOut This is a Checked Out property. boolean single readonly false false true true false cmis:lastModifiedBy cmis:lastModifiedBy local Modified By cmis:lastModifiedBy This is a Modified By property. string single readonly false false true true false cmis:createdBy cmis:createdBy local Created By cmis:createdBy This is a Created By property. string single readonly false false true true false cmis:checkinComment cmis:checkinComment local Checkin Comment cmis:checkinComment This is a Checkin Comment property. string single readonly false false true true false cmis:objectId cmis:objectId local Object Id cmis:objectId This is a Object Id property. id single readonly false false true true false cmis:isImmutable cmis:isImmutable local Immutable cmis:isImmutable This is a Immutable property. boolean single readonly false false true true false cmis:isMajorVersion cmis:isMajorVersion local Is Major Version cmis:isMajorVersion This is a Is Major Version property. boolean single readonly false false true true false cmis:baseTypeId cmis:baseTypeId local Base-Type-Id cmis:baseTypeId This is a Base-Type-Id property. id single readonly false false true true false cmis:contentStreamFileName cmis:contentStreamFileName local File Name cmis:contentStreamFileName This is a File Name property. string single readonly false false true true false cmis:lastModificationDate cmis:lastModificationDate local Modification Date cmis:lastModificationDate This is a Modification Date property. datetime single readonly false false true true false false allowed libcmis-0.4.1/qa/libcmis/data/atom/valid-object-noactions.xml0000644000175000001440000001200212156277657021044 00000000000000 Admin Some obscure Id 2012-11-29T16:14:47Z Valid Object 2012-11-29T16:14:47Z 2012-11-29T16:14:47Z * /Valid Object Admin cmis:folder Admin Valid Object valid-object 2012-11-29T16:14:47.019Z 1354205687020 cmis:folder root-folder 2012-11-29T16:14:47.020Z valid-object Valid Object libcmis-0.4.1/qa/libcmis/data/atom/type-docLevel2.xml0000644000175000001440000010277712156277657017327 00000000000000 unknown http://mockup/mock/obscure id Document Level 2 2013-01-25T09:46:50Z 2013-01-25T09:46:50Z DocumentLevel2 DocumentLevel2 local Document Level 2 DocumentLevel2 Description of Document Level 2 Type cmis:document DocumentLevel1 true true false false true false true cmis:isLatestMajorVersion cmis:isLatestMajorVersion local Is Latest Major Version cmis:isLatestMajorVersion This is a Is Latest Major Version property. boolean single readonly true false true true false cmis:contentStreamId cmis:contentStreamId local Stream Id cmis:contentStreamId This is a Stream Id property. id single readonly true false true true false cmis:contentStreamLength cmis:contentStreamLength local Content Length cmis:contentStreamLength This is a Content Length property. integer single readonly true false true true false cmis:versionSeriesCheckedOutBy cmis:versionSeriesCheckedOutBy local Checked Out By cmis:versionSeriesCheckedOutBy This is a Checked Out By property. string single readonly true false true true false cmis:objectTypeId cmis:objectTypeId local Type-Id cmis:objectTypeId This is a Type-Id property. id single oncreate true true true true false cmis:versionSeriesCheckedOutId cmis:versionSeriesCheckedOutId local Checked Out Id cmis:versionSeriesCheckedOutId This is a Checked Out Id property. id single readonly true false true true false cmis:name cmis:name local Name cmis:name This is a Name property. string single readwrite true true true true false cmis:contentStreamMimeType cmis:contentStreamMimeType local Mime Type cmis:contentStreamMimeType This is a Mime Type property. string single readonly true false true true false cmis:versionSeriesId cmis:versionSeriesId local Version Series Id cmis:versionSeriesId This is a Version Series Id property. id single readonly true false true true false cmis:creationDate cmis:creationDate local Creation Date cmis:creationDate This is a Creation Date property. datetime single readonly true false true true false cmis:changeToken cmis:changeToken local Change Token cmis:changeToken This is a Change Token property. string single readonly true false true true false cmis:versionLabel cmis:versionLabel local Version Label cmis:versionLabel This is a Version Label property. string single readonly true false true true false cmis:isLatestVersion cmis:isLatestVersion local Is Latest Version cmis:isLatestVersion This is a Is Latest Version property. boolean single readonly true false true true false cmis:isVersionSeriesCheckedOut cmis:isVersionSeriesCheckedOut local Checked Out cmis:isVersionSeriesCheckedOut This is a Checked Out property. boolean single readonly true false true true false cmis:lastModifiedBy cmis:lastModifiedBy local Modified By cmis:lastModifiedBy This is a Modified By property. string single readonly true false true true false cmis:createdBy cmis:createdBy local Created By cmis:createdBy This is a Created By property. string single readonly true false true true false cmis:checkinComment cmis:checkinComment local Checkin Comment cmis:checkinComment This is a Checkin Comment property. string single readonly true false true true false cmis:objectId cmis:objectId local Object Id cmis:objectId This is a Object Id property. id single readonly true false true true false cmis:isImmutable cmis:isImmutable local Immutable cmis:isImmutable This is a Immutable property. boolean single readonly true false true true false cmis:isMajorVersion cmis:isMajorVersion local Is Major Version cmis:isMajorVersion This is a Is Major Version property. boolean single readonly true false true true false cmis:baseTypeId cmis:baseTypeId local Base-Type-Id cmis:baseTypeId This is a Base-Type-Id property. id single readonly true false true true false cmis:contentStreamFileName cmis:contentStreamFileName local File Name cmis:contentStreamFileName This is a File Name property. string single readonly true false true true false cmis:lastModificationDate cmis:lastModificationDate local Modification Date cmis:lastModificationDate This is a Modification Date property. datetime single readonly true false true true false HtmlProp HtmlProp local Sample Html Property HtmlProp This is a Sample Html Property property. html single readwrite false false true true false IdProp IdProp local Sample Id Property IdProp This is a Sample Id Property property. id single readwrite false false true true false DateTimePropMV DateTimePropMV local Sample DateTime multi-value Property DateTimePropMV This is a Sample DateTime multi-value Property property. datetime multi readwrite false false true true false UriProp UriProp local Sample Uri Property UriProp This is a Sample Uri Property property. uri single readwrite false false true true false DecimalProp DecimalProp local Sample Decimal Property DecimalProp This is a Sample Decimal Property property. decimal single readwrite false false true true false UriPropMV UriPropMV local Sample Uri multi-value Property UriPropMV This is a Sample Uri multi-value Property property. uri multi readwrite false false true true false IdPropMV IdPropMV local Sample Id Html multi-value Property IdPropMV This is a Sample Id Html multi-value Property property. id multi readwrite false false true true false PickListProp PickListProp local Sample Pick List Property PickListProp This is a Sample Pick List Property property. string single readwrite false false true true false blue red green blue black IntProp IntProp local Sample Int Property IntProp This is a Sample Int Property property. integer single readwrite false false true true false HtmlPropMV HtmlPropMV local Sample Html multi-value Property HtmlPropMV This is a Sample Html multi-value Property property. html multi readwrite false false true true false StringProp StringProp local Sample String Property StringProp This is a Sample String Property property. string single readwrite false false true true false DecimalPropMV DecimalPropMV local Sample Decimal multi-value Property DecimalPropMV This is a Sample Decimal multi-value Property property. decimal multi readwrite false false true true false DateTimeProp DateTimeProp local Sample DateTime Property DateTimeProp This is a Sample DateTime Property property. datetime single readwrite false false true true false BooleanProp BooleanProp local Sample Boolean Property BooleanProp This is a Sample Boolean Property property. boolean single readwrite false false true true false BooleanPropMV BooleanPropMV local Sample Boolean multi-value Property BooleanPropMV This is a Sample Boolean multi-value Property property. boolean multi readwrite false false true true false IntPropMV IntPropMV local Sample Int multi-value Property IntPropMV This is a Sample Int multi-value Property property. integer multi readwrite false false true true false false allowed libcmis-0.4.1/qa/libcmis/data/atom/typechildren-docLevel1.xml0000644000175000001440000000735612156277657021034 00000000000000 unknown http://mockup/mock/obscure id Document Level 1 2013-01-25T10:11:03Z 2013-01-25T10:11:03Z 1 libcmis-0.4.1/qa/libcmis/data/atom/valid-object.xml0000644000175000001440000001540612156277657017064 00000000000000 Admin Some obscure Id 2012-11-29T16:14:47Z Valid Object 2012-11-29T16:14:47Z 2012-11-29T16:14:47Z * /Valid Object Admin cmis:folder Admin Valid Object valid-object 2012-11-29T16:14:47.019Z 1354205687020 cmis:folder root-folder 2012-11-29T16:14:47.020Z true true true true false true true true true false false false false false false false false false false false false true true true false true false false false valid-object Valid Object libcmis-0.4.1/qa/libcmis/data/atom/type-docLevel1.xml0000644000175000001440000005072012156277657017314 00000000000000 unknown http://mockup/mock/obscure id Document Level 1 2013-01-25T09:47:39Z 2013-01-25T09:47:39Z DocumentLevel1 DocumentLevel1 local Document Level 1 DocumentLevel1 Description of Document Level 1 Type cmis:document cmis:document true true false false true false true cmis:isLatestMajorVersion cmis:isLatestMajorVersion local Is Latest Major Version cmis:isLatestMajorVersion This is a Is Latest Major Version property. boolean single readonly true false true true false cmis:contentStreamId cmis:contentStreamId local Stream Id cmis:contentStreamId This is a Stream Id property. id single readonly true false true true false cmis:contentStreamLength cmis:contentStreamLength local Content Length cmis:contentStreamLength This is a Content Length property. integer single readonly true false true true false cmis:versionSeriesCheckedOutBy cmis:versionSeriesCheckedOutBy local Checked Out By cmis:versionSeriesCheckedOutBy This is a Checked Out By property. string single readonly true false true true false cmis:objectTypeId cmis:objectTypeId local Type-Id cmis:objectTypeId This is a Type-Id property. id single oncreate true true true true false cmis:versionSeriesCheckedOutId cmis:versionSeriesCheckedOutId local Checked Out Id cmis:versionSeriesCheckedOutId This is a Checked Out Id property. id single readonly true false true true false cmis:name cmis:name local Name cmis:name This is a Name property. string single readwrite true true true true false cmis:contentStreamMimeType cmis:contentStreamMimeType local Mime Type cmis:contentStreamMimeType This is a Mime Type property. string single readonly true false true true false cmis:versionSeriesId cmis:versionSeriesId local Version Series Id cmis:versionSeriesId This is a Version Series Id property. id single readonly true false true true false cmis:creationDate cmis:creationDate local Creation Date cmis:creationDate This is a Creation Date property. datetime single readonly true false true true false cmis:changeToken cmis:changeToken local Change Token cmis:changeToken This is a Change Token property. string single readonly true false true true false cmis:isLatestVersion cmis:isLatestVersion local Is Latest Version cmis:isLatestVersion This is a Is Latest Version property. boolean single readonly true false true true false cmis:versionLabel cmis:versionLabel local Version Label cmis:versionLabel This is a Version Label property. string single readonly true false true true false cmis:isVersionSeriesCheckedOut cmis:isVersionSeriesCheckedOut local Checked Out cmis:isVersionSeriesCheckedOut This is a Checked Out property. boolean single readonly true false true true false cmis:lastModifiedBy cmis:lastModifiedBy local Modified By cmis:lastModifiedBy This is a Modified By property. string single readonly true false true true false cmis:createdBy cmis:createdBy local Created By cmis:createdBy This is a Created By property. string single readonly true false true true false cmis:checkinComment cmis:checkinComment local Checkin Comment cmis:checkinComment This is a Checkin Comment property. string single readonly true false true true false cmis:objectId cmis:objectId local Object Id cmis:objectId This is a Object Id property. id single readonly true false true true false cmis:isMajorVersion cmis:isMajorVersion local Is Major Version cmis:isMajorVersion This is a Is Major Version property. boolean single readonly true false true true false cmis:isImmutable cmis:isImmutable local Immutable cmis:isImmutable This is a Immutable property. boolean single readonly true false true true false cmis:baseTypeId cmis:baseTypeId local Base-Type-Id cmis:baseTypeId This is a Base-Type-Id property. id single readonly true false true true false cmis:lastModificationDate cmis:lastModificationDate local Modification Date cmis:lastModificationDate This is a Modification Date property. datetime single readonly true false true true false cmis:contentStreamFileName cmis:contentStreamFileName local File Name cmis:contentStreamFileName This is a File Name property. string single readonly true false true true false false allowed libcmis-0.4.1/qa/libcmis/data/atom/working-copy.xml0000644000175000001440000001772212156277657017154 00000000000000 unknown Some obscure Id 2013-05-21T13:50:45Z Test Document 2013-05-21T13:50:45Z 2013-05-21T13:50:45Z false 12345 DocumentLevel2 unknown working-copy Test Document text/plain version-series 2013-05-21T13:50:45.300Z 1369144245300 V 0.2 false true unknown unknown working-copy false false cmis:document data.txt 2013-05-21T13:50:45.300Z working-copy Test Document libcmis-0.4.1/qa/libcmis/data/atom/allowable-actions.xml0000644000175000001440000000347512156277657020124 00000000000000 true true true true false true true true true false false false false false false false false false false false false true true true false true false false false libcmis-0.4.1/qa/libcmis/data/atom/root-folder.xml0000644000175000001440000001442312156277657016753 00000000000000 Admin Some obscure Id 2012-11-29T16:14:47Z Root Folder 2012-11-29T16:14:47Z 2012-11-29T16:14:47Z * / Admin cmis:folder Admin Valid Object valid-object 2012-11-29T16:14:47.019Z 1354205687020 cmis:folder 2012-11-29T16:14:47.020Z true true true true false true true true true false false false false false false false false false false false false true true true false true false false false libcmis-0.4.1/qa/libcmis/data/atom/create-folder.xml0000644000175000001440000001135012156277657017227 00000000000000 Admin Some obscure Id 2012-11-29T16:14:47Z create folder 2012-11-29T16:14:47Z 2012-11-29T16:14:47Z * /create folder Admin cmis:folder Admin create folder create-folder 2012-11-29T16:14:47.019Z 1354205687020 cmis:folder root-folder 2012-11-29T16:14:47.020Z libcmis-0.4.1/qa/libcmis/data/atom/test-document-updated.xml0000644000175000001440000002660512156277657020743 00000000000000 unknown Some obscure Id 2013-01-28T14:10:06Z New name 2013-01-28T14:10:06Z 2013-01-28T14:10:06Z 12345 DocumentLevel2 true false unknown unknown blue true New name text/plain My Doc StringProperty 6 2013-01-28T14:10:06.736Z 1359382206736 test-document false true cmis:document data.txt 2013-01-28T14:10:06.736Z true true false true false true false false true true false false false true false true true true false false false false false false false false false false false test-document New name libcmis-0.4.1/qa/libcmis/data/atom/root-children.xml0000644000175000001440000007604412156277657017277 00000000000000 Admin Some obscure Id Root Folder 2013-01-30T09:26:10Z 2013-01-30T09:26:10Z 5 Folder collection application/cmisatom+xml unknown Some obscure Id 2013-01-30T09:26:13Z Child 1 2013-01-30T09:26:13Z 2013-01-30T09:26:13Z 33446 DocumentLevel2 true false unknown unknown true Child 1 text/plain 2013-01-30T09:26:13.932Z 1359537973932 child1 false true cmis:document data.txt 2013-01-30T09:26:13.932Z unknown Some obscure Id 2013-01-30T09:26:13Z Child 2 2013-01-30T09:26:13Z 2013-01-30T09:26:13Z 33537 DocumentLevel2 true false unknown unknown true Child 2 text/plain 2013-01-30T09:26:13.978Z 1359537973978 child2 false true cmis:document data.txt 2013-01-30T09:26:13.978Z unknown Some obscure Id 2013-01-30T09:26:14Z Child 3 2013-01-30T09:26:14Z 2013-01-30T09:26:14Z 33353 DocumentLevel2 true false unknown unknown true Child 3 text/plain 2013-01-30T09:26:14.031Z 1359537974031 child3 false true cmis:document data.txt 2013-01-30T09:26:14.031Z unknown Some obscure Id 2013-01-30T09:26:12Z Child 4 2013-01-30T09:26:12Z 2013-01-30T09:26:12Z * /Child 4 unknown cmis:folder unknown Child 4 child4 2013-01-30T09:26:12.384Z 1359537972384 cmis:folder root-folder 2013-01-30T09:26:12.384Z unknown Some obscure Id 2013-01-30T09:26:13Z Child 5 2013-01-30T09:26:13Z 2013-01-30T09:26:13Z * /Child 5 unknown cmis:folder unknown Child 5 child5 2013-01-30T09:26:13.338Z 1359537973338 cmis:folder root-folder 2013-01-30T09:26:13.338Z libcmis-0.4.1/qa/libcmis/data/atom/test-document.xml0000644000175000001440000002755712177713255017316 00000000000000 unknown Some obscure Id 2013-01-28T14:10:06Z Test Document 2013-01-28T14:10:06Z 2013-01-28T14:10:06Z 12345 DocumentLevel2 true false unknown unknown blue true Test Document text/plain My Doc StringProperty 6 2013-01-28T14:10:06.736Z 1359382206736 test-document false true cmis:document data.txt 2013-01-28T14:10:06.736Z true true false true false true false false true true true false false true true true true true false false false false false false false false false false false test-document Test Document libcmis-0.4.1/qa/libcmis/data/atom/type-folder.xml0000644000175000001440000002647412156277657016762 00000000000000 unknown http://mockup/mock/obscure id CMIS Folder 2012-11-29T16:39:44Z 2012-11-29T16:39:44Z cmis:folder cmis:folder local CMIS Folder cmis:folder Description of CMIS Folder Type cmis:folder true true false false true false true cmis:allowedChildObjectTypeIds cmis:allowedChildObjectTypeIds local Allowed Child Types cmis:allowedChildObjectTypeIds This is a Allowed Child Types property. id multi readonly false false true true false cmis:path cmis:path local Path cmis:path This is a Path property. string single readonly false false true true false cmis:lastModifiedBy cmis:lastModifiedBy local Modified By cmis:lastModifiedBy This is a Modified By property. string single readonly false false true true false cmis:objectTypeId cmis:objectTypeId local Type-Id cmis:objectTypeId This is a Type-Id property. id single oncreate false true true true false cmis:createdBy cmis:createdBy local Created By cmis:createdBy This is a Created By property. string single readonly false false true true false cmis:name cmis:name local Name cmis:name This is a Name property. string single readwrite false true true true false cmis:objectId cmis:objectId local Object Id cmis:objectId This is a Object Id property. id single readonly false false true true false cmis:creationDate cmis:creationDate local Creation Date cmis:creationDate This is a Creation Date property. datetime single readonly false false true true false cmis:changeToken cmis:changeToken local Change Token cmis:changeToken This is a Change Token property. string single readonly false false true true false cmis:baseTypeId cmis:baseTypeId local Base-Type-Id cmis:baseTypeId This is a Base-Type-Id property. id single readonly false false true true false cmis:parentId cmis:parentId local Parent Id cmis:parentId This is a Parent Id property. id single readonly false false true true false cmis:lastModificationDate cmis:lastModificationDate local Modification Date cmis:lastModificationDate This is a Modification Date property. datetime single readonly false false true true false libcmis-0.4.1/qa/libcmis/data/atom/create-document.xml0000644000175000001440000001556312156277657017604 00000000000000 unknown Some obscure Id 2013-01-28T14:10:06Z create document 2013-01-28T14:10:06Z 2013-01-28T14:10:06Z 12345 cmis:document true false unknown unknown true create document text/plain 2013-01-28T14:10:06.736Z 1359382206736 create-document false true cmis:document data.txt 2013-01-28T14:10:06.736Z libcmis-0.4.1/qa/libcmis/data/atom/create-folder-bad-type.xml0000644000175000001440000001101112156277657020724 00000000000000 Admin Some obscure Id 2012-11-29T16:14:47Z create folder 2012-11-29T16:14:47Z 2012-11-29T16:14:47Z * /create folder Admin cmis:document Admin create folder create-folder 2012-11-29T16:14:47.019Z 1354205687020 cmis:document root-folder 2012-11-29T16:14:47.020Z libcmis-0.4.1/qa/libcmis/data/atom/test-document-parents.xml0000644000175000001440000002331612156277657020765 00000000000000 unknown Some Obscure Id Test Document 2013-01-31T08:04:37Z 2013-01-31T08:04:37Z Admin Some Obscure Id 2013-01-31T08:04:35Z Parent 1 2013-01-31T08:04:35Z 2013-01-31T08:04:35Z * /Parent 1 Admin cmis:folder Admin Parent 1 parent1 2013-01-31T08:04:35.866Z 1359619475867 cmis:folder root-folder 2013-01-31T08:04:35.867Z Test Document Admin Some Obscure Id 2013-01-31T08:04:35Z Parent 2 2013-01-31T08:04:35Z 2013-01-31T08:04:35Z * /Parent 2 Admin cmis:folder Admin Parent 2 parent2 2013-01-31T08:04:35.866Z 1359619475867 cmis:folder root-folder 2013-01-31T08:04:35.867Z Test Document libcmis-0.4.1/qa/libcmis/data/atom/typechildren-document.xml0000644000175000001440000000716412156277657021031 00000000000000 unknown http://mockup/mock/obscure id CMIS Document 2013-01-25T10:05:56Z 2013-01-25T10:05:56Z 1 libcmis-0.4.1/qa/libcmis/test-helpers.hxx0000644000175000001440000000327212156277657015274 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2011 SUSE * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #include #include #include #include "document.hxx" #include "session.hxx" #include "xmlserializable.hxx" namespace test { // Test helper functions for parser and writer tests xmlNodePtr getXmlNode( std::string str ); const char* getXmlns( ); std::string writeXml( boost::shared_ptr< libcmis::XmlSerializable > serializable ); std::string getXmlNodeAsString( const std::string& xmlDoc, const std::string& xpath ); // Helper functions to populate the test repository libcmis::DocumentPtr createVersionableDocument( libcmis::Session* session, std::string docName ); } libcmis-0.4.1/qa/libcmis/test-gdrive.cxx0000644000175000001440000012521712173212453015067 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2013 Cao Cuong Ngo * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #include #include #include #include #define private public #define protected public #include #include "gdrive-session.hxx" #include "oauth2-handler.hxx" #include "gdrive-object.hxx" #include "document.hxx" using namespace std; using namespace libcmis; static const string CLIENT_ID ( "mock-id" ); static const string CLIENT_SECRET ( "mock-secret" ); static const string USERNAME( "mock-user" ); static const string PASSWORD( "mock-password" ); static const string LOGIN_URL ("https://login/url" ); static const string APPROVAL_URL ("https://approval/url" ); static const string AUTH_URL ( "https://auth/url" ); static const string TOKEN_URL ( "https://token/url" ); static const string SCOPE ( "https://scope/url" ); static const string REDIRECT_URI ("redirect:uri" ); static const string BASE_URL ( "https://base/url" ); class GDriveTest : public CppUnit::TestFixture { public: void sessionAuthenticationTest( ); void sessionExpiryTokenGetTest( ); void sessionExpiryTokenPostTest( ); void sessionExpiryTokenPutTest( ); void sessionExpiryTokenDeleteTest( ); void getRepositoriesTest( ); void getTypeTest( ); void getObjectTest( ); void getDocumentTest( ); void getFolderTest( ); void getDocumentParentsTest( ); void getContentStreamTest( ); void setContentStreamTest( ); void setContentStreamGdocTest( ); void getChildrenTest( ); void getDocumentAllowableActionsTest( ); void getFolderAllowableActionsTest( ); void checkOutTest( ); void checkInTest( ); void deleteTest( ); void moveTest( ); void createDocumentTest( ); void createFolderTest( ); void updatePropertiesTest( ); void removeTreeTest( ); void getContentStreamWithRenditionsTest( ); void getRefreshTokenTest( ); void getThumbnailUrlTest( ); void getAllVersionsTest( ); CPPUNIT_TEST_SUITE( GDriveTest ); CPPUNIT_TEST( sessionAuthenticationTest ); CPPUNIT_TEST( sessionExpiryTokenGetTest ); CPPUNIT_TEST( sessionExpiryTokenPutTest ); CPPUNIT_TEST( sessionExpiryTokenPostTest ); CPPUNIT_TEST( sessionExpiryTokenDeleteTest ); CPPUNIT_TEST( getRepositoriesTest ); CPPUNIT_TEST( getTypeTest ); CPPUNIT_TEST( getObjectTest ); CPPUNIT_TEST( getDocumentTest ); CPPUNIT_TEST( getFolderTest ); CPPUNIT_TEST( getDocumentParentsTest ); CPPUNIT_TEST( getContentStreamTest ); CPPUNIT_TEST( setContentStreamTest ); CPPUNIT_TEST( setContentStreamGdocTest ); CPPUNIT_TEST( getChildrenTest ); CPPUNIT_TEST( getDocumentAllowableActionsTest ); CPPUNIT_TEST( getFolderAllowableActionsTest ); CPPUNIT_TEST( checkOutTest ); CPPUNIT_TEST( checkInTest ); CPPUNIT_TEST( deleteTest ); CPPUNIT_TEST( moveTest ); CPPUNIT_TEST( createDocumentTest ); CPPUNIT_TEST( createFolderTest ); CPPUNIT_TEST( updatePropertiesTest ); CPPUNIT_TEST( removeTreeTest ); CPPUNIT_TEST( getContentStreamWithRenditionsTest ); CPPUNIT_TEST( getRefreshTokenTest ); CPPUNIT_TEST( getThumbnailUrlTest ); CPPUNIT_TEST( getAllVersionsTest ); CPPUNIT_TEST_SUITE_END( ); private: GDriveSession getTestSession( string username, string password ); }; GDriveSession GDriveTest::getTestSession( string username, string password ) { libcmis::OAuth2DataPtr oauth2( new libcmis::OAuth2Data( AUTH_URL, TOKEN_URL, SCOPE, REDIRECT_URI, CLIENT_ID, CLIENT_SECRET )); curl_mockup_reset( ); string empty; //login response string loginIdentifier = string("scope=") + SCOPE + string("&redirect_uri=") + REDIRECT_URI + string("&response_type=code") + string("&client_id=") + CLIENT_ID; curl_mockup_addResponse ( AUTH_URL.c_str(), loginIdentifier.c_str( ), "GET", DATA_DIR "/gdrive/login.html", 200, true); //authentication response curl_mockup_addResponse( LOGIN_URL.c_str( ), empty.c_str( ), "POST", DATA_DIR "/gdrive/approve.html", 200, true); //approval response curl_mockup_addResponse( APPROVAL_URL.c_str( ), empty.c_str( ), "POST", DATA_DIR "/gdrive/authcode.html", 200, true); curl_mockup_addResponse ( TOKEN_URL.c_str( ), empty.c_str( ), "POST", DATA_DIR "/gdrive/token-response.json", 200, true ); return GDriveSession( BASE_URL, username, password, oauth2, false ); } void GDriveTest::sessionAuthenticationTest( ) { GDriveSession session = getTestSession( USERNAME, PASSWORD ); string empty; // Check authentication request string authRequest( curl_mockup_getRequestBody( LOGIN_URL.c_str(), empty.c_str( ), "POST" ) ); string expectedAuthRequest = string ( "continue=redirectLink&scope=Scope&service=lso&GALX=cookie" "&Email=") + USERNAME + string("&Passwd=") + PASSWORD; CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong authentication request", expectedAuthRequest, authRequest ); // Check code request string codeRequest( curl_mockup_getRequestBody( APPROVAL_URL.c_str(), empty.c_str( ), "POST" ) ); string expectedCodeRequest = string( "state_wrapper=stateWrapper&submit_access=true" ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong approval request", expectedCodeRequest, codeRequest); // Check token request string expectedTokenRequest = string( "code=AuthCode") + string( "&client_id=") + CLIENT_ID + string( "&client_secret=") + CLIENT_SECRET + string( "&redirect_uri=") + REDIRECT_URI + string( "&grant_type=authorization_code" ); string tokenRequest( curl_mockup_getRequestBody( TOKEN_URL.c_str(), empty.c_str( ), "POST" ) ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong token request", expectedTokenRequest, tokenRequest ); // Check token CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong access token", string ( "mock-access-token" ), session.m_oauth2Handler->getAccessToken( )); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong refresh token", string ("mock-refresh-token"), session.m_oauth2Handler->getRefreshToken( )); } void GDriveTest::sessionExpiryTokenGetTest( ) { // Access_token will expire after expires_in seconds, // We need to use the refresh key to get a new one. curl_mockup_reset( ); GDriveSession session = getTestSession( USERNAME, PASSWORD ); curl_mockup_reset( ); static const string objectId("aFileId"); string url = BASE_URL + "/files/" + objectId; // 401 response, token is expired curl_mockup_addResponse( url.c_str( ),"", "GET", "", 401, false ); curl_mockup_addResponse( TOKEN_URL.c_str(), "", "POST", DATA_DIR "/gdrive/refresh_response.json", 200, true); try { // GET expires, need to refresh then GET again libcmis::ObjectPtr obj = session.getObject( objectId ); } catch ( ... ) { if ( session.getHttpStatus( ) == 401 ) { // Check if access token is refreshed CPPUNIT_ASSERT_EQUAL_MESSAGE( "wrong access token", string ( "new-access-token" ), session.m_oauth2Handler->getAccessToken( ) ); } } } void GDriveTest::sessionExpiryTokenPostTest( ) { // Access_token will expire after expires_in seconds, // We need to use the refresh key to get a new one. curl_mockup_reset( ); GDriveSession session = getTestSession( USERNAME, PASSWORD ); curl_mockup_reset( ); static const string folderId("aFileId"); const string folderUrl = BASE_URL + "/files/" + folderId; const string metaUrl = BASE_URL + "/files"; curl_mockup_addResponse( TOKEN_URL.c_str(), "", "POST", DATA_DIR "/gdrive/refresh_response.json", 200, true); curl_mockup_addResponse( folderUrl.c_str( ), "", "GET", DATA_DIR "/gdrive/folder.json", 200, true ); // 401 response, token is expired // refresh and then POST again curl_mockup_addResponse( metaUrl.c_str( ), "", "POST", "", 401, false ); libcmis::FolderPtr parent = session.getFolder( folderId ); try { PropertyPtrMap properties; // POST expires, need to refresh then POST again parent->createFolder( properties ); } catch ( ... ) { if ( session.getHttpStatus( ) == 401 ) { // Check if access token is refreshed CPPUNIT_ASSERT_EQUAL_MESSAGE( "wrong access token", string ( "new-access-token" ), session.m_oauth2Handler->getAccessToken( ) ); } } } void GDriveTest::sessionExpiryTokenDeleteTest( ) { // Access_token will expire after expires_in seconds, // We need to use the refresh key to get a new one. curl_mockup_reset( ); GDriveSession session = getTestSession( USERNAME, PASSWORD ); curl_mockup_reset( ); static const string objectId("aFileId"); string url = BASE_URL + "/files/" + objectId; curl_mockup_addResponse( url.c_str( ), "", "GET", DATA_DIR "/gdrive/document2.json", 200, true); curl_mockup_addResponse( TOKEN_URL.c_str(), "", "POST", DATA_DIR "/gdrive/refresh_response.json", 200, true); // 401 response, token is expired curl_mockup_addResponse( url.c_str( ),"", "DELETE", "", 401, false); libcmis::ObjectPtr obj = session.getObject( objectId ); libcmis::ObjectPtr object = session.getObject( objectId ); try { // DELETE expires, need to refresh then DELETE again object->remove( ); } catch ( ... ) { if ( session.getHttpStatus( ) == 401 ) { // Check if access token is refreshed CPPUNIT_ASSERT_EQUAL_MESSAGE( "wrong access token", string ( "new-access-token" ), session.m_oauth2Handler->getAccessToken( ) ); const struct HttpRequest* deleteRequest = curl_mockup_getRequest( url.c_str( ), "", "DELETE" ); CPPUNIT_ASSERT_MESSAGE( "Delete request not sent", deleteRequest ); } } } void GDriveTest::sessionExpiryTokenPutTest( ) { // Access_token will expire after expires_in seconds, // We need to use the refresh key to get a new one. curl_mockup_reset( ); GDriveSession session = getTestSession( USERNAME, PASSWORD ); curl_mockup_reset( ); static const string objectId("aFileId"); string url = BASE_URL + "/files/" + objectId; curl_mockup_addResponse( TOKEN_URL.c_str(), "", "POST", DATA_DIR "/gdrive/refresh_response.json", 200, true); curl_mockup_addResponse( url.c_str( ), "", "GET", DATA_DIR "/gdrive/document.json", 200, true ); // 401 response, token is expired curl_mockup_addResponse( url.c_str( ),"", "PUT", "", 401, false ); libcmis::ObjectPtr object = session.getObject( objectId ); try { // PUT expires, need to refresh then PUT again object->updateProperties( object->getProperties( ) ); } catch ( ... ) { if ( session.getHttpStatus( ) == 401 ) { // Check if access token is refreshed CPPUNIT_ASSERT_EQUAL_MESSAGE( "wrong access token", string ( "new-access-token" ), session.m_oauth2Handler->getAccessToken( ) ); } } } void GDriveTest::getDocumentTest( ) { curl_mockup_reset( ); static const string objectId ("aFileId"); GDriveSession session = getTestSession( USERNAME, PASSWORD ); string url = BASE_URL + "/files/" + objectId; curl_mockup_addResponse( url.c_str( ), "", "GET", DATA_DIR "/gdrive/document.json", 200, true); libcmis::ObjectPtr obj = session.getObject( objectId ); // Check if we got the document object. libcmis::DocumentPtr document = boost::dynamic_pointer_cast< libcmis::Document >( obj ); CPPUNIT_ASSERT_MESSAGE( "Fetched object should be an instance of libcmis::DocumentPtr", NULL != document ); // Test the document properties CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong document ID", objectId, document->getId( ) ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong document name", string( "GDrive File" ), document->getName( ) ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong document type", string( "application/vnd.google-apps.form" ), document->getContentType( ) ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong base type", string( "cmis:document" ), document->getBaseType( ) ); CPPUNIT_ASSERT_MESSAGE( "CreatedBy is missing", !document->getCreatedBy( ).empty( ) ); CPPUNIT_ASSERT_MESSAGE( "CreationDate is missing", !document->getCreationDate( ).is_not_a_date_time() ); CPPUNIT_ASSERT_MESSAGE( "LastModifiedBy is missing", !document->getLastModifiedBy( ).empty( ) ); CPPUNIT_ASSERT_MESSAGE( "LastModificationDate is missing", !document->getLastModificationDate( ).is_not_a_date_time() ); CPPUNIT_ASSERT_MESSAGE( "Content length is incorrect", 123 == document->getContentLength( ) ); } void GDriveTest::getFolderTest( ) { curl_mockup_reset( ); GDriveSession session = getTestSession( USERNAME, PASSWORD ); static const string folderId( "aFolderId" ); static const string parentId( "parentID" ); string url = BASE_URL + "/files/" + folderId; string parentUrl = BASE_URL + "/files/" + parentId; curl_mockup_addResponse( url.c_str( ), "", "GET", DATA_DIR "/gdrive/folder.json", 200, true); curl_mockup_addResponse( parentUrl.c_str( ), "", "GET", DATA_DIR "/gdrive/folder.json", 200, true); // Check if we got the Folder object. libcmis::FolderPtr folder = session.getFolder( folderId ); CPPUNIT_ASSERT_MESSAGE( "Fetched object should be an instance of libcmis::FolderPtr", NULL != folder ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong folder ID", folderId, folder->getId( ) ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong folder name", string( "testFolder" ), folder->getName( ) ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong base type", string( "cmis:folder" ), folder->getBaseType( ) ); CPPUNIT_ASSERT_MESSAGE( "Missing folder parent", folder->getFolderParent( ).get( ) ); CPPUNIT_ASSERT_MESSAGE( "Not a root folder", !folder->isRootFolder() ); CPPUNIT_ASSERT_MESSAGE( "CreatedBy is missing", !folder->getCreatedBy( ).empty( ) ); CPPUNIT_ASSERT_MESSAGE( "CreationDate is missing", !folder->getCreationDate( ).is_not_a_date_time() ); CPPUNIT_ASSERT_MESSAGE( "LastModifiedBy is missing", !folder->getLastModifiedBy( ).empty( ) ); CPPUNIT_ASSERT_MESSAGE( "LastModificationDate is missing", !folder->getLastModificationDate( ).is_not_a_date_time() ); } void GDriveTest::getDocumentParentsTest( ) { curl_mockup_reset( ); GDriveSession session = getTestSession( USERNAME, PASSWORD ); static const string documentId( "aFileId" ); static const string parentId( "aFolderId" ); static const string parentId2( "aNewFolderId" ); string url = BASE_URL + "/files/" + documentId; curl_mockup_addResponse( url.c_str( ), "", "GET", DATA_DIR "/gdrive/document.json", 200, true); string parent1Url = BASE_URL + "/files/" + parentId; string parent2Url = BASE_URL + "/files/" + parentId2; curl_mockup_addResponse( parent1Url.c_str( ), "", "GET", DATA_DIR "/gdrive/folder.json", 200, true); curl_mockup_addResponse( parent2Url.c_str( ), "", "GET", DATA_DIR "/gdrive/folder2.json", 200, true); libcmis::ObjectPtr object = session.getObject( "aFileId" ); libcmis::DocumentPtr document = boost::dynamic_pointer_cast< libcmis::Document >( object ); CPPUNIT_ASSERT_MESSAGE( "Document expected", document != NULL ); vector< libcmis::FolderPtr > parents= document->getParents( ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Bad number of parents", size_t( 2 ), parents.size() ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong parent Id", parentId, parents[0]->getId( ) ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong parent Id", parentId2, parents[1]->getId( ) ); } void GDriveTest::getContentStreamTest( ) { curl_mockup_reset( ); GDriveSession session = getTestSession( USERNAME, PASSWORD ); static const string documentId( "aFileId" ); string url = BASE_URL + "/files/" + documentId; curl_mockup_addResponse( url.c_str( ), "", "GET", DATA_DIR "/gdrive/document.json", 200, true); string expectedContent( "Test content stream" ); string downloadUrl = "https://downloadLink"; curl_mockup_addResponse( downloadUrl.c_str( ), "", "GET", expectedContent.c_str( ), 0, false ); libcmis::ObjectPtr object = session.getObject( documentId ); libcmis::DocumentPtr document = boost::dynamic_pointer_cast< libcmis::Document >( object ); try { boost::shared_ptr< istream > is = document->getContentStream( ); ostringstream out; out << is->rdbuf(); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Content stream doesn't match", expectedContent, out.str( ) ); } catch ( const libcmis::Exception& e ) { string msg = "Unexpected exception: "; msg += e.what(); CPPUNIT_FAIL( msg.c_str() ); } } void GDriveTest::setContentStreamTest( ) { curl_mockup_reset( ); GDriveSession session = getTestSession( USERNAME, PASSWORD ); const string documentId( "aFileId" ); const string uploadBaseUrl = "https://www.googleapis.com/upload/drive/v2/files/"; string url = BASE_URL + "/files/" + documentId; string putUrl = uploadBaseUrl + documentId; curl_mockup_addResponse( url.c_str( ), "", "GET", DATA_DIR "/gdrive/document2.json", 200, true); libcmis::ObjectPtr object = session.getObject( documentId ); libcmis::DocumentPtr document = boost::dynamic_pointer_cast< libcmis::Document >( object ); curl_mockup_addResponse( url.c_str( ), "", "PUT", DATA_DIR "/gdrive/document2.json", 200, true); curl_mockup_addResponse( putUrl.c_str( ), "", "PUT", "Updated", 0, false ); try { string expectedContent( "Test set content stream" ); boost::shared_ptr< ostream > os ( new stringstream ( expectedContent ) ); string filename( "aFileName" ); document->setContentStream( os, "text/plain", filename ); CPPUNIT_ASSERT_MESSAGE( "Object not refreshed during setContentStream", object->getRefreshTimestamp( ) > 0 ); // Check if metadata has been properly uploaded const char* meta = curl_mockup_getRequestBody( url.c_str( ), "", "PUT" ); string expectedMeta = "{\n \"title\": \"aFileName\"\n}\n"; CPPUNIT_ASSERT_EQUAL_MESSAGE( "Bad meta uploaded", expectedMeta, string( meta ) ); // Check the content has been properly uploaded const char* content = curl_mockup_getRequestBody( putUrl.c_str( ), "", "PUT" ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Bad content uploaded", expectedContent, string( content ) ); } catch ( const libcmis::Exception& e ) { string msg = "Unexpected exception: "; msg += e.what(); CPPUNIT_FAIL( msg.c_str() ); } } void GDriveTest::setContentStreamGdocTest( ) { curl_mockup_reset( ); GDriveSession session = getTestSession( USERNAME, PASSWORD ); const string documentId( "aFileId" ); const string uploadBaseUrl = "https://www.googleapis.com/upload/drive/v2/files/"; string url = BASE_URL + "/files/" + documentId; string putUrl = uploadBaseUrl + documentId; curl_mockup_addResponse( url.c_str( ), "", "GET", DATA_DIR "/gdrive/document.json", 200, true); libcmis::ObjectPtr object = session.getObject( documentId ); libcmis::DocumentPtr document = boost::dynamic_pointer_cast< libcmis::Document >( object ); curl_mockup_addResponse( url.c_str( ), "convert=true", "PUT", DATA_DIR "/gdrive/document.json", 200, true); curl_mockup_addResponse( putUrl.c_str( ), "convert=true", "PUT", "Updated", 0, false ); try { string expectedContent( "Test set content stream" ); boost::shared_ptr< ostream > os ( new stringstream ( expectedContent ) ); string filename( "aFileName" ); document->setContentStream( os, "text/plain", filename ); CPPUNIT_ASSERT_MESSAGE( "Object not refreshed during setContentStream", object->getRefreshTimestamp( ) > 0 ); // Check the content has been properly uploaded const char* content = curl_mockup_getRequestBody( putUrl.c_str( ), "", "PUT" ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Bad content uploaded", expectedContent, string( content ) ); } catch ( const libcmis::Exception& e ) { string msg = "Unexpected exception: "; msg += e.what(); CPPUNIT_FAIL( msg.c_str() ); } } void GDriveTest::getChildrenTest( ) { curl_mockup_reset( ); GDriveSession session = getTestSession( USERNAME, PASSWORD ); static const string folderId ("aFolderId"); string url = BASE_URL + "/files/" + folderId; curl_mockup_addResponse( url.c_str( ), "", "GET", DATA_DIR "/gdrive/folder.json", 200, true); string urlChildFolder = BASE_URL + "/files/" + string ("aChildFolder"); curl_mockup_addResponse( urlChildFolder.c_str( ), "", "GET", DATA_DIR "/gdrive/folder.json", 200, true); string urlChildDocument = BASE_URL + "/files/" + string ("aChildDocument"); curl_mockup_addResponse( urlChildDocument.c_str( ), "", "GET", DATA_DIR "/gdrive/document.json", 200, true); libcmis::ObjectPtr obj = session.getObject( folderId ); // Check if we got the Folder object. libcmis::FolderPtr folder = boost::dynamic_pointer_cast< libcmis::Folder >( obj ); CPPUNIT_ASSERT_MESSAGE( "Folder expected", folder != NULL ); string query = "q=\"" + folderId + "\"+in+parents+and+trashed+=+false"; string childrenUrl = BASE_URL + "/files"; curl_mockup_addResponse( childrenUrl.c_str( ), query.c_str( ), "GET", DATA_DIR "/gdrive/folder_children.json", 200, true); vector< libcmis::ObjectPtr > children= folder->getChildren( ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Bad number of children", size_t( 2 ), children.size() ); int folderCount = 0; int documentCount = 0; for ( vector< libcmis::ObjectPtr >::iterator it = children.begin( ); it != children.end( ); ++it ) { if ( NULL != boost::dynamic_pointer_cast< libcmis::Folder >( *it ) ) ++folderCount; else if ( NULL != boost::dynamic_pointer_cast< libcmis::Document >( *it ) ) ++documentCount; } CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong number of folder children", 1, folderCount ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong number of document children", 1, documentCount ); } void GDriveTest::getTypeTest( ) { curl_mockup_reset( ); GDriveSession session = getTestSession( USERNAME, PASSWORD ); string expectedId( "cmis:document" ); libcmis::ObjectTypePtr actual = session.getType( expectedId ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong Id for fetched type", expectedId, actual->getId( ) ); } void GDriveTest::getRepositoriesTest( ) { curl_mockup_reset( ); GDriveSession session = getTestSession( USERNAME, PASSWORD ); vector< libcmis::RepositoryPtr > actual = session.getRepositories( ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong number of repositories", size_t( 1 ), actual.size( ) ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong repository found", string ( "GoogleDrive" ), actual.front()->getId( ) ); } void GDriveTest::getObjectTest() { static const string objectId ("aFileId"); GDriveSession session = getTestSession( USERNAME, PASSWORD ); string url = BASE_URL + "/files/" + objectId; curl_mockup_addResponse ( url.c_str( ), "", "GET", DATA_DIR "/gdrive/gdoc-file.json", 200, true); libcmis::ObjectPtr object = session.getObject( objectId ); boost::shared_ptr obj = boost::dynamic_pointer_cast (object); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong Object Id", objectId, obj->getId( ) ); } void GDriveTest::getDocumentAllowableActionsTest( ) { curl_mockup_reset( ); static const string objectId ("aFileId"); GDriveSession session = getTestSession( USERNAME, PASSWORD ); string url = BASE_URL + "/files/" + objectId; curl_mockup_addResponse( url.c_str( ), "", "GET", DATA_DIR "/gdrive/document.json", 200, true); libcmis::ObjectPtr obj = session.getObject( objectId ); libcmis::DocumentPtr document = boost::dynamic_pointer_cast< libcmis::Document >( obj ); boost::shared_ptr< libcmis::AllowableActions > actions = document->getAllowableActions( ); CPPUNIT_ASSERT_MESSAGE( "GetContentStream allowable action should be true", actions->isDefined( libcmis::ObjectAction::GetContentStream ) && actions->isAllowed( libcmis::ObjectAction::GetContentStream ) ); CPPUNIT_ASSERT_MESSAGE( "CreateDocument allowable action should be false", actions->isDefined( libcmis::ObjectAction::CreateDocument ) && !actions->isAllowed( libcmis::ObjectAction::CreateDocument ) ); } void GDriveTest::getFolderAllowableActionsTest( ) { curl_mockup_reset( ); static const string folderId ("aFolderId"); GDriveSession session = getTestSession( USERNAME, PASSWORD ); string url = BASE_URL + "/files/" + folderId; curl_mockup_addResponse( url.c_str( ), "", "GET", DATA_DIR "/gdrive/folder.json", 200, true); libcmis::FolderPtr folder = session.getFolder( folderId ); boost::shared_ptr< libcmis::AllowableActions > actions = folder->getAllowableActions( ); CPPUNIT_ASSERT_MESSAGE( "CreateDocument allowable action should be true", actions->isDefined( libcmis::ObjectAction::CreateDocument ) && actions->isAllowed( libcmis::ObjectAction::CreateDocument ) ); CPPUNIT_ASSERT_MESSAGE( "GetContentStream allowable action should be false", actions->isDefined( libcmis::ObjectAction::GetContentStream ) && !actions->isAllowed( libcmis::ObjectAction::GetContentStream ) ); } void GDriveTest::checkOutTest( ) { curl_mockup_reset( ); GDriveSession session = getTestSession( USERNAME, PASSWORD ); static const string documentId( "aFileId" ); string url = BASE_URL + "/files/" + documentId; curl_mockup_addResponse( url.c_str( ), "", "GET", DATA_DIR "/gdrive/document.json", 200, true); libcmis::ObjectPtr object = session.getObject( documentId ); libcmis::DocumentPtr document = boost::dynamic_pointer_cast< libcmis::Document >( object ); libcmis::DocumentPtr checkout = document->checkOut( ); CPPUNIT_ASSERT_MESSAGE( "CheckOut failed", NULL != checkout ); } void GDriveTest::checkInTest( ) { curl_mockup_reset( ); GDriveSession session = getTestSession( USERNAME, PASSWORD ); const string documentId( "aFileId" ); const string uploadBaseUrl = "https://www.googleapis.com/upload/drive/v2/files/"; string url = BASE_URL + "/files/" + documentId; string putUrl = uploadBaseUrl + documentId; curl_mockup_addResponse( url.c_str( ), "", "GET", DATA_DIR "/gdrive/document2.json", 200, true); libcmis::ObjectPtr object = session.getObject( documentId ); libcmis::DocumentPtr document = boost::dynamic_pointer_cast< libcmis::Document >( object ); curl_mockup_addResponse( url.c_str( ), "", "PUT", DATA_DIR "/gdrive/document2.json", 200, true); curl_mockup_addResponse( putUrl.c_str( ), "", "PUT", "Updated", 0, false ); string expectedContent( "content stream" ); boost::shared_ptr< ostream > os ( new stringstream ( expectedContent ) ); string filename( "aFileName" ); const PropertyPtrMap& properties = document->getProperties( ); libcmis::DocumentPtr checkIn = document->checkIn( true, "", properties, os, "text/plain", filename); CPPUNIT_ASSERT_MESSAGE( "CheckIn failed", NULL != checkIn ); } void GDriveTest::deleteTest( ) { curl_mockup_reset( ); GDriveSession session = getTestSession( USERNAME, PASSWORD ); const string objectId( "aFileId" ); string url = BASE_URL + "/files/" + objectId; curl_mockup_addResponse( url.c_str( ), "", "GET", DATA_DIR "/gdrive/document2.json", 200, true); curl_mockup_addResponse( url.c_str( ),"", "DELETE", "", 204, false); libcmis::ObjectPtr object = session.getObject( objectId ); object->remove( ); const struct HttpRequest* deleteRequest = curl_mockup_getRequest( url.c_str( ), "", "DELETE" ); CPPUNIT_ASSERT_MESSAGE( "Delete request not sent", deleteRequest ); } void GDriveTest::moveTest( ) { curl_mockup_reset( ); GDriveSession session = getTestSession( USERNAME, PASSWORD ); const string objectId( "aFileId" ); const string sourceId( "aFolderId" ); const string desId( "aNewFolderId" ); string url = BASE_URL + "/files/" + objectId; string sourceUrl = BASE_URL + "/files/" + sourceId; string desUrl = BASE_URL + "/files/" + desId; curl_mockup_addResponse( url.c_str( ), "", "GET", DATA_DIR "/gdrive/document2.json", 200, true ); curl_mockup_addResponse( url.c_str( ), "", "PUT", DATA_DIR "/gdrive/document2.json", 200, true ); curl_mockup_addResponse( sourceUrl.c_str( ), "", "GET", DATA_DIR "/gdrive/folder.json", 200, true ); curl_mockup_addResponse( desUrl.c_str( ), "", "GET", DATA_DIR "/gdrive/folder2.json", 200, true ); libcmis::ObjectPtr object = session.getObject( objectId ); libcmis::FolderPtr source = session.getFolder( sourceId ); libcmis::FolderPtr destination = session.getFolder( desId ); object->move( source, destination ); const char* moveRequest = curl_mockup_getRequestBody( url.c_str( ), "", "PUT" ); Json parentJson = Json::parse( string( moveRequest ) ); string newParentId = parentJson["parents"].getList().front()["id"].toString( ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Bad new parent folder", desId, newParentId); } void GDriveTest::createDocumentTest( ) { curl_mockup_reset( ); GDriveSession session = getTestSession( USERNAME, PASSWORD ); const string documentId( "aFileId" ); const string folderId( "aFolderId" ); const string folderUrl = BASE_URL + "/files/" + folderId; const string metaUrl = BASE_URL + "/files/"; const string uploadBaseUrl = "https://www.googleapis.com/upload/drive/v2/files/"; string uploadUrl = uploadBaseUrl + documentId; string documentUrl = metaUrl + documentId; curl_mockup_addResponse( folderUrl.c_str( ), "", "GET", DATA_DIR "/gdrive/folder.json", 200, true ); curl_mockup_addResponse( metaUrl.c_str( ), "", "POST", DATA_DIR "/gdrive/document.json", 200, true ); curl_mockup_addResponse( uploadUrl.c_str( ), "", "PUT", "updated", 0, false ); curl_mockup_addResponse( documentUrl.c_str( ), "", "GET", DATA_DIR "/gdrive/document2.json", 200, true); libcmis::FolderPtr parent = session.getFolder( folderId ); try { string expectedContent( "Test set content stream" ); boost::shared_ptr< ostream > os ( new stringstream ( expectedContent ) ); string filename( "aFileName" ); PropertyPtrMap properties; // function to test parent->createDocument( properties, os, "text/plain", filename ); const char* createRequest = curl_mockup_getRequestBody( metaUrl.c_str( ), "", "POST" ); Json request = Json::parse( string( createRequest ) ); string sentParentId = request["parents"].getList( ).front( )["id"].toString( ); string sentFilename = request["title"].toString( ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Bad parents sent", folderId, sentParentId ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Bad filename sent", filename, sentFilename ); const char* content = curl_mockup_getRequestBody( uploadUrl.c_str( ), "", "PUT" ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Bad content uploaded", expectedContent, string( content ) ); } catch ( const libcmis::Exception& e ) { string msg = "Unexpected exception: "; msg += e.what(); CPPUNIT_FAIL( msg.c_str() ); } } void GDriveTest::createFolderTest( ) { curl_mockup_reset( ); GDriveSession session = getTestSession( USERNAME, PASSWORD ); const string folderId( "aFolderId" ); const string folderUrl = BASE_URL + "/files/" + folderId; const string metaUrl = BASE_URL + "/files"; curl_mockup_addResponse( folderUrl.c_str( ), "", "GET", DATA_DIR "/gdrive/folder.json", 200, true ); curl_mockup_addResponse( metaUrl.c_str( ), "", "POST", DATA_DIR "/gdrive/folder2.json", 200, true ); libcmis::FolderPtr parent = session.getFolder( folderId ); try { PropertyPtrMap properties; // function to test parent->createFolder( properties ); const char* createRequest = curl_mockup_getRequestBody( metaUrl.c_str( ), "", "POST" ); Json request = Json::parse( string( createRequest ) ); string sentParentId = request["parents"].getList( ).front( )["id"].toString( ); string sentMimeType = request["mimeType"].toString( ); string expectedMimeType( "application/vnd.google-apps.folder" ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Bad parents sent", folderId, sentParentId ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Bad mimeType", expectedMimeType, sentMimeType ); } catch ( const libcmis::Exception& e ) { string msg = "Unexpected exception: "; msg += e.what(); CPPUNIT_FAIL( msg.c_str() ); } } void GDriveTest::removeTreeTest( ) { curl_mockup_reset( ); GDriveSession session = getTestSession( USERNAME, PASSWORD ); const string folderId( "aFolderId" ); const string folderUrl = BASE_URL + "/files/" + folderId; const string trashUrl = folderUrl + "/trash"; curl_mockup_addResponse( folderUrl.c_str( ), "", "GET", DATA_DIR "/gdrive/folder.json", 200, true ); curl_mockup_addResponse( trashUrl.c_str( ), "", "POST", "", 200, false ); libcmis::FolderPtr folder = session.getFolder( folderId ); // just make sure it doesn't crash folder->removeTree( ); } void GDriveTest::getContentStreamWithRenditionsTest( ) { curl_mockup_reset( ); GDriveSession session = getTestSession( USERNAME, PASSWORD ); static const string documentId( "aFileId" ); string url = BASE_URL + "/files/" + documentId; curl_mockup_addResponse( url.c_str( ), "", "GET", DATA_DIR "/gdrive/document.json", 200, true); libcmis::ObjectPtr object = session.getObject( documentId ); libcmis::DocumentPtr document = boost::dynamic_pointer_cast< libcmis::Document >( object ); // pdf stream string pdfContent( "pdf Content stream" ); string pdfUrl = "pdflink"; curl_mockup_addResponse( pdfUrl.c_str( ), "", "GET", pdfContent.c_str( ), 0, false ); try { boost::shared_ptr< istream > is = document->getContentStream( "application/pdf" ); ostringstream out; out << is->rdbuf(); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Content stream doesn't match", pdfContent, out.str( ) ); } catch ( const libcmis::Exception& e ) { string msg = "Unexpected exception: "; msg += e.what(); CPPUNIT_FAIL( msg.c_str() ); } // ODF stream string odfContent( "open document Content stream" ); string odfUrl = "https://downloadLink"; curl_mockup_addResponse( odfUrl.c_str( ), "", "GET", odfContent.c_str( ), 0, false ); try { boost::shared_ptr< istream > is = document->getContentStream( "application/x-vnd.oasis.opendocument.spreadsheet" ); ostringstream out; out << is->rdbuf(); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Content stream doesn't match", odfContent, out.str( ) ); } catch ( const libcmis::Exception& e ) { string msg = "Unexpected exception: "; msg += e.what(); CPPUNIT_FAIL( msg.c_str() ); } // MS stream string msContent( "office document Content stream" ); string msUrl = "xlslink"; curl_mockup_addResponse( msUrl.c_str( ), "", "GET", msContent.c_str( ), 0, false ); try { boost::shared_ptr< istream > is = document->getContentStream( "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" ); ostringstream out; out << is->rdbuf(); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Content stream doesn't match", msContent, out.str( ) ); } catch ( const libcmis::Exception& e ) { string msg = "Unexpected exception: "; msg += e.what(); CPPUNIT_FAIL( msg.c_str() ); } } void GDriveTest::updatePropertiesTest( ) { curl_mockup_reset( ); GDriveSession session = getTestSession( USERNAME, PASSWORD ); const string documentId( "aFileId" ); const string documentUrl = BASE_URL + "/files/" + documentId; curl_mockup_addResponse( documentUrl.c_str( ), "", "GET", DATA_DIR "/gdrive/document.json", 200, true ); curl_mockup_addResponse( documentUrl.c_str( ), "", "PUT", DATA_DIR "/gdrive/document.json", 200, true ); libcmis::ObjectPtr document = session.getObject( documentId ); document->updateProperties( document->getProperties( ) ); const char* updateRequest = curl_mockup_getRequestBody( documentUrl.c_str( ), "", "PUT" ); // Check if properties keys are properly converted back before sending Json json = Json::parse( string( updateRequest ) ); string id = json["id"].toString( ); string createdDate = json["createdDate"].toString( ); string title = json["title"].toString( ); string mimeType = json["mimeType"].toString( ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "id key not converted", documentId, id ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "createdDate key not converted", string( "2010-04-28T14:53:23.141Z"), createdDate ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "title key not converted", string( "GDrive File"), title ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "mimeType key not converted", string( "application/vnd.google-apps.form"), mimeType ); } void GDriveTest::getRefreshTokenTest( ) { curl_mockup_reset( ); GDriveSession session = getTestSession( USERNAME, PASSWORD ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Refresh token does not match", string ("mock-refresh-token"), session.getRefreshToken( ) ); } void GDriveTest::getThumbnailUrlTest( ) { curl_mockup_reset( ); GDriveSession session = getTestSession( USERNAME, PASSWORD ); const string documentId( "aFileId" ); const string documentUrl = BASE_URL + "/files/" + documentId; curl_mockup_addResponse( documentUrl.c_str( ), "", "GET", DATA_DIR "/gdrive/document.json", 200, true ); libcmis::ObjectPtr document = session.getObject( documentId ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Thumbnail URL does not match", string ("https://aThumbnailLink"), document->getThumbnailUrl( ) ); } void GDriveTest::getAllVersionsTest( ) { curl_mockup_reset( ); static const string objectId ("aFileId"); GDriveSession session = getTestSession( USERNAME, PASSWORD ); string url = BASE_URL + "/files/" + objectId; curl_mockup_addResponse( url.c_str( ), "", "GET", DATA_DIR "/gdrive/document.json", 200, true); string revisionUrl = url + "/revisions"; curl_mockup_addResponse( revisionUrl.c_str( ), "", "GET", DATA_DIR "/gdrive/allVersions.json", 200, true); libcmis::ObjectPtr obj = session.getObject( objectId ); libcmis::DocumentPtr document = boost::dynamic_pointer_cast< libcmis::Document >( obj ); // Method to test vector< libcmis::DocumentPtr > versions = document->getAllVersions( ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong number of versions", size_t( 3 ), versions.size( ) ); } CPPUNIT_TEST_SUITE_REGISTRATION( GDriveTest ); libcmis-0.4.1/qa/libcmis/test-soap.cxx0000644000175000001440000004536212156277657014575 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2011 SUSE * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #include #include #include #include #include "ws-relatedmultipart.hxx" #include "ws-requests.hxx" #include "ws-soap.hxx" #include "test-helpers.hxx" using namespace std; class SoapTest : public CppUnit::TestFixture { private: map< string, SoapResponseCreator > getTestMapping( ); map< string, string > getTestNamespaces( ); map< string, SoapFaultDetailCreator > getTestDetailMapping( ); public: // Soap Responses tests void createResponseTest( ); void parseFaultDetailEmptyTest( ); void parseFaultDetailUnknownTest( ); void parseFaultDetailValidTest( ); void createFaultDefaultTest( ); void parseResponseTest( ); void parseResponseFaultTest( ); // RelatedMultipart tests void serializeMultipartSimpleTest( ); void serializeMultipartComplexTest( ); void parseMultipartTest( ); void getStreamFromNodeXopTest( ); void getStreamFromNodeBase64Test( ); // CMISM utilities tests void writeCmismStreamTest( ); CPPUNIT_TEST_SUITE( SoapTest ); CPPUNIT_TEST( createResponseTest ); CPPUNIT_TEST( parseFaultDetailEmptyTest ); CPPUNIT_TEST( parseFaultDetailUnknownTest ); CPPUNIT_TEST( parseFaultDetailValidTest ); CPPUNIT_TEST( parseResponseTest ); CPPUNIT_TEST( parseResponseFaultTest ); CPPUNIT_TEST( serializeMultipartSimpleTest ); CPPUNIT_TEST( serializeMultipartComplexTest ); CPPUNIT_TEST( parseMultipartTest ); CPPUNIT_TEST( getStreamFromNodeXopTest ); CPPUNIT_TEST( getStreamFromNodeBase64Test ); CPPUNIT_TEST( writeCmismStreamTest ); CPPUNIT_TEST_SUITE_END( ); }; CPPUNIT_TEST_SUITE_REGISTRATION( SoapTest ); /** Dummy response class to use for testing */ class TestResponse : public SoapResponse { private: TestResponse( ) { }; public: static SoapResponsePtr create( xmlNodePtr, RelatedMultipart&, SoapSession* ) { SoapResponsePtr resp ( new TestResponse( ) ); return resp; } }; class TestFaultDetail : public SoapFaultDetail { private: TestFaultDetail( ) : SoapFaultDetail( ) { }; public: ~TestFaultDetail( ) throw ( ) { }; static SoapFaultDetailPtr create( xmlNodePtr ) { return SoapFaultDetailPtr( new TestFaultDetail( ) ); } }; map< string, SoapResponseCreator > SoapTest::getTestMapping( ) { map< string, SoapResponseCreator > mapping; mapping[ "{test-ns-url}testResponse" ] = &TestResponse::create; return mapping; } map< string, SoapFaultDetailCreator > SoapTest::getTestDetailMapping( ) { map< string, SoapFaultDetailCreator > mapping; mapping[ "{test-ns-url}testFault" ] = &TestFaultDetail::create; return mapping; } map< string, string > SoapTest::getTestNamespaces( ) { map< string, string > namespaces; namespaces[ "test" ] = "test-ns-url"; return namespaces; } void SoapTest::createResponseTest( ) { SoapResponseFactory factory; factory.setMapping( getTestMapping() ); factory.setNamespaces( getTestNamespaces( ) ); factory.setDetailMapping( getTestDetailMapping( ) ); string xml = ""; RelatedMultipart multipart; // Multipart won't be used in that test SoapResponsePtr actual = factory.createResponse( test::getXmlNode( xml ), multipart ); CPPUNIT_ASSERT_MESSAGE( "Wrong response created", dynamic_cast< TestResponse* >( actual.get( ) ) != NULL ); } void SoapTest::parseFaultDetailEmptyTest( ) { SoapResponseFactory factory; factory.setMapping( getTestMapping() ); factory.setNamespaces( getTestNamespaces( ) ); factory.setDetailMapping( getTestDetailMapping( ) ); string xml = ""; vector< SoapFaultDetailPtr > actual = factory.parseFaultDetail( test::getXmlNode( xml ) ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Shouldn't have any detail", size_t( 0 ), actual.size() ); } void SoapTest::parseFaultDetailUnknownTest( ) { SoapResponseFactory factory; factory.setMapping( getTestMapping() ); factory.setNamespaces( getTestNamespaces( ) ); factory.setDetailMapping( getTestDetailMapping( ) ); string xml = ""; vector< SoapFaultDetailPtr > actual = factory.parseFaultDetail( test::getXmlNode( xml ) ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Shouldn't have ignored unknonw details", size_t( 0 ), actual.size() ); } void SoapTest::parseFaultDetailValidTest( ) { SoapResponseFactory factory; factory.setMapping( getTestMapping() ); factory.setNamespaces( getTestNamespaces( ) ); factory.setDetailMapping( getTestDetailMapping( ) ); string xml = ""; vector< SoapFaultDetailPtr > actual = factory.parseFaultDetail( test::getXmlNode( xml ) ); CPPUNIT_ASSERT_MESSAGE( "Wrong fault detail created", dynamic_cast< TestFaultDetail* >( actual.front( ).get( ) ) != NULL ); } void SoapTest::parseResponseTest( ) { SoapResponseFactory factory; factory.setMapping( getTestMapping() ); factory.setNamespaces( getTestNamespaces( ) ); factory.setDetailMapping( getTestDetailMapping( ) ); string xml = "" "" "" ""; string name( "name" ); string type( "application/xop+xml" ); RelatedPartPtr requestPart( new RelatedPart( name, type, xml ) ); RelatedMultipart multipart; string cid = multipart.addPart( requestPart ); string startInfo( "text/xml" ); multipart.setStart( cid, startInfo ); vector< SoapResponsePtr > actual = factory.parseResponse( multipart ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong number of responses", size_t( 2 ), actual.size( ) ); } void SoapTest::parseResponseFaultTest( ) { SoapResponseFactory factory; factory.setMapping( getTestMapping() ); factory.setNamespaces( getTestNamespaces( ) ); factory.setDetailMapping( getTestDetailMapping( ) ); string xml = "" " " " S:Client" " Some Error Message" " " " " ""; string name( "name" ); string type( "application/xop+xml" ); RelatedPartPtr requestPart( new RelatedPart( name, type, xml ) ); RelatedMultipart multipart; string cid = multipart.addPart( requestPart ); string startInfo( "text/xml" ); multipart.setStart( cid, startInfo ); try { factory.parseResponse( multipart ); CPPUNIT_FAIL( "Should have thrown the SoapFault" ); } catch ( const SoapFault& e ) { CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong detail string", string( "Some Error Message" ), e.getFaultstring() ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong detail string", string( "Client" ), e.getFaultcode() ); CPPUNIT_ASSERT_MESSAGE( "Wrong fault detail created", dynamic_cast< TestFaultDetail* >( e.getDetail( ).front( ).get( ) ) != NULL ); } } void SoapTest::serializeMultipartSimpleTest( ) { string partName = "data"; string partType = "text/plain"; string partContent = "Some content"; string startInfo = "some info"; RelatedMultipart multipart; RelatedPartPtr part( new RelatedPart( partName, partType, partContent ) ); string cid = multipart.addPart( part ); multipart.setStart( cid, startInfo ); boost::shared_ptr< istringstream > actual = multipart.toStream( ); string boundary = multipart.getBoundary( ); string expected = "\r\n--" + boundary + "\r\n" + "Content-Id: <" + cid + ">\r\n" + "Content-Type: " + partType + "\r\n" + "Content-Transfer-Encoding: binary\r\n" + "\r\n" + partContent + "\r\n--" + boundary + "--\r\n"; CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong body", expected, actual->str() ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong content type", "multipart/related;start=\"" + cid + "\";type=\"" + partType + "\";boundary=\"" + boundary + "\";start-info=\"" + startInfo + "\"", multipart.getContentType() ); } void SoapTest::serializeMultipartComplexTest( ) { string rootName = "root"; string rootType = "text/plain"; string rootContent = "Some content"; string part2Name = "part2"; string part2Type = "application/octet-stream"; string part2Content = "Some content 2"; string startInfo = "some info"; RelatedMultipart multipart; RelatedPartPtr rootPart( new RelatedPart( rootName, rootType, rootContent ) ); string rootCid = multipart.addPart( rootPart ); RelatedPartPtr part2( new RelatedPart( part2Name, part2Type, part2Content ) ); string part2Cid = multipart.addPart( part2 ); multipart.setStart( rootCid, startInfo ); boost::shared_ptr< istringstream > actual = multipart.toStream( ); string boundary = multipart.getBoundary( ); string expected = "\r\n--" + boundary + "\r\n" + "Content-Id: <" + rootCid + ">\r\n" + "Content-Type: " + rootType + "\r\n" + "Content-Transfer-Encoding: binary\r\n" + "\r\n" + rootContent + "\r\n--" + boundary + "\r\n" + "Content-Id: <" + part2Cid + ">\r\n" + "Content-Type: " + part2Type + "\r\n" + "Content-Transfer-Encoding: binary\r\n" + "\r\n" + part2Content + "\r\n--" + boundary + "--\r\n"; CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong body", expected, actual->str() ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong content type", "multipart/related;start=\"" + rootCid + "\";type=\"" + rootType + "\";boundary=\"" + boundary + "\";start-info=\"" + startInfo + "\"", multipart.getContentType() ); } void SoapTest::parseMultipartTest( ) { string rootCid = "root-cid"; string rootType = "text/plain"; string rootContent = "Some content"; string part2Cid = "part2-cid"; string part2Type = "application/octet-stream"; string part2Content = "Some content 2"; string startInfo = "some info"; string boundary = "------------ABCDEF-Boundary"; string body = "\r\n--" + boundary + "\r\n" + "Content-Id: <" + rootCid + ">\r\n" + "Content-Type: " + rootType + "\r\n" + "Content-Transfer-Encoding: binary\r\n" + "\r\n" + rootContent + "\r\n--" + boundary + "\r\n" + // Voluntarily make a case-sensitivity error to test the SharePoint case "Content-ID: <" + part2Cid + ">\r\n" + "Content-Type: " + part2Type + "\r\n" + "Content-Transfer-Encoding: binary\r\n" + "\r\n" + part2Content + "\r\n--" + boundary + "--\r\n"; // Added a space before one of the items as it may happen string contentType = "multipart/related; start=\"" + rootCid + "\";type=\"" + rootType + "\";" + "boundary=\"" + boundary + "\";start-info=\"" + startInfo + "\""; RelatedMultipart multipart( body, contentType ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong start Content id", rootCid, multipart.getStartId( ) ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong start info", startInfo, multipart.getStartInfo( ) ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong boundary", boundary, multipart.getBoundary( ) ); vector< string > cids = multipart.getIds( ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong number of parts parsed", size_t( 2 ), cids.size( ) ); RelatedPartPtr actualRoot = multipart.getPart( rootCid ); CPPUNIT_ASSERT_MESSAGE( "No part corresponding to root cid", actualRoot.get( ) != NULL ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong root part content type", rootType, actualRoot->getContentType( ) ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong root part content", rootContent, actualRoot->getContent( ) ); RelatedPartPtr actualPart2 = multipart.getPart( part2Cid ); CPPUNIT_ASSERT_MESSAGE( "No part corresponding to part2 cid", actualPart2.get( ) != NULL ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong part2 part content type", part2Type, actualPart2->getContentType( ) ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong part2 part content", part2Content, actualPart2->getContent( ) ); } void SoapTest::getStreamFromNodeXopTest( ) { // Create the test multipart string dataCid = "http://data-cid"; string dataCidEncoded = "http%3A%2F%2Fdata-cid"; string dataContent = "Some transfered content"; string boundary = "------------ABCDEF-Boundary"; string body = "\r\n--" + boundary + "\r\n" + "Content-Id: \r\n" + "Content-Type: text/plain\r\n" + "Content-Transfer-Encoding: binary\r\n" + "\r\n" + "Who cares? we assume, this has been properly extracted in this test" + "\r\n--" + boundary + "\r\n" + "Content-Id: " + dataCid + "\r\n" + "Content-Type: text/plain\r\n" + "Content-Transfer-Encoding: binary\r\n" + "\r\n" + dataContent + "\r\n--" + boundary + "--\r\n"; string contentType = string( "multipart/related;start=\"root-cid\";type=\"text/plain\";" ) + "boundary=\"" + boundary + "\";start-info=\"info\""; RelatedMultipart multipart( body, contentType ); // Create test node stringstream buf; buf << "" << " " << ""; xmlNodePtr node = test::getXmlNode( buf.str( ) ); // Run the tested method boost::shared_ptr< istream > stream = getStreamFromNode( node, multipart ); // Checks stringstream out; out << stream->rdbuf( ); CPPUNIT_ASSERT_EQUAL( dataContent, out.str( ) ); } void SoapTest::getStreamFromNodeBase64Test( ) { // Create the test multipart string boundary = "------------ABCDEF-Boundary"; string body = "\r\n--" + boundary + "\r\n" + "Content-Id: \r\n" + "Content-Type: text/plain\r\n" + "Content-Transfer-Encoding: binary\r\n" + "\r\n" + "Who cares? we assume, this has been properly extracted in this test" + "\r\n--" + boundary + "--\r\n"; string contentType = string( "multipart/related;start=\"root-cid\";type=\"text/plain\";" ) + "boundary=\"" + boundary + "\";start-info=\"info\""; RelatedMultipart multipart( body, contentType ); // Create test node string dataContent = "U29tZSB0cmFuc2ZlcmVkIGNvbnRlbnQ="; string expectedContent = "Some transfered content"; stringstream buf; buf << "" << dataContent << ""; xmlNodePtr node = test::getXmlNode( buf.str( ) ); // Run the tested method boost::shared_ptr< istream > stream = getStreamFromNode( node, multipart ); // Checks stringstream out; out << stream->rdbuf( ); CPPUNIT_ASSERT_EQUAL( expectedContent, out.str( ) ); } void SoapTest::writeCmismStreamTest( ) { // Initialize the writer xmlBufferPtr buf = xmlBufferCreate( ); xmlTextWriterPtr writer = xmlNewTextWriterMemory( buf, 0 ); xmlTextWriterStartDocument( writer, NULL, NULL, NULL ); // Test writeCmismStream RelatedMultipart multipart; string contentType( "text/plain" ); string content( "Expected content" ); string filename( "name.txt" ); boost::shared_ptr< ostream > os( new stringstream( content ) ); writeCmismStream( writer, multipart, os, contentType, filename ); // Close the writer and check the results xmlTextWriterEndDocument( writer ); string str( ( const char * )xmlBufferContent( buf ) ); vector< string > ids = multipart.getIds( ); CPPUNIT_ASSERT_EQUAL( size_t( 1 ), ids.size( ) ); string partId = ids.front( ); RelatedPartPtr part = multipart.getPart( partId ); CPPUNIT_ASSERT_MESSAGE( "Missing stream related part", part.get( ) != NULL ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Content not properly attached", content, part->getContent( ) ); stringstream expectedXml; expectedXml << "\n" << "" << content.size( ) << "" << "" << contentType << "" << "" << filename << "" << "" << "" << "\n"; CPPUNIT_ASSERT_EQUAL_MESSAGE( "Envelope part isn't correct", expectedXml.str( ), str ); // Free it all xmlFreeTextWriter( writer ); xmlBufferFree( buf ); } libcmis-0.4.1/qa/libcmis/test-jsonutils.cxx0000644000175000001440000001322112173212453015630 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2013 Cao Cuong Ngo * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #include #include #include #include #include #include #define private public #define protected public #include "json-utils.hxx" #include "property.hxx" #include "property-type.hxx" using namespace std; using namespace libcmis; class JsonTest : public CppUnit::TestFixture { public: void parseTest( ); void parseTypeTest( ); void createFromPropertyTest( ); void createFromPropertiesTest( ); void badKeyTest( ); void addTest( ); CPPUNIT_TEST_SUITE( JsonTest ); CPPUNIT_TEST( parseTest ); CPPUNIT_TEST( parseTypeTest ); CPPUNIT_TEST( createFromPropertyTest ); CPPUNIT_TEST( createFromPropertiesTest ); CPPUNIT_TEST( badKeyTest ); CPPUNIT_TEST( addTest ); CPPUNIT_TEST_SUITE_END( ); }; string getFileContents( const char *filename) { std::ifstream in( filename, std::ios::in | std::ios::binary ); if (in) { std::string contents; in.seekg( 0, std::ios::end ); contents.resize(in.tellg( ) ); in.seekg( 0, std::ios::beg ); in.read( &contents[0], contents.size( ) ); in.close( ); return contents; } throw ( errno ); } Json parseFile( string fileName ) { Json json = Json::parse( getFileContents( fileName.c_str( ) ) ); return json; } void JsonTest::parseTest( ) { Json json = parseFile( DATA_DIR "/gdrive/jsontest-good.json" ); string kind = json["kind"].toString( ); string id = json["id"].toString( ); string mimeType = json["mimeType"].toString( ); string createdDate = json["createdDate"].toString( ); string intTest = json["intTest"].toString( ); string doubleTest = json["doubleTest"].toString( ); string editable = json["editable"].toString( ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong kind", string( "drive#file" ), kind ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong id", string( "aFileId"), id ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong mimeType", string( "application/vnd.google-apps.form"), mimeType ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong createdDate", string( "2010-04-28T14:53:23.141Z"), createdDate ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong intTest", string("-123"), intTest ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong doubleTest", string("-123.456"), doubleTest ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong editable", string( "true"), editable ); } void JsonTest::parseTypeTest( ) { Json json = parseFile( DATA_DIR "/gdrive/jsontest-good.json" ); Json::Type stringType = json["kind"].getDataType( ); Json::Type boolType = json["editable"].getDataType( ); Json::Type intType = json["intTest"].getDataType( ); Json::Type doubleType = json["doubleTest"].getDataType( ); Json::Type dateTimeType = json["createdDate"].getDataType( ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong string type", Json::json_string, stringType ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong bool type", Json::json_bool, boolType ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong int type", Json::json_int, intType ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong double type", Json::json_double, doubleType ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong datetime type", Json::json_datetime, dateTimeType ); } void JsonTest::createFromPropertyTest( ) { vector< string > values; string expected("Value 1" ); values.push_back( expected ); PropertyTypePtr propertyType( new PropertyType( ) ); PropertyPtr property( new Property( propertyType, values ) ); Json json( property ); CPPUNIT_ASSERT_EQUAL( expected, json.toString( ) ); } void JsonTest::createFromPropertiesTest( ) { vector< string > values; string expected( "value" ); values.push_back( "value" ); PropertyTypePtr propertyType( new PropertyType( ) ); PropertyPtr property( new libcmis::Property( propertyType, values ) ); PropertyPtrMap properties; properties[ "key" ] = property; Json json( properties ); CPPUNIT_ASSERT_EQUAL( expected, json["key"].toString( ) ); } void JsonTest::badKeyTest( ) { Json json = parseFile( DATA_DIR "/gdrive/jsontest-good.json" ); // just make sure it doesn't crash here string notExist = json["nonExistedKey"].toString( ); CPPUNIT_ASSERT_EQUAL( string( ), notExist); } void JsonTest::addTest( ) { Json json = parseFile( DATA_DIR "/gdrive/jsontest-good.json" ); Json addJson("added"); json.add( "new", addJson); CPPUNIT_ASSERT_EQUAL( addJson.toString( ), json["new"].toString( ) ); } CPPUNIT_TEST_SUITE_REGISTRATION( JsonTest ); libcmis-0.4.1/qa/mockup/0000755000175000001440000000000012200457455012036 500000000000000libcmis-0.4.1/qa/mockup/mockup-config.h0000644000175000001440000000650212200225743014664 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2011 SUSE * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #include #ifdef __cplusplus extern "C" { #endif /* Mockup behavior configuration functions */ void curl_mockup_reset( ); /** Add a new HTTP response the server should send. \param baseURL the base URL of the request without parameters \param matchParam a string to find in the parameters part of the URL to match \param response a string corresponding either to the file path of the request body to send or directly the content to send. This value has a different meaning depending on isFilePath parameter. \param method HTTP method to match like PUT, GET, POST or DELETE. An empty string matches any method. \param status the HTTP status to return. 0 means HTTP OK (200). \param isFilePath if this value is true the response value is used as a file path, otherwise, the response value is used as the body of the HTTP response to send. \param headers the HTTP headers block to send with the response. By default no header is sent. */ void curl_mockup_addResponse( const char* baseUrl, const char* matchParam, const char* method, const char* response, unsigned int status = 0, bool isFilePath = true, const char* headers = 0 ); /** Set the HTTP response the server is supposed to send. This will reset all already defined responses. */ void curl_mockup_setResponse( const char* filepath ); void curl_mockup_setCredentials( const char* username, const char* password ); struct HttpRequest { const char* url; const char* body; }; const struct HttpRequest* curl_mockup_getRequest( const char* baseUrl, const char* matchParam, const char* method ); const char* curl_mockup_getRequestBody( const char* baseUrl, const char* matchParam, const char* method ); const char* curl_mockup_getProxy( CURL* handle ); const char* curl_mockup_getNoProxy( CURL* handle ); const char* curl_mockup_getProxyUser( CURL* handle ); const char* curl_mockup_getProxyPass( CURL* handle ); /** Set a fake invalid certificate to raise CURLE_SSL_CACERT. Setting it to an empty string will reset to no certificate. */ void curl_mockup_setSSLBadCertificate( const char* certificate ); #ifdef __cplusplus } #endif libcmis-0.4.1/qa/mockup/Makefile.in0000644000175000001440000004657412200457433014037 00000000000000# Makefile.in generated by automake 1.13.4 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = qa/mockup DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/boost.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) @OS_WIN32_FALSE@libcmis_mockup_la_DEPENDENCIES = \ @OS_WIN32_FALSE@ $(top_builddir)/src/libcmis/libcmis.la am__libcmis_mockup_la_SOURCES_DIST = curl-mockup.cxx internals.hxx \ mockup-config.cxx mockup-config.h curl/curl.h @OS_WIN32_FALSE@am_libcmis_mockup_la_OBJECTS = curl-mockup.lo \ @OS_WIN32_FALSE@ mockup-config.lo libcmis_mockup_la_OBJECTS = $(am_libcmis_mockup_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = libcmis_mockup_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CXXLD) \ $(AM_CXXFLAGS) $(CXXFLAGS) $(libcmis_mockup_la_LDFLAGS) \ $(LDFLAGS) -o $@ @OS_WIN32_FALSE@am_libcmis_mockup_la_rpath = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CXXFLAGS) $(CXXFLAGS) AM_V_CXX = $(am__v_CXX_@AM_V@) am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) am__v_CXX_0 = @echo " CXX " $@; am__v_CXX_1 = CXXLD = $(CXX) CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) am__v_CXXLD_0 = @echo " CXXLD " $@; am__v_CXXLD_1 = COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libcmis_mockup_la_SOURCES) DIST_SOURCES = $(am__libcmis_mockup_la_SOURCES_DIST) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BOOST_CPPFLAGS = @BOOST_CPPFLAGS@ BOOST_DATE_TIME_LDFLAGS = @BOOST_DATE_TIME_LDFLAGS@ BOOST_DATE_TIME_LIBS = @BOOST_DATE_TIME_LIBS@ BOOST_PROGRAM_OPTIONS_LDFLAGS = @BOOST_PROGRAM_OPTIONS_LDFLAGS@ BOOST_PROGRAM_OPTIONS_LIBS = @BOOST_PROGRAM_OPTIONS_LIBS@ BOOST_ROOT = @BOOST_ROOT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPCHECK = @CPPCHECK@ CPPFLAGS = @CPPFLAGS@ CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ CPPUNIT_LIBS = @CPPUNIT_LIBS@ CURL_CFLAGS = @CURL_CFLAGS@ CURL_LIBS = @CURL_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISTCHECK_CONFIGURE_FLAGS = @DISTCHECK_CONFIGURE_FLAGS@ DLLTOOL = @DLLTOOL@ DOCBOOK2MAN = @DOCBOOK2MAN@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBCMIS_API_VERSION = @LIBCMIS_API_VERSION@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SRCDIR = @SRCDIR@ STRIP = @STRIP@ VERSION = @VERSION@ XML2_CFLAGS = @XML2_CFLAGS@ XML2_LIBS = @XML2_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ @OS_WIN32_FALSE@noinst_LTLIBRARIES = libcmis-mockup.la @OS_WIN32_FALSE@libcmis_mockup_la_SOURCES = \ @OS_WIN32_FALSE@ curl-mockup.cxx \ @OS_WIN32_FALSE@ internals.hxx \ @OS_WIN32_FALSE@ mockup-config.cxx \ @OS_WIN32_FALSE@ mockup-config.h \ @OS_WIN32_FALSE@ curl/curl.h @OS_WIN32_FALSE@libcmis_mockup_la_LIBADD = \ @OS_WIN32_FALSE@ $(top_builddir)/src/libcmis/libcmis.la @OS_WIN32_FALSE@libcmis_mockup_la_LDFLAGS = -export-dynamic -no-undefined all: all-am .SUFFIXES: .SUFFIXES: .cxx .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign qa/mockup/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign qa/mockup/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libcmis-mockup.la: $(libcmis_mockup_la_OBJECTS) $(libcmis_mockup_la_DEPENDENCIES) $(EXTRA_libcmis_mockup_la_DEPENDENCIES) $(AM_V_CXXLD)$(libcmis_mockup_la_LINK) $(am_libcmis_mockup_la_rpath) $(libcmis_mockup_la_OBJECTS) $(libcmis_mockup_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/curl-mockup.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mockup-config.Plo@am__quote@ .cxx.o: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< .cxx.obj: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cxx.lo: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES cscopelist-am ctags \ ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: libcmis-0.4.1/qa/mockup/Makefile.am0000644000175000001440000000046312200452476014013 00000000000000if !OS_WIN32 noinst_LTLIBRARIES = libcmis-mockup.la libcmis_mockup_la_SOURCES = \ curl-mockup.cxx \ internals.hxx \ mockup-config.cxx \ mockup-config.h \ curl/curl.h libcmis_mockup_la_LIBADD = \ $(top_builddir)/src/libcmis/libcmis.la libcmis_mockup_la_LDFLAGS = -export-dynamic -no-undefined endif libcmis-0.4.1/qa/mockup/curl-mockup.cxx0000644000175000001440000003060712200225743014742 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2011 SUSE * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #include #include #include #include #include #include "curl/curl.h" #include "internals.hxx" using namespace std; namespace mockup { extern Configuration* config; } /** Code mostly coming from curl */ struct curl_slist *curl_slist_append( struct curl_slist * list, const char * data ) { struct curl_slist* new_item = ( struct curl_slist* ) malloc( sizeof( struct curl_slist ) ); if( new_item ) { char *dupdata = strdup(data); if ( dupdata ) { new_item->next = NULL; new_item->data = dupdata; } else { free(new_item); return NULL; } } else return NULL; if ( list ) { curl_slist* last = list; while ( last->next ) last = last->next; last->next = new_item; return list; } /* if this is the first item, then new_item *is* the list */ return new_item; } void curl_slist_free_all( struct curl_slist * list ) { if ( list ) { struct curl_slist* item = list; struct curl_slist* next = NULL; do { next = item->next; if ( item->data ) free( item->data ); free(item); item = next; } while ( next ); } } void curl_free( void * /*p*/ ) { /* TODO Implement me */ } CURLcode curl_global_init( long ) { return CURLE_OK; } CURL *curl_easy_init( void ) { return new CurlHandle(); } void curl_easy_cleanup( CURL * curl ) { CurlHandle* handle = static_cast< CurlHandle* >( curl ); delete( handle ); } void curl_easy_reset( CURL * curl ) { CurlHandle* handle = static_cast< CurlHandle * >( curl ); handle->reset( ); } char *curl_easy_escape( CURL *, const char *string, int length ) { return strndup( string, length ); } char *curl_unescape( const char *string, int length ) { return strndup( string, length ); } char *curl_easy_unescape( CURL *, const char *string, int length, int * ) { return curl_unescape( string, length ); } CURLcode curl_easy_setopt( CURL * curl, CURLoption option, ... ) { CurlHandle* handle = static_cast< CurlHandle * >( curl ); va_list arg; va_start( arg, option ); switch ( option ) { /* TODO Add support for more options */ case CURLOPT_POST: { if ( va_arg( arg, long ) ) handle->m_method = string( "POST" ); break; } case CURLOPT_UPLOAD: { if ( 0 != va_arg( arg, long ) ) handle->m_method = string( "PUT" ); break; } case CURLOPT_CUSTOMREQUEST: handle->m_method = string( va_arg( arg, char* ) ); break; case CURLOPT_URL: { handle->m_url = string( va_arg( arg, char* ) ); break; } case CURLOPT_WRITEFUNCTION: { handle->m_writeFn = va_arg( arg, write_callback ); break; } case CURLOPT_WRITEDATA: { handle->m_writeData = va_arg( arg, void* ); break; } case CURLOPT_READFUNCTION: { handle->m_readFn = va_arg( arg, read_callback ); break; } case CURLOPT_READDATA: { handle->m_readData = va_arg( arg, void* ); break; } case CURLOPT_INFILESIZE: { handle->m_readSize = va_arg( arg, long ); break; } case CURLOPT_HEADERFUNCTION: { handle->m_headersFn = va_arg( arg, headers_callback ); break; } case CURLOPT_WRITEHEADER: { handle->m_headersData = va_arg( arg, void* ); break; } case CURLOPT_USERNAME: { handle->m_username = string( va_arg( arg, char* ) ); break; } case CURLOPT_PASSWORD: { handle->m_password = string( va_arg( arg, char* ) ); break; } case CURLOPT_USERPWD: { string userpwd( va_arg( arg, char* ) ); size_t pos = userpwd.find( ':' ); if ( pos != string::npos ) { handle->m_username = userpwd.substr( 0, pos ); handle->m_password = userpwd.substr( pos + 1 ); } break; } case CURLOPT_PROXY: { // FIXME curl does some more complex things with port and type handle->m_proxy = string( va_arg( arg, char* ) ); break; } case CURLOPT_NOPROXY: { handle->m_noProxy = string( va_arg( arg, char* ) ); break; } case CURLOPT_PROXYUSERNAME: { handle->m_proxyUser = string( va_arg( arg, char* ) ); break; } case CURLOPT_PROXYPASSWORD: { handle->m_proxyPass = string( va_arg( arg, char* ) ); break; } case CURLOPT_PROXYUSERPWD: { string userpwd( va_arg( arg, char* ) ); size_t pos = userpwd.find( ':' ); if ( pos != string::npos ) { handle->m_proxyUser = userpwd.substr( 0, pos ); handle->m_proxyPass = userpwd.substr( pos + 1 ); } break; } case CURLOPT_SSL_VERIFYHOST: { handle->m_verifyHost = va_arg( arg, long ) != 0; break; } case CURLOPT_SSL_VERIFYPEER: { handle->m_verifyPeer = va_arg( arg, long ) != 0; break; } case CURLOPT_CERTINFO: { handle->m_certInfo = va_arg( arg, long ) != 0; break; } default: { // We surely don't want to break the test for that. } } va_end( arg ); return CURLE_OK; } CURLcode curl_easy_perform( CURL * curl ) { CurlHandle* handle = static_cast< CurlHandle * >( curl ); /* Fake a bad SSL Certificate? */ if ( !mockup::config->m_badSSLCertificate.empty( ) && handle->m_verifyPeer && handle->m_verifyHost ) { return CURLE_SSL_CACERT; } /* Populate the certificate infos */ if ( handle->m_certInfo && !mockup::config->m_badSSLCertificate.empty( ) ) { curl_slist * certData = NULL; string cert( "Cert:" + mockup::config->m_badSSLCertificate ); char* c_cert = strdup( cert.c_str( ) ); certData = curl_slist_append( certData, c_cert ); free( c_cert ); handle->m_certs.num_of_certs = 1; handle->m_certs.certinfo = ( struct curl_slist** )calloc( ( size_t )1, sizeof( struct curl_slist * ) ); handle->m_certs.certinfo[0] = certData; } /* Check the credentials */ if ( mockup::config->hasCredentials( ) && ( handle->m_username != mockup::config->m_username || handle->m_password != mockup::config->m_password ) ) { // Send HTTP 401 handle->m_httpError = 401; return CURLE_HTTP_RETURNED_ERROR; } // Store the requests for later verifications stringstream body; if ( handle->m_readFn && handle->m_readData ) { size_t bufSize = 2048; char* buf = new char[bufSize]; size_t read = 0; do { read = handle->m_readFn( buf, 1, bufSize, handle->m_readData ); body.write( buf, read ); } while ( read == bufSize ); delete[] buf; } mockup::config->m_requests.push_back( mockup::Request( handle->m_url, handle->m_method, body.str( ) ) ); return mockup::config->writeResponse( handle ); } CURLcode curl_easy_getinfo( CURL * curl, CURLINFO info, ... ) { CurlHandle* handle = static_cast< CurlHandle * >( curl ); va_list arg; va_start( arg, info ); switch ( info ) { case CURLINFO_RESPONSE_CODE: { long* buf = va_arg( arg, long* ); *buf = handle->m_httpError; break; } case CURLINFO_CERTINFO: { struct curl_slist** param = va_arg( arg, struct curl_slist** ); if ( NULL != param ) { union { struct curl_certinfo * to_certinfo; struct curl_slist * to_slist; } ptr; // Fill it ptr.to_certinfo = &handle->m_certs; *param = ptr.to_slist; } break; } default: { // We surely don't want to break the test for that. } } va_end( arg ); return CURLE_OK; } CurlHandle::CurlHandle( ) : m_url( ), m_writeFn( NULL ), m_writeData( NULL ), m_readFn( NULL ), m_readData( NULL ), m_readSize( 0 ), m_headersFn( NULL ), m_headersData( NULL ), m_username( ), m_password( ), m_proxy( ), m_noProxy( ), m_proxyUser( ), m_proxyPass( ), m_verifyHost( true ), m_verifyPeer( true ), m_certInfo( false ), m_certs( ), m_httpError( 0 ), m_method( "GET" ) { } CurlHandle::CurlHandle( const CurlHandle& copy ) : m_url( copy.m_url ), m_writeFn( copy.m_writeFn ), m_writeData( copy.m_writeData ), m_readFn( copy.m_readFn ), m_readData( copy.m_readData ), m_readSize( copy.m_readSize ), m_headersFn( copy.m_headersFn ), m_headersData( copy.m_headersData ), m_username( copy.m_username ), m_password( copy.m_password ), m_proxy( copy.m_proxy ), m_noProxy( copy.m_noProxy ), m_proxyUser( copy.m_proxyUser ), m_proxyPass( copy.m_proxyPass ), m_verifyHost( copy.m_verifyHost ), m_verifyPeer( copy.m_verifyPeer ), m_certInfo( copy.m_certInfo ), m_certs( copy.m_certs ), m_httpError( copy.m_httpError ), m_method( copy.m_method ) { } CurlHandle& CurlHandle::operator=( const CurlHandle& copy ) { if ( this != © ) { m_url = copy.m_url; m_writeFn = copy.m_writeFn; m_writeData = copy.m_writeData; m_readFn = copy.m_readFn; m_readData = copy.m_readData; m_readSize = copy.m_readSize; m_headersFn = copy.m_headersFn; m_headersData = copy.m_headersData; m_username = copy.m_username; m_password = copy.m_password; m_proxy = copy.m_proxy; m_noProxy = copy.m_noProxy; m_proxyUser = copy.m_proxyUser; m_proxyPass = copy.m_proxyPass; m_verifyHost = copy.m_verifyHost; m_verifyPeer = copy.m_verifyPeer; m_certInfo = copy.m_certInfo; m_certs = copy.m_certs; m_httpError = copy.m_httpError; m_method = copy.m_method; } return *this; } void CurlHandle::reset( ) { m_url = string( ); m_writeFn = NULL; m_writeData = NULL; m_readFn = NULL; m_readData = NULL; m_readSize = 0; m_username = string( ); m_password = string( ); m_proxy = string( ); m_noProxy = string( ); m_proxyUser = string( ); m_proxyPass = string( ); m_verifyHost = true; m_verifyPeer = true; m_certInfo = false; for ( int i = 0; i < m_certs.num_of_certs; ++i ) { curl_slist_free_all( m_certs.certinfo[i] ); m_certs.certinfo[i] = NULL; } free( m_certs.certinfo ); m_certs.certinfo = NULL; m_certs.num_of_certs = 0; m_method = "GET"; } libcmis-0.4.1/qa/mockup/internals.hxx0000644000175000001440000000665712200225743014515 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2011 SUSE * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #include #include #include typedef size_t ( *write_callback )( char *ptr, size_t size, size_t nmemb, void *userdata ); typedef size_t ( *read_callback )( char *ptr, size_t size, size_t nmemb, void *userdata ); typedef size_t ( *headers_callback )( char *ptr, size_t size, size_t nmemb, void *userdata ); class CurlHandle { public: CurlHandle( ); CurlHandle( const CurlHandle& copy ); CurlHandle& operator=( const CurlHandle& copy ); std::string m_url; write_callback m_writeFn; void* m_writeData; read_callback m_readFn; void* m_readData; long m_readSize; headers_callback m_headersFn; void* m_headersData; std::string m_username; std::string m_password; std::string m_proxy; std::string m_noProxy; std::string m_proxyUser; std::string m_proxyPass; bool m_verifyHost; bool m_verifyPeer; bool m_certInfo; struct curl_certinfo m_certs; long m_httpError; std::string m_method; void reset( ); }; namespace mockup { class Response { public: Response( std::string response, unsigned int status, bool isFilePath, std::string headers ); std::string m_response; unsigned int m_status; bool m_isFilePath; std::string m_headers; }; class Request { public: Request( std::string url, std::string method, std::string body ); std::string m_url; std::string m_method; std::string m_body; }; class RequestMatcher { public: RequestMatcher( std::string baseUrl, std::string matchParam, std::string method ); bool operator< ( const RequestMatcher& compare ) const; std::string m_baseUrl; std::string m_matchParam; std::string m_method; }; class Configuration { public: Configuration( ); bool hasCredentials( ); CURLcode writeResponse( CurlHandle* handle ); std::map< RequestMatcher, Response > m_responses; std::vector< Request > m_requests; std::string m_username; std::string m_password; std::string m_badSSLCertificate; }; } libcmis-0.4.1/qa/mockup/mockup-config.cxx0000644000175000001440000002254012200225743015237 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2011 SUSE * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #include "mockup-config.h" #include "internals.hxx" #include #include #include using namespace std; namespace { void lcl_splitUrl( const string& url, string& urlBase, string& params ) { size_t pos = url.find( "?" ); urlBase = url; if ( pos != string::npos ) { urlBase = url.substr( 0, pos ); params = url.substr( pos + 1 ); } } } namespace mockup { Response::Response( string response, unsigned int status, bool isFilePath, string headers ) : m_response( response ), m_status( status ), m_isFilePath( isFilePath ), m_headers( headers ) { } Request::Request( string url, string method, string body ) : m_url( url ), m_method( method ), m_body( body ) { } RequestMatcher::RequestMatcher( string baseUrl, string matchParam, string method ) : m_baseUrl( baseUrl ), m_matchParam( matchParam ), m_method( method ) { } bool RequestMatcher::operator< ( const RequestMatcher& compare ) const { int cmpBaseUrl = m_baseUrl.compare( compare.m_baseUrl ) ; bool result = cmpBaseUrl; if ( cmpBaseUrl == 0 ) { int cmpMatchParam = m_matchParam.compare( compare.m_matchParam ); result = cmpMatchParam < 0; if ( cmpMatchParam == 0 ) { int cmpMatchMethod = m_method.compare( compare.m_method ); result = cmpMatchMethod; } } return result; } Configuration::Configuration( ) : m_responses( ), m_requests( ), m_username( ), m_password( ), m_badSSLCertificate( ) { } bool Configuration::hasCredentials( ) { return !m_username.empty( ) && !m_password.empty( ); } CURLcode Configuration::writeResponse( CurlHandle* handle ) { CURLcode code = CURLE_OK; string headers; string response; bool foundResponse = false; bool isFilePath = true; const string& url = handle->m_url; string urlBase = url; string params; lcl_splitUrl( url, urlBase, params ); string method = handle->m_method; for ( map< RequestMatcher, Response >::iterator it = m_responses.begin( ); it != m_responses.end( ) && response.empty( ); ++it ) { RequestMatcher matcher = it->first; string& paramFind = matcher.m_matchParam; bool matchBaseUrl = matcher.m_baseUrl.empty() || ( urlBase.find( matcher.m_baseUrl ) == 0 ); bool matchParams = paramFind.empty( ) || ( params.find( paramFind ) != string::npos ); bool matchMethod = it->first.m_method.empty( ) || ( it->first.m_method == method ); if ( matchBaseUrl && matchParams && matchMethod ) { foundResponse = true; response = it->second.m_response; handle->m_httpError = it->second.m_status; isFilePath = it->second.m_isFilePath; headers = it->second.m_headers; } } // Output headers is any if ( !headers.empty() ) { char* buf = strdup( headers.c_str() ); handle->m_headersFn( buf, 1, headers.size( ), handle->m_headersData ); free( buf ); } // If nothing matched, then send a 404 HTTP error instead if ( !foundResponse || ( foundResponse && isFilePath && response.empty() ) ) handle->m_httpError = 404; else { if ( isFilePath ) { FILE* fd = fopen( response.c_str( ), "r" ); size_t bufSize = 2048; char* buf = new char[bufSize]; size_t read = 0; size_t written = 0; do { read = fread( buf, 1, bufSize, fd ); written = handle->m_writeFn( buf, 1, read, handle->m_writeData ); } while ( read == bufSize && written == read ); fclose( fd ); delete[] buf; } else { if ( !response.empty() ) { char* buf = strdup( response.c_str() ); handle->m_writeFn( buf, 1, response.size( ), handle->m_writeData ); free( buf ); } } } // What curl error code to give? if ( handle->m_httpError == 0 ) handle->m_httpError = 200; if ( handle->m_httpError < 200 || handle->m_httpError >= 300 ) code = CURLE_HTTP_RETURNED_ERROR; return code; } Configuration* config = new Configuration( ); } void curl_mockup_reset( ) { if ( mockup::config != NULL ) delete mockup::config; mockup::config = new mockup::Configuration( ); } void curl_mockup_addResponse( const char* urlBase, const char* matchParam, const char* method, const char* response, unsigned int status, bool isFilePath, const char* headers ) { mockup::RequestMatcher matcher( urlBase, matchParam, method ); map< mockup::RequestMatcher, mockup::Response >::iterator it = mockup::config->m_responses.find( matcher ); if ( it != mockup::config->m_responses.end( ) ) mockup::config->m_responses.erase( it ); string headersStr; if ( headers != NULL ) headersStr = headers; mockup::Response responseDesc( response, status, isFilePath, headersStr ); mockup::config->m_responses.insert( pair< mockup::RequestMatcher, mockup::Response >( matcher, responseDesc ) ); } void curl_mockup_setResponse( const char* filepath ) { mockup::config->m_responses.clear( ); curl_mockup_addResponse( "", "", "", filepath ); } void curl_mockup_setCredentials( const char* username, const char* password ) { mockup::config->m_username = string( username ); mockup::config->m_password = string( password ); } const struct HttpRequest* curl_mockup_getRequest( const char* urlBase, const char* matchParam, const char* method ) { struct HttpRequest* request = NULL; string urlBaseString( urlBase ); string matchParamString( matchParam ); for ( vector< mockup::Request >::iterator it = mockup::config->m_requests.begin( ); it != mockup::config->m_requests.end( ) && request == NULL; ++it ) { string url; string params; if ( it->m_method == string( method ) ) { lcl_splitUrl( it->m_url, url, params ); bool matchBaseUrl = urlBaseString.empty() || ( url.find( urlBaseString ) == 0 ); bool matchParams = matchParamString.empty( ) || ( params.find( matchParamString ) != string::npos ); if ( matchBaseUrl && matchParams ) { request = new HttpRequest; request->url = it->m_url.c_str(); request->body = it->m_body.c_str(); } } } return request; } const char* curl_mockup_getRequestBody( const char* urlBase, const char* matchParam, const char* method ) { const struct HttpRequest* request = curl_mockup_getRequest( urlBase, matchParam, method ); if ( request ) { const char* body = request->body; delete request; return body; } return NULL; } const char* curl_mockup_getProxy( CURL* curl ) { CurlHandle* handle = static_cast< CurlHandle* >( curl ); if ( NULL != handle ) return handle->m_proxy.c_str(); return NULL; } const char* curl_mockup_getNoProxy( CURL* curl ) { CurlHandle* handle = static_cast< CurlHandle* >( curl ); if ( NULL != handle ) return handle->m_noProxy.c_str(); return NULL; } const char* curl_mockup_getProxyUser( CURL* curl ) { CurlHandle* handle = static_cast< CurlHandle* >( curl ); if ( NULL != handle ) return handle->m_proxyUser.c_str(); return NULL; } const char* curl_mockup_getProxyPass( CURL* curl ) { CurlHandle* handle = static_cast< CurlHandle* >( curl ); if ( NULL != handle ) return handle->m_proxyPass.c_str(); return NULL; } void curl_mockup_setSSLBadCertificate( const char* certificate ) { mockup::config->m_badSSLCertificate = string( certificate ); } libcmis-0.4.1/qa/mockup/curl/0000755000175000001440000000000012200457455013003 500000000000000libcmis-0.4.1/qa/mockup/curl/curl.h0000644000175000001440000001163112200225743014034 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2011 SUSE * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #ifndef _MOCKUP_CURL_CURL_H_ #define _MOCKUP_CURL_CURL_H_ #ifdef __cplusplus extern "C" { #endif /* Curl used symbols to mockup */ typedef void CURL; typedef enum { CURLIOE_OK, /* I/O operation successful */ CURLIOE_UNKNOWNCMD, /* command was unknown to callback */ CURLIOE_FAILRESTART, /* failed to restart the read */ CURLIOE_LAST /* never use */ } curlioerr; #define CURL_GLOBAL_SSL (1<<0) #define CURL_GLOBAL_WIN32 (1<<1) #define CURL_GLOBAL_ALL (CURL_GLOBAL_SSL|CURL_GLOBAL_WIN32) #define CURLOPTTYPE_LONG 0 #define CURLOPTTYPE_OBJECTPOINT 10000 #define CURLOPTTYPE_FUNCTIONPOINT 20000 #define CURLOPTTYPE_OFF_T 30000 typedef enum { CURLOPT_WRITEFUNCTION = CURLOPTTYPE_FUNCTIONPOINT + 11, CURLOPT_READFUNCTION = CURLOPTTYPE_FUNCTIONPOINT + 12, CURLOPT_WRITEDATA = CURLOPTTYPE_OBJECTPOINT + 1, CURLOPT_HEADERFUNCTION = CURLOPTTYPE_FUNCTIONPOINT + 79, CURLOPT_WRITEHEADER = CURLOPTTYPE_OBJECTPOINT + 29, CURLOPT_FOLLOWLOCATION = CURLOPTTYPE_LONG + 52, CURLOPT_MAXREDIRS = CURLOPTTYPE_LONG + 68, CURLOPT_INFILESIZE = CURLOPTTYPE_LONG + 14, CURLOPT_READDATA = CURLOPTTYPE_OBJECTPOINT + 9, CURLOPT_UPLOAD = CURLOPTTYPE_LONG + 46, CURLOPT_IOCTLFUNCTION = CURLOPTTYPE_FUNCTIONPOINT + 130, CURLOPT_IOCTLDATA = CURLOPTTYPE_OBJECTPOINT + 131, CURLOPT_HTTPHEADER = CURLOPTTYPE_OBJECTPOINT + 23, CURLOPT_POSTFIELDSIZE = CURLOPTTYPE_LONG + 60, CURLOPT_POST = CURLOPTTYPE_LONG + 47, CURLOPT_CUSTOMREQUEST = CURLOPTTYPE_OBJECTPOINT + 36, CURLOPT_URL = CURLOPTTYPE_OBJECTPOINT + 2, CURLOPT_HTTPAUTH = CURLOPTTYPE_LONG + 107, CURLOPT_USERNAME = CURLOPTTYPE_OBJECTPOINT + 173, CURLOPT_PASSWORD = CURLOPTTYPE_OBJECTPOINT + 174, CURLOPT_USERPWD = CURLOPTTYPE_OBJECTPOINT + 5, CURLOPT_ERRORBUFFER = CURLOPTTYPE_OBJECTPOINT + 10, CURLOPT_FAILONERROR = CURLOPTTYPE_LONG + 45, CURLOPT_VERBOSE = CURLOPTTYPE_LONG + 41, CURLOPT_PROXY = CURLOPTTYPE_OBJECTPOINT + 4, CURLOPT_PROXYUSERPWD = CURLOPTTYPE_OBJECTPOINT + 6, CURLOPT_PROXYAUTH = CURLOPTTYPE_LONG + 111, CURLOPT_PROXYUSERNAME = CURLOPTTYPE_OBJECTPOINT + 175, CURLOPT_PROXYPASSWORD = CURLOPTTYPE_OBJECTPOINT + 176, CURLOPT_NOPROXY = CURLOPTTYPE_OBJECTPOINT + 177, CURLOPT_SSL_VERIFYPEER = CURLOPTTYPE_LONG + 64, CURLOPT_SSL_VERIFYHOST = CURLOPTTYPE_LONG + 81, CURLOPT_CERTINFO = CURLOPTTYPE_LONG + 172 } CURLoption; #define CURLAUTH_DIGEST_IE (((unsigned long)1)<<4) #define CURLAUTH_ANY (~CURLAUTH_DIGEST_IE) typedef enum { CURLE_OK = 0, CURLE_HTTP_RETURNED_ERROR = 22, CURLE_SSL_CACERT = 60, /* TODO Add some more error codes from curl? */ CURL_LAST } CURLcode; struct curl_slist { char *data; struct curl_slist *next; }; struct curl_slist *curl_slist_append( struct curl_slist *, const char * ); void curl_slist_free_all( struct curl_slist * ); void curl_free( void *p ); CURLcode curl_global_init( long flags ); CURL *curl_easy_init( void ); void curl_easy_cleanup( CURL *curl ); CURLcode curl_easy_setopt( CURL *curl, CURLoption option, ... ); char *curl_easy_escape( CURL *handle, const char *string, int length ); char *curl_unescape( const char *string, int length ); char *curl_easy_unescape( CURL *handle, const char *string, int length, int *outlength ); CURLcode curl_easy_perform( CURL *curl ); void curl_easy_reset( CURL *curl ); struct curl_certinfo { int num_of_certs; struct curl_slist **certinfo; }; #define CURLINFO_LONG 0x200000 #define CURLINFO_SLIST 0x400000 typedef enum { CURLINFO_NONE, CURLINFO_RESPONSE_CODE = CURLINFO_LONG + 2, CURLINFO_CERTINFO = CURLINFO_SLIST + 34, CURLINFO_LASTONE = 42 } CURLINFO; CURLcode curl_easy_getinfo( CURL *curl, CURLINFO info, ... ); #define LIBCURL_VERSION_MAJOR 7 #define LIBCURL_VERSION_MINOR 26 #define LIBCURL_VERSION_PATCH 0 #ifdef __cplusplus } #endif #endif libcmis-0.4.1/qa/libcmis-c/0000755000175000001440000000000012200457455012402 500000000000000libcmis-0.4.1/qa/libcmis-c/test-build.c0000644000175000001440000000224512167544732014554 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2011 SUSE * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #include "libcmis-c.h" int main ( int argc, char ** argv ) { ( void )argc; ( void )argv; return 0; } libcmis-0.4.1/qa/libcmis-c/Makefile.in0000644000175000001440000014751412200457433014377 00000000000000# Makefile.in generated by automake 1.13.4 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ @ENABLE_TESTS_TRUE@check_PROGRAMS = test-api$(EXEEXT) \ @ENABLE_TESTS_TRUE@ test-c-build$(EXEEXT) @ENABLE_TESTS_TRUE@TESTS = test-api$(EXEEXT) subdir = qa/libcmis-c DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/boost.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__test_api_SOURCES_DIST = test-api.cxx test-allowable-actions.cxx \ test-document.cxx test-dummies.hxx test-dummies.cxx \ test-folder.cxx test-object.cxx test-object-type.cxx \ test-property.cxx test-property-type.cxx test-repository.cxx \ test-session.cxx @ENABLE_TESTS_TRUE@am_test_api_OBJECTS = test_api-test-api.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ test_api-test-allowable-actions.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ test_api-test-document.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ test_api-test-dummies.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ test_api-test-folder.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ test_api-test-object.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ test_api-test-object-type.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ test_api-test-property.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ test_api-test-property-type.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ test_api-test-repository.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ test_api-test-session.$(OBJEXT) test_api_OBJECTS = $(am_test_api_OBJECTS) am__DEPENDENCIES_1 = @ENABLE_TESTS_TRUE@test_api_DEPENDENCIES = $(top_builddir)/src/libcmis-c/libcmis-c-@LIBCMIS_API_VERSION@.la \ @ENABLE_TESTS_TRUE@ $(top_builddir)/src/libcmis/libcmis-@LIBCMIS_API_VERSION@.la \ @ENABLE_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ @ENABLE_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = test_api_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(test_api_CXXFLAGS) \ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ am__test_c_build_SOURCES_DIST = test-build.c @ENABLE_TESTS_TRUE@am_test_c_build_OBJECTS = \ @ENABLE_TESTS_TRUE@ test_c_build-test-build.$(OBJEXT) test_c_build_OBJECTS = $(am_test_c_build_OBJECTS) @ENABLE_TESTS_TRUE@test_c_build_DEPENDENCIES = $(top_builddir)/src/libcmis-c/libcmis-c-@LIBCMIS_API_VERSION@.la \ @ENABLE_TESTS_TRUE@ $(top_builddir)/src/libcmis/libcmis-@LIBCMIS_API_VERSION@.la \ @ENABLE_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ @ENABLE_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) test_c_build_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(test_c_build_CFLAGS) \ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CXXFLAGS) $(CXXFLAGS) AM_V_CXX = $(am__v_CXX_@AM_V@) am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) am__v_CXX_0 = @echo " CXX " $@; am__v_CXX_1 = CXXLD = $(CXX) CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) am__v_CXXLD_0 = @echo " CXXLD " $@; am__v_CXXLD_1 = SOURCES = $(test_api_SOURCES) $(test_c_build_SOURCES) DIST_SOURCES = $(am__test_api_SOURCES_DIST) \ $(am__test_c_build_SOURCES_DIST) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__tty_colors_dummy = \ mgn= red= grn= lgn= blu= brg= std=; \ am__color_tests=no am__tty_colors = { \ $(am__tty_colors_dummy); \ if test "X$(AM_COLOR_TESTS)" = Xno; then \ am__color_tests=no; \ elif test "X$(AM_COLOR_TESTS)" = Xalways; then \ am__color_tests=yes; \ elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \ am__color_tests=yes; \ fi; \ if test $$am__color_tests = yes; then \ red=''; \ grn=''; \ lgn=''; \ blu=''; \ mgn=''; \ brg=''; \ std=''; \ fi; \ } DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BOOST_CPPFLAGS = @BOOST_CPPFLAGS@ BOOST_DATE_TIME_LDFLAGS = @BOOST_DATE_TIME_LDFLAGS@ BOOST_DATE_TIME_LIBS = @BOOST_DATE_TIME_LIBS@ BOOST_PROGRAM_OPTIONS_LDFLAGS = @BOOST_PROGRAM_OPTIONS_LDFLAGS@ BOOST_PROGRAM_OPTIONS_LIBS = @BOOST_PROGRAM_OPTIONS_LIBS@ BOOST_ROOT = @BOOST_ROOT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPCHECK = @CPPCHECK@ CPPFLAGS = @CPPFLAGS@ CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ CPPUNIT_LIBS = @CPPUNIT_LIBS@ CURL_CFLAGS = @CURL_CFLAGS@ CURL_LIBS = @CURL_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISTCHECK_CONFIGURE_FLAGS = @DISTCHECK_CONFIGURE_FLAGS@ DLLTOOL = @DLLTOOL@ DOCBOOK2MAN = @DOCBOOK2MAN@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBCMIS_API_VERSION = @LIBCMIS_API_VERSION@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SRCDIR = @SRCDIR@ STRIP = @STRIP@ VERSION = @VERSION@ XML2_CFLAGS = @XML2_CFLAGS@ XML2_LIBS = @XML2_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ @ENABLE_TESTS_TRUE@test_api_SOURCES = \ @ENABLE_TESTS_TRUE@ test-api.cxx \ @ENABLE_TESTS_TRUE@ test-allowable-actions.cxx \ @ENABLE_TESTS_TRUE@ test-document.cxx \ @ENABLE_TESTS_TRUE@ test-dummies.hxx \ @ENABLE_TESTS_TRUE@ test-dummies.cxx \ @ENABLE_TESTS_TRUE@ test-folder.cxx \ @ENABLE_TESTS_TRUE@ test-object.cxx \ @ENABLE_TESTS_TRUE@ test-object-type.cxx \ @ENABLE_TESTS_TRUE@ test-property.cxx \ @ENABLE_TESTS_TRUE@ test-property-type.cxx \ @ENABLE_TESTS_TRUE@ test-repository.cxx \ @ENABLE_TESTS_TRUE@ test-session.cxx @ENABLE_TESTS_TRUE@test_api_CXXFLAGS = -I$(top_srcdir)/src/ -I$(top_srcdir)/src/libcmis-c/ $(XML2_CFLAGS) $(BOOST_CPPFLAGS) @ENABLE_TESTS_TRUE@test_api_LDADD = \ @ENABLE_TESTS_TRUE@ $(top_builddir)/src/libcmis-c/libcmis-c-@LIBCMIS_API_VERSION@.la \ @ENABLE_TESTS_TRUE@ $(top_builddir)/src/libcmis/libcmis-@LIBCMIS_API_VERSION@.la \ @ENABLE_TESTS_TRUE@ $(XML2_LIBS) \ @ENABLE_TESTS_TRUE@ $(CURL_LIBS) \ @ENABLE_TESTS_TRUE@ $(CPPUNIT_LIBS) \ @ENABLE_TESTS_TRUE@ $(BOOST_DATE_TIME_LIBS) @ENABLE_TESTS_TRUE@test_c_build_SOURCES = \ @ENABLE_TESTS_TRUE@ test-build.c @ENABLE_TESTS_TRUE@test_c_build_CFLAGS = -I$(top_srcdir)/src/ -I$(top_srcdir)/src/libcmis-c/ $(XML2_CFLAGS) @ENABLE_TESTS_TRUE@test_c_build_LDADD = \ @ENABLE_TESTS_TRUE@ $(top_builddir)/src/libcmis-c/libcmis-c-@LIBCMIS_API_VERSION@.la \ @ENABLE_TESTS_TRUE@ $(top_builddir)/src/libcmis/libcmis-@LIBCMIS_API_VERSION@.la \ @ENABLE_TESTS_TRUE@ $(XML2_LIBS) \ @ENABLE_TESTS_TRUE@ $(CURL_LIBS) \ @ENABLE_TESTS_TRUE@ $(CPPUNIT_LIBS) \ @ENABLE_TESTS_TRUE@ $(BOOST_DATE_TIME_LIBS) all: all-am .SUFFIXES: .SUFFIXES: .c .cxx .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign qa/libcmis-c/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign qa/libcmis-c/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-checkPROGRAMS: @list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list test-api$(EXEEXT): $(test_api_OBJECTS) $(test_api_DEPENDENCIES) $(EXTRA_test_api_DEPENDENCIES) @rm -f test-api$(EXEEXT) $(AM_V_CXXLD)$(test_api_LINK) $(test_api_OBJECTS) $(test_api_LDADD) $(LIBS) test-c-build$(EXEEXT): $(test_c_build_OBJECTS) $(test_c_build_DEPENDENCIES) $(EXTRA_test_c_build_DEPENDENCIES) @rm -f test-c-build$(EXEEXT) $(AM_V_CCLD)$(test_c_build_LINK) $(test_c_build_OBJECTS) $(test_c_build_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_api-test-allowable-actions.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_api-test-api.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_api-test-document.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_api-test-dummies.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_api-test-folder.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_api-test-object-type.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_api-test-object.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_api-test-property-type.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_api-test-property.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_api-test-repository.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_api-test-session.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_c_build-test-build.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< test_c_build-test-build.o: test-build.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_c_build_CFLAGS) $(CFLAGS) -MT test_c_build-test-build.o -MD -MP -MF $(DEPDIR)/test_c_build-test-build.Tpo -c -o test_c_build-test-build.o `test -f 'test-build.c' || echo '$(srcdir)/'`test-build.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_c_build-test-build.Tpo $(DEPDIR)/test_c_build-test-build.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test-build.c' object='test_c_build-test-build.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_c_build_CFLAGS) $(CFLAGS) -c -o test_c_build-test-build.o `test -f 'test-build.c' || echo '$(srcdir)/'`test-build.c test_c_build-test-build.obj: test-build.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_c_build_CFLAGS) $(CFLAGS) -MT test_c_build-test-build.obj -MD -MP -MF $(DEPDIR)/test_c_build-test-build.Tpo -c -o test_c_build-test-build.obj `if test -f 'test-build.c'; then $(CYGPATH_W) 'test-build.c'; else $(CYGPATH_W) '$(srcdir)/test-build.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_c_build-test-build.Tpo $(DEPDIR)/test_c_build-test-build.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test-build.c' object='test_c_build-test-build.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_c_build_CFLAGS) $(CFLAGS) -c -o test_c_build-test-build.obj `if test -f 'test-build.c'; then $(CYGPATH_W) 'test-build.c'; else $(CYGPATH_W) '$(srcdir)/test-build.c'; fi` .cxx.o: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< .cxx.obj: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cxx.lo: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $< test_api-test-api.o: test-api.cxx @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_api_CXXFLAGS) $(CXXFLAGS) -MT test_api-test-api.o -MD -MP -MF $(DEPDIR)/test_api-test-api.Tpo -c -o test_api-test-api.o `test -f 'test-api.cxx' || echo '$(srcdir)/'`test-api.cxx @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_api-test-api.Tpo $(DEPDIR)/test_api-test-api.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test-api.cxx' object='test_api-test-api.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_api_CXXFLAGS) $(CXXFLAGS) -c -o test_api-test-api.o `test -f 'test-api.cxx' || echo '$(srcdir)/'`test-api.cxx test_api-test-api.obj: test-api.cxx @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_api_CXXFLAGS) $(CXXFLAGS) -MT test_api-test-api.obj -MD -MP -MF $(DEPDIR)/test_api-test-api.Tpo -c -o test_api-test-api.obj `if test -f 'test-api.cxx'; then $(CYGPATH_W) 'test-api.cxx'; else $(CYGPATH_W) '$(srcdir)/test-api.cxx'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_api-test-api.Tpo $(DEPDIR)/test_api-test-api.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test-api.cxx' object='test_api-test-api.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_api_CXXFLAGS) $(CXXFLAGS) -c -o test_api-test-api.obj `if test -f 'test-api.cxx'; then $(CYGPATH_W) 'test-api.cxx'; else $(CYGPATH_W) '$(srcdir)/test-api.cxx'; fi` test_api-test-allowable-actions.o: test-allowable-actions.cxx @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_api_CXXFLAGS) $(CXXFLAGS) -MT test_api-test-allowable-actions.o -MD -MP -MF $(DEPDIR)/test_api-test-allowable-actions.Tpo -c -o test_api-test-allowable-actions.o `test -f 'test-allowable-actions.cxx' || echo '$(srcdir)/'`test-allowable-actions.cxx @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_api-test-allowable-actions.Tpo $(DEPDIR)/test_api-test-allowable-actions.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test-allowable-actions.cxx' object='test_api-test-allowable-actions.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_api_CXXFLAGS) $(CXXFLAGS) -c -o test_api-test-allowable-actions.o `test -f 'test-allowable-actions.cxx' || echo '$(srcdir)/'`test-allowable-actions.cxx test_api-test-allowable-actions.obj: test-allowable-actions.cxx @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_api_CXXFLAGS) $(CXXFLAGS) -MT test_api-test-allowable-actions.obj -MD -MP -MF $(DEPDIR)/test_api-test-allowable-actions.Tpo -c -o test_api-test-allowable-actions.obj `if test -f 'test-allowable-actions.cxx'; then $(CYGPATH_W) 'test-allowable-actions.cxx'; else $(CYGPATH_W) '$(srcdir)/test-allowable-actions.cxx'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_api-test-allowable-actions.Tpo $(DEPDIR)/test_api-test-allowable-actions.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test-allowable-actions.cxx' object='test_api-test-allowable-actions.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_api_CXXFLAGS) $(CXXFLAGS) -c -o test_api-test-allowable-actions.obj `if test -f 'test-allowable-actions.cxx'; then $(CYGPATH_W) 'test-allowable-actions.cxx'; else $(CYGPATH_W) '$(srcdir)/test-allowable-actions.cxx'; fi` test_api-test-document.o: test-document.cxx @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_api_CXXFLAGS) $(CXXFLAGS) -MT test_api-test-document.o -MD -MP -MF $(DEPDIR)/test_api-test-document.Tpo -c -o test_api-test-document.o `test -f 'test-document.cxx' || echo '$(srcdir)/'`test-document.cxx @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_api-test-document.Tpo $(DEPDIR)/test_api-test-document.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test-document.cxx' object='test_api-test-document.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_api_CXXFLAGS) $(CXXFLAGS) -c -o test_api-test-document.o `test -f 'test-document.cxx' || echo '$(srcdir)/'`test-document.cxx test_api-test-document.obj: test-document.cxx @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_api_CXXFLAGS) $(CXXFLAGS) -MT test_api-test-document.obj -MD -MP -MF $(DEPDIR)/test_api-test-document.Tpo -c -o test_api-test-document.obj `if test -f 'test-document.cxx'; then $(CYGPATH_W) 'test-document.cxx'; else $(CYGPATH_W) '$(srcdir)/test-document.cxx'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_api-test-document.Tpo $(DEPDIR)/test_api-test-document.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test-document.cxx' object='test_api-test-document.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_api_CXXFLAGS) $(CXXFLAGS) -c -o test_api-test-document.obj `if test -f 'test-document.cxx'; then $(CYGPATH_W) 'test-document.cxx'; else $(CYGPATH_W) '$(srcdir)/test-document.cxx'; fi` test_api-test-dummies.o: test-dummies.cxx @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_api_CXXFLAGS) $(CXXFLAGS) -MT test_api-test-dummies.o -MD -MP -MF $(DEPDIR)/test_api-test-dummies.Tpo -c -o test_api-test-dummies.o `test -f 'test-dummies.cxx' || echo '$(srcdir)/'`test-dummies.cxx @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_api-test-dummies.Tpo $(DEPDIR)/test_api-test-dummies.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test-dummies.cxx' object='test_api-test-dummies.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_api_CXXFLAGS) $(CXXFLAGS) -c -o test_api-test-dummies.o `test -f 'test-dummies.cxx' || echo '$(srcdir)/'`test-dummies.cxx test_api-test-dummies.obj: test-dummies.cxx @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_api_CXXFLAGS) $(CXXFLAGS) -MT test_api-test-dummies.obj -MD -MP -MF $(DEPDIR)/test_api-test-dummies.Tpo -c -o test_api-test-dummies.obj `if test -f 'test-dummies.cxx'; then $(CYGPATH_W) 'test-dummies.cxx'; else $(CYGPATH_W) '$(srcdir)/test-dummies.cxx'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_api-test-dummies.Tpo $(DEPDIR)/test_api-test-dummies.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test-dummies.cxx' object='test_api-test-dummies.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_api_CXXFLAGS) $(CXXFLAGS) -c -o test_api-test-dummies.obj `if test -f 'test-dummies.cxx'; then $(CYGPATH_W) 'test-dummies.cxx'; else $(CYGPATH_W) '$(srcdir)/test-dummies.cxx'; fi` test_api-test-folder.o: test-folder.cxx @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_api_CXXFLAGS) $(CXXFLAGS) -MT test_api-test-folder.o -MD -MP -MF $(DEPDIR)/test_api-test-folder.Tpo -c -o test_api-test-folder.o `test -f 'test-folder.cxx' || echo '$(srcdir)/'`test-folder.cxx @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_api-test-folder.Tpo $(DEPDIR)/test_api-test-folder.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test-folder.cxx' object='test_api-test-folder.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_api_CXXFLAGS) $(CXXFLAGS) -c -o test_api-test-folder.o `test -f 'test-folder.cxx' || echo '$(srcdir)/'`test-folder.cxx test_api-test-folder.obj: test-folder.cxx @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_api_CXXFLAGS) $(CXXFLAGS) -MT test_api-test-folder.obj -MD -MP -MF $(DEPDIR)/test_api-test-folder.Tpo -c -o test_api-test-folder.obj `if test -f 'test-folder.cxx'; then $(CYGPATH_W) 'test-folder.cxx'; else $(CYGPATH_W) '$(srcdir)/test-folder.cxx'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_api-test-folder.Tpo $(DEPDIR)/test_api-test-folder.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test-folder.cxx' object='test_api-test-folder.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_api_CXXFLAGS) $(CXXFLAGS) -c -o test_api-test-folder.obj `if test -f 'test-folder.cxx'; then $(CYGPATH_W) 'test-folder.cxx'; else $(CYGPATH_W) '$(srcdir)/test-folder.cxx'; fi` test_api-test-object.o: test-object.cxx @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_api_CXXFLAGS) $(CXXFLAGS) -MT test_api-test-object.o -MD -MP -MF $(DEPDIR)/test_api-test-object.Tpo -c -o test_api-test-object.o `test -f 'test-object.cxx' || echo '$(srcdir)/'`test-object.cxx @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_api-test-object.Tpo $(DEPDIR)/test_api-test-object.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test-object.cxx' object='test_api-test-object.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_api_CXXFLAGS) $(CXXFLAGS) -c -o test_api-test-object.o `test -f 'test-object.cxx' || echo '$(srcdir)/'`test-object.cxx test_api-test-object.obj: test-object.cxx @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_api_CXXFLAGS) $(CXXFLAGS) -MT test_api-test-object.obj -MD -MP -MF $(DEPDIR)/test_api-test-object.Tpo -c -o test_api-test-object.obj `if test -f 'test-object.cxx'; then $(CYGPATH_W) 'test-object.cxx'; else $(CYGPATH_W) '$(srcdir)/test-object.cxx'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_api-test-object.Tpo $(DEPDIR)/test_api-test-object.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test-object.cxx' object='test_api-test-object.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_api_CXXFLAGS) $(CXXFLAGS) -c -o test_api-test-object.obj `if test -f 'test-object.cxx'; then $(CYGPATH_W) 'test-object.cxx'; else $(CYGPATH_W) '$(srcdir)/test-object.cxx'; fi` test_api-test-object-type.o: test-object-type.cxx @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_api_CXXFLAGS) $(CXXFLAGS) -MT test_api-test-object-type.o -MD -MP -MF $(DEPDIR)/test_api-test-object-type.Tpo -c -o test_api-test-object-type.o `test -f 'test-object-type.cxx' || echo '$(srcdir)/'`test-object-type.cxx @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_api-test-object-type.Tpo $(DEPDIR)/test_api-test-object-type.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test-object-type.cxx' object='test_api-test-object-type.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_api_CXXFLAGS) $(CXXFLAGS) -c -o test_api-test-object-type.o `test -f 'test-object-type.cxx' || echo '$(srcdir)/'`test-object-type.cxx test_api-test-object-type.obj: test-object-type.cxx @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_api_CXXFLAGS) $(CXXFLAGS) -MT test_api-test-object-type.obj -MD -MP -MF $(DEPDIR)/test_api-test-object-type.Tpo -c -o test_api-test-object-type.obj `if test -f 'test-object-type.cxx'; then $(CYGPATH_W) 'test-object-type.cxx'; else $(CYGPATH_W) '$(srcdir)/test-object-type.cxx'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_api-test-object-type.Tpo $(DEPDIR)/test_api-test-object-type.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test-object-type.cxx' object='test_api-test-object-type.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_api_CXXFLAGS) $(CXXFLAGS) -c -o test_api-test-object-type.obj `if test -f 'test-object-type.cxx'; then $(CYGPATH_W) 'test-object-type.cxx'; else $(CYGPATH_W) '$(srcdir)/test-object-type.cxx'; fi` test_api-test-property.o: test-property.cxx @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_api_CXXFLAGS) $(CXXFLAGS) -MT test_api-test-property.o -MD -MP -MF $(DEPDIR)/test_api-test-property.Tpo -c -o test_api-test-property.o `test -f 'test-property.cxx' || echo '$(srcdir)/'`test-property.cxx @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_api-test-property.Tpo $(DEPDIR)/test_api-test-property.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test-property.cxx' object='test_api-test-property.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_api_CXXFLAGS) $(CXXFLAGS) -c -o test_api-test-property.o `test -f 'test-property.cxx' || echo '$(srcdir)/'`test-property.cxx test_api-test-property.obj: test-property.cxx @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_api_CXXFLAGS) $(CXXFLAGS) -MT test_api-test-property.obj -MD -MP -MF $(DEPDIR)/test_api-test-property.Tpo -c -o test_api-test-property.obj `if test -f 'test-property.cxx'; then $(CYGPATH_W) 'test-property.cxx'; else $(CYGPATH_W) '$(srcdir)/test-property.cxx'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_api-test-property.Tpo $(DEPDIR)/test_api-test-property.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test-property.cxx' object='test_api-test-property.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_api_CXXFLAGS) $(CXXFLAGS) -c -o test_api-test-property.obj `if test -f 'test-property.cxx'; then $(CYGPATH_W) 'test-property.cxx'; else $(CYGPATH_W) '$(srcdir)/test-property.cxx'; fi` test_api-test-property-type.o: test-property-type.cxx @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_api_CXXFLAGS) $(CXXFLAGS) -MT test_api-test-property-type.o -MD -MP -MF $(DEPDIR)/test_api-test-property-type.Tpo -c -o test_api-test-property-type.o `test -f 'test-property-type.cxx' || echo '$(srcdir)/'`test-property-type.cxx @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_api-test-property-type.Tpo $(DEPDIR)/test_api-test-property-type.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test-property-type.cxx' object='test_api-test-property-type.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_api_CXXFLAGS) $(CXXFLAGS) -c -o test_api-test-property-type.o `test -f 'test-property-type.cxx' || echo '$(srcdir)/'`test-property-type.cxx test_api-test-property-type.obj: test-property-type.cxx @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_api_CXXFLAGS) $(CXXFLAGS) -MT test_api-test-property-type.obj -MD -MP -MF $(DEPDIR)/test_api-test-property-type.Tpo -c -o test_api-test-property-type.obj `if test -f 'test-property-type.cxx'; then $(CYGPATH_W) 'test-property-type.cxx'; else $(CYGPATH_W) '$(srcdir)/test-property-type.cxx'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_api-test-property-type.Tpo $(DEPDIR)/test_api-test-property-type.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test-property-type.cxx' object='test_api-test-property-type.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_api_CXXFLAGS) $(CXXFLAGS) -c -o test_api-test-property-type.obj `if test -f 'test-property-type.cxx'; then $(CYGPATH_W) 'test-property-type.cxx'; else $(CYGPATH_W) '$(srcdir)/test-property-type.cxx'; fi` test_api-test-repository.o: test-repository.cxx @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_api_CXXFLAGS) $(CXXFLAGS) -MT test_api-test-repository.o -MD -MP -MF $(DEPDIR)/test_api-test-repository.Tpo -c -o test_api-test-repository.o `test -f 'test-repository.cxx' || echo '$(srcdir)/'`test-repository.cxx @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_api-test-repository.Tpo $(DEPDIR)/test_api-test-repository.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test-repository.cxx' object='test_api-test-repository.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_api_CXXFLAGS) $(CXXFLAGS) -c -o test_api-test-repository.o `test -f 'test-repository.cxx' || echo '$(srcdir)/'`test-repository.cxx test_api-test-repository.obj: test-repository.cxx @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_api_CXXFLAGS) $(CXXFLAGS) -MT test_api-test-repository.obj -MD -MP -MF $(DEPDIR)/test_api-test-repository.Tpo -c -o test_api-test-repository.obj `if test -f 'test-repository.cxx'; then $(CYGPATH_W) 'test-repository.cxx'; else $(CYGPATH_W) '$(srcdir)/test-repository.cxx'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_api-test-repository.Tpo $(DEPDIR)/test_api-test-repository.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test-repository.cxx' object='test_api-test-repository.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_api_CXXFLAGS) $(CXXFLAGS) -c -o test_api-test-repository.obj `if test -f 'test-repository.cxx'; then $(CYGPATH_W) 'test-repository.cxx'; else $(CYGPATH_W) '$(srcdir)/test-repository.cxx'; fi` test_api-test-session.o: test-session.cxx @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_api_CXXFLAGS) $(CXXFLAGS) -MT test_api-test-session.o -MD -MP -MF $(DEPDIR)/test_api-test-session.Tpo -c -o test_api-test-session.o `test -f 'test-session.cxx' || echo '$(srcdir)/'`test-session.cxx @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_api-test-session.Tpo $(DEPDIR)/test_api-test-session.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test-session.cxx' object='test_api-test-session.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_api_CXXFLAGS) $(CXXFLAGS) -c -o test_api-test-session.o `test -f 'test-session.cxx' || echo '$(srcdir)/'`test-session.cxx test_api-test-session.obj: test-session.cxx @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_api_CXXFLAGS) $(CXXFLAGS) -MT test_api-test-session.obj -MD -MP -MF $(DEPDIR)/test_api-test-session.Tpo -c -o test_api-test-session.obj `if test -f 'test-session.cxx'; then $(CYGPATH_W) 'test-session.cxx'; else $(CYGPATH_W) '$(srcdir)/test-session.cxx'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_api-test-session.Tpo $(DEPDIR)/test_api-test-session.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test-session.cxx' object='test_api-test-session.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_api_CXXFLAGS) $(CXXFLAGS) -c -o test_api-test-session.obj `if test -f 'test-session.cxx'; then $(CYGPATH_W) 'test-session.cxx'; else $(CYGPATH_W) '$(srcdir)/test-session.cxx'; fi` mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags check-TESTS: $(TESTS) @failed=0; all=0; xfail=0; xpass=0; skip=0; \ srcdir=$(srcdir); export srcdir; \ list=' $(TESTS) '; \ $(am__tty_colors); \ if test -n "$$list"; then \ for tst in $$list; do \ if test -f ./$$tst; then dir=./; \ elif test -f $$tst; then dir=; \ else dir="$(srcdir)/"; fi; \ if $(TESTS_ENVIRONMENT) $${dir}$$tst $(AM_TESTS_FD_REDIRECT); then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$tst[\ \ ]*) \ xpass=`expr $$xpass + 1`; \ failed=`expr $$failed + 1`; \ col=$$red; res=XPASS; \ ;; \ *) \ col=$$grn; res=PASS; \ ;; \ esac; \ elif test $$? -ne 77; then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$tst[\ \ ]*) \ xfail=`expr $$xfail + 1`; \ col=$$lgn; res=XFAIL; \ ;; \ *) \ failed=`expr $$failed + 1`; \ col=$$red; res=FAIL; \ ;; \ esac; \ else \ skip=`expr $$skip + 1`; \ col=$$blu; res=SKIP; \ fi; \ echo "$${col}$$res$${std}: $$tst"; \ done; \ if test "$$all" -eq 1; then \ tests="test"; \ All=""; \ else \ tests="tests"; \ All="All "; \ fi; \ if test "$$failed" -eq 0; then \ if test "$$xfail" -eq 0; then \ banner="$$All$$all $$tests passed"; \ else \ if test "$$xfail" -eq 1; then failures=failure; else failures=failures; fi; \ banner="$$All$$all $$tests behaved as expected ($$xfail expected $$failures)"; \ fi; \ else \ if test "$$xpass" -eq 0; then \ banner="$$failed of $$all $$tests failed"; \ else \ if test "$$xpass" -eq 1; then passes=pass; else passes=passes; fi; \ banner="$$failed of $$all $$tests did not behave as expected ($$xpass unexpected $$passes)"; \ fi; \ fi; \ dashes="$$banner"; \ skipped=""; \ if test "$$skip" -ne 0; then \ if test "$$skip" -eq 1; then \ skipped="($$skip test was not run)"; \ else \ skipped="($$skip tests were not run)"; \ fi; \ test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \ dashes="$$skipped"; \ fi; \ report=""; \ if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \ report="Please report to $(PACKAGE_BUGREPORT)"; \ test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \ dashes="$$report"; \ fi; \ dashes=`echo "$$dashes" | sed s/./=/g`; \ if test "$$failed" -eq 0; then \ col="$$grn"; \ else \ col="$$red"; \ fi; \ echo "$${col}$$dashes$${std}"; \ echo "$${col}$$banner$${std}"; \ test -z "$$skipped" || echo "$${col}$$skipped$${std}"; \ test -z "$$report" || echo "$${col}$$report$${std}"; \ echo "$${col}$$dashes$${std}"; \ test "$$failed" -eq 0; \ else :; fi distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-checkPROGRAMS clean-generic clean-libtool \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: check-am install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-TESTS check-am clean \ clean-checkPROGRAMS clean-generic clean-libtool cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: libcmis-0.4.1/qa/libcmis-c/test-object.cxx0000644000175000001440000003517712156277657015324 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2011 SUSE * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #include #include #include #include "allowable-actions.h" #include "error.h" #include "folder.h" #include "internals.hxx" #include "object.h" #include "object-type.h" #include "property.h" #include "property-type.h" #include "test-dummies.hxx" #include "vectors.h" using namespace std; class ObjectTest : public CppUnit::TestFixture { private: libcmis_ObjectPtr getTested( bool triggersFaults ); libcmis_FolderPtr getTestFolder( ); public: void getIdTest( ); void getNameTest( ); void getPathsTest( ); void getBaseTypeTest( ); void getTypeTest( ); void getCreatedByTest( ); void getCreationDateTest( ); void getLastModifiedByTest( ); void getLastModificationDateTest( ); void getChangeTokenTest( ); void isImmutableTest( ); void getPropertiesTest( ); void getPropertyTest( ); void getPropertyMissingTest( ); void updatePropertiesTest( ); void updatePropertiesErrorTest( ); void getTypeDescriptionTest( ); void getAllowableActionsTest( ); void refreshTest( ); void refreshErrorTest( ); void removeTest( ); void removeErrorTest( ); void moveTest( ); void moveErrorTest( ); void toStringTest( ); CPPUNIT_TEST_SUITE( ObjectTest ); CPPUNIT_TEST( getIdTest ); CPPUNIT_TEST( getNameTest ); CPPUNIT_TEST( getPathsTest ); CPPUNIT_TEST( getBaseTypeTest ); CPPUNIT_TEST( getTypeTest ); CPPUNIT_TEST( getCreatedByTest ); CPPUNIT_TEST( getCreationDateTest ); CPPUNIT_TEST( getLastModifiedByTest ); CPPUNIT_TEST( getLastModificationDateTest ); CPPUNIT_TEST( getChangeTokenTest ); CPPUNIT_TEST( isImmutableTest ); CPPUNIT_TEST( getPropertiesTest ); CPPUNIT_TEST( getPropertyTest ); CPPUNIT_TEST( getPropertyMissingTest ); CPPUNIT_TEST( updatePropertiesTest ); CPPUNIT_TEST( updatePropertiesErrorTest ); CPPUNIT_TEST( getTypeDescriptionTest ); CPPUNIT_TEST( getAllowableActionsTest ); CPPUNIT_TEST( refreshTest ); CPPUNIT_TEST( refreshErrorTest ); CPPUNIT_TEST( removeTest ); CPPUNIT_TEST( removeErrorTest ); CPPUNIT_TEST( moveTest ); CPPUNIT_TEST( moveErrorTest ); CPPUNIT_TEST( toStringTest ); CPPUNIT_TEST_SUITE_END( ); }; CPPUNIT_TEST_SUITE_REGISTRATION( ObjectTest ); libcmis_ObjectPtr ObjectTest::getTested( bool triggersFaults ) { libcmis_ObjectPtr result = new libcmis_object( ); libcmis::ObjectPtr handle( new dummies::Object( triggersFaults ) ); result->handle = handle; return result; } libcmis_FolderPtr ObjectTest::getTestFolder( ) { libcmis_FolderPtr result = new libcmis_folder( ); libcmis::FolderPtr handle( new dummies::Folder( false, false ) ); result->setHandle( handle ); return result; } void ObjectTest::getIdTest( ) { libcmis_ObjectPtr tested = getTested( false ); char* actual = libcmis_object_getId( tested ); CPPUNIT_ASSERT_EQUAL( string( "Object::Id" ), string( actual ) ); free( actual ); libcmis_object_free( tested ); } void ObjectTest::getNameTest( ) { libcmis_ObjectPtr tested = getTested( false ); char* actual = libcmis_object_getName( tested ); CPPUNIT_ASSERT_EQUAL( string( "Object::Name" ), string( actual ) ); free( actual ); libcmis_object_free( tested ); } void ObjectTest::getPathsTest( ) { libcmis_ObjectPtr tested = getTested( false ); libcmis_vector_string_Ptr actual = libcmis_object_getPaths( tested ); CPPUNIT_ASSERT_EQUAL( size_t( 2 ), libcmis_vector_string_size( actual ) ); CPPUNIT_ASSERT_EQUAL( string( "/Path1/" ), string( libcmis_vector_string_get( actual, 0 ) ) ); libcmis_vector_string_free( actual ); libcmis_object_free( tested ); } void ObjectTest::getBaseTypeTest( ) { libcmis_ObjectPtr tested = getTested( false ); char* actual = libcmis_object_getBaseType( tested ); CPPUNIT_ASSERT_EQUAL( string( "Object::BaseType" ), string( actual ) ); free( actual ); libcmis_object_free( tested ); } void ObjectTest::getTypeTest( ) { libcmis_ObjectPtr tested = getTested( false ); char* actual = libcmis_object_getType( tested ); CPPUNIT_ASSERT_EQUAL( string( "Object::Type" ), string( actual ) ); free( actual ); libcmis_object_free( tested ); } void ObjectTest::getCreatedByTest( ) { libcmis_ObjectPtr tested = getTested( false ); char* actual = libcmis_object_getCreatedBy( tested ); CPPUNIT_ASSERT_EQUAL( string( "Object::CreatedBy" ), string( actual ) ); free( actual ); libcmis_object_free( tested ); } void ObjectTest::getCreationDateTest( ) { libcmis_ObjectPtr tested = getTested( false ); time_t actual = libcmis_object_getCreationDate( tested ); CPPUNIT_ASSERT( 0 != actual ); libcmis_object_free( tested ); } void ObjectTest::getLastModifiedByTest( ) { libcmis_ObjectPtr tested = getTested( false ); char* actual = libcmis_object_getLastModifiedBy( tested ); CPPUNIT_ASSERT_EQUAL( string( "Object::LastModifiedBy" ), string( actual ) ); free( actual ); libcmis_object_free( tested ); } void ObjectTest::getLastModificationDateTest( ) { libcmis_ObjectPtr tested = getTested( false ); time_t actual = libcmis_object_getLastModificationDate( tested ); CPPUNIT_ASSERT( 0 != actual ); libcmis_object_free( tested ); } void ObjectTest::getChangeTokenTest( ) { libcmis_ObjectPtr tested = getTested( false ); char* actual = libcmis_object_getChangeToken( tested ); CPPUNIT_ASSERT_EQUAL( string( "Object::ChangeToken" ), string( actual ) ); free( actual ); libcmis_object_free( tested ); } void ObjectTest::isImmutableTest( ) { libcmis_ObjectPtr tested = getTested( false ); CPPUNIT_ASSERT( libcmis_object_isImmutable( tested ) ); libcmis_object_free( tested ); } void ObjectTest::getPropertiesTest( ) { libcmis_ObjectPtr tested = getTested( false ); libcmis_vector_property_Ptr actual = libcmis_object_getProperties( tested ); CPPUNIT_ASSERT_EQUAL( size_t( 1 ), libcmis_vector_property_size( actual ) ); libcmis_vector_property_free( actual ); libcmis_object_free( tested ); } void ObjectTest::getPropertyTest( ) { libcmis_ObjectPtr tested = getTested( false ); const char* id = "Property1"; libcmis_PropertyPtr actual = libcmis_object_getProperty( tested, id ); CPPUNIT_ASSERT( NULL != actual ); libcmis_property_free( actual ); libcmis_object_free( tested ); } void ObjectTest::getPropertyMissingTest( ) { libcmis_ObjectPtr tested = getTested( false ); const char* id = "MissingProperty"; libcmis_PropertyPtr actual = libcmis_object_getProperty( tested, id ); CPPUNIT_ASSERT( NULL == actual ); libcmis_property_free( actual ); libcmis_object_free( tested ); } void ObjectTest::updatePropertiesTest( ) { libcmis_ObjectPtr tested = getTested( false ); CPPUNIT_ASSERT_MESSAGE( "Timestamp not set to 0 initially", 0 == libcmis_object_getRefreshTimestamp( tested ) ); libcmis_ErrorPtr error = libcmis_error_create( ); // Create the changed properties map libcmis_vector_property_Ptr newProperties = libcmis_vector_property_create( ); libcmis_ObjectTypePtr objectType = libcmis_object_getTypeDescription( tested ); libcmis_PropertyTypePtr propertyType = libcmis_object_type_getPropertyType( objectType, "cmis:Property2" ); size_t size = 2; const char** values = new const char*[size]; values[0] = "Value 1"; values[1] = "Value 2"; libcmis_PropertyPtr newProperty = libcmis_property_create( propertyType, values, size ); delete[ ] values; libcmis_vector_property_append( newProperties, newProperty ); // Update the properties (method under test) libcmis_ObjectPtr updated = libcmis_object_updateProperties( tested, newProperties, error ); // Checks CPPUNIT_ASSERT_MESSAGE( "Timestamp not updated", 0 != libcmis_object_getRefreshTimestamp( tested ) ); CPPUNIT_ASSERT( updated != NULL ); // Free it all libcmis_object_free( updated ); libcmis_property_free( newProperty ); libcmis_property_type_free( propertyType ); libcmis_object_type_free( objectType ); libcmis_vector_property_free( newProperties ); libcmis_error_free( error ); libcmis_object_free( tested ); } void ObjectTest::updatePropertiesErrorTest( ) { libcmis_ObjectPtr tested = getTested( true ); CPPUNIT_ASSERT_MESSAGE( "Timestamp not set to 0 initially", 0 == libcmis_object_getRefreshTimestamp( tested ) ); libcmis_ErrorPtr error = libcmis_error_create( ); // Create the changed properties map libcmis_vector_property_Ptr newProperties = libcmis_vector_property_create( ); libcmis_ObjectTypePtr objectType = libcmis_object_getTypeDescription( tested ); libcmis_PropertyTypePtr propertyType = libcmis_object_type_getPropertyType( objectType, "cmis:Property2" ); size_t size = 2; const char** values = new const char*[size]; values[0] = "Value 1"; values[1] = "Value 2"; libcmis_PropertyPtr newProperty = libcmis_property_create( propertyType, values, size ); delete[ ] values; libcmis_vector_property_append( newProperties, newProperty ); // Update the properties (method under test) libcmis_ObjectPtr updated = libcmis_object_updateProperties( tested, newProperties, error ); // Checks CPPUNIT_ASSERT( updated == NULL ); const char* actualMessage = libcmis_error_getMessage( error ); CPPUNIT_ASSERT( !string( actualMessage ).empty( ) ); // Free it all libcmis_object_free( updated ); libcmis_property_free( newProperty ); libcmis_property_type_free( propertyType ); libcmis_object_type_free( objectType ); libcmis_vector_property_free( newProperties ); libcmis_error_free( error ); libcmis_object_free( tested ); } void ObjectTest::getTypeDescriptionTest( ) { libcmis_ObjectPtr tested = getTested( false ); libcmis_ObjectTypePtr actual = libcmis_object_getTypeDescription( tested ); char* actualId = libcmis_object_type_getId( actual ); CPPUNIT_ASSERT( !string( actualId ).empty( ) ); free( actualId ); libcmis_object_type_free( actual ); libcmis_object_free( tested ); } void ObjectTest::getAllowableActionsTest( ) { libcmis_ObjectPtr tested = getTested( false ); libcmis_AllowableActionsPtr actual = libcmis_object_getAllowableActions( tested ); CPPUNIT_ASSERT( libcmis_allowable_actions_isDefined( actual, libcmis_GetFolderParent ) ); libcmis_allowable_actions_free( actual ); libcmis_object_free( tested ); } void ObjectTest::refreshTest( ) { libcmis_ObjectPtr tested = getTested( false ); CPPUNIT_ASSERT_MESSAGE( "Timestamp not set to 0 initially", 0 == libcmis_object_getRefreshTimestamp( tested ) ); libcmis_ErrorPtr error = libcmis_error_create( ); libcmis_object_refresh( tested, error ); CPPUNIT_ASSERT_MESSAGE( "Timestamp not updated", 0 != libcmis_object_getRefreshTimestamp( tested ) ); libcmis_error_free( error ); libcmis_object_free( tested ); } void ObjectTest::refreshErrorTest( ) { libcmis_ObjectPtr tested = getTested( true ); CPPUNIT_ASSERT_MESSAGE( "Timestamp not set to 0 initially", 0 == libcmis_object_getRefreshTimestamp( tested ) ); libcmis_ErrorPtr error = libcmis_error_create( ); libcmis_object_refresh( tested, error ); const char* actualMessage = libcmis_error_getMessage( error ); CPPUNIT_ASSERT( !string( actualMessage ).empty( ) ); libcmis_error_free( error ); libcmis_object_free( tested ); } void ObjectTest::removeTest( ) { libcmis_ObjectPtr tested = getTested( false ); CPPUNIT_ASSERT_MESSAGE( "Timestamp not set to 0 initially", 0 == libcmis_object_getRefreshTimestamp( tested ) ); libcmis_ErrorPtr error = libcmis_error_create( ); libcmis_object_remove( tested, true, error ); CPPUNIT_ASSERT_MESSAGE( "Timestamp not updated", 0 != libcmis_object_getRefreshTimestamp( tested ) ); libcmis_error_free( error ); libcmis_object_free( tested ); } void ObjectTest::removeErrorTest( ) { libcmis_ObjectPtr tested = getTested( true ); CPPUNIT_ASSERT_MESSAGE( "Timestamp not set to 0 initially", 0 == libcmis_object_getRefreshTimestamp( tested ) ); libcmis_ErrorPtr error = libcmis_error_create( ); libcmis_object_remove( tested, true, error ); const char* actualMessage = libcmis_error_getMessage( error ); CPPUNIT_ASSERT( !string( actualMessage ).empty( ) ); libcmis_error_free( error ); libcmis_object_free( tested ); } void ObjectTest::moveTest( ) { libcmis_ObjectPtr tested = getTested( false ); CPPUNIT_ASSERT_MESSAGE( "Timestamp not set to 0 initially", 0 == libcmis_object_getRefreshTimestamp( tested ) ); libcmis_ErrorPtr error = libcmis_error_create( ); // Move the object from source to dest (tested method) libcmis_FolderPtr source = getTestFolder( ); libcmis_FolderPtr dest = getTestFolder( ); libcmis_object_move( tested, source, dest, error ); // Check CPPUNIT_ASSERT_MESSAGE( "Timestamp not updated", 0 != libcmis_object_getRefreshTimestamp( tested ) ); // Free it all libcmis_folder_free( dest ); libcmis_folder_free( source ); libcmis_error_free( error ); libcmis_object_free( tested ); } void ObjectTest::moveErrorTest( ) { } void ObjectTest::toStringTest( ) { libcmis_ObjectPtr tested = getTested( false ); char* actual = libcmis_object_toString( tested ); CPPUNIT_ASSERT_EQUAL( string( "Object::toString" ), string( actual ) ); free( actual ); libcmis_object_free( tested ); } libcmis-0.4.1/qa/libcmis-c/Makefile.am0000644000175000001440000000204612156277657014376 00000000000000 if ENABLE_TESTS check_PROGRAMS = \ test-api \ test-c-build test_api_SOURCES = \ test-api.cxx \ test-allowable-actions.cxx \ test-document.cxx \ test-dummies.hxx \ test-dummies.cxx \ test-folder.cxx \ test-object.cxx \ test-object-type.cxx \ test-property.cxx \ test-property-type.cxx \ test-repository.cxx \ test-session.cxx test_api_CXXFLAGS = -I$(top_srcdir)/src/ -I$(top_srcdir)/src/libcmis-c/ $(XML2_CFLAGS) $(BOOST_CPPFLAGS) test_api_LDADD = \ $(top_builddir)/src/libcmis-c/libcmis-c-@LIBCMIS_API_VERSION@.la \ $(top_builddir)/src/libcmis/libcmis-@LIBCMIS_API_VERSION@.la \ $(XML2_LIBS) \ $(CURL_LIBS) \ $(CPPUNIT_LIBS) \ $(BOOST_DATE_TIME_LIBS) test_c_build_SOURCES = \ test-build.c test_c_build_CFLAGS = -I$(top_srcdir)/src/ -I$(top_srcdir)/src/libcmis-c/ $(XML2_CFLAGS) test_c_build_LDADD = \ $(top_builddir)/src/libcmis-c/libcmis-c-@LIBCMIS_API_VERSION@.la \ $(top_builddir)/src/libcmis/libcmis-@LIBCMIS_API_VERSION@.la \ $(XML2_LIBS) \ $(CURL_LIBS) \ $(CPPUNIT_LIBS) \ $(BOOST_DATE_TIME_LIBS) TESTS = test-api endif libcmis-0.4.1/qa/libcmis-c/test-object-type.cxx0000644000175000001440000003060012156277657016265 00000000000000 /* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2011 SUSE * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #include #include #include #include "error.h" #include "internals.hxx" #include "object-type.h" #include "property-type.h" #include "test-dummies.hxx" using namespace std; class ObjectTypeTest : public CppUnit::TestFixture { private: libcmis_ObjectTypePtr getTested( bool rootType, bool triggersFaults ); public: void getIdTest( ); void getLocalNameTest( ); void getLocalNamespaceTest( ); void getQueryNameTest( ); void getDisplayNameTest( ); void getDescriptionTest( ); void getParentTypeTest( ); void getParentTypeRootTest( ); void getParentTypeErrorTest( ); void getBaseTypeTest( ); void getBaseTypeErrorTest( ); void getChildrenTest( ); void getChildrenErrorTest( ); void isCreatableTest( ); void isFileableTest( ); void isQueryableTest( ); void isFulltextIndexedTest( ); void isIncludedInSupertypeQueryTest( ); void isControllablePolicyTest( ); void isControllableACLTest( ); void isVersionableTest( ); void getContentStreamAllowedTest( ); void getPropertiesTypesTest( ); void getPropertyTypeTest( ); void toStringTest( ); // TODO Add more tests CPPUNIT_TEST_SUITE( ObjectTypeTest ); CPPUNIT_TEST( getIdTest ); CPPUNIT_TEST( getLocalNameTest ); CPPUNIT_TEST( getLocalNamespaceTest ); CPPUNIT_TEST( getQueryNameTest ); CPPUNIT_TEST( getDisplayNameTest ); CPPUNIT_TEST( getDescriptionTest ); CPPUNIT_TEST( getParentTypeTest ); CPPUNIT_TEST( getParentTypeRootTest ); CPPUNIT_TEST( getParentTypeErrorTest ); CPPUNIT_TEST( getBaseTypeTest ); CPPUNIT_TEST( getBaseTypeErrorTest ); CPPUNIT_TEST( getChildrenTest ); CPPUNIT_TEST( getChildrenErrorTest ); CPPUNIT_TEST( isCreatableTest ); CPPUNIT_TEST( isFileableTest ); CPPUNIT_TEST( isQueryableTest ); CPPUNIT_TEST( isFulltextIndexedTest ); CPPUNIT_TEST( isIncludedInSupertypeQueryTest ); CPPUNIT_TEST( isControllablePolicyTest ); CPPUNIT_TEST( isControllableACLTest ); CPPUNIT_TEST( isVersionableTest ); CPPUNIT_TEST( getContentStreamAllowedTest ); CPPUNIT_TEST( getPropertiesTypesTest ); CPPUNIT_TEST( getPropertyTypeTest ); CPPUNIT_TEST( toStringTest ); CPPUNIT_TEST_SUITE_END( ); }; CPPUNIT_TEST_SUITE_REGISTRATION( ObjectTypeTest ); libcmis_ObjectTypePtr ObjectTypeTest::getTested( bool rootType, bool triggersFaults ) { libcmis_ObjectTypePtr result = new libcmis_object_type( ); libcmis::ObjectTypePtr handle( new dummies::ObjectType( rootType, triggersFaults ) ); result->handle = handle; return result; } void ObjectTypeTest::getIdTest( ) { libcmis_ObjectTypePtr tested = getTested( false, false ); char* id = libcmis_object_type_getId( tested ); CPPUNIT_ASSERT_EQUAL( string( "ObjectType::Id" ), string( id ) ); free( id ); libcmis_object_type_free( tested ); } void ObjectTypeTest::getLocalNameTest( ) { libcmis_ObjectTypePtr tested = getTested( false, false ); char* actual = libcmis_object_type_getLocalName( tested ); CPPUNIT_ASSERT_EQUAL( string( "ObjectType::LocalName" ), string( actual ) ); free( actual ); libcmis_object_type_free( tested ); } void ObjectTypeTest::getLocalNamespaceTest( ) { libcmis_ObjectTypePtr tested = getTested( false, false ); char* actual = libcmis_object_type_getLocalNamespace( tested ); CPPUNIT_ASSERT_EQUAL( string( "ObjectType::LocalNamespace" ), string( actual ) ); free( actual ); libcmis_object_type_free( tested ); } void ObjectTypeTest::getQueryNameTest( ) { libcmis_ObjectTypePtr tested = getTested( false, false ); char* actual = libcmis_object_type_getQueryName( tested ); CPPUNIT_ASSERT_EQUAL( string( "ObjectType::QueryName" ), string( actual ) ); free( actual ); libcmis_object_type_free( tested ); } void ObjectTypeTest::getDisplayNameTest( ) { libcmis_ObjectTypePtr tested = getTested( false, false ); char* actual = libcmis_object_type_getDisplayName( tested ); CPPUNIT_ASSERT_EQUAL( string( "ObjectType::DisplayName" ), string( actual ) ); free( actual ); libcmis_object_type_free( tested ); } void ObjectTypeTest::getDescriptionTest( ) { libcmis_ObjectTypePtr tested = getTested( false, false ); char* actual = libcmis_object_type_getDescription( tested ); CPPUNIT_ASSERT_EQUAL( string( "ObjectType::Description" ), string( actual ) ); free( actual ); libcmis_object_type_free( tested ); } void ObjectTypeTest::getParentTypeTest( ) { libcmis_ObjectTypePtr tested = getTested( false, false ); libcmis_ErrorPtr error = libcmis_error_create( ); libcmis_ObjectTypePtr parent = libcmis_object_type_getParentType( tested, error ); CPPUNIT_ASSERT( NULL == libcmis_error_getMessage( error ) ); char* id = libcmis_object_type_getId( parent ); CPPUNIT_ASSERT_EQUAL( string( "ParentType::Id" ), string( id ) ); free( id ); libcmis_error_free( error ); libcmis_object_type_free( parent ); libcmis_object_type_free( tested ); } void ObjectTypeTest::getParentTypeRootTest( ) { libcmis_ObjectTypePtr tested = getTested( true, false ); libcmis_ErrorPtr error = libcmis_error_create( ); libcmis_ObjectTypePtr parent = libcmis_object_type_getParentType( tested, error ); CPPUNIT_ASSERT( NULL == libcmis_error_getMessage( error ) ); CPPUNIT_ASSERT( NULL == parent ); libcmis_error_free( error ); libcmis_object_type_free( tested ); } void ObjectTypeTest::getParentTypeErrorTest( ) { libcmis_ObjectTypePtr tested = getTested( false, true ); libcmis_ErrorPtr error = libcmis_error_create( ); libcmis_ObjectTypePtr parent = libcmis_object_type_getParentType( tested, error ); CPPUNIT_ASSERT( NULL != libcmis_error_getMessage( error ) ); CPPUNIT_ASSERT( NULL == parent ); libcmis_error_free( error ); libcmis_object_type_free( tested ); } void ObjectTypeTest::getBaseTypeTest( ) { libcmis_ObjectTypePtr tested = getTested( false, false ); libcmis_ErrorPtr error = libcmis_error_create( ); libcmis_ObjectTypePtr base = libcmis_object_type_getBaseType( tested, error ); CPPUNIT_ASSERT( NULL == libcmis_error_getMessage( error ) ); char* id = libcmis_object_type_getId( base ); CPPUNIT_ASSERT_EQUAL( string( "RootType::Id" ), string( id ) ); free( id ); libcmis_error_free( error ); libcmis_object_type_free( base ); libcmis_object_type_free( tested ); } void ObjectTypeTest::getBaseTypeErrorTest( ) { libcmis_ObjectTypePtr tested = getTested( false, true ); libcmis_ErrorPtr error = libcmis_error_create( ); libcmis_ObjectTypePtr base = libcmis_object_type_getBaseType( tested, error ); CPPUNIT_ASSERT( NULL != libcmis_error_getMessage( error ) ); CPPUNIT_ASSERT( NULL == base ); libcmis_error_free( error ); libcmis_object_type_free( tested ); } void ObjectTypeTest::getChildrenTest( ) { libcmis_ObjectTypePtr tested = getTested( false, false ); libcmis_ErrorPtr error = libcmis_error_create( ); libcmis_vector_object_type_Ptr children = libcmis_object_type_getChildren( tested, error ); CPPUNIT_ASSERT( NULL == libcmis_error_getMessage( error ) ); size_t size = libcmis_vector_object_type_size( children ); CPPUNIT_ASSERT_EQUAL( size_t( 2 ), size ); libcmis_error_free( error ); libcmis_vector_object_type_free( children ); libcmis_object_type_free( tested ); } void ObjectTypeTest::getChildrenErrorTest( ) { libcmis_ObjectTypePtr tested = getTested( false, true ); libcmis_ErrorPtr error = libcmis_error_create( ); libcmis_vector_object_type_Ptr children = libcmis_object_type_getChildren( tested, error ); CPPUNIT_ASSERT( NULL != libcmis_error_getMessage( error ) ); CPPUNIT_ASSERT( NULL == children ); libcmis_error_free( error ); libcmis_object_type_free( tested ); } void ObjectTypeTest::isCreatableTest( ) { libcmis_ObjectTypePtr tested = getTested( false, false ); CPPUNIT_ASSERT( libcmis_object_type_isCreatable( tested ) ); libcmis_object_type_free( tested ); } void ObjectTypeTest::isFileableTest( ) { libcmis_ObjectTypePtr tested = getTested( false, false ); CPPUNIT_ASSERT( libcmis_object_type_isFileable( tested ) ); libcmis_object_type_free( tested ); } void ObjectTypeTest::isQueryableTest( ) { libcmis_ObjectTypePtr tested = getTested( false, false ); CPPUNIT_ASSERT( libcmis_object_type_isQueryable( tested ) ); libcmis_object_type_free( tested ); } void ObjectTypeTest::isFulltextIndexedTest( ) { libcmis_ObjectTypePtr tested = getTested( false, false ); CPPUNIT_ASSERT( libcmis_object_type_isFulltextIndexed( tested ) ); libcmis_object_type_free( tested ); } void ObjectTypeTest::isIncludedInSupertypeQueryTest( ) { libcmis_ObjectTypePtr tested = getTested( false, false ); CPPUNIT_ASSERT( libcmis_object_type_isIncludedInSupertypeQuery( tested ) ); libcmis_object_type_free( tested ); } void ObjectTypeTest::isControllablePolicyTest( ) { libcmis_ObjectTypePtr tested = getTested( false, false ); CPPUNIT_ASSERT( libcmis_object_type_isControllablePolicy( tested ) ); libcmis_object_type_free( tested ); } void ObjectTypeTest::isControllableACLTest( ) { libcmis_ObjectTypePtr tested = getTested( false, false ); CPPUNIT_ASSERT( libcmis_object_type_isControllableACL( tested ) ); libcmis_object_type_free( tested ); } void ObjectTypeTest::isVersionableTest( ) { libcmis_ObjectTypePtr tested = getTested( false, false ); CPPUNIT_ASSERT( libcmis_object_type_isVersionable( tested ) ); libcmis_object_type_free( tested ); } void ObjectTypeTest::getContentStreamAllowedTest( ) { libcmis_ObjectTypePtr tested = getTested( false, false ); CPPUNIT_ASSERT_EQUAL( libcmis_Allowed, libcmis_object_type_getContentStreamAllowed( tested ) ); libcmis_object_type_free( tested ); } void ObjectTypeTest::getPropertiesTypesTest( ) { libcmis_ObjectTypePtr tested = getTested( false, false ); libcmis_vector_property_type_Ptr propertiesTypes = libcmis_object_type_getPropertiesTypes( tested ); CPPUNIT_ASSERT_EQUAL( size_t( 3 ), libcmis_vector_property_type_size( propertiesTypes ) ); libcmis_vector_property_type_free( propertiesTypes ); libcmis_object_type_free( tested ); } void ObjectTypeTest::getPropertyTypeTest( ) { libcmis_ObjectTypePtr tested = getTested( false, false ); string id( "Property2" ); libcmis_PropertyTypePtr propertyType = libcmis_object_type_getPropertyType( tested, id.c_str( ) ); char* propertyId = libcmis_property_type_getId( propertyType ); CPPUNIT_ASSERT_EQUAL( id, string( propertyId ) ); free( propertyId ); libcmis_property_type_free( propertyType ); libcmis_object_type_free( tested ); } void ObjectTypeTest::toStringTest( ) { libcmis_ObjectTypePtr tested = getTested( false, false ); char* actual = libcmis_object_type_toString( tested ); CPPUNIT_ASSERT_EQUAL( string( "ObjectType::toString" ), string( actual ) ); free( actual ); libcmis_object_type_free( tested ); } libcmis-0.4.1/qa/libcmis-c/test-repository.cxx0000644000175000001440000001420012156277657016255 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2011 SUSE * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #include #include #include #include "internals.hxx" #include "repository.h" #include "test-dummies.hxx" using namespace std; class RepositoryTest : public CppUnit::TestFixture { private: libcmis_RepositoryPtr getTested( ); public: void getIdTest( ); void getNameTest( ); void getDescriptionTest( ); void getVendorNameTest( ); void getProductNameTest( ); void getProductVersionTest( ); void getRootIdTest( ); void getCmisVersionSupportedTest( ); void getThinClientUriTest( ); void getPrincipalAnonymousTest( ); void getPrincipalAnyoneTest( ); CPPUNIT_TEST_SUITE( RepositoryTest ); CPPUNIT_TEST( getIdTest ); CPPUNIT_TEST( getNameTest ); CPPUNIT_TEST( getDescriptionTest ); CPPUNIT_TEST( getVendorNameTest ); CPPUNIT_TEST( getProductNameTest ); CPPUNIT_TEST( getProductVersionTest ); CPPUNIT_TEST( getRootIdTest ); CPPUNIT_TEST( getCmisVersionSupportedTest ); CPPUNIT_TEST( getThinClientUriTest ); CPPUNIT_TEST( getPrincipalAnonymousTest ); CPPUNIT_TEST( getPrincipalAnyoneTest ); CPPUNIT_TEST_SUITE_END( ); }; CPPUNIT_TEST_SUITE_REGISTRATION( RepositoryTest ); libcmis_RepositoryPtr RepositoryTest::getTested( ) { libcmis_RepositoryPtr result = new libcmis_repository( ); libcmis::RepositoryPtr handle( new dummies::Repository( ) ); result->handle = handle; return result; } void RepositoryTest::getIdTest( ) { libcmis_RepositoryPtr tested = getTested( ); char* actual = libcmis_repository_getId( tested ); string expected( "Repository::Id" ); CPPUNIT_ASSERT_EQUAL( expected, string( actual ) ); free( actual ); libcmis_repository_free( tested ); } void RepositoryTest::getNameTest( ) { libcmis_RepositoryPtr tested = getTested( ); char* actual = libcmis_repository_getName( tested ); string expected( "Repository::Name" ); CPPUNIT_ASSERT_EQUAL( expected, string( actual ) ); free( actual ); libcmis_repository_free( tested ); } void RepositoryTest::getDescriptionTest( ) { libcmis_RepositoryPtr tested = getTested( ); char* actual = libcmis_repository_getDescription( tested ); string expected( "Repository::Description" ); CPPUNIT_ASSERT_EQUAL( expected, string( actual ) ); free( actual ); libcmis_repository_free( tested ); } void RepositoryTest::getVendorNameTest( ) { libcmis_RepositoryPtr tested = getTested( ); char* actual = libcmis_repository_getVendorName( tested ); string expected( "Repository::VendorName" ); CPPUNIT_ASSERT_EQUAL( expected, string( actual ) ); free( actual ); libcmis_repository_free( tested ); } void RepositoryTest::getProductNameTest( ) { libcmis_RepositoryPtr tested = getTested( ); char* actual = libcmis_repository_getProductName( tested ); string expected( "Repository::ProductName" ); CPPUNIT_ASSERT_EQUAL( expected, string( actual ) ); free( actual ); libcmis_repository_free( tested ); } void RepositoryTest::getProductVersionTest( ) { libcmis_RepositoryPtr tested = getTested( ); char* actual = libcmis_repository_getProductVersion( tested ); string expected( "Repository::ProductVersion" ); CPPUNIT_ASSERT_EQUAL( expected, string( actual ) ); free( actual ); libcmis_repository_free( tested ); } void RepositoryTest::getRootIdTest( ) { libcmis_RepositoryPtr tested = getTested( ); char* actual = libcmis_repository_getRootId( tested ); string expected( "Repository::RootId" ); CPPUNIT_ASSERT_EQUAL( expected, string( actual ) ); free( actual ); libcmis_repository_free( tested ); } void RepositoryTest::getCmisVersionSupportedTest( ) { libcmis_RepositoryPtr tested = getTested( ); char* actual = libcmis_repository_getCmisVersionSupported( tested ); string expected( "Repository::CmisVersionSupported" ); CPPUNIT_ASSERT_EQUAL( expected, string( actual ) ); free( actual ); libcmis_repository_free( tested ); } void RepositoryTest::getThinClientUriTest( ) { libcmis_RepositoryPtr tested = getTested( ); char* actual = libcmis_repository_getThinClientUri( tested ); string expected( "Repository::ThinClientUri" ); CPPUNIT_ASSERT_EQUAL( expected, string( actual ) ); free( actual ); libcmis_repository_free( tested ); } void RepositoryTest::getPrincipalAnonymousTest( ) { libcmis_RepositoryPtr tested = getTested( ); char* actual = libcmis_repository_getPrincipalAnonymous( tested ); string expected( "Repository::PrincipalAnonymous" ); CPPUNIT_ASSERT_EQUAL( expected, string( actual ) ); free( actual ); libcmis_repository_free( tested ); } void RepositoryTest::getPrincipalAnyoneTest( ) { libcmis_RepositoryPtr tested = getTested( ); char* actual = libcmis_repository_getPrincipalAnyone( tested ); string expected( "Repository::PrincipalAnyone" ); CPPUNIT_ASSERT_EQUAL( expected, string( actual ) ); free( actual ); libcmis_repository_free( tested ); } libcmis-0.4.1/qa/libcmis-c/test-session.cxx0000644000175000001440000000426112156277657015527 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2011 SUSE * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #include #include #include #include "internals.hxx" #include "repository.h" #include "session.h" #include "test-dummies.hxx" using namespace std; class SessionTest : public CppUnit::TestFixture { private: libcmis_SessionPtr getTested( ); public: void getRepositoriesTest( ); CPPUNIT_TEST_SUITE( SessionTest ); CPPUNIT_TEST( getRepositoriesTest ); CPPUNIT_TEST_SUITE_END( ); }; CPPUNIT_TEST_SUITE_REGISTRATION( SessionTest ); libcmis_SessionPtr SessionTest::getTested( ) { libcmis_SessionPtr result = new libcmis_session(); libcmis::Session* handle = new dummies::Session( ); result->handle = handle; return result; } void SessionTest::getRepositoriesTest( ) { libcmis_SessionPtr session = getTested( ); libcmis_vector_Repository_Ptr repos = libcmis_session_getRepositories( session ); size_t actualSize = libcmis_vector_repository_size( repos ); CPPUNIT_ASSERT_EQUAL( size_t( 2 ), actualSize ); libcmis_vector_repository_free( repos ); libcmis_session_free( session ); } libcmis-0.4.1/qa/libcmis-c/test-allowable-actions.cxx0000644000175000001440000000526512156277657017451 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2011 SUSE * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #include #include #include #include "allowable-actions.h" #include "internals.hxx" #include "test-dummies.hxx" using namespace std; class AllowableActionsTest : public CppUnit::TestFixture { private: libcmis_AllowableActionsPtr getTested( ); public: void isDefinedTest( ); void isAllowedTest( ); CPPUNIT_TEST_SUITE( AllowableActionsTest ); CPPUNIT_TEST( isDefinedTest ); CPPUNIT_TEST( isAllowedTest ); CPPUNIT_TEST_SUITE_END( ); }; CPPUNIT_TEST_SUITE_REGISTRATION( AllowableActionsTest ); libcmis_AllowableActionsPtr AllowableActionsTest::getTested( ) { libcmis_AllowableActionsPtr result = new libcmis_allowable_actions( ); libcmis::AllowableActionsPtr handle( new dummies::AllowableActions( ) ); result->handle = handle; return result; } void AllowableActionsTest::isDefinedTest( ) { libcmis_AllowableActionsPtr allowableActions = getTested( ); CPPUNIT_ASSERT( !libcmis_allowable_actions_isDefined( allowableActions, libcmis_DeleteObject ) ); CPPUNIT_ASSERT( libcmis_allowable_actions_isDefined( allowableActions, libcmis_GetFolderParent ) ); libcmis_allowable_actions_free( allowableActions ); } void AllowableActionsTest::isAllowedTest( ) { libcmis_AllowableActionsPtr allowableActions = getTested( ); CPPUNIT_ASSERT( libcmis_allowable_actions_isAllowed( allowableActions, libcmis_GetProperties ) ); CPPUNIT_ASSERT( !libcmis_allowable_actions_isAllowed( allowableActions, libcmis_GetFolderParent ) ); libcmis_allowable_actions_free( allowableActions ); } libcmis-0.4.1/qa/libcmis-c/test-property-type.cxx0000644000175000001440000002001412156277657016701 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2011 SUSE * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #include #include #include #include "internals.hxx" #include "property-type.h" #include "test-dummies.hxx" using namespace std; class PropertyTypeTest : public CppUnit::TestFixture { private: libcmis_PropertyTypePtr getTested( string id, string xmlType ); public: void getIdTest( ); void getLocalNameTest( ); void getLocalNamespaceTest( ); void getDisplayNameTest( ); void getQueryNameTest( ); void getTypeTest( ); void isMultiValuedTest( ); void isUpdatableTest( ); void isInheritedTest( ); void isRequiredTest( ); void isQueryableTest( ); void isOrderableTest( ); void isOpenChoiceTest( ); CPPUNIT_TEST_SUITE( PropertyTypeTest ); CPPUNIT_TEST( getIdTest ); CPPUNIT_TEST( getLocalNameTest ); CPPUNIT_TEST( getLocalNamespaceTest ); CPPUNIT_TEST( getDisplayNameTest ); CPPUNIT_TEST( getQueryNameTest ); CPPUNIT_TEST( getTypeTest ); CPPUNIT_TEST( isMultiValuedTest ); CPPUNIT_TEST( isUpdatableTest ); CPPUNIT_TEST( isInheritedTest ); CPPUNIT_TEST( isRequiredTest ); CPPUNIT_TEST( isQueryableTest ); CPPUNIT_TEST( isOrderableTest ); CPPUNIT_TEST( isOpenChoiceTest ); CPPUNIT_TEST_SUITE_END( ); }; CPPUNIT_TEST_SUITE_REGISTRATION( PropertyTypeTest ); libcmis_PropertyTypePtr PropertyTypeTest::getTested( string id, string xmlType ) { libcmis_PropertyTypePtr result = new libcmis_property_type( ); libcmis::PropertyTypePtr handle( new dummies::PropertyType( id, xmlType ) ); result->handle = handle; return result; } void PropertyTypeTest::getIdTest( ) { string id( "Id" ); libcmis_PropertyTypePtr tested = getTested( id, "string" ); char* actual = libcmis_property_type_getId( tested ); CPPUNIT_ASSERT_EQUAL( id, string( actual ) ); free( actual ); libcmis_property_type_free( tested ); } void PropertyTypeTest::getLocalNameTest( ) { libcmis_PropertyTypePtr tested = getTested( "id", "string" ); char* actual = libcmis_property_type_getLocalName( tested ); CPPUNIT_ASSERT_EQUAL( string( "PropertyType::LocalName" ), string( actual ) ); free( actual ); libcmis_property_type_free( tested ); } void PropertyTypeTest::getLocalNamespaceTest( ) { libcmis_PropertyTypePtr tested = getTested( "id", "string" ); char* actual = libcmis_property_type_getLocalNamespace( tested ); CPPUNIT_ASSERT_EQUAL( string( "PropertyType::LocalNamespace" ), string( actual ) ); free( actual ); libcmis_property_type_free( tested ); } void PropertyTypeTest::getDisplayNameTest( ) { libcmis_PropertyTypePtr tested = getTested( "id", "string" ); char* actual = libcmis_property_type_getDisplayName( tested ); CPPUNIT_ASSERT_EQUAL( string( "PropertyType::DisplayName" ), string( actual ) ); free( actual ); libcmis_property_type_free( tested ); } void PropertyTypeTest::getQueryNameTest( ) { libcmis_PropertyTypePtr tested = getTested( "id", "string" ); char* actual = libcmis_property_type_getQueryName( tested ); CPPUNIT_ASSERT_EQUAL( string( "PropertyType::QueryName" ), string( actual ) ); free( actual ); libcmis_property_type_free( tested ); } void PropertyTypeTest::getTypeTest( ) { // String { libcmis_PropertyTypePtr tested = getTested( "id", "string" ); libcmis_property_type_Type actualType = libcmis_property_type_getType( tested ); CPPUNIT_ASSERT_EQUAL( libcmis_String, actualType ); char* actualXml = libcmis_property_type_getXmlType( tested ); CPPUNIT_ASSERT_EQUAL( string( "String" ), string( actualXml ) ); free( actualXml ); libcmis_property_type_free( tested ); } // DateTime { libcmis_PropertyTypePtr tested = getTested( "id", "datetime" ); libcmis_property_type_Type actualType = libcmis_property_type_getType( tested ); CPPUNIT_ASSERT_EQUAL( libcmis_DateTime, actualType ); char* actualXml = libcmis_property_type_getXmlType( tested ); CPPUNIT_ASSERT_EQUAL( string( "DateTime" ), string( actualXml ) ); free( actualXml ); libcmis_property_type_free( tested ); } // Integer { libcmis_PropertyTypePtr tested = getTested( "id", "integer" ); libcmis_property_type_Type actualType = libcmis_property_type_getType( tested ); CPPUNIT_ASSERT_EQUAL( libcmis_Integer, actualType ); char* actualXml = libcmis_property_type_getXmlType( tested ); CPPUNIT_ASSERT_EQUAL( string( "Integer" ), string( actualXml ) ); free( actualXml ); libcmis_property_type_free( tested ); } // Html { libcmis_PropertyTypePtr tested = getTested( "id", "html" ); libcmis_property_type_Type actualType = libcmis_property_type_getType( tested ); CPPUNIT_ASSERT_EQUAL( libcmis_String, actualType ); char* actualXml = libcmis_property_type_getXmlType( tested ); CPPUNIT_ASSERT_EQUAL( string( "Html" ), string( actualXml ) ); free( actualXml ); libcmis_property_type_free( tested ); } } void PropertyTypeTest::isMultiValuedTest( ) { libcmis_PropertyTypePtr tested = getTested( "id", "string" ); bool actual = libcmis_property_type_isMultiValued( tested ); CPPUNIT_ASSERT_EQUAL( true , actual ); libcmis_property_type_free( tested ); } void PropertyTypeTest::isUpdatableTest( ) { libcmis_PropertyTypePtr tested = getTested( "id", "string" ); bool actual = libcmis_property_type_isUpdatable( tested ); CPPUNIT_ASSERT_EQUAL( true , actual ); libcmis_property_type_free( tested ); } void PropertyTypeTest::isInheritedTest( ) { libcmis_PropertyTypePtr tested = getTested( "id", "string" ); bool actual = libcmis_property_type_isInherited( tested ); CPPUNIT_ASSERT_EQUAL( true , actual ); libcmis_property_type_free( tested ); } void PropertyTypeTest::isRequiredTest( ) { libcmis_PropertyTypePtr tested = getTested( "id", "string" ); bool actual = libcmis_property_type_isRequired( tested ); CPPUNIT_ASSERT_EQUAL( true , actual ); libcmis_property_type_free( tested ); } void PropertyTypeTest::isQueryableTest( ) { libcmis_PropertyTypePtr tested = getTested( "id", "string" ); bool actual = libcmis_property_type_isQueryable( tested ); CPPUNIT_ASSERT_EQUAL( true , actual ); libcmis_property_type_free( tested ); } void PropertyTypeTest::isOrderableTest( ) { libcmis_PropertyTypePtr tested = getTested( "id", "string" ); bool actual = libcmis_property_type_isOrderable( tested ); CPPUNIT_ASSERT_EQUAL( true , actual ); libcmis_property_type_free( tested ); } void PropertyTypeTest::isOpenChoiceTest( ) { libcmis_PropertyTypePtr tested = getTested( "id", "string" ); bool actual = libcmis_property_type_isOpenChoice( tested ); CPPUNIT_ASSERT_EQUAL( true , actual ); libcmis_property_type_free( tested ); } libcmis-0.4.1/qa/libcmis-c/test-dummies.cxx0000644000175000001440000004425012156277657015511 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2011 SUSE * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #include "test-dummies.hxx" using namespace std; using libcmis::PropertyPtrMap; bool isOutOfMemory = false; /// Ignore all tests results depending on this when running in valgrind void * operator new ( size_t requestedSize ) throw ( bad_alloc ) { if ( isOutOfMemory ) { throw bad_alloc( ); } return malloc( requestedSize ); } void operator delete ( void* ptr ) throw ( ) { free( ptr ); } namespace dummies { Session::Session( ) { } Session::~Session( ) { } libcmis::RepositoryPtr Session::getRepository( ) throw ( libcmis::Exception ) { libcmis::RepositoryPtr repo( new Repository( ) ); return repo; } bool Session::setRepository( std::string ) { return true; } vector< libcmis::RepositoryPtr > Session::getRepositories( ) { vector< libcmis::RepositoryPtr > repos; libcmis::RepositoryPtr repo1( new Repository( ) ); libcmis::RepositoryPtr repo2( new Repository( ) ); repos.push_back( repo1 ); repos.push_back( repo2 ); return repos; } libcmis::FolderPtr Session::getRootFolder() throw ( libcmis::Exception ) { libcmis::FolderPtr root( new Folder( true, false ) ); return root; } libcmis::ObjectPtr Session::getObject( string id ) throw ( libcmis::Exception ) { return getFolder( id ); } libcmis::ObjectPtr Session::getObjectByPath( string path ) throw ( libcmis::Exception ) { return getFolder( path ); } libcmis::FolderPtr Session::getFolder( string ) throw ( libcmis::Exception ) { libcmis::FolderPtr result( new Folder( false, false ) ); return result; } libcmis::ObjectTypePtr Session::getType( string ) throw ( libcmis::Exception ) { libcmis::ObjectTypePtr type( new ObjectType( true, false ) ); return type; } std::string Session::getRefreshToken( ) throw ( libcmis::Exception ) { return string( ); } Repository::Repository( ) : libcmis::Repository( ) { m_id = string( "Repository::Id" ); m_name = string( "Repository::Name" ); m_description = string( "Repository::Description" ); m_vendorName = string( "Repository::VendorName" ); m_productName = string( "Repository::ProductName" ); m_productVersion = string( "Repository::ProductVersion" ); m_rootId = string( "Repository::RootId" ); m_cmisVersionSupported = string( "Repository::CmisVersionSupported" ); m_thinClientUri.reset( new string( "Repository::ThinClientUri" ) ); m_principalAnonymous.reset( new string( "Repository::PrincipalAnonymous" ) ); m_principalAnyone.reset( new string( "Repository::PrincipalAnyone" ) ); } Repository::~Repository( ) { } PropertyType::PropertyType( string id, string xmlType ) : libcmis::PropertyType( ) { setId( id ); setLocalName( string( "PropertyType::LocalName" ) ); setLocalNamespace( string( "PropertyType::LocalNamespace" ) ); setDisplayName( string( "PropertyType::DisplayName" ) ); setQueryName( string( "PropertyType::QueryName" ) ); setTypeFromXml( xmlType ); // Setting true for the tests to see a difference with // the default false result of the tested functions setMultiValued( true ); setUpdatable( true ); setInherited( true ); setRequired( true ); setQueryable( true ); setOrderable( true ); setOpenChoice( true ); } PropertyType::~PropertyType( ) { } AllowableActions::AllowableActions( ) : libcmis::AllowableActions( ) { m_states.insert( pair< libcmis::ObjectAction::Type, bool >( libcmis::ObjectAction::GetProperties, true ) ); m_states.insert( pair< libcmis::ObjectAction::Type, bool >( libcmis::ObjectAction::GetFolderParent, false ) ); } AllowableActions::~AllowableActions( ) { } ObjectType::ObjectType( ) : libcmis::ObjectType( ), m_typeId( ), m_childrenIds( ), m_triggersFaults( false ) { } ObjectType::ObjectType( bool rootType, bool triggersFaults ) : libcmis::ObjectType( ), m_typeId( ), m_childrenIds( ), m_triggersFaults( triggersFaults ) { if ( rootType ) m_typeId = "RootType"; else { m_typeId = "ObjectType"; m_parentTypeId = "ParentType"; m_childrenIds.push_back( "ChildType1" ); m_childrenIds.push_back( "ChildType2" ); } m_baseTypeId = "RootType"; libcmis::PropertyTypePtr propType1( new PropertyType( "Property1", "string" ) ); m_propertiesTypes.insert( pair< string, libcmis::PropertyTypePtr >( propType1->getId( ), propType1 ) ); libcmis::PropertyTypePtr propType2( new PropertyType( "Property2", "string" ) ); m_propertiesTypes.insert( pair< string, libcmis::PropertyTypePtr >( propType2->getId( ), propType2 ) ); libcmis::PropertyTypePtr propType3( new PropertyType( "Property3", "string" ) ); m_propertiesTypes.insert( pair< string, libcmis::PropertyTypePtr >( propType3->getId( ), propType3 ) ); initMembers( ); } void ObjectType::initMembers( ) { m_id = m_typeId + "::Id"; m_localName = m_typeId + "::LocalName"; m_localNamespace = m_typeId + "::LocalNamespace"; m_displayName = m_typeId + "::DisplayName"; m_queryName = m_typeId + "::QueryName"; m_description = m_typeId + "::Description"; m_creatable = true; m_fileable = true; m_queryable = true; m_fulltextIndexed = true; m_includedInSupertypeQuery = true; m_controllablePolicy = true; m_controllableAcl = true; m_versionable = true; m_contentStreamAllowed = libcmis::ObjectType::Allowed; } ObjectType::~ObjectType( ) { } libcmis::ObjectTypePtr ObjectType::getParentType( ) throw ( libcmis::Exception ) { if ( m_triggersFaults ) throw libcmis::Exception( "Fault triggered" ); ObjectType* parent = NULL; if ( !m_parentTypeId.empty( ) ) { parent = new ObjectType( ); parent->m_typeId = m_parentTypeId; parent->m_parentTypeId = m_baseTypeId; parent->m_baseTypeId = m_baseTypeId; parent->m_childrenIds.push_back( m_id ); parent->m_triggersFaults = m_triggersFaults; parent->m_propertiesTypes = m_propertiesTypes; parent->initMembers( ); } libcmis::ObjectTypePtr result( parent ); return result; } libcmis::ObjectTypePtr ObjectType::getBaseType( ) throw ( libcmis::Exception ) { if ( m_triggersFaults ) throw libcmis::Exception( "Fault triggered" ); ObjectType* base = this; if ( m_typeId != m_baseTypeId ) { base = new ObjectType( ); base->m_typeId = m_baseTypeId; base->m_baseTypeId = m_baseTypeId; base->m_childrenIds.push_back( m_id ); base->m_triggersFaults = m_triggersFaults; base->m_propertiesTypes = m_propertiesTypes; base->initMembers( ); } libcmis::ObjectTypePtr result( base ); return result; } vector< libcmis::ObjectTypePtr > ObjectType::getChildren( ) throw ( libcmis::Exception ) { if ( m_triggersFaults ) throw libcmis::Exception( "Fault triggered" ); vector< libcmis::ObjectTypePtr > children; for ( vector< string >::iterator it = m_childrenIds.begin( ); it != m_childrenIds.end( ); ++it ) { ObjectType* child = new ObjectType( ); child->m_typeId = *it; child->m_parentTypeId = m_typeId; child->m_baseTypeId = m_baseTypeId; child->m_triggersFaults = m_triggersFaults; child->m_propertiesTypes = m_propertiesTypes; child->initMembers( ); libcmis::ObjectTypePtr result( child ); children.push_back( result ); } return children; } string ObjectType::toString( ) { return m_typeId + "::toString"; } Object::Object( bool triggersFaults, string type ): libcmis::Object( NULL ), m_type( type ), m_triggersFaults( triggersFaults ) { libcmis::PropertyTypePtr propertyType( new PropertyType( "Property1", "string" ) ); vector< string > values; values.push_back( "Value1" ); libcmis::PropertyPtr property( new libcmis::Property( propertyType, values ) ); m_properties.insert( pair< string, libcmis::PropertyPtr >( propertyType->getId( ), property ) ); } string Object::getId( ) { return m_type + "::Id"; } string Object::getName( ) { return m_type + "::Name"; } vector< string > Object::getPaths( ) { vector< string > paths; paths.push_back( string( "/Path1/" ) ); paths.push_back( string( "/Path2/" ) ); return paths; } string Object::getBaseType( ) { return m_type + "::BaseType"; } string Object::getType( ) { return m_type + "::Type"; } boost::posix_time::ptime Object::getCreationDate( ) { boost::posix_time::ptime now( boost::posix_time::second_clock::local_time( ) ); return now; } boost::posix_time::ptime Object::getLastModificationDate( ) { boost::posix_time::ptime now( boost::posix_time::second_clock::local_time( ) ); return now; } libcmis::ObjectPtr Object::updateProperties( const PropertyPtrMap& ) throw ( libcmis::Exception ) { if ( m_triggersFaults ) throw libcmis::Exception( "Fault triggered" ); time( &m_refreshTimestamp ); libcmis::ObjectPtr result( new Object( false ) ); return result; } libcmis::ObjectTypePtr Object::getTypeDescription( ) { libcmis::ObjectTypePtr type( new ObjectType( false, m_triggersFaults ) ); return type; } libcmis::AllowableActionsPtr Object::getAllowableActions( ) { libcmis::AllowableActionsPtr allowableActions( new AllowableActions( ) ); return allowableActions; } void Object::refresh( ) throw ( libcmis::Exception ) { if ( m_triggersFaults ) throw libcmis::Exception( "Fault triggered" ); time( &m_refreshTimestamp ); } void Object::remove( bool ) throw ( libcmis::Exception ) { if ( m_triggersFaults ) throw libcmis::Exception( "Fault triggered" ); time( &m_refreshTimestamp ); } void Object::move( libcmis::FolderPtr, libcmis::FolderPtr ) throw ( libcmis::Exception ) { if ( m_triggersFaults ) throw libcmis::Exception( "Fault triggered" ); time( &m_refreshTimestamp ); } void Object::toXml( xmlTextWriterPtr ) { } Folder::Folder( bool isRoot, bool triggersFaults ) : libcmis::Object( NULL ), libcmis::Folder( NULL ), dummies::Object( triggersFaults, "Folder" ), m_isRoot( isRoot ) { } libcmis::FolderPtr Folder::getFolderParent( ) throw ( libcmis::Exception ) { if ( m_triggersFaults ) throw libcmis::Exception( "Fault triggered" ); libcmis::FolderPtr parent; if ( !m_isRoot ) parent.reset( new Folder( true, m_triggersFaults ) ); return parent; } vector< libcmis::ObjectPtr > Folder::getChildren( ) throw ( libcmis::Exception ) { if ( m_triggersFaults ) throw libcmis::Exception( "Fault triggered" ); vector< libcmis::ObjectPtr > children; libcmis::ObjectPtr child1( new Object( m_triggersFaults ) ); children.push_back( child1 ); libcmis::ObjectPtr child2( new Object( m_triggersFaults ) ); children.push_back( child2 ); return children; } string Folder::getPath( ) { return string( "/Path/" ); } bool Folder::isRootFolder( ) { return m_isRoot; } libcmis::FolderPtr Folder::createFolder( const PropertyPtrMap& ) throw ( libcmis::Exception ) { if ( m_triggersFaults ) throw libcmis::Exception( "Fault triggered" ); libcmis::FolderPtr created( new Folder( true, m_triggersFaults ) ); return created; } libcmis::DocumentPtr Folder::createDocument( const PropertyPtrMap& properties, boost::shared_ptr< ostream > os, string contentType, string filename ) throw ( libcmis::Exception ) { if ( m_triggersFaults ) throw libcmis::Exception( "Fault triggered" ); dummies::Document* document = new dummies::Document( true, false ); PropertyPtrMap propertiesCopy( properties ); document->getProperties( ).swap( propertiesCopy ); document->setContentStream( os, contentType, filename ); libcmis::DocumentPtr created( document ); return created; } vector< string > Folder::removeTree( bool, libcmis::UnfileObjects::Type, bool ) throw ( libcmis::Exception ) { if ( m_triggersFaults ) throw libcmis::Exception( "Fault triggered" ); time( &m_refreshTimestamp ); vector< string > failed; failed.push_back( "failed 1" ); return failed; } Document::Document( bool isFiled, bool triggersFaults ) : libcmis::Object( NULL ), libcmis::Document( NULL ), dummies::Object( triggersFaults, "Document" ), m_isFiled( isFiled ), m_contentString( "Document::ContentStream" ) { } vector< libcmis::FolderPtr > Document::getParents( ) throw ( libcmis::Exception ) { if ( m_triggersFaults ) throw libcmis::Exception( "Fault triggered" ); vector< libcmis::FolderPtr > parents; if ( m_isFiled ) { libcmis::FolderPtr parent1( new Folder( true, m_triggersFaults ) ); parents.push_back( parent1 ); libcmis::FolderPtr parent2( new Folder( false, m_triggersFaults ) ); parents.push_back( parent2 ); } return parents; } boost::shared_ptr< istream > Document::getContentStream( string /*streamId*/ ) throw ( libcmis::Exception ) { if ( m_triggersFaults ) throw libcmis::Exception( "Fault triggered" ); bool oldOutOfMem = isOutOfMemory; isOutOfMemory = false; boost::shared_ptr< istream > stream( new stringstream( m_contentString ) ); isOutOfMemory = oldOutOfMem; return stream; } void Document::setContentStream( boost::shared_ptr< ostream > os, string, string, bool ) throw ( libcmis::Exception ) { if ( m_triggersFaults ) throw libcmis::Exception( "Fault triggered" ); istream is( os->rdbuf( ) ); stringstream out; is.seekg( 0 ); int bufSize = 2048; char* buf = new char[ bufSize ]; while ( !is.eof( ) ) { is.read( buf, bufSize ); size_t read = is.gcount( ); out.write( buf, read ); } delete[] buf; m_contentString = out.str( ); time( &m_refreshTimestamp ); } string Document::getContentType( ) { return "Document::ContentType"; } string Document::getContentFilename( ) { return "Document::ContentFilename"; } long Document::getContentLength( ) { return long( 12345 ); } libcmis::DocumentPtr Document::checkOut( ) throw ( libcmis::Exception ) { if ( m_triggersFaults ) throw libcmis::Exception( "Fault triggered" ); time( &m_refreshTimestamp ); libcmis::DocumentPtr result( new Document( true, m_triggersFaults ) ); return result; } void Document::cancelCheckout( ) throw ( libcmis::Exception ) { if ( m_triggersFaults ) throw libcmis::Exception( "Fault triggered" ); time( &m_refreshTimestamp ); } libcmis::DocumentPtr Document::checkIn( bool, string, const PropertyPtrMap& properties, boost::shared_ptr< ostream > os, string contentType, string filename ) throw ( libcmis::Exception ) { if ( m_triggersFaults ) throw libcmis::Exception( "Fault triggered" ); m_properties = properties; setContentStream( os, contentType, filename ); time( &m_refreshTimestamp ); return libcmis::DocumentPtr( new Document( true, false ) ); } vector< libcmis::DocumentPtr > Document::getAllVersions( ) throw ( libcmis::Exception ) { if ( m_triggersFaults ) throw libcmis::Exception( "Fault triggered" ); vector< libcmis::DocumentPtr > versions; libcmis::DocumentPtr version1( new Document( true, false ) ); versions.push_back( version1 ); libcmis::DocumentPtr version2( new Document( true, false ) ); versions.push_back( version2 ); return versions; } } libcmis-0.4.1/qa/libcmis-c/test-property.cxx0000644000175000001440000002166712156277657015741 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2011 SUSE * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #include #include #include #include "internals.hxx" #include "property.h" #include "property-type.h" #include "test-dummies.hxx" #include "vectors.h" using namespace std; class PropertyTest : public CppUnit::TestFixture { private: libcmis_PropertyTypePtr getTestType( string xmlType ); public: void getDateTimesTest( ); void getBoolsTest( ); void getStringsTest( ); void getLongsTest( ); void getDoublesTest( ); void setValuesTest( ); CPPUNIT_TEST_SUITE( PropertyTest ); CPPUNIT_TEST( getDateTimesTest ); CPPUNIT_TEST( getBoolsTest ); CPPUNIT_TEST( getStringsTest ); CPPUNIT_TEST( getLongsTest ); CPPUNIT_TEST( getDoublesTest ); CPPUNIT_TEST( setValuesTest ); CPPUNIT_TEST_SUITE_END( ); }; CPPUNIT_TEST_SUITE_REGISTRATION( PropertyTest ); libcmis_PropertyTypePtr PropertyTest::getTestType( string xmlType ) { libcmis_PropertyTypePtr result = new libcmis_property_type( ); libcmis::PropertyTypePtr handle( new dummies::PropertyType( "Id", xmlType ) ); result->handle = handle; return result; } void PropertyTest::getDateTimesTest( ) { libcmis_PropertyTypePtr type = getTestType( "datetime" ); size_t size = 2; const char** values = new const char*[size]; values[0] = "2012-01-19T09:06:57.388Z"; values[1] = "2012-02-19T09:06:57.388Z"; libcmis_PropertyPtr tested = libcmis_property_create( type, values, size ); libcmis_vector_time_Ptr times = libcmis_property_getDateTimes( tested ); CPPUNIT_ASSERT_EQUAL( size, libcmis_vector_time_size( times ) ); libcmis_vector_time_free( times ); libcmis_vector_string_Ptr strings = libcmis_property_getStrings( tested ); CPPUNIT_ASSERT_EQUAL( size, libcmis_vector_string_size( strings ) ); CPPUNIT_ASSERT_EQUAL( string( values[1] ), string( libcmis_vector_string_get( strings, 1 ) ) ); libcmis_vector_string_free( strings ); delete[] values; libcmis_vector_bool_Ptr bools = libcmis_property_getBools( tested ); CPPUNIT_ASSERT_EQUAL( size_t( 0 ), libcmis_vector_bool_size( bools ) ); libcmis_vector_bool_free( bools ); libcmis_property_free( tested ); libcmis_property_type_free( type ); } void PropertyTest::getBoolsTest( ) { libcmis_PropertyTypePtr type = getTestType( "boolean" ); size_t size = 2; const char** values = new const char*[size]; values[0] = "true"; values[1] = "false"; libcmis_PropertyPtr tested = libcmis_property_create( type, values, size ); libcmis_vector_bool_Ptr bools = libcmis_property_getBools( tested ); CPPUNIT_ASSERT_EQUAL( size, libcmis_vector_bool_size( bools ) ); CPPUNIT_ASSERT_EQUAL( true, libcmis_vector_bool_get( bools, 0 ) ); CPPUNIT_ASSERT_EQUAL( false, libcmis_vector_bool_get( bools, 1 ) ); libcmis_vector_bool_free( bools ); libcmis_vector_string_Ptr strings = libcmis_property_getStrings( tested ); CPPUNIT_ASSERT_EQUAL( size, libcmis_vector_string_size( strings ) ); CPPUNIT_ASSERT_EQUAL( string( values[1] ), string( libcmis_vector_string_get( strings, 1 ) ) ); libcmis_vector_string_free( strings ); delete[] values; libcmis_vector_long_Ptr longs = libcmis_property_getLongs( tested ); CPPUNIT_ASSERT_EQUAL( size_t( 0 ), libcmis_vector_long_size( longs ) ); libcmis_vector_long_free( longs ); libcmis_property_free( tested ); libcmis_property_type_free( type ); } void PropertyTest::getStringsTest( ) { libcmis_PropertyTypePtr type = getTestType( "string" ); size_t size = 2; const char** values = new const char*[size]; values[0] = "string 1"; values[1] = "string 2"; libcmis_PropertyPtr tested = libcmis_property_create( type, values, size ); libcmis_vector_string_Ptr strings = libcmis_property_getStrings( tested ); CPPUNIT_ASSERT_EQUAL( size, libcmis_vector_string_size( strings ) ); CPPUNIT_ASSERT_EQUAL( string( values[0] ), string( libcmis_vector_string_get( strings, 0 ) ) ); CPPUNIT_ASSERT_EQUAL( string( values[1] ), string( libcmis_vector_string_get( strings, 1 ) ) ); libcmis_vector_string_free( strings ); delete[] values; libcmis_vector_double_Ptr doubles = libcmis_property_getDoubles( tested ); CPPUNIT_ASSERT_EQUAL( size_t( 0 ), libcmis_vector_double_size( doubles ) ); libcmis_vector_double_free( doubles ); libcmis_property_free( tested ); libcmis_property_type_free( type ); } void PropertyTest::getLongsTest( ) { libcmis_PropertyTypePtr type = getTestType( "integer" ); size_t size = 2; const char** values = new const char*[size]; values[0] = "123456"; values[1] = "789"; libcmis_PropertyPtr tested = libcmis_property_create( type, values, size ); libcmis_vector_long_Ptr longs = libcmis_property_getLongs( tested ); CPPUNIT_ASSERT_EQUAL( size, libcmis_vector_long_size( longs ) ); CPPUNIT_ASSERT_EQUAL( long( 123456 ), libcmis_vector_long_get( longs, 0 ) ); CPPUNIT_ASSERT_EQUAL( long( 789 ), libcmis_vector_long_get( longs, 1 ) ); libcmis_vector_long_free( longs ); libcmis_vector_string_Ptr strings = libcmis_property_getStrings( tested ); CPPUNIT_ASSERT_EQUAL( size, libcmis_vector_string_size( strings ) ); CPPUNIT_ASSERT_EQUAL( string( values[1] ), string( libcmis_vector_string_get( strings, 1 ) ) ); libcmis_vector_string_free( strings ); delete[] values; libcmis_vector_time_Ptr times = libcmis_property_getDateTimes( tested ); CPPUNIT_ASSERT_EQUAL( size_t( 0 ), libcmis_vector_time_size( times ) ); libcmis_vector_time_free( times ); libcmis_property_free( tested ); libcmis_property_type_free( type ); } void PropertyTest::getDoublesTest( ) { libcmis_PropertyTypePtr type = getTestType( "decimal" ); size_t size = 2; const char** values = new const char*[size]; values[0] = "123.456"; values[1] = "7.89"; libcmis_PropertyPtr tested = libcmis_property_create( type, values, size ); libcmis_vector_double_Ptr doubles = libcmis_property_getDoubles( tested ); CPPUNIT_ASSERT_EQUAL( size, libcmis_vector_double_size( doubles ) ); CPPUNIT_ASSERT_EQUAL( 123.456, libcmis_vector_double_get( doubles, 0 ) ); CPPUNIT_ASSERT_EQUAL( 7.89, libcmis_vector_double_get( doubles, 1 ) ); libcmis_vector_double_free( doubles ); libcmis_vector_string_Ptr strings = libcmis_property_getStrings( tested ); CPPUNIT_ASSERT_EQUAL( size, libcmis_vector_string_size( strings ) ); CPPUNIT_ASSERT_EQUAL( string( values[1] ), string( libcmis_vector_string_get( strings, 1 ) ) ); libcmis_vector_string_free( strings ); delete[] values; libcmis_vector_long_Ptr longs = libcmis_property_getLongs( tested ); CPPUNIT_ASSERT_EQUAL( size_t( 0 ), libcmis_vector_long_size( longs ) ); libcmis_vector_long_free( longs ); libcmis_property_free( tested ); libcmis_property_type_free( type ); } void PropertyTest::setValuesTest( ) { libcmis_PropertyTypePtr type = getTestType( "string" ); size_t size = 1; const char** values = new const char*[size]; values[0] = "string 1"; libcmis_PropertyPtr tested = libcmis_property_create( type, values, size ); delete[] values; size_t newSize = 2; const char** newValues = new const char*[newSize]; newValues[0] = "new string 1"; newValues[1] = "new string 2"; libcmis_property_setValues( tested, newValues, newSize ); libcmis_vector_string_Ptr newStrings = libcmis_property_getStrings( tested ); CPPUNIT_ASSERT_EQUAL( newSize, libcmis_vector_string_size( newStrings ) ); CPPUNIT_ASSERT_EQUAL( string( newValues[0] ), string( libcmis_vector_string_get( newStrings, 0 ) ) ); CPPUNIT_ASSERT_EQUAL( string( newValues[1] ), string( libcmis_vector_string_get( newStrings, 1 ) ) ); libcmis_vector_string_free( newStrings ); delete[] newValues; libcmis_property_free( tested ); libcmis_property_type_free( type ); } libcmis-0.4.1/qa/libcmis-c/test-folder.cxx0000644000175000001440000003636512156277657015331 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2011 SUSE * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #include #include #include #include "document.h" #include "error.h" #include "internals.hxx" #include "folder.h" #include "object.h" #include "object-type.h" #include "property.h" #include "property-type.h" #include "test-dummies.hxx" #include "vectors.h" using namespace std; class FolderTest : public CppUnit::TestFixture { private: libcmis_FolderPtr getTested( bool isRoot, bool triggersFaults ); dummies::Document* getDocumentImplementation( libcmis_DocumentPtr document ); public: void objectCastTest( ); void objectCastFailureTest( ); void objectFunctionsTest( ); void getParentTest( ); void getParentRootTest( ); void getParentErrorTest( ); void getChildrenTest( ); void getChildrenErrorTest( ); void getPathTest( ); void createFolderTest( ); void createFolderErrorTest( ); void createDocumentTest( ); void createDocumentErrorTest( ); void removeTreeTest( ); void removeTreeErrorTest( ); CPPUNIT_TEST_SUITE( FolderTest ); CPPUNIT_TEST( objectCastTest ); CPPUNIT_TEST( objectCastFailureTest ); CPPUNIT_TEST( objectFunctionsTest ); CPPUNIT_TEST( getParentTest ); CPPUNIT_TEST( getParentRootTest ); CPPUNIT_TEST( getParentErrorTest ); CPPUNIT_TEST( getChildrenTest ); CPPUNIT_TEST( getChildrenErrorTest ); CPPUNIT_TEST( getPathTest ); CPPUNIT_TEST( createFolderTest ); CPPUNIT_TEST( createFolderErrorTest ); CPPUNIT_TEST( createDocumentTest ); CPPUNIT_TEST( createDocumentErrorTest ); CPPUNIT_TEST( removeTreeTest ); CPPUNIT_TEST( removeTreeErrorTest ); CPPUNIT_TEST_SUITE_END( ); }; CPPUNIT_TEST_SUITE_REGISTRATION( FolderTest ); libcmis_FolderPtr FolderTest::getTested( bool isRoot, bool triggersFaults ) { libcmis_FolderPtr result = new libcmis_folder( ); libcmis::FolderPtr handle( new dummies::Folder( isRoot, triggersFaults ) ); result->setHandle( handle ); return result; } dummies::Document* FolderTest::getDocumentImplementation( libcmis_DocumentPtr document ) { dummies::Document* impl = dynamic_cast< dummies::Document* >( document->handle.get( ) ); return impl; } void FolderTest::objectCastTest( ) { // Create the test object to cast libcmis_ObjectPtr tested = new libcmis_object( ); libcmis::FolderPtr handle( new dummies::Folder( false, false ) ); tested->handle = handle; // Test libcmis_is_folder CPPUNIT_ASSERT( libcmis_is_folder( tested ) ); // Actually cast to a folder libcmis_FolderPtr actual = libcmis_folder_cast( tested ); // Check the result CPPUNIT_ASSERT( NULL != actual ); // Check that the libcmis_object-* functions are working with the cast result char* actualId = libcmis_object_getId( tested ); CPPUNIT_ASSERT_EQUAL( string( "Folder::Id" ), string( actualId ) ); free( actualId ); // Free it all libcmis_folder_free( actual ); libcmis_object_free( tested ); } void FolderTest::objectCastFailureTest( ) { // Create the test object to cast libcmis_ObjectPtr tested = new libcmis_object( ); libcmis::DocumentPtr handle( new dummies::Document( true, false ) ); tested->handle = handle; // Test libcmis_is_folder CPPUNIT_ASSERT( !libcmis_is_folder( tested ) ); // Actually cast to a folder libcmis_FolderPtr actual = libcmis_folder_cast( tested ); // Check the result CPPUNIT_ASSERT( NULL == actual ); libcmis_object_free( tested ); } void FolderTest::objectFunctionsTest( ) { libcmis_FolderPtr tested = getTested( false, false ); char* actual = libcmis_object_getId( tested ); CPPUNIT_ASSERT_EQUAL( string( "Folder::Id" ), string( actual ) ); free( actual ); libcmis_folder_free( tested ); } void FolderTest::getParentTest( ) { libcmis_FolderPtr tested = getTested( false, false ); libcmis_ErrorPtr error = libcmis_error_create( ); libcmis_FolderPtr parent = libcmis_folder_getParent( tested, error ); CPPUNIT_ASSERT( NULL != parent ); CPPUNIT_ASSERT( !libcmis_folder_isRootFolder( tested ) ); libcmis_folder_free( parent ); libcmis_error_free( error ); libcmis_folder_free( tested ); } void FolderTest::getParentRootTest( ) { libcmis_FolderPtr tested = getTested( true, false ); libcmis_ErrorPtr error = libcmis_error_create( ); libcmis_FolderPtr parent = libcmis_folder_getParent( tested, error ); CPPUNIT_ASSERT( NULL == parent ); CPPUNIT_ASSERT( libcmis_folder_isRootFolder( tested ) ); libcmis_error_free( error ); libcmis_folder_free( tested ); } void FolderTest::getParentErrorTest( ) { libcmis_FolderPtr tested = getTested( false, true ); libcmis_ErrorPtr error = libcmis_error_create( ); libcmis_FolderPtr parent = libcmis_folder_getParent( tested, error ); CPPUNIT_ASSERT( NULL == parent ); const char* actualMessage = libcmis_error_getMessage( error ); CPPUNIT_ASSERT( !string( actualMessage ).empty( ) ); libcmis_error_free( error ); libcmis_folder_free( tested ); } void FolderTest::getChildrenTest( ) { libcmis_FolderPtr tested = getTested( false, false ); libcmis_ErrorPtr error = libcmis_error_create( ); libcmis_vector_object_Ptr children = libcmis_folder_getChildren( tested, error ); CPPUNIT_ASSERT_EQUAL( size_t( 2 ), libcmis_vector_object_size( children ) ); libcmis_vector_object_free( children ); libcmis_error_free( error ); libcmis_folder_free( tested ); } void FolderTest::getChildrenErrorTest( ) { libcmis_FolderPtr tested = getTested( false, true ); libcmis_ErrorPtr error = libcmis_error_create( ); libcmis_vector_object_Ptr children = libcmis_folder_getChildren( tested, error ); CPPUNIT_ASSERT( NULL == children ); const char* actualMessage = libcmis_error_getMessage( error ); CPPUNIT_ASSERT( !string( actualMessage ).empty( ) ); libcmis_error_free( error ); libcmis_folder_free( tested ); } void FolderTest::getPathTest( ) { libcmis_FolderPtr tested = getTested( false, false ); char* actual = libcmis_folder_getPath( tested ); CPPUNIT_ASSERT_EQUAL( string( "/Path/" ), string( actual ) ); free( actual ); libcmis_folder_free( tested ); } void FolderTest::createFolderTest( ) { libcmis_FolderPtr tested = getTested( false, false ); libcmis_ErrorPtr error = libcmis_error_create( ); // Create the properties for the new folder libcmis_vector_property_Ptr properties = libcmis_vector_property_create( ); libcmis_ObjectTypePtr objectType = libcmis_object_getTypeDescription( tested ); const char* id = "Property1"; libcmis_PropertyTypePtr propertyType = libcmis_object_type_getPropertyType( objectType, id ); size_t size = 2; const char** values = new const char*[size]; values[0] = "Value 1"; values[1] = "Value 2"; libcmis_PropertyPtr property = libcmis_property_create( propertyType, values, size ); delete[] values; libcmis_vector_property_append( properties, property ); // Create the new folder (method to test) libcmis_FolderPtr created = libcmis_folder_createFolder( tested, properties, error ); // Check CPPUNIT_ASSERT( NULL != created ); // Free everything libcmis_folder_free( created ); libcmis_property_free( property ); libcmis_property_type_free( propertyType ); libcmis_object_type_free( objectType ); libcmis_vector_property_free( properties ); libcmis_error_free( error ); libcmis_folder_free( tested ); } void FolderTest::createFolderErrorTest( ) { libcmis_FolderPtr tested = getTested( false, true ); libcmis_ErrorPtr error = libcmis_error_create( ); // Create the properties for the new folder libcmis_vector_property_Ptr properties = libcmis_vector_property_create( ); libcmis_ObjectTypePtr objectType = libcmis_object_getTypeDescription( tested ); const char* id = "Property1"; libcmis_PropertyTypePtr propertyType = libcmis_object_type_getPropertyType( objectType, id ); size_t size = 2; const char** values = new const char*[size]; values[0] = "Value 1"; values[1] = "Value 2"; libcmis_PropertyPtr property = libcmis_property_create( propertyType, values, size ); delete[] values; libcmis_vector_property_append( properties, property ); // Create the new folder (method to test) libcmis_FolderPtr created = libcmis_folder_createFolder( tested, properties, error ); // Check CPPUNIT_ASSERT( NULL == created ); const char* actualMessage = libcmis_error_getMessage( error ); CPPUNIT_ASSERT( !string( actualMessage ).empty( ) ); // Free everything libcmis_folder_free( created ); libcmis_property_free( property ); libcmis_property_type_free( propertyType ); libcmis_object_type_free( objectType ); libcmis_vector_property_free( properties ); libcmis_error_free( error ); libcmis_folder_free( tested ); } void FolderTest::createDocumentTest( ) { libcmis_FolderPtr tested = getTested( true, false ); libcmis_ErrorPtr error = libcmis_error_create( ); // Prepare the content to set FILE* tmp = tmpfile( ); string expectedStream( "New Content Stream" ); fwrite( expectedStream.c_str( ), 1, expectedStream.size( ), tmp ); rewind( tmp ); // Create the properties for the new version libcmis_vector_property_Ptr properties = libcmis_vector_property_create( ); libcmis_ObjectTypePtr objectType = libcmis_object_getTypeDescription( tested ); const char* id = "Property1"; libcmis_PropertyTypePtr propertyType = libcmis_object_type_getPropertyType( objectType, id ); size_t size = 2; const char** values = new const char*[size]; values[0] = "Value 1"; values[1] = "Value 2"; libcmis_PropertyPtr property = libcmis_property_create( propertyType, values, size ); delete[] values; libcmis_vector_property_append( properties, property ); // get the content into a temporary file (tested method) const char* contentType = "content/type"; const char* filename = "name.txt"; libcmis_DocumentPtr actual = libcmis_folder_createDocument( tested, properties, ( libcmis_readFn )fread, tmp, contentType, filename, error ); fclose( tmp ); // Check string actualStream = getDocumentImplementation( actual )->getContentString( ); CPPUNIT_ASSERT( NULL == libcmis_error_getMessage( error ) ); CPPUNIT_ASSERT_EQUAL( expectedStream, actualStream ); libcmis_PropertyPtr checkedProperty = libcmis_object_getProperty( actual, "Property1" ); libcmis_vector_string_Ptr newValues = libcmis_property_getStrings( checkedProperty ); CPPUNIT_ASSERT_EQUAL( size_t( 2 ), libcmis_vector_string_size( newValues ) ); // Free it all libcmis_vector_string_free( newValues ); libcmis_property_free( checkedProperty ); libcmis_document_free( actual ); libcmis_property_free( property ); libcmis_property_type_free( propertyType ); libcmis_object_type_free( objectType ); libcmis_vector_property_free( properties ); libcmis_error_free( error ); libcmis_folder_free( tested ); } void FolderTest::createDocumentErrorTest( ) { libcmis_FolderPtr tested = getTested( true, true ); libcmis_ErrorPtr error = libcmis_error_create( ); // Prepare the content to set FILE* tmp = tmpfile( ); string newStream( "New Content Stream" ); fwrite( newStream.c_str( ), 1, newStream.size( ), tmp ); rewind( tmp ); // Create the properties for the new version libcmis_vector_property_Ptr properties = libcmis_vector_property_create( ); libcmis_ObjectTypePtr objectType = libcmis_object_getTypeDescription( tested ); const char* id = "Property1"; libcmis_PropertyTypePtr propertyType = libcmis_object_type_getPropertyType( objectType, id ); size_t size = 2; const char** values = new const char*[size]; values[0] = "Value 1"; values[1] = "Value 2"; libcmis_PropertyPtr property = libcmis_property_create( propertyType, values, size ); delete[] values; libcmis_vector_property_append( properties, property ); // get the content into a temporary file (tested method) const char* contentType = "content/type"; const char* filename = "name.txt"; libcmis_DocumentPtr actual = libcmis_folder_createDocument( tested, properties, ( libcmis_readFn )fread, tmp, contentType, filename, error ); fclose( tmp ); // Check CPPUNIT_ASSERT( !string( libcmis_error_getMessage( error ) ).empty( ) ); CPPUNIT_ASSERT( NULL == actual ); // Free it all libcmis_property_free( property ); libcmis_property_type_free( propertyType ); libcmis_object_type_free( objectType ); libcmis_vector_property_free( properties ); libcmis_error_free( error ); libcmis_folder_free( tested ); } void FolderTest::removeTreeTest( ) { libcmis_FolderPtr tested = getTested( false, false ); libcmis_ErrorPtr error = libcmis_error_create( ); CPPUNIT_ASSERT_MESSAGE( "Timestamp not set to 0 initially", 0 == libcmis_object_getRefreshTimestamp( tested ) ); // Remove the tree (method to test) libcmis_vector_string_Ptr failed = libcmis_folder_removeTree( tested, true, libcmis_Delete, true, error ); // Check CPPUNIT_ASSERT_MESSAGE( "Timestamp not updated", 0 != libcmis_object_getRefreshTimestamp( tested ) ); CPPUNIT_ASSERT_EQUAL( size_t( 1 ), libcmis_vector_string_size( failed ) ); CPPUNIT_ASSERT_EQUAL( string( "failed 1" ), string( libcmis_vector_string_get( failed, 0 ) ) ); // Free everything libcmis_vector_string_free( failed ); libcmis_error_free( error ); libcmis_folder_free( tested ); } void FolderTest::removeTreeErrorTest( ) { libcmis_FolderPtr tested = getTested( false, true ); libcmis_ErrorPtr error = libcmis_error_create( ); // Remove the tree (method to test) libcmis_vector_string_Ptr failed = libcmis_folder_removeTree( tested, true, libcmis_Delete, true, error ); // Check const char* actualMessage = libcmis_error_getMessage( error ); CPPUNIT_ASSERT( !string( actualMessage ).empty( ) ); // Free everything libcmis_vector_string_free( failed ); libcmis_error_free( error ); libcmis_folder_free( tested ); } libcmis-0.4.1/qa/libcmis-c/test-document.cxx0000644000175000001440000005027412156277657015667 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2011 SUSE * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #include #include #include #include "error.h" #include "folder.h" #include "internals.hxx" #include "document.h" #include "object.h" #include "object-type.h" #include "property.h" #include "property-type.h" #include "test-dummies.hxx" #include "vectors.h" using namespace std; extern int isOutOfMemory; namespace { string lcl_readFile( FILE* file ) { // Get the size fseek( file, 0, SEEK_END ); long size = ftell( file ); rewind( file ); char* buf = new char[size + 1]; size_t readbytes = fread( buf, 1, size, file ); buf[ readbytes ] = '\0'; string result( buf ); delete[] buf; return result; } } class DocumentTest : public CppUnit::TestFixture { private: libcmis_DocumentPtr getTested( bool isFiled, bool triggersFaults ); dummies::Document* getTestedImplementation( libcmis_DocumentPtr document ); public: void objectCastTest( ); void objectCastFailureTest( ); void objectFunctionsTest( ); void getParentsTest( ); void getParentsUnfiledTest( ); void getParentsErrorTest( ); void getContentStreamTest( ); void getContentStreamErrorTest( ); void getContentStreamBadAllocTest( ); void setContentStreamTest( ); void setContentStreamErrorTest( ); void getContentTypeTest( ); void getContentFilenameTest( ); void getContentLengthTest( ); void checkOutTest( ); void checkOutErrorTest( ); void cancelCheckoutTest( ); void cancelCheckoutErrorTest( ); void checkInTest( ); void checkInErrorTest( ); void getAllVersionsTest( ); void getAllVersionsErrorTest( ); CPPUNIT_TEST_SUITE( DocumentTest ); CPPUNIT_TEST( objectCastTest ); CPPUNIT_TEST( objectCastFailureTest ); CPPUNIT_TEST( objectFunctionsTest ); CPPUNIT_TEST( getParentsTest ); CPPUNIT_TEST( getParentsUnfiledTest ); CPPUNIT_TEST( getParentsErrorTest ); CPPUNIT_TEST( getContentStreamTest ); CPPUNIT_TEST( getContentStreamErrorTest ); CPPUNIT_TEST( getContentStreamBadAllocTest ); CPPUNIT_TEST( setContentStreamTest ); CPPUNIT_TEST( setContentStreamErrorTest ); CPPUNIT_TEST( getContentTypeTest ); CPPUNIT_TEST( getContentFilenameTest ); CPPUNIT_TEST( getContentLengthTest ); CPPUNIT_TEST( checkOutTest ); CPPUNIT_TEST( checkOutErrorTest ); CPPUNIT_TEST( cancelCheckoutTest ); CPPUNIT_TEST( cancelCheckoutErrorTest ); CPPUNIT_TEST( checkInTest ); CPPUNIT_TEST( checkInErrorTest ); CPPUNIT_TEST( getAllVersionsTest ); CPPUNIT_TEST( getAllVersionsErrorTest ); CPPUNIT_TEST_SUITE_END( ); }; CPPUNIT_TEST_SUITE_REGISTRATION( DocumentTest ); libcmis_DocumentPtr DocumentTest::getTested( bool isFiled, bool triggersFaults ) { // Create the document libcmis_DocumentPtr result = new libcmis_document( ); libcmis::DocumentPtr handle( new dummies::Document( isFiled, triggersFaults ) ); result->setHandle( handle ); return result; } dummies::Document* DocumentTest::getTestedImplementation( libcmis_DocumentPtr document ) { dummies::Document* impl = dynamic_cast< dummies::Document* >( document->handle.get( ) ); return impl; } void DocumentTest::objectCastTest( ) { // Create the test object to cast libcmis_ObjectPtr tested = new libcmis_object( ); libcmis::DocumentPtr handle( new dummies::Document( true, false ) ); tested->handle = handle; // Test libcmis_is_document CPPUNIT_ASSERT( libcmis_is_document( tested ) ); // Actually cast to a document libcmis_DocumentPtr actual = libcmis_document_cast( tested ); // Check the result CPPUNIT_ASSERT( NULL != actual ); // Check that the libcmis_object-* functions are working with the cast result char* actualId = libcmis_object_getId( tested ); CPPUNIT_ASSERT_EQUAL( string( "Document::Id" ), string( actualId ) ); free( actualId ); // Free it all libcmis_document_free( actual ); libcmis_object_free( tested ); } void DocumentTest::objectCastFailureTest( ) { // Create the test object to cast libcmis_ObjectPtr tested = new libcmis_object( ); libcmis::FolderPtr handle( new dummies::Folder( false, false ) ); tested->handle = handle; // Test libcmis_is_document CPPUNIT_ASSERT( !libcmis_is_document( tested ) ); // Actually cast to a document libcmis_DocumentPtr actual = libcmis_document_cast( tested ); // Check the result CPPUNIT_ASSERT( NULL == actual ); libcmis_object_free( tested ); } void DocumentTest::objectFunctionsTest( ) { libcmis_DocumentPtr tested = getTested( true, false ); char* actual = libcmis_object_getId( tested ); CPPUNIT_ASSERT_EQUAL( string( "Document::Id" ), string( actual ) ); free( actual ); libcmis_document_free( tested ); } void DocumentTest::getParentsTest( ) { libcmis_DocumentPtr tested = getTested( true, false ); libcmis_ErrorPtr error = libcmis_error_create( ); // get the parent folders (tested method) libcmis_vector_folder_Ptr actual = libcmis_document_getParents( tested, error ); // Check CPPUNIT_ASSERT_EQUAL( size_t( 2 ), libcmis_vector_folder_size( actual ) ); // Free it all libcmis_vector_folder_free( actual ); libcmis_error_free( error ); libcmis_document_free( tested ); } void DocumentTest::getParentsUnfiledTest( ) { libcmis_DocumentPtr tested = getTested( false, false ); libcmis_ErrorPtr error = libcmis_error_create( ); // get the parent folders (tested method) libcmis_vector_folder_Ptr actual = libcmis_document_getParents( tested, error ); // Check CPPUNIT_ASSERT_EQUAL( size_t( 0 ), libcmis_vector_folder_size( actual ) ); // Free it all libcmis_vector_folder_free( actual ); libcmis_error_free( error ); libcmis_document_free( tested ); } void DocumentTest::getParentsErrorTest( ) { libcmis_DocumentPtr tested = getTested( true, true ); libcmis_ErrorPtr error = libcmis_error_create( ); // get the parent folders (tested method) libcmis_vector_folder_Ptr actual = libcmis_document_getParents( tested, error ); // Check CPPUNIT_ASSERT( NULL == actual ); CPPUNIT_ASSERT( !string( libcmis_error_getMessage( error ) ).empty( ) ); // Free it all libcmis_vector_folder_free( actual ); libcmis_error_free( error ); libcmis_document_free( tested ); } void DocumentTest::getContentStreamTest( ) { libcmis_DocumentPtr tested = getTested( true, false ); libcmis_ErrorPtr error = libcmis_error_create( ); // get the content into a temporary file (tested method) FILE* tmp = tmpfile( ); libcmis_document_getContentStream( tested, ( libcmis_writeFn )fwrite, tmp, error ); // Check string expected = getTestedImplementation( tested )->getContentString( ); string actual = lcl_readFile( tmp ); fclose( tmp ); CPPUNIT_ASSERT( NULL == libcmis_error_getMessage( error ) ); CPPUNIT_ASSERT_EQUAL( expected, actual ); // Free it all libcmis_error_free( error ); libcmis_document_free( tested ); } void DocumentTest::getContentStreamErrorTest( ) { libcmis_DocumentPtr tested = getTested( true, true ); libcmis_ErrorPtr error = libcmis_error_create( ); // get the content into a temporary file (tested method) FILE* tmp = tmpfile( ); libcmis_document_getContentStream( tested, ( libcmis_writeFn )fwrite, tmp, error ); // Check string actual = lcl_readFile( tmp ); fclose( tmp ); CPPUNIT_ASSERT_EQUAL( string( ), actual ); CPPUNIT_ASSERT( !string( libcmis_error_getMessage( error ) ).empty( ) ); // Free it all libcmis_error_free( error ); libcmis_document_free( tested ); } void DocumentTest::getContentStreamBadAllocTest( ) { libcmis_DocumentPtr tested = getTested( true, false ); libcmis_ErrorPtr error = libcmis_error_create( ); // get the content into a temporary file (tested method) FILE* tmp = tmpfile( ); isOutOfMemory= true; libcmis_document_getContentStream( tested, ( libcmis_writeFn )fwrite, tmp, error ); isOutOfMemory = false; // Check string actual = lcl_readFile( tmp ); fclose( tmp ); CPPUNIT_ASSERT( !string( libcmis_error_getMessage( error ) ).empty() ); CPPUNIT_ASSERT_EQUAL( string( ), actual ); // Free it all libcmis_error_free( error ); libcmis_document_free( tested ); } void DocumentTest::setContentStreamTest( ) { libcmis_DocumentPtr tested = getTested( true, false ); libcmis_ErrorPtr error = libcmis_error_create( ); // Prepare the content to set FILE* tmp = tmpfile( ); string expected( "New Content Stream" ); fwrite( expected.c_str( ), 1, expected.size( ), tmp ); rewind( tmp ); // get the content into a temporary file (tested method) const char* contentType = "content/type"; const char* filename = "name.txt"; libcmis_document_setContentStream( tested, ( libcmis_readFn )fread, tmp, contentType, filename, true, error ); fclose( tmp ); // Check string actual = getTestedImplementation( tested )->getContentString( ); CPPUNIT_ASSERT( NULL == libcmis_error_getMessage( error ) ); CPPUNIT_ASSERT_EQUAL( expected, actual ); // Free it all libcmis_error_free( error ); libcmis_document_free( tested ); } void DocumentTest::setContentStreamErrorTest( ) { libcmis_DocumentPtr tested = getTested( true, true ); libcmis_ErrorPtr error = libcmis_error_create( ); string expected = getTestedImplementation( tested )->getContentString( ); // Prepare the content to set FILE* tmp = tmpfile( ); string newContent( "New Content Stream" ); fwrite( newContent.c_str( ), 1, newContent.size( ), tmp ); rewind( tmp ); // get the content into a temporary file (tested method) const char* contentType = "content/type"; const char* filename = "name.txt"; libcmis_document_setContentStream( tested, ( libcmis_readFn )fread, tmp, contentType, filename, true, error ); fclose( tmp ); // Check string actual = getTestedImplementation( tested )->getContentString( ); CPPUNIT_ASSERT( !string( libcmis_error_getMessage( error ) ).empty( ) ); CPPUNIT_ASSERT_EQUAL( expected, actual ); // Free it all libcmis_error_free( error ); libcmis_document_free( tested ); } void DocumentTest::getContentTypeTest( ) { libcmis_DocumentPtr tested = getTested( true, false ); char* actual = libcmis_document_getContentType( tested ); CPPUNIT_ASSERT_EQUAL( string( "Document::ContentType" ), string( actual ) ); free( actual ); libcmis_document_free( tested ); } void DocumentTest::getContentFilenameTest( ) { libcmis_DocumentPtr tested = getTested( true, false ); char* actual = libcmis_document_getContentFilename( tested ); CPPUNIT_ASSERT_EQUAL( string( "Document::ContentFilename" ), string( actual ) ); free( actual ); libcmis_document_free( tested ); } void DocumentTest::getContentLengthTest( ) { libcmis_DocumentPtr tested = getTested( true, false ); long actual = libcmis_document_getContentLength( tested ); CPPUNIT_ASSERT( 0 != actual ); libcmis_document_free( tested ); } void DocumentTest::checkOutTest( ) { libcmis_DocumentPtr tested = getTested( true, false ); libcmis_ErrorPtr error = libcmis_error_create( ); // checkout a private working copy (tested method) libcmis_DocumentPtr actual = libcmis_document_checkOut( tested, error ); // Check CPPUNIT_ASSERT( NULL != actual ); // Free it all libcmis_document_free( actual ); libcmis_error_free( error ); libcmis_document_free( tested ); } void DocumentTest::checkOutErrorTest( ) { libcmis_DocumentPtr tested = getTested( true, true ); libcmis_ErrorPtr error = libcmis_error_create( ); // checkout a private working copy (tested method) libcmis_DocumentPtr actual = libcmis_document_checkOut( tested, error ); // Check CPPUNIT_ASSERT( NULL == actual ); CPPUNIT_ASSERT( !string( libcmis_error_getMessage( error ) ).empty( ) ); // Free it all libcmis_document_free( actual ); libcmis_error_free( error ); libcmis_document_free( tested ); } void DocumentTest::cancelCheckoutTest( ) { libcmis_DocumentPtr tested = getTested( true, false ); libcmis_ErrorPtr error = libcmis_error_create( ); // checkout a private working copy (tested method) libcmis_document_cancelCheckout( tested, error ); // Check CPPUNIT_ASSERT( 0 != libcmis_object_getRefreshTimestamp( tested ) ); // Free it all libcmis_error_free( error ); libcmis_document_free( tested ); } void DocumentTest::cancelCheckoutErrorTest( ) { libcmis_DocumentPtr tested = getTested( true, true ); libcmis_ErrorPtr error = libcmis_error_create( ); // checkout a private working copy (tested method) libcmis_document_cancelCheckout( tested, error ); // Check CPPUNIT_ASSERT( 0 == libcmis_object_getRefreshTimestamp( tested ) ); CPPUNIT_ASSERT( !string( libcmis_error_getMessage( error ) ).empty( ) ); // Free it all libcmis_error_free( error ); libcmis_document_free( tested ); } void DocumentTest::checkInTest( ) { libcmis_DocumentPtr tested = getTested( true, false ); libcmis_ErrorPtr error = libcmis_error_create( ); // Prepare the content to set FILE* tmp = tmpfile( ); string expected( "New Content Stream" ); fwrite( expected.c_str( ), 1, expected.size( ), tmp ); rewind( tmp ); // Create the properties for the new version libcmis_vector_property_Ptr properties = libcmis_vector_property_create( ); libcmis_ObjectTypePtr objectType = libcmis_object_getTypeDescription( tested ); const char* id = "Property1"; libcmis_PropertyTypePtr propertyType = libcmis_object_type_getPropertyType( objectType, id ); size_t size = 2; const char** values = new const char*[size]; values[0] = "Value 1"; values[1] = "Value 2"; libcmis_PropertyPtr property = libcmis_property_create( propertyType, values, size ); delete[] values; libcmis_vector_property_append( properties, property ); // get the content into a temporary file (tested method) const char* contentType = "content/type"; const char* comment = "Version comment"; const char* filename = "filename.txt"; libcmis_DocumentPtr newVersion = libcmis_document_checkIn( tested, true, comment, properties, ( libcmis_readFn )fread, tmp, contentType, filename, error ); fclose( tmp ); // Check CPPUNIT_ASSERT( NULL != newVersion ); string actual = getTestedImplementation( tested )->getContentString( ); CPPUNIT_ASSERT( NULL == libcmis_error_getMessage( error ) ); CPPUNIT_ASSERT_EQUAL( expected, actual ); libcmis_PropertyPtr checkedProperty = libcmis_object_getProperty( tested, "Property1" ); libcmis_vector_string_Ptr newValues = libcmis_property_getStrings( checkedProperty ); CPPUNIT_ASSERT_EQUAL( size_t( 2 ), libcmis_vector_string_size( newValues ) ); // Free it all libcmis_vector_string_free( newValues ); libcmis_property_free( checkedProperty ); libcmis_document_free( newVersion ); libcmis_property_free( property ); libcmis_property_type_free( propertyType ); libcmis_object_type_free( objectType ); libcmis_vector_property_free( properties ); libcmis_error_free( error ); libcmis_document_free( tested ); } void DocumentTest::checkInErrorTest( ) { libcmis_DocumentPtr tested = getTested( true, true ); libcmis_ErrorPtr error = libcmis_error_create( ); string expected = getTestedImplementation( tested )->getContentString( ); // Prepare the content to set FILE* tmp = tmpfile( ); string newContent( "New Content Stream" ); fwrite( newContent.c_str( ), 1, newContent.size( ), tmp ); rewind( tmp ); // Create the properties for the new version libcmis_vector_property_Ptr properties = libcmis_vector_property_create( ); libcmis_ObjectTypePtr objectType = libcmis_object_getTypeDescription( tested ); const char* id = "Property1"; libcmis_PropertyTypePtr propertyType = libcmis_object_type_getPropertyType( objectType, id ); size_t size = 2; const char** values = new const char*[size]; values[0] = "Value 1"; values[1] = "Value 2"; libcmis_PropertyPtr property = libcmis_property_create( propertyType, values, size ); delete[] values; libcmis_vector_property_append( properties, property ); // get the content into a temporary file (tested method) const char* contentType = "content/type"; const char* comment = "Version comment"; const char* filename = "filename.txt"; libcmis_DocumentPtr newVersion = libcmis_document_checkIn( tested, true, comment, properties, ( libcmis_readFn )fread, tmp, contentType, filename, error ); fclose( tmp ); // Check CPPUNIT_ASSERT( NULL == newVersion ); string actual = getTestedImplementation( tested )->getContentString( ); CPPUNIT_ASSERT( !string( libcmis_error_getMessage( error ) ).empty( ) ); CPPUNIT_ASSERT_EQUAL( expected, actual ); libcmis_PropertyPtr checkedProperty = libcmis_object_getProperty( tested, "Property1" ); libcmis_vector_string_Ptr newValues = libcmis_property_getStrings( checkedProperty ); CPPUNIT_ASSERT_EQUAL( size_t( 1 ), libcmis_vector_string_size( newValues ) ); // Free it all libcmis_vector_string_free( newValues ); libcmis_property_free( checkedProperty ); libcmis_document_free( newVersion ); libcmis_property_free( property ); libcmis_property_type_free( propertyType ); libcmis_object_type_free( objectType ); libcmis_vector_property_free( properties ); libcmis_error_free( error ); libcmis_document_free( tested ); } void DocumentTest::getAllVersionsTest( ) { libcmis_DocumentPtr tested = getTested( true, false ); libcmis_ErrorPtr error = libcmis_error_create( ); // get all versions (tested method) libcmis_vector_document_Ptr versions = libcmis_document_getAllVersions( tested, error ); // Check CPPUNIT_ASSERT_EQUAL( size_t( 2 ), libcmis_vector_document_size( versions ) ); libcmis_DocumentPtr actualVersion = libcmis_vector_document_get( versions, 0 ); char* actualId = libcmis_object_getId( actualVersion ); CPPUNIT_ASSERT( actualId != NULL ); free( actualId ); // Free it all libcmis_document_free( actualVersion ); libcmis_vector_document_free( versions ); libcmis_error_free( error ); libcmis_document_free( tested ); } void DocumentTest::getAllVersionsErrorTest( ) { libcmis_DocumentPtr tested = getTested( true, true ); libcmis_ErrorPtr error = libcmis_error_create( ); // get all versions (tested method) libcmis_vector_document_Ptr versions = libcmis_document_getAllVersions( tested, error ); // Check CPPUNIT_ASSERT( NULL == versions ); CPPUNIT_ASSERT( !string( libcmis_error_getMessage( error ) ).empty( ) ); // Free it all libcmis_vector_document_free( versions ); libcmis_error_free( error ); libcmis_document_free( tested ); } libcmis-0.4.1/qa/libcmis-c/test-dummies.hxx0000644000175000001440000002147712173212453015502 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2011 SUSE * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #ifndef _LIBCMIS_TEST_DUMMIES_HXX_ #define _LIBCMIS_TEST_DUMMIES_HXX_ #include #include #include #include #include #include #include #include /** This namespace contains dummy classes to simulate the libcmis layer in the libcmis-c unit tests. */ namespace dummies { class Session : public libcmis::Session { public: Session( ); ~Session( ); virtual libcmis::RepositoryPtr getRepository( ) throw ( libcmis::Exception ); virtual bool setRepository( std::string repositoryId ); virtual std::vector< libcmis::RepositoryPtr > getRepositories( ); virtual libcmis::FolderPtr getRootFolder() throw ( libcmis::Exception ); virtual libcmis::ObjectPtr getObject( std::string id ) throw ( libcmis::Exception ); virtual libcmis::ObjectPtr getObjectByPath( std::string path ) throw ( libcmis::Exception ); virtual libcmis::FolderPtr getFolder( std::string id ) throw ( libcmis::Exception ); virtual libcmis::ObjectTypePtr getType( std::string id ) throw ( libcmis::Exception ); virtual std::string getRefreshToken( ) throw ( libcmis::Exception ); virtual void setNoSSLCertificateCheck( bool /*noCheck*/ ) { } }; class Repository : public libcmis::Repository { public: Repository( ); ~Repository( ); }; class PropertyType : public libcmis::PropertyType { public: PropertyType( std::string id, std::string xmlType ); ~PropertyType( ); }; /** Dummy for testing the C API for allowable actions. The dummy has only the following actions defined: \li \c GetProperties, defined to \c true \li \c GetFolderParent, defined to \c false */ class AllowableActions : public libcmis::AllowableActions { public: AllowableActions( ); ~AllowableActions( ); }; class ObjectType : public libcmis::ObjectType { private: std::string m_typeId; std::vector< std::string > m_childrenIds; bool m_triggersFaults; ObjectType( ); void initMembers( ); public: ObjectType( bool rootType, bool triggersFaults ); ~ObjectType( ); virtual boost::shared_ptr< libcmis::ObjectType > getParentType( ) throw ( libcmis::Exception ); virtual boost::shared_ptr< libcmis::ObjectType > getBaseType( ) throw ( libcmis::Exception ); virtual std::vector< boost::shared_ptr< libcmis::ObjectType > > getChildren( ) throw ( libcmis::Exception ); virtual std::string toString( ); }; class Object : public virtual libcmis::Object { public: std::string m_type; bool m_triggersFaults; public: Object( bool triggersFaults, std::string m_type = "Object" ); ~Object( ) { } virtual std::string getId( ); virtual std::string getName( ); virtual std::vector< std::string > getPaths( ); virtual std::string getBaseType( ); virtual std::string getType( ); virtual std::string getCreatedBy( ) { return m_type + "::CreatedBy"; } virtual boost::posix_time::ptime getCreationDate( ); virtual std::string getLastModifiedBy( ) { return m_type + "::LastModifiedBy"; } virtual boost::posix_time::ptime getLastModificationDate( ); virtual std::string getChangeToken( ) { return m_type + "::ChangeToken"; } virtual bool isImmutable( ) { return true; }; virtual libcmis::ObjectPtr updateProperties( const std::map< std::string, libcmis::PropertyPtr >& properties ) throw ( libcmis::Exception ); virtual libcmis::ObjectTypePtr getTypeDescription( ); virtual libcmis::AllowableActionsPtr getAllowableActions( ); virtual void refresh( ) throw ( libcmis::Exception ); virtual void remove( bool allVersions = true ) throw ( libcmis::Exception ); virtual void move( libcmis::FolderPtr source, libcmis::FolderPtr destination ) throw ( libcmis::Exception ); virtual std::string toString( ) { return m_type + "::toString"; } virtual void toXml( xmlTextWriterPtr writer ); }; class Folder : public libcmis::Folder, public Object { private: bool m_isRoot; public: Folder( bool isRoot, bool triggersFaults ); ~Folder( ) { } virtual libcmis::FolderPtr getFolderParent( ) throw ( libcmis::Exception ); virtual std::vector< libcmis::ObjectPtr > getChildren( ) throw ( libcmis::Exception ); virtual std::string getPath( ); virtual bool isRootFolder( ); virtual libcmis::FolderPtr createFolder( const std::map< std::string, libcmis::PropertyPtr >& properties ) throw ( libcmis::Exception ); virtual libcmis::DocumentPtr createDocument( const std::map< std::string, libcmis::PropertyPtr >& properties, boost::shared_ptr< std::ostream > os, std::string contentType, std::string filename ) throw ( libcmis::Exception ); virtual std::vector< std::string > removeTree( bool allVersion = true, libcmis::UnfileObjects::Type unfile = libcmis::UnfileObjects::Delete, bool continueOnError = false ) throw ( libcmis::Exception ); virtual std::vector< std::string > getPaths( ) { return dummies::Object::getPaths( ); } virtual std::string toString( ) { return dummies::Object::toString( ); } }; class Document : public libcmis::Document, public Object { private: bool m_isFiled; std::string m_contentString; public: Document( bool isFiled, bool triggersFaults ); ~Document( ) { } std::string getContentString( ) { return m_contentString; } virtual std::vector< libcmis::FolderPtr > getParents( ) throw ( libcmis::Exception ); virtual boost::shared_ptr< std::istream > getContentStream( std::string streamId = std::string( ) ) throw ( libcmis::Exception ); virtual void setContentStream( boost::shared_ptr< std::ostream > os, std::string contentType, std::string fileName, bool overwrite = true ) throw ( libcmis::Exception ); virtual std::string getContentType( ); virtual std::string getContentFilename( ); virtual long getContentLength( ); virtual libcmis::DocumentPtr checkOut( ) throw ( libcmis::Exception ); virtual void cancelCheckout( ) throw ( libcmis::Exception ); virtual libcmis::DocumentPtr checkIn( bool isMajor, std::string comment, const std::map< std::string, libcmis::PropertyPtr >& properties, boost::shared_ptr< std::ostream > stream, std::string contentType, std::string filename ) throw ( libcmis::Exception ); virtual std::vector< libcmis::DocumentPtr > getAllVersions( ) throw ( libcmis::Exception ); virtual std::vector< std::string > getPaths( ) { return dummies::Object::getPaths( ); } virtual std::string toString( ) { return dummies::Object::toString( ); } }; } #endif libcmis-0.4.1/qa/libcmis-c/test-api.cxx0000644000175000001440000000263112156277657014614 00000000000000/* libcmis * Version: MPL 1.1 / GPLv2+ / LGPLv2+ * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License or as specified alternatively below. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Major Contributor(s): * Copyright (C) 2011 SUSE * * * All Rights Reserved. * * For minor contributions see the git repository. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPLv2+"), or * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable * instead of those above. */ #include #include int main( int, char** ) { CppUnit::TextUi::TestRunner runner; CppUnit::TestFactoryRegistry ®istry = CppUnit::TestFactoryRegistry::getRegistry(); runner.addTest( registry.makeTest() ); bool wasSuccess = runner.run( "", false ); return !wasSuccess; } libcmis-0.4.1/libcmis-c.pc.in0000644000175000001440000000050512156277657012670 00000000000000prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ Name: libcmis Description: CMIS protocol C client library Version: @VERSION@ Requires: libcmis-@LIBCMIS_API_VERSION@ libcurl libxml-2.0 Libs: -L${libdir} -lcmis-c-@LIBCMIS_API_VERSION@ Cflags: -I${includedir}/libcmis-c-@LIBCMIS_API_VERSION@ libcmis-0.4.1/install-sh0000755000175000001440000003325512102025510012053 00000000000000#!/bin/sh # install - install a program, script, or datafile scriptversion=2011-11-20.07; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # 'make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. nl=' ' IFS=" "" $nl" # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit=${DOITPROG-} if test -z "$doit"; then doit_exec=exec else doit_exec=$doit fi # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_glob='?' initialize_posix_glob=' test "$posix_glob" != "?" || { if (set -f) 2>/dev/null; then posix_glob= else posix_glob=: fi } ' posix_mkdir= # Desired mode of installed file. mode=0755 chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false no_target_directory= usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve the last data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *' '* | *' '* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -s) stripcmd=$stripprog;; -t) dst_arg=$2 # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac shift;; -T) no_target_directory=true;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call 'install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then do_exit='(exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 trap "ret=141; $do_exit" 13 trap "ret=143; $do_exit" 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names problematic for 'test' and other utilities. case $src in -* | [=\(\)!]) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test -n "$no_target_directory"; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dst=$dstdir/`basename "$src"` dstdir_status=0 else # Prefer dirname, but fall back on a substitute if dirname fails. dstdir=` (dirname "$dst") 2>/dev/null || expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$dst" : 'X\(//\)[^/]' \| \ X"$dst" : 'X\(//\)$' \| \ X"$dst" : 'X\(/\)' \| . 2>/dev/null || echo X"$dst" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q' ` test -d "$dstdir" dstdir_status=$? fi fi obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # Create intermediate dirs using mode 755 as modified by the umask. # This is like FreeBSD 'install' as of 1997-10-28. umask=`umask` case $stripcmd.$umask in # Optimize common cases. *[2367][2367]) mkdir_umask=$umask;; .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; *[0-7]) mkdir_umask=`expr $umask + 22 \ - $umask % 100 % 40 + $umask % 20 \ - $umask % 10 % 4 + $umask % 2 `;; *) mkdir_umask=$umask,go-w;; esac # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false case $umask in *[123567][0-7][0-7]) # POSIX mkdir -p sets u+wx bits regardless of umask, which # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 if (umask $mkdir_umask && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. ls_ld_tmpdir=`ls -ld "$tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/d" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null fi trap '' 0;; esac;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # The umask is ridiculous, or mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; [-=\(\)!]*) prefix='./';; *) prefix='';; esac eval "$initialize_posix_glob" oIFS=$IFS IFS=/ $posix_glob set -f set fnord $dstdir shift $posix_glob set +f IFS=$oIFS prefixes= for d do test X"$d" = X && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask=$mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && eval "$initialize_posix_glob" && $posix_glob set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && $posix_glob set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd -f "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: libcmis-0.4.1/depcomp0000755000175000001440000005055212102025510011423 00000000000000#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2012-03-27.16; # UTC # Copyright (C) 1999-2012 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Alexandre Oliva . case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by 'PROGRAMS ARGS'. object Object file output by 'PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputting dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac # A tabulation character. tab=' ' # A newline character. nl=' ' if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi cygpath_u="cygpath -u -f -" if test "$depmode" = msvcmsys; then # This is just like msvisualcpp but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvisualcpp fi if test "$depmode" = msvc7msys; then # This is just like msvc7 but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvc7 fi if test "$depmode" = xlc; then # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency informations. gccflag=-qmakedep=gcc,-MF depmode=gcc fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. ## Unfortunately, FreeBSD c89 acceptance of flags depends upon ## the command line argument order; so add the flags where they ## appear in depend2.am. Note that the slowdown incurred here ## affects only configure: in makefiles, %FASTDEP% shortcuts this. for arg do case $arg in -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; *) set fnord "$@" "$arg" ;; esac shift # fnord shift # $arg done "$@" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ## The second -e expression handles DOS-style file names with drive letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the "deleted header file" problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. tr ' ' "$nl" < "$tmpdepfile" | ## Some versions of gcc put a space before the ':'. On the theory ## that the space means something, we add a space to the output as ## well. hp depmode also adds that space, but also prefixes the VPATH ## to the object. Take care to not repeat it in the output. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like '#:fec' to the end of the # dependency line. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ tr "$nl" ' ' >> "$depfile" echo >> "$depfile" # The second pass generates a dummy entry for each header file. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; xlc) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts '$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then tmpdepfile1=$dir$base.u tmpdepfile2=$base.u tmpdepfile3=$dir.libs/$base.u "$@" -Wc,-M else tmpdepfile1=$dir$base.u tmpdepfile2=$dir$base.u tmpdepfile3=$dir$base.u "$@" -M fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then # Each line is of the form 'foo.o: dependent.h'. # Do two passes, one to just change these to # '$object: dependent.h' and one to simply 'dependent.h:'. sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; icc) # Intel's C compiler anf tcc (Tiny C Compiler) understand '-MD -MF file'. # However on # $CC -MD -MF foo.d -c -o sub/foo.o sub/foo.c # ICC 7.0 will fill foo.d with something like # foo.o: sub/foo.c # foo.o: sub/foo.h # which is wrong. We want # sub/foo.o: sub/foo.c # sub/foo.o: sub/foo.h # sub/foo.c: # sub/foo.h: # ICC 7.1 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using '\': # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... # tcc 0.9.26 (FIXME still under development at the moment of writing) # will emit a similar output, but also prepend the continuation lines # with horizontal tabulation characters. "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form 'foo.o: dependent.h', # or 'foo.o: dep1.h dep2.h \', or ' dep3.h dep4.h \'. # Do two passes, one to just change these to # '$object: dependent.h' and one to simply 'dependent.h:'. sed -e "s/^[ $tab][ $tab]*/ /" -e "s,^[^:]*:,$object :," \ < "$tmpdepfile" > "$depfile" sed ' s/[ '"$tab"'][ '"$tab"']*/ /g s/^ *// s/ *\\*$// s/^[^:]*: *// /^$/d /:$/d s/$/ :/ ' < "$tmpdepfile" >> "$depfile" rm -f "$tmpdepfile" ;; hp2) # The "hp" stanza above does not work with aCC (C++) and HP's ia64 # compilers, which have integrated preprocessors. The correct option # to use with these is +Maked; it writes dependencies to a file named # 'foo.d', which lands next to the object file, wherever that # happens to be. # Much of this is similar to the tru64 case; see comments there. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then tmpdepfile1=$dir$base.d tmpdepfile2=$dir.libs/$base.d "$@" -Wc,+Maked else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d "$@" +Maked fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" # Add 'dependent.h:' lines. sed -ne '2,${ s/^ *// s/ \\*$// s/$/:/ p }' "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" "$tmpdepfile2" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in 'foo.d' instead, so we check for that too. # Subdirectories are respected. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then # With Tru64 cc, shared objects can also be used to make a # static library. This mechanism is used in libtool 1.4 series to # handle both shared and static libraries in a single compilation. # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. # # With libtool 1.5 this exception was removed, and libtool now # generates 2 separate objects for the 2 libraries. These two # compilations output dependencies in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is # automatically cleaned when .libs/ is deleted, while ignoring # the former would cause a distcleancheck panic. tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 tmpdepfile2=$dir$base.o.d # libtool 1.5 tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.o.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d tmpdepfile4=$dir$base.d "$@" -MD fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; msvc7) if test "$libtool" = yes; then showIncludes=-Wc,-showIncludes else showIncludes=-showIncludes fi "$@" $showIncludes > "$tmpdepfile" stat=$? grep -v '^Note: including file: ' "$tmpdepfile" if test "$stat" = 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The first sed program below extracts the file names and escapes # backslashes for cygpath. The second sed program outputs the file # name when reading, but also accumulates all include files in the # hold buffer in order to output them again at the end. This only # works with sed implementations that can handle large buffers. sed < "$tmpdepfile" -n ' /^Note: including file: *\(.*\)/ { s//\1/ s/\\/\\\\/g p }' | $cygpath_u | sort -u | sed -n ' s/ /\\ /g s/\(.*\)/'"$tab"'\1 \\/p s/.\(.*\) \\/\1:/ H $ { s/.*/'"$tab"'/ G p }' >> "$depfile" rm -f "$tmpdepfile" ;; msvc7msys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for ':' # in the target name. This is to cope with DOS-style filenames: # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. "$@" $dashmflag | sed 's:^['"$tab"' ]*[^:'"$tab"' ][^:][^:]*\:['"$tab"' ]*:'"$object"'\: :' > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" tr ' ' "$nl" < "$tmpdepfile" | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # X makedepend shift cleared=no eat=no for arg do case $cleared in no) set ""; shift cleared=yes ;; esac if test $eat = yes; then eat=no continue fi case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -arch) eat=yes ;; -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix=`echo "$object" | sed 's/^.*\././'` touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" # makedepend may prepend the VPATH from the source file name to the object. # No need to regex-escape $object, excess matching of '.' is harmless. sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" sed '1,2d' "$tmpdepfile" | tr ' ' "$nl" | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi IFS=" " for arg do case "$arg" in -o) shift ;; $object) shift ;; "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E 2>/dev/null | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" echo "$tab" >> "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; msvcmsys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: