blcr-0.8.5/0000755000000000000000000000000012102072123007403 500000000000000blcr-0.8.5/rpm/0000755000000000000000000000000012102072126010204 500000000000000blcr-0.8.5/rpm/Makefile.am0000664000000000000000000000324712102034252012166 00000000000000# To get a spec file w/ the version in it, we copy 'specfile' to the final name # This is also our chance to substitute in an RPM release number and a date. RPM_SPECFILE = $(PACKAGE)-$(VERSION).spec RPM_RELEASE = 1 RPM_DATE = $(shell env LC_ALL=C date +"%a %b %d %Y") $(RPM_SPECFILE): specfile @PERL@ -pe 's|\@rpm_release\@|$(RPM_RELEASE)|;' \ -e 's|\@date\@|$(RPM_DATE)|;' -- $< >$@ # Unless told otherwise, try to build for current CPU RPMBUILD_FLAGS = --target @CR_CPU@ EXTRA_DIST = $(RPM_SPECFILE) license.txt CLEANFILES = $(RPM_SPECFILE) # Targets to build a kernel-specific RPMs if HAVE_RPMBUILD RPM_TARFILE = $(top_builddir)/$(PACKAGE)-$(VERSION).tar.gz RPM_CMD = @RPMBUILD@ --define '_topdir '`pwd` $(RPMBUILD_FLAGS) .PHONY: _srpm _rpm _all srpm rpm rpm_prep _srpm: @mkdir -p SRPMS SPECS $(RPM_SUDO) $(RPM_CMD) -ts $(RPM_TARFILE) @rm -rf SPECS _rpm: @mkdir -p RPMS SPECS BUILD $(RPM_CMD) -tb $(RPM_TARFILE) @rm -rf SPECS BUILD _all: @mkdir -p SRPMS RPMS SPECS BUILD $(RPM_CMD) -ta $(RPM_TARFILE) @rm -rf SPECS BUILD rpm_prep: @rm -f $(RPM_TARFILE) $(RPM_SPECFILE) # ensure we start fresh, specfile will be rebuilt by dist-gzip $(RPM_SUDO) $(MAKE) $(AM_MAKEFLAGS) -C $(top_builddir) dist-gzip TAR_OPTIONS="--owner=0 --group=0" srpm: rpm_prep $(MAKE) $(AM_MAKEFLAGS) _srpm rpm: rpm_prep $(MAKE) $(AM_MAKEFLAGS) _rpm all: rpm_prep $(MAKE) $(AM_MAKEFLAGS) _all clean-local: -rm -rf RPMS SRPMS SPECS BUILD $(RPM_SPECFILE) distcheck-hook: _all $(MAKE) $(AM_MAKEFLAGS) clean else all: @echo "===========================================" @echo "Don't know how to build RPMs on your system" @echo "===========================================" distcheck-hook: @true endif blcr-0.8.5/rpm/Makefile.in0000664000000000000000000003226512102070010012171 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ 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 = rpm DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/specfile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/blcr_config.h CONFIG_CLEAN_FILES = specfile CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CONFIGURE_ARGS = @CONFIGURE_ARGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CR_ARCH = @CR_ARCH@ CR_CLIENT_LDADD = @CR_CLIENT_LDADD@ CR_CPU = @CR_CPU@ CR_FTB_INCLUDES = @CR_FTB_INCLUDES@ CR_FTB_LDADD = @CR_FTB_LDADD@ CR_FTB_LDFLAGS = @CR_FTB_LDFLAGS@ CR_KARCH = @CR_KARCH@ CR_KERNEL = @CR_KERNEL@ CR_KERNEL_BASE = @CR_KERNEL_BASE@ CR_LIBARCH = @CR_LIBARCH@ CR_LIBCR_CFLAGS = @CR_LIBCR_CFLAGS@ CR_MODULE_DIR = @CR_MODULE_DIR@ CR_MODULE_MAJOR = @CR_MODULE_MAJOR@ CR_MODULE_MINOR = @CR_MODULE_MINOR@ CR_MODULE_PATCH = @CR_MODULE_PATCH@ CR_MODULE_VERSION = @CR_MODULE_VERSION@ CR_NDEBUG = @CR_NDEBUG@ CR_RELEASE_MAJOR = @CR_RELEASE_MAJOR@ CR_RELEASE_MINOR = @CR_RELEASE_MINOR@ CR_RELEASE_PATCH = @CR_RELEASE_PATCH@ CR_RELEASE_VERSION = @CR_RELEASE_VERSION@ CR_SIGNUM = @CR_SIGNUM@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GMAKE_ELSE = @GMAKE_ELSE@ GMAKE_ENDIF = @GMAKE_ENDIF@ GMAKE_IFEQ = @GMAKE_IFEQ@ GMAKE_IFNEQ = @GMAKE_IFNEQ@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KBUILD_MAK = @KBUILD_MAK@ KBUILD_MAKE_ARGS = @KBUILD_MAKE_ARGS@ KCC = @KCC@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBCR_MAJOR = @LIBCR_MAJOR@ LIBCR_MINOR = @LIBCR_MINOR@ LIBCR_PATCH = @LIBCR_PATCH@ LIBCR_VERSION = @LIBCR_VERSION@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_AGE = @LIBTOOL_AGE@ LIBTOOL_INTERFACE = @LIBTOOL_INTERFACE@ LIBTOOL_REVISION = @LIBTOOL_REVISION@ LINUX_OBJ = @LINUX_OBJ@ LINUX_SRC = @LINUX_SRC@ LINUX_SYMTAB_CMD = @LINUX_SYMTAB_CMD@ LINUX_SYMTAB_CONF = @LINUX_SYMTAB_CONF@ LINUX_SYMTAB_FILE = @LINUX_SYMTAB_FILE@ LINUX_VER = @LINUX_VER@ LINUX_VERSION_H = @LINUX_VERSION_H@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKE = @MAKE@ MAKEINFO = @MAKEINFO@ 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_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PWD_PROG = @PWD_PROG@ RANLIB = @RANLIB@ RPMBUILD = @RPMBUILD@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TOP_BUILDDIR = @TOP_BUILDDIR@ TOP_SRCDIR = @TOP_SRCDIR@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ 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@ lt_ECHO = @lt_ECHO@ 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@ # To get a spec file w/ the version in it, we copy 'specfile' to the final name # This is also our chance to substitute in an RPM release number and a date. RPM_SPECFILE = $(PACKAGE)-$(VERSION).spec RPM_RELEASE = 1 RPM_DATE = $(shell env LC_ALL=C date +"%a %b %d %Y") # Unless told otherwise, try to build for current CPU RPMBUILD_FLAGS = --target @CR_CPU@ EXTRA_DIST = $(RPM_SPECFILE) license.txt CLEANFILES = $(RPM_SPECFILE) # Targets to build a kernel-specific RPMs @HAVE_RPMBUILD_TRUE@RPM_TARFILE = $(top_builddir)/$(PACKAGE)-$(VERSION).tar.gz @HAVE_RPMBUILD_TRUE@RPM_CMD = @RPMBUILD@ --define '_topdir '`pwd` $(RPMBUILD_FLAGS) all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign rpm/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign rpm/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): specfile: $(top_builddir)/config.status $(srcdir)/specfile.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags: TAGS TAGS: ctags: CTAGS CTAGS: 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 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." @HAVE_RPMBUILD_FALSE@clean-local: clean: clean-am clean-am: clean-generic clean-libtool clean-local mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ clean-local distclean distclean-generic distclean-libtool \ distdir dvi dvi-am html html-am info info-am install \ install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ uninstall uninstall-am $(RPM_SPECFILE): specfile @PERL@ -pe 's|\@rpm_release\@|$(RPM_RELEASE)|;' \ -e 's|\@date\@|$(RPM_DATE)|;' -- $< >$@ @HAVE_RPMBUILD_TRUE@.PHONY: _srpm _rpm _all srpm rpm rpm_prep @HAVE_RPMBUILD_TRUE@_srpm: @HAVE_RPMBUILD_TRUE@ @mkdir -p SRPMS SPECS @HAVE_RPMBUILD_TRUE@ $(RPM_SUDO) $(RPM_CMD) -ts $(RPM_TARFILE) @HAVE_RPMBUILD_TRUE@ @rm -rf SPECS @HAVE_RPMBUILD_TRUE@_rpm: @HAVE_RPMBUILD_TRUE@ @mkdir -p RPMS SPECS BUILD @HAVE_RPMBUILD_TRUE@ $(RPM_CMD) -tb $(RPM_TARFILE) @HAVE_RPMBUILD_TRUE@ @rm -rf SPECS BUILD @HAVE_RPMBUILD_TRUE@_all: @HAVE_RPMBUILD_TRUE@ @mkdir -p SRPMS RPMS SPECS BUILD @HAVE_RPMBUILD_TRUE@ $(RPM_CMD) -ta $(RPM_TARFILE) @HAVE_RPMBUILD_TRUE@ @rm -rf SPECS BUILD @HAVE_RPMBUILD_TRUE@rpm_prep: @HAVE_RPMBUILD_TRUE@ @rm -f $(RPM_TARFILE) $(RPM_SPECFILE) # ensure we start fresh, specfile will be rebuilt by dist-gzip @HAVE_RPMBUILD_TRUE@ $(RPM_SUDO) $(MAKE) $(AM_MAKEFLAGS) -C $(top_builddir) dist-gzip TAR_OPTIONS="--owner=0 --group=0" @HAVE_RPMBUILD_TRUE@srpm: rpm_prep @HAVE_RPMBUILD_TRUE@ $(MAKE) $(AM_MAKEFLAGS) _srpm @HAVE_RPMBUILD_TRUE@rpm: rpm_prep @HAVE_RPMBUILD_TRUE@ $(MAKE) $(AM_MAKEFLAGS) _rpm @HAVE_RPMBUILD_TRUE@all: rpm_prep @HAVE_RPMBUILD_TRUE@ $(MAKE) $(AM_MAKEFLAGS) _all @HAVE_RPMBUILD_TRUE@clean-local: @HAVE_RPMBUILD_TRUE@ -rm -rf RPMS SRPMS SPECS BUILD $(RPM_SPECFILE) @HAVE_RPMBUILD_TRUE@distcheck-hook: _all @HAVE_RPMBUILD_TRUE@ $(MAKE) $(AM_MAKEFLAGS) clean @HAVE_RPMBUILD_FALSE@all: @HAVE_RPMBUILD_FALSE@ @echo "===========================================" @HAVE_RPMBUILD_FALSE@ @echo "Don't know how to build RPMs on your system" @HAVE_RPMBUILD_FALSE@ @echo "===========================================" @HAVE_RPMBUILD_FALSE@distcheck-hook: @HAVE_RPMBUILD_FALSE@ @true # 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: blcr-0.8.5/rpm/specfile.in0000664000000000000000000002512212065143552012264 00000000000000Name: @PACKAGE@ Version: @VERSION@ Release: @rpm_release@ Summary: Berkeley Lab Checkpoint/Restart for Linux Url: http://ftg.lbl.gov/checkpoint ## Documentation for end-users: # You can "--define 'with_autoreconf 1'" on the rpmbuild commandline # to force use of site-specific or distro-specific autotools. # The default is NO. # You can "--define 'with_multilib 0'" to disable configuration of # BLCR with --enable-multilib (which builds 32-bit libs on a 64-bit # platform, in addition to the 64-bit ones). # This is ignored on 32-bit targets. # If not building against the running kernel, then you'll need to # add exactly one of the following two mutually exclusive options # to your rpmbuild (or rpm) command line: # 1) "--define 'kernel_ver '" # 2) "--define 'kernel_obj /lib/modules//build'", # When using either of these, you may also want/need to add # "--define 'kernel_src /usr/src/linux-'". # Of course the values assigned to kernel_obj and kernel_src # above are just examples. # Use of "--define 'kernel_type '" will allow one to # override /boot/kernel.h, where SOMETHING=SMP, UP, etc. if using # kernel sources configured via that file. ## END of end-user documentation # Control use of local autotools %define run_autoreconf %{?with_autoreconf:1}%{!?with_autoreconf:0} # Read next line as "kernel = defined(kernel_ver) ? kernel_ver : `uname -r`" %define kernel %{?kernel_ver:%{kernel_ver}}%{!?kernel_ver:%(uname -r)} # Name the kernel modules package w/o dashes in the kernel version: %define modsubpkg modules_%(echo %{kernel} | tr - _) %define moduledir /lib/modules/%{kernel}/extra # Name of the unpacked source directory and stem of the tarball name %define distname %{name}-%{version} # Disable RedHat's automatic build of a debuginfo subpackage: %define debug_package %{nil} # Macro for scanning configure arguments # First arg is default value, second is option name. %define is_enabled() %(X=%1; eval set -- @CONFIGURE_ARGS@; for x in "$@"; do if [ x"$x" = "x--disable-%2" -o x"$x" = "x--enable-%2=no" ]; then X=0; elif [ x"$x" = "x--enable-%2" -o x"$x" = "x--enable-%2=yes" ]; then X=1; fi; done; echo $X) # Are we building shared and/or static libs? %define build_shared %{is_enabled 1 shared} %if %{build_shared} %define build_static %{is_enabled 0 static} %else %define build_static 1 %endif # Are we building static executables %define build_all_static %{is_enabled 0 all-static} # Are we installing the test-suite %define build_testsuite %{is_enabled 1 testsuite} # Are we building both 32- and 64-bit libcr? %ifarch x86_64 ppc64 # Honour with_multilib if set, otherwise use is_enabled %define build_libdir32 %{?with_multilib:%{with_multilib}}%{!?with_multilib:%{is_enabled 1 multilib}} %else %define build_libdir32 0 %endif # Where to put 32-bit libs on a 64-bit platform %if %{build_libdir32} %define libdir32 %(echo %{_libdir} | sed -e s/lib64/lib/) %endif Group: System Environment/Base License: GPLv2+ Source: %{distname}.tar.gz BuildRoot: %{_tmppath}/buildroot-%{name}-%{version} BuildRequires: perl sed Requires(post): /sbin/chkconfig Requires(preun): /sbin/chkconfig # Kernel and asm support only ported to certain architectures # i386 is omitted because it lacks required atomic instructions ExclusiveArch: i486 i586 i686 athlon x86_64 ppc ppc64 arm ExclusiveOs: Linux Requires: %{name}-modules >= %{version}-%{release} # DON'T require since many clusters are built w/ non-RPM kernels: # BuildPreReq: kernel-source = %{kernel} %description Berkeley Lab Checkpoint/Restart for Linux (BLCR) This package implements system-level checkpointing of scientific applications in a manner suitable for implementing preemption, migration and fault recovery by a batch scheduler. BLCR includes documented interfaces for a cooperating applications or libraries to implement extensions to the checkpoint system, such as consistent checkpointing of distributed MPI applications. Using this package with an appropriate MPI implementation, the vast majority of scientific applications which use MPI for communication on Linux clusters are checkpointable without any modifications to the application source code. You must also install the %{name}-libs package and a %{name}-modules_* package matching your kernel version. %prep %setup -q -n %{distname} %build # Work with rpm's various botched ideas of host vs. target %define _host_cpu %{_target_cpu} %define _host %{_target} %define _build_cpu %{_target_cpu} %define _build %{_target} # Allow user to request use of local autotools %if %{run_autoreconf} autoreconf --force --install %endif # VPATH build required to ensure --enable-multilib will work mkdir -p builddir cd builddir ln -s ../configure . # Configure the thing # Order arguments such that user's configure arguments can disable multilib, and # enable the config-report, but doesn't clobber kernel version info from the # rpmbuild command line %configure \ --srcdir=.. \ %{?libdir32:--enable-multilib} \ --enable-testsuite \ --disable-config-report \ @CONFIGURE_ARGS@ \ %{!?kernel_obj:--with-linux=%{kernel}}%{?kernel_obj:--with-linux=%{kernel_obj}} \ %{?kernel_src:--with-linux-src=%{kernel_src}} \ %{?kernel_type:--with-kernel-type=%{kernel_type}} # Now build it make %clean rm -Rf ${RPM_BUILD_ROOT} %install cd builddir rm -Rf ${RPM_BUILD_ROOT} make install-strip DESTDIR=${RPM_BUILD_ROOT} # Ensure man pages are gzipped, regardless of brp-compress if [ -n "${RPM_BUILD_ROOT}" -a "${RPM_BUILD_ROOT}" != "/" ]; then find ${RPM_BUILD_ROOT}/%{_mandir} -name '*.[1-9]' | xargs gzip -9 fi # Install the init script make -C etc install DESTDIR=${RPM_BUILD_ROOT} # On some systems rpmbuild dislikes having an RPATH that points # to a system directory. Some versions of libtool get this right # on their own, while others don't. # So, we try to clean it up here if we have chrpath. if chrpath --version >& /dev/null; then %if !%{build_all_static} chrpath -d ${RPM_BUILD_ROOT}/%{_bindir}/cr_checkpoint chrpath -d ${RPM_BUILD_ROOT}/%{_bindir}/cr_restart %endif %if !%{build_all_static} && %{build_testsuite} list=`make -C tests --no-print-directory echoval VARNAME=testsexec_PROGRAMS` ( cd ${RPM_BUILD_ROOT}/%{_libexecdir}/blcr-testsuite && chrpath -d $list ) %endif : # ensure non-empty body fi %post if [ $1 = 1 ]; then /sbin/chkconfig --add blcr fi exit 0 %preun if [ $1 = 0 ]; then /sbin/chkconfig --del blcr fi exit 0 %files %defattr(-,root,root) %doc util/license.txt %doc COPYING %doc NEWS %doc doc/README %doc doc/html %doc %{_mandir}/man1/cr_checkpoint.1.gz %doc %{_mandir}/man1/cr_restart.1.gz %doc %{_mandir}/man1/cr_run.1.gz %{_bindir}/cr_checkpoint #%{_bindir}/cr_info %{_bindir}/cr_restart %{_bindir}/cr_run #%{_libexecdir}/vmadcheck %{_sysconfdir}/init.d/blcr %if %{build_shared} # # Libs in a separate package # TODO: separate 32-bit package in multilib builds # %package libs Group: System Environment/Libraries Summary: Libraries for Berkeley Lab Checkpoint/Restart for Linux License: LGPLv2+ Requires(post): /sbin/ldconfig Requires(postun): /sbin/ldconfig %description libs Runtime libraries for Berkeley Lab Checkpoint/Restart for Linux (BLCR) %post libs -p /sbin/ldconfig %postun libs -p /sbin/ldconfig %files libs %defattr(-,root,root) %doc libcr/license.txt %doc COPYING.LIB %doc NEWS %{_libdir}/libcr.so.@LIBCR_MAJOR@ %{_libdir}/libcr.so.@LIBCR_VERSION@ %{_libdir}/libcr_run.so.@LIBCR_MAJOR@ %{_libdir}/libcr_run.so.@LIBCR_VERSION@ %{_libdir}/libcr_omit.so.@LIBCR_MAJOR@ %{_libdir}/libcr_omit.so.@LIBCR_VERSION@ %endif %if %{build_shared} && %{build_libdir32} %{libdir32}/libcr.so.@LIBCR_MAJOR@ %{libdir32}/libcr.so.@LIBCR_VERSION@ %{libdir32}/libcr_run.so.@LIBCR_MAJOR@ %{libdir32}/libcr_run.so.@LIBCR_VERSION@ %{libdir32}/libcr_omit.so.@LIBCR_MAJOR@ %{libdir32}/libcr_omit.so.@LIBCR_VERSION@ %endif # # Separate -devel package # TODO: separate 32-bit package in multilib builds # %package devel %if %{build_shared} Requires: %{name}-libs = %{version}-%{release} %endif Group: Development/Libraries Summary: Header and object files for Berkeley Lab Checkpoint/Restart for Linux License: LGPLv2+ %description devel Header and object files for Berkeley Lab Checkpoint/Restart for Linux You must also install the %{name}-libs package. %files devel %defattr(-,root,root) %doc README.devel %doc libcr/license.txt %doc COPYING.LIB %{_includedir}/blcr_common.h %{_includedir}/blcr_errcodes.h %{_includedir}/blcr_ioctl.h %{_includedir}/blcr_proc.h %{_includedir}/libcr.h # .la files %{_libdir}/libcr.la %{_libdir}/libcr_run.la %{_libdir}/libcr_omit.la %if %{build_libdir32} %{libdir32}/libcr.la %{libdir32}/libcr_run.la %{libdir32}/libcr_omit.la %endif # .so files %if %{build_shared} %{_libdir}/libcr.so %{_libdir}/libcr_run.so %{_libdir}/libcr_omit.so %endif %if %{build_shared} && %{build_libdir32} %{libdir32}/libcr.so %{libdir32}/libcr_run.so %{libdir32}/libcr_omit.so %endif # .a files %if %{build_static} %{_libdir}/libcr.a %{_libdir}/libcr_run.a %{_libdir}/libcr_omit.a %endif %if %{build_static} && %{build_libdir32} %{libdir32}/libcr.a %{libdir32}/libcr_run.a %{libdir32}/libcr_omit.a %endif # # Kernel modules as a separate package # %package %{modsubpkg} Group: System Environment/Kernel Summary: Kernel modules for Berkeley Lab Checkpoint/Restart for Linux Provides: %{name}-modules = %{version}-%{release} Requires: %{name} = %{version} # DON'T require since many clusters are built w/ non-RPM kernels: # Requires: kernel = %{kernel} %description %{modsubpkg} Kernel modules for Berkeley Lab Checkpoint/Restart for Linux (BLCR) These kernel modules are built for Linux %{kernel}. You must also install the base %{name} package. %post %{modsubpkg} /sbin/depmod -a -F /boot/System.map-%{kernel} %{kernel} if [ $1 = 2 ]; then # conditional reload on upgrade /etc/init.d/blcr reload >& /dev/null fi exit 0 %preun %{modsubpkg} if [ $1 = 0 ]; then /etc/init.d/blcr stop >& /dev/null fi exit 0 %postun %{modsubpkg} if [ $1 = 0 ]; then /sbin/depmod -a -F /boot/System.map-%{kernel} %{kernel} fi exit 0 %files %{modsubpkg} %defattr(-,root,root) %doc cr_module/license.txt %doc COPYING %dir %{moduledir} %{moduledir}/blcr.ko %{moduledir}/blcr_imports.ko ## ## testsuite as an additional package if configured in ## %if %{build_testsuite} %package testsuite Group: System Environment/Base Summary: Test suite for Berkeley Lab Checkpoint/Restart for Linux License: GPLv2+ Requires: %{name} = %{version} %description testsuite This package includes tests for Berkeley Lab Checkpoint/Restart for Linux %files testsuite %defattr(-,root,root) %doc tests/license.txt %doc COPYING %{_libexecdir}/blcr-testsuite %endif %changelog * @date@ Paul H. Hargrove @VERSION@-@rpm_release@ - Add this autogenerated %%changelog to quiet rpmlint blcr-0.8.5/rpm/license.txt0000664000000000000000000000143707755231462012340 00000000000000This 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 If you are recieving this as part of BLCR, you will find the GNU GPL in the file COPYING in the top-level BLCR directory. blcr-0.8.5/rpm/blcr-0.8.5.spec0000644000000000000000000002462212102072125012375 00000000000000Name: blcr Version: 0.8.5 Release: 1 Summary: Berkeley Lab Checkpoint/Restart for Linux Url: http://ftg.lbl.gov/checkpoint ## Documentation for end-users: # You can "--define 'with_autoreconf 1'" on the rpmbuild commandline # to force use of site-specific or distro-specific autotools. # The default is NO. # You can "--define 'with_multilib 0'" to disable configuration of # BLCR with --enable-multilib (which builds 32-bit libs on a 64-bit # platform, in addition to the 64-bit ones). # This is ignored on 32-bit targets. # If not building against the running kernel, then you'll need to # add exactly one of the following two mutually exclusive options # to your rpmbuild (or rpm) command line: # 1) "--define 'kernel_ver '" # 2) "--define 'kernel_obj /lib/modules//build'", # When using either of these, you may also want/need to add # "--define 'kernel_src /usr/src/linux-'". # Of course the values assigned to kernel_obj and kernel_src # above are just examples. # Use of "--define 'kernel_type '" will allow one to # override /boot/kernel.h, where SOMETHING=SMP, UP, etc. if using # kernel sources configured via that file. ## END of end-user documentation # Control use of local autotools %define run_autoreconf %{?with_autoreconf:1}%{!?with_autoreconf:0} # Read next line as "kernel = defined(kernel_ver) ? kernel_ver : `uname -r`" %define kernel %{?kernel_ver:%{kernel_ver}}%{!?kernel_ver:%(uname -r)} # Name the kernel modules package w/o dashes in the kernel version: %define modsubpkg modules_%(echo %{kernel} | tr - _) %define moduledir /lib/modules/%{kernel}/extra # Name of the unpacked source directory and stem of the tarball name %define distname %{name}-%{version} # Disable RedHat's automatic build of a debuginfo subpackage: %define debug_package %{nil} # Macro for scanning configure arguments # First arg is default value, second is option name. %define is_enabled() %(X=%1; eval set -- ; for x in "$@"; do if [ x"$x" = "x--disable-%2" -o x"$x" = "x--enable-%2=no" ]; then X=0; elif [ x"$x" = "x--enable-%2" -o x"$x" = "x--enable-%2=yes" ]; then X=1; fi; done; echo $X) # Are we building shared and/or static libs? %define build_shared %{is_enabled 1 shared} %if %{build_shared} %define build_static %{is_enabled 0 static} %else %define build_static 1 %endif # Are we building static executables %define build_all_static %{is_enabled 0 all-static} # Are we installing the test-suite %define build_testsuite %{is_enabled 1 testsuite} # Are we building both 32- and 64-bit libcr? %ifarch x86_64 ppc64 # Honour with_multilib if set, otherwise use is_enabled %define build_libdir32 %{?with_multilib:%{with_multilib}}%{!?with_multilib:%{is_enabled 1 multilib}} %else %define build_libdir32 0 %endif # Where to put 32-bit libs on a 64-bit platform %if %{build_libdir32} %define libdir32 %(echo %{_libdir} | sed -e s/lib64/lib/) %endif Group: System Environment/Base License: GPLv2+ Source: %{distname}.tar.gz BuildRoot: %{_tmppath}/buildroot-%{name}-%{version} BuildRequires: perl sed Requires(post): /sbin/chkconfig Requires(preun): /sbin/chkconfig # Kernel and asm support only ported to certain architectures # i386 is omitted because it lacks required atomic instructions ExclusiveArch: i486 i586 i686 athlon x86_64 ppc ppc64 arm ExclusiveOs: Linux Requires: %{name}-modules >= %{version}-%{release} # DON'T require since many clusters are built w/ non-RPM kernels: # BuildPreReq: kernel-source = %{kernel} %description Berkeley Lab Checkpoint/Restart for Linux (BLCR) This package implements system-level checkpointing of scientific applications in a manner suitable for implementing preemption, migration and fault recovery by a batch scheduler. BLCR includes documented interfaces for a cooperating applications or libraries to implement extensions to the checkpoint system, such as consistent checkpointing of distributed MPI applications. Using this package with an appropriate MPI implementation, the vast majority of scientific applications which use MPI for communication on Linux clusters are checkpointable without any modifications to the application source code. You must also install the %{name}-libs package and a %{name}-modules_* package matching your kernel version. %prep %setup -q -n %{distname} %build # Work with rpm's various botched ideas of host vs. target %define _host_cpu %{_target_cpu} %define _host %{_target} %define _build_cpu %{_target_cpu} %define _build %{_target} # Allow user to request use of local autotools %if %{run_autoreconf} autoreconf --force --install %endif # VPATH build required to ensure --enable-multilib will work mkdir -p builddir cd builddir ln -s ../configure . # Configure the thing # Order arguments such that user's configure arguments can disable multilib, and # enable the config-report, but doesn't clobber kernel version info from the # rpmbuild command line %configure \ --srcdir=.. \ %{?libdir32:--enable-multilib} \ --enable-testsuite \ --disable-config-report \ \ %{!?kernel_obj:--with-linux=%{kernel}}%{?kernel_obj:--with-linux=%{kernel_obj}} \ %{?kernel_src:--with-linux-src=%{kernel_src}} \ %{?kernel_type:--with-kernel-type=%{kernel_type}} # Now build it make %clean rm -Rf ${RPM_BUILD_ROOT} %install cd builddir rm -Rf ${RPM_BUILD_ROOT} make install-strip DESTDIR=${RPM_BUILD_ROOT} # Ensure man pages are gzipped, regardless of brp-compress if [ -n "${RPM_BUILD_ROOT}" -a "${RPM_BUILD_ROOT}" != "/" ]; then find ${RPM_BUILD_ROOT}/%{_mandir} -name '*.[1-9]' | xargs gzip -9 fi # Install the init script make -C etc install DESTDIR=${RPM_BUILD_ROOT} # On some systems rpmbuild dislikes having an RPATH that points # to a system directory. Some versions of libtool get this right # on their own, while others don't. # So, we try to clean it up here if we have chrpath. if chrpath --version >& /dev/null; then %if !%{build_all_static} chrpath -d ${RPM_BUILD_ROOT}/%{_bindir}/cr_checkpoint chrpath -d ${RPM_BUILD_ROOT}/%{_bindir}/cr_restart %endif %if !%{build_all_static} && %{build_testsuite} list=`make -C tests --no-print-directory echoval VARNAME=testsexec_PROGRAMS` ( cd ${RPM_BUILD_ROOT}/%{_libexecdir}/blcr-testsuite && chrpath -d $list ) %endif : # ensure non-empty body fi %post if [ $1 = 1 ]; then /sbin/chkconfig --add blcr fi exit 0 %preun if [ $1 = 0 ]; then /sbin/chkconfig --del blcr fi exit 0 %files %defattr(-,root,root) %doc util/license.txt %doc COPYING %doc NEWS %doc doc/README %doc doc/html %doc %{_mandir}/man1/cr_checkpoint.1.gz %doc %{_mandir}/man1/cr_restart.1.gz %doc %{_mandir}/man1/cr_run.1.gz %{_bindir}/cr_checkpoint #%{_bindir}/cr_info %{_bindir}/cr_restart %{_bindir}/cr_run #%{_libexecdir}/vmadcheck %{_sysconfdir}/init.d/blcr %if %{build_shared} # # Libs in a separate package # TODO: separate 32-bit package in multilib builds # %package libs Group: System Environment/Libraries Summary: Libraries for Berkeley Lab Checkpoint/Restart for Linux License: LGPLv2+ Requires(post): /sbin/ldconfig Requires(postun): /sbin/ldconfig %description libs Runtime libraries for Berkeley Lab Checkpoint/Restart for Linux (BLCR) %post libs -p /sbin/ldconfig %postun libs -p /sbin/ldconfig %files libs %defattr(-,root,root) %doc libcr/license.txt %doc COPYING.LIB %doc NEWS %{_libdir}/libcr.so.0 %{_libdir}/libcr.so.0.5.5 %{_libdir}/libcr_run.so.0 %{_libdir}/libcr_run.so.0.5.5 %{_libdir}/libcr_omit.so.0 %{_libdir}/libcr_omit.so.0.5.5 %endif %if %{build_shared} && %{build_libdir32} %{libdir32}/libcr.so.0 %{libdir32}/libcr.so.0.5.5 %{libdir32}/libcr_run.so.0 %{libdir32}/libcr_run.so.0.5.5 %{libdir32}/libcr_omit.so.0 %{libdir32}/libcr_omit.so.0.5.5 %endif # # Separate -devel package # TODO: separate 32-bit package in multilib builds # %package devel %if %{build_shared} Requires: %{name}-libs = %{version}-%{release} %endif Group: Development/Libraries Summary: Header and object files for Berkeley Lab Checkpoint/Restart for Linux License: LGPLv2+ %description devel Header and object files for Berkeley Lab Checkpoint/Restart for Linux You must also install the %{name}-libs package. %files devel %defattr(-,root,root) %doc README.devel %doc libcr/license.txt %doc COPYING.LIB %{_includedir}/blcr_common.h %{_includedir}/blcr_errcodes.h %{_includedir}/blcr_ioctl.h %{_includedir}/blcr_proc.h %{_includedir}/libcr.h # .la files %{_libdir}/libcr.la %{_libdir}/libcr_run.la %{_libdir}/libcr_omit.la %if %{build_libdir32} %{libdir32}/libcr.la %{libdir32}/libcr_run.la %{libdir32}/libcr_omit.la %endif # .so files %if %{build_shared} %{_libdir}/libcr.so %{_libdir}/libcr_run.so %{_libdir}/libcr_omit.so %endif %if %{build_shared} && %{build_libdir32} %{libdir32}/libcr.so %{libdir32}/libcr_run.so %{libdir32}/libcr_omit.so %endif # .a files %if %{build_static} %{_libdir}/libcr.a %{_libdir}/libcr_run.a %{_libdir}/libcr_omit.a %endif %if %{build_static} && %{build_libdir32} %{libdir32}/libcr.a %{libdir32}/libcr_run.a %{libdir32}/libcr_omit.a %endif # # Kernel modules as a separate package # %package %{modsubpkg} Group: System Environment/Kernel Summary: Kernel modules for Berkeley Lab Checkpoint/Restart for Linux Provides: %{name}-modules = %{version}-%{release} Requires: %{name} = %{version} # DON'T require since many clusters are built w/ non-RPM kernels: # Requires: kernel = %{kernel} %description %{modsubpkg} Kernel modules for Berkeley Lab Checkpoint/Restart for Linux (BLCR) These kernel modules are built for Linux %{kernel}. You must also install the base %{name} package. %post %{modsubpkg} /sbin/depmod -a -F /boot/System.map-%{kernel} %{kernel} if [ $1 = 2 ]; then # conditional reload on upgrade /etc/init.d/blcr reload >& /dev/null fi exit 0 %preun %{modsubpkg} if [ $1 = 0 ]; then /etc/init.d/blcr stop >& /dev/null fi exit 0 %postun %{modsubpkg} if [ $1 = 0 ]; then /sbin/depmod -a -F /boot/System.map-%{kernel} %{kernel} fi exit 0 %files %{modsubpkg} %defattr(-,root,root) %doc cr_module/license.txt %doc COPYING %dir %{moduledir} %{moduledir}/blcr.ko %{moduledir}/blcr_imports.ko ## ## testsuite as an additional package if configured in ## %if %{build_testsuite} %package testsuite Group: System Environment/Base Summary: Test suite for Berkeley Lab Checkpoint/Restart for Linux License: GPLv2+ Requires: %{name} = %{version} %description testsuite This package includes tests for Berkeley Lab Checkpoint/Restart for Linux %files testsuite %defattr(-,root,root) %doc tests/license.txt %doc COPYING %{_libexecdir}/blcr-testsuite %endif %changelog * Tue Jan 29 2013 Paul H. Hargrove 0.8.5-1 - Add this autogenerated %%changelog to quiet rpmlint blcr-0.8.5/vmadump4/0000755000000000000000000000000012102072125011142 500000000000000blcr-0.8.5/vmadump4/vmadcheck.c0000664000000000000000000003746012064133251013174 00000000000000/*------------------------------------------------------------------------- * vmadcheck.c: Dump file sanity checker (for debugging only) * * Copyright (C) 1999-2001 by Erik Hendriks * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * $Id: vmadcheck.c,v 1.7.40.1 2012/12/18 18:32:09 phargrov Exp $ *-----------------------------------------------------------------------*/ #include #include #include #include #include #include #include #include #include #include /* Including these files is fairly perilous. */ #include #include struct task_struct; #include #if defined(__i386__) /*#include */ #endif #if defined(__x86_64__) #endif #include "vmadump.h" /* This stuff is here because the kernel and glibc disagree about signal datatypes */ #undef _NSIG #undef _NSIG_BPW #undef _NSIG_WORDS #define _NSIG 64 #define _NSIG_BPW (sizeof(long)*8) #define _NSIG_WORDS (_NSIG / _NSIG_BPW) typedef struct { unsigned long sig[_NSIG_WORDS]; } k_sigset_t; struct k_sigaction { void *ksa_handler; unsigned long ksa_flags; void *ksa_restorer; k_sigset_t ksa_mask; }; static void read_check(int fd, void *p, size_t bytes) { int r; r = read(fd, p, bytes); if (r < 0) { fprintf(stderr, "Read error: %s\n", strerror(errno)); exit(1); } if (r != bytes) { printf("Short file.\n"); exit(1); } } static void read_skip(int fd, size_t bytes) { int len; char buffer[PAGE_SIZE]; while (bytes > 0) { len = bytes > PAGE_SIZE ? PAGE_SIZE : bytes; read_check(fd, buffer, len); bytes -= len; } } #define PTRWIDTH ((int)(sizeof(void *)*2)) char *arch_names[] = {"","i386","sparc", "alpha", "ppc", "x86_64", "ppc64"}; #define MAX_ARCH ((sizeof(arch_names)/sizeof(char *))-1) static char vmad_magic[4] = VMAD_MAGIC; int main(int argc, char *argv[]) { int fd, i; char filename[PAGE_SIZE]; struct vmadump_header head; struct vmadump_vma_header map; struct vmadump_page_header page; struct vmadump_mm_info mm; struct vmadump_hook_header hook; struct pt_regs regs; k_sigset_t blocked; struct k_sigaction sa; if (argc != 2) { fprintf(stderr, "Usage: %s dumpfile\n", argv[0]); exit(0); } fd = open(argv[1], O_RDONLY); if (fd == -1) { perror(argv[1]); exit(1); } read_check(fd, &head, sizeof(head)); if (memcmp(head.magic, vmad_magic, sizeof(head.magic))) { printf("Invalid magic number.\n"); exit(1); } printf("dump version: %d\n", (int) head.fmt_vers); if (head.fmt_vers != VMAD_FMT_VERS) { fprintf(stderr, "I only know about dump format version %d. (Sorry)\n", VMAD_FMT_VERS); exit(1); } printf("kernel: %d.%d.%d\n", (int) head.major, (int) head.minor, (int) head.patch); if (head.arch <= MAX_ARCH) printf("arch: %s\n", arch_names[head.arch]); else printf("arch: %d (unknown arch)\n", (int) head.arch); if (head.arch != VMAD_ARCH) { fprintf(stderr, "I can only inspect dumps from my own architecture. (Sorry)\n"); exit(1); } read_check(fd, filename, 16); printf("comm: %s\n", filename); { int pid; read_check(fd, &pid, sizeof(pid)); printf("pid: %d\n", pid); } read_check(fd, ®s, sizeof(regs)); /*--------------------------------------------------------------------- * There are a bunch of magical numbers being used in here for * different cpu specific structure sizes. These are (were) * correct but they might change at some point. *-------------------------------------------------------------------*/ #if defined(__i386__) { uint32_t fpu[128]; /* union i387_union */ long debug[8], i; char flag; struct { uint32_t a, b; } tls[3]; /* 3 = GDT_ENTRY_TLS_ENTRIES */ uint32_t fs, gs; printf("regs: eax=%08lx ebx=%08lx ecx=%08lx edx=%08lx\n" "regs: esi=%08lx edi=%08lx esp=%08lx ebp=%08lx\n" "regs: eip=%08lx flgs=%08lx cs=%04x ss=%04x\n" "regs: ds=%04x es=%04x\n", regs.eax, regs.ebx, regs.ecx, regs.edx, regs.esi, regs.edi, regs.esp, regs.ebp, regs.eip, regs.eflags, regs.xcs, regs.xss, regs.xds, regs.xes); read_check(fd, &flag, sizeof(flag)); if (flag) { read_check(fd, &fpu, sizeof(fpu)); printf("fpu: FPU state present.\n"); } else printf("fpu: No FPU state.\n"); read_check(fd, debug, sizeof(long)*8); printf("db: "); for (i=0; i < 8; i++) printf(" %08lx", debug[i]); printf("\n"); read_check(fd, &tls, sizeof(tls)); #define GET_BASE(desc) ( \ (((desc)->a >> 16) & 0x0000ffff) | \ (((desc)->b << 16) & 0x00ff0000) | \ ( (desc)->b & 0xff000000) ) #define GET_LIMIT(desc) ( \ ((desc)->a & 0x0ffff) | \ ((desc)->b & 0xf0000) ) #define GET_PRESENT(desc) (((desc)->b >> 15) & 1) for (i=0; i < 3; i++) if (GET_PRESENT(&tls[i])) printf("tls: %ld base=0x%08x limit=0x%08x\n", i, GET_BASE(&tls[i]), GET_LIMIT(&tls[i])); else printf("tls: %ld (not present)\n", i); read_check(fd, &fs, sizeof(fs)); read_check(fd, &gs, sizeof(gs)); printf("seg: fs=0x%04x gs=0x%04x\n", (int) fs, (int) gs); } #elif defined(__sparc__) { int i; printf("regs: pc=%08lx npc=%08lx y=%08lx\n", regs.pc, regs.npc, regs.y); printf("regs: G"); for (i=UREG_G0; i <=UREG_G7; i++) printf(" %08lx", regs.u_regs[i]); printf("\n"); printf("regs: I"); for (i=UREG_I0; i <=UREG_I7; i++) printf(" %08lx", regs.u_regs[i]); printf("\n"); } #elif defined(__alpha__) { struct switch_stack ss; unsigned long usp; read_check(fd, &ss, sizeof(ss)); read_check(fd, &usp, sizeof(usp)); printf("regs: pc = %016lx ra = %016lx ps = %04lx\n" "regs: r0 = %016lx r1 = %016lx r2 = %016lx\n" "regs: r3 = %016lx r4 = %016lx r5 = %016lx\n" "regs: r6 = %016lx r7 = %016lx r8 = %016lx\n" "regs: r9 = %016lx r10= %016lx r11= %016lx\n" "regs: r12= %016lx r13= %016lx r14= %016lx\n" "regs: r15= %016lx\n" "regs: r16= %016lx r17= %016lx r18= %016lx\n" "regs: r19= %016lx r20= %016lx r21= %016lx\n" "regs: r22= %016lx r23= %016lx r24= %016lx\n" "regs: r25= %016lx r27= %016lx r28= %016lx\n" "regs: gp = %016lx sp = %016lx\n", regs.pc, regs.r26, regs.ps, regs.r0, regs.r1, regs.r2, regs.r3, regs.r4, regs.r5, regs.r6, regs.r7, regs.r8, ss.r9, ss.r10, ss.r11, ss.r12, ss.r13, ss.r14, ss.r15, regs.r16, regs.r17, regs.r18, regs.r19, regs.r20, regs.r21, regs.r22, regs.r23, regs.r24, regs.r25, regs.r27, regs.r28, regs.gp, usp); } #elif defined(powerpc) { double fpr[32]; unsigned long fpscr; typedef struct { __u32 u[4]; } vector128; vector128 vr[32]; vector128 vscr; read_check(fd, fpr, sizeof(fpr)); read_check(fd, &fpscr, sizeof(fpscr)); read_check(fd, vr, sizeof(vr)); read_check(fd, &vscr, sizeof(vscr)); for (i=0; i < 32; i++) { if (i%4 == 0) printf("regs:"); printf(" r%02d = %08lx", i, regs.gpr[i]); if (i%4 == 3) printf("\n"); } for (i=0; i < 32; i++) { if (i%4 == 0) printf("regs:"); printf(" fp%02d = %f", i, fpr[i]); if (i%4 == 3) printf("\n"); } printf("regs: fpscr = %08lx\n", fpscr); /* XXX We're presuming altivec is present here */ for (i=0; i < 32; i++) { if (i%2 == 0) printf("regs:"); printf(" av%02d = %08x%08x%08x%08x", i, vr[i].u[0], vr[i].u[1], vr[i].u[2], vr[i].u[3]); if (i%2 == 1) printf("\n"); } printf("regs: vscr = %08x%08x%08x%08x\n", vscr.u[0], vscr.u[1], vscr.u[2], vscr.u[3]); } #elif defined(__x86_64__) { struct i387_fxsave_struct { uint16_t cwd; uint16_t swd; uint16_t twd; uint16_t fop; uint64_t rip; uint64_t rdp; uint32_t mxcsr; uint32_t mxcsr_mask; uint32_t st_space[32]; uint32_t xmm_space[64]; uint32_t padding[24]; } __attribute__ ((aligned (16))); union i387_union { struct i387_fxsave_struct fxsave; }; union i387_union fpu; long debug[8], i; char flag; unsigned long fs, gs; uint16_t fsindex, gsindex; struct { uint32_t a, b; } tls[3]; /* 3 = GDT_ENTRY_TLS_ENTRIES */ printf("regs: rax=%016lx rbx=%016lx\n" "regs: rcx=%016lx rdx=%016lx\n" "regs: rbp=%016lx rsi=%016lx\n" "regs: rdi=%016lx rsp=%016lx\n" "regs: r8 =%016lx r9 =%016lx\n" "regs: r10=%016lx r11=%016lx\n" "regs: r12=%016lx r13=%016lx\n" "regs: r14=%016lx r15=%016lx\n" "regs: rip=%016lx efl=%016lx\n", regs.rax, regs.rbx, regs.rcx, regs.rdx, regs.rbp, regs.rsi, regs.rdi, regs.rsp, regs.r8, regs.r9, regs.r10, regs.r11, regs.r12, regs.r13, regs.r14, regs.r15, regs.rip, regs.eflags); printf("regs: cs=%04lx ss=%04lx\n", regs.cs, regs.ss); read_check(fd, &flag, sizeof(flag)); if (flag) { read_check(fd, &fpu, sizeof(fpu)); printf("fpu: FPU state present.\n"); } else printf("fpu: No FPU state.\n"); printf("seg: %d-bit Mode Process.\n", (regs.cs == 0x23) ? 32 : 64); /* Segments and crap */ read_check(fd, &fs, sizeof(fs)); read_check(fd, &gs, sizeof(gs)); printf("seg: fs=%016lx gs=%016lx\n", fs, gs); read_check(fd, &fsindex, sizeof(fsindex)); read_check(fd, &gsindex, sizeof(gsindex)); printf("seg: fsindex=%04x gsindex=%04x\n", fsindex, gsindex); read_check(fd, &tls, sizeof(tls)); #define GET_BASE(desc) ( \ (((desc)->a >> 16) & 0x0000ffff) | \ (((desc)->b << 16) & 0x00ff0000) | \ ( (desc)->b & 0xff000000) ) #define GET_LIMIT(desc) ( \ ((desc)->a & 0x0ffff) | \ ((desc)->b & 0xf0000) ) #define GET_PRESENT(desc) (((desc)->b >> 15) & 1) for (i=0; i < 3; i++) if (GET_PRESENT(&tls[i])) printf("tls: %ld base=0x%08x limit=0x%08x\n", i, GET_BASE(&tls[i]), GET_LIMIT(&tls[i])); else printf("tls: %ld (not present)\n", i); read_check(fd, debug, sizeof(long)*6); printf("db: "); for (i=0; i < 3; i++) printf(" %016lx", debug[i]); printf("\ndb: "); for (i=0; i < 3; i++) printf(" %016lx", debug[i]); printf("\n"); } #elif defined(__powerpc64__) { double fpr[32]; unsigned long fpscr; typedef struct { __u32 u[4]; } vector128; vector128 vr[32]; vector128 vscr; read_check(fd, fpr, sizeof(fpr)); read_check(fd, &fpscr, sizeof(fpscr)); read_check(fd, vr, sizeof(vr)); read_check(fd, &vscr, sizeof(vscr)); printf("regs: %d-bit Mode Process.\n", (regs.msr & (1L<<63)) ? 64 : 32); for (i=0; i < 32; i++) { if (i%4 == 0) printf("regs:"); printf(" r%02d = %016lx", i, regs.gpr[i]); if (i%4 == 3) printf("\n"); } for (i=0; i < 32; i++) { if (i%4 == 0) printf("regs:"); printf(" fp%02d = %f", i, fpr[i]); if (i%4 == 3) printf("\n"); } printf("regs: fpscr = %08lx\n", fpscr); /* XXX We're presuming altivec is present here */ for (i=0; i < 32; i++) { if (i%2 == 0) printf("regs:"); printf(" av%02d = %08x%08x%08x%08x", i, vr[i].u[0], vr[i].u[1], vr[i].u[2], vr[i].u[3]); if (i%2 == 1) printf("\n"); } printf("regs: vscr = %08x%08x%08x%08x\n", vscr.u[0], vscr.u[1], vscr.u[2], vscr.u[3]); } #else printf("regs: no register display for this arch\n"); #endif /*--- Signal Information ---------------------------------------*/ read_check(fd, &blocked, sizeof(blocked)); printf("sigblk: "); for (i=0; i < _NSIG; i++) { if (blocked.sig[i / (sizeof(long)*8)] & (1 << (i % (sizeof(long)*8)))) printf(" %d", i+1); } printf("\n"); { k_sigset_t pending_set; int flags; read_check(fd, &flags, sizeof(flags)); while (flags != -1) { siginfo_t info; read_check(fd, &info, sizeof(info)); read_check(fd, &flags, sizeof(flags)); } read_check(fd, &pending_set, sizeof(pending_set)); printf("private sigpend: "); for (i=0; i < _NSIG; i++) { if (pending_set.sig[i / (sizeof(long)*8)] & (1 << (i % (sizeof(long)*8)))) printf(" %d", i+1); } printf("\n"); read_check(fd, &pending_set, sizeof(pending_set)); printf("shared sigpend: "); for (i=0; i < _NSIG; i++) { if (pending_set.sig[i / (sizeof(long)*8)] & (1 << (i % (sizeof(long)*8)))) printf(" %d", i+1); } printf("\n"); } for (i=0; i < _NSIG; i++) { read_check(fd, &sa, sizeof(sa)); if (sa.ksa_handler == 0) continue; printf("sigact: %2d", i+1); if (sa.ksa_handler == (void *)1) printf(" IGNORED"); else { printf(" handler=%0*lx", PTRWIDTH,(long)sa.ksa_handler); #if 0 if (blocked[i / (sizeof(long)*8)] & (1 << (i % (sizeof(long)*8)))) printf(" %d", i+1); #endif } printf("\n"); } /*--- Misc process information ---------------------------------*/ { void *clear_child_tid; unsigned long personality; read_check(fd, &clear_child_tid, sizeof(clear_child_tid)); read_check(fd, &personality, sizeof(personality)); printf("child_tid: %p\n", clear_child_tid); printf("personality: %p\n", (void*)personality); } /*--- Memory meta-data -----------------------------------------*/ read_check(fd, &mm, sizeof(mm)); printf("code: %0*lx-%0*lx\n", PTRWIDTH, mm.start_code, PTRWIDTH, mm.end_code); printf("data: %0*lx-%0*lx\n", PTRWIDTH, mm.start_data, PTRWIDTH, mm.end_data); printf("brk: %0*lx-%0*lx\n", PTRWIDTH, mm.start_brk, PTRWIDTH, mm.brk); printf("stack: %*s-%0*lx\n", PTRWIDTH, "", PTRWIDTH, mm.start_stack); printf("arg: %0*lx-%0*lx\n", PTRWIDTH, mm.arg_start, PTRWIDTH, mm.arg_end); printf("env: %0*lx-%0*lx\n", PTRWIDTH, mm.env_start, PTRWIDTH, mm.env_end); /*--- Memory data ----------------------------------------------*/ read_check(fd, &map, sizeof(map)); while (map.start != ~0 || map.end != ~0) { if (map.namelen) { if (map.namelen > PAGE_SIZE) { printf("Map has invalid name length: %d\n", (int) map.namelen); exit(1); } read_check(fd, filename, map.namelen); filename[map.namelen]=0; printf("map: %0*lx-%0*lx %04x file %s:%0*lx\n", PTRWIDTH, map.start, PTRWIDTH, map.end, (int)map.flags, filename, PTRWIDTH, map.pgoff * PAGE_SIZE); } else { printf("map: %0*lx-%0*lx %04x (data provided)\n", PTRWIDTH, map.start, PTRWIDTH, map.end, (int)map.flags); } read_check(fd, &page, sizeof(page)); while (page.start != ~0) { printf("page: %0*lx (data provided)\n", PTRWIDTH, page.start); lseek(fd, PAGE_SIZE, SEEK_CUR); read_check(fd, &page, sizeof(page)); } read_check(fd, &map, sizeof(map)); } /*--- Read hook data -------------------------------------------*/ read_check(fd, &hook, sizeof(hook)); while (hook.tag[0]) { printf("hook: tag=\"%s\" bytes=%ld\n", hook.tag, hook.size); read_skip(fd, hook.size); read_check(fd, &hook, sizeof(hook)); } /* Complain about trailing garbage? */ if (read(fd, &i, sizeof(i)) != 0) { fprintf(stderr, "Trailing garbage at end of file.\n"); exit(1); } exit(0); } /* * Local variables: * c-basic-offset: 4 * End: */ blcr-0.8.5/vmadump4/vmadump_i386.c0000664000000000000000000002643712065262174013503 00000000000000/*------------------------------------------------------------------------- * vmadump_i386.c: i386 specific dumping/undumping routines * * Copyright (C) 1999-2001 by Erik Hendriks * * 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 * * $Id: vmadump_i386.c,v 1.38.8.4 2012/12/22 07:42:52 phargrov Exp $ * * THIS VERSION MODIFIED FOR BLCR *-----------------------------------------------------------------------*/ #include #include #include #define __VMADUMP_INTERNAL__ #include "vmadump.h" #include "vmadump_x86.h" long vmadump_store_cpu(cr_chkpt_proc_req_t *ctx, struct file *file, struct pt_regs *regs) { struct pt_regs regtmp; long bytes = 0, r; /* Zero upper 2 bytes of the stored segment registers. * These bytes are uninitialized and could, in theory, produce * a leak of kernel information if saved to the dump file. */ regtmp = *regs; #if HAVE_PT_REGS_XCS regtmp.xcs &= 0xffff; regtmp.xds &= 0xffff; regtmp.xes &= 0xffff; regtmp.xss &= 0xffff; #if HAVE_PT_REGS_XFS regtmp.xfs &= 0xffff; #endif #if HAVE_PT_REGS_XGS regtmp.xgs &= 0xffff; #endif #elif HAVE_PT_REGS_CS regtmp.cs &= 0xffff; regtmp.ds &= 0xffff; regtmp.es &= 0xffff; regtmp.ss &= 0xffff; #if HAVE_PT_REGS_FS regtmp.fs &= 0xffff; #endif #if HAVE_PT_REGS_GS regtmp.gs &= 0xffff; #endif #else #error #endif /* Store struct pt_regs */ r = write_kern(ctx, file, ®tmp, sizeof(regtmp)); if (r != sizeof(regtmp)) goto err; bytes += r; /* Store FPU info (and later general "extended state") */ r = vmadump_store_i387(ctx, file); if (r <= 0) goto err; bytes += r; /* Store debugging state */ r = vmadump_store_debugreg(ctx, file); if (r <= 0) goto err; bytes += r; /* Store TLS (segment) information */ r = write_kern(ctx, file, ¤t->thread.tls_array, sizeof(current->thread.tls_array)); if (r != sizeof(current->thread.tls_array)) goto err; bytes += r; #if !(HAVE_PT_REGS_XFS || HAVE_PT_REGS_FS) savesegment(fs,current->thread.fs); current->thread.fs &= 0xffff; r = write_kern(ctx, file, ¤t->thread.fs, sizeof(current->thread.fs)); if (r != sizeof(current->thread.fs)) goto err; bytes += r; #endif #if !(HAVE_PT_REGS_XGS || HAVE_PT_REGS_GS) savesegment(gs,current->thread.gs); current->thread.gs &= 0xffff; r = write_kern(ctx, file, ¤t->thread.gs, sizeof(current->thread.gs)); if (r != sizeof(current->thread.gs)) goto err; bytes += r; #endif #if HAVE_THREAD_INFO_SYSENTER_RETURN { void *sysenter_return = current_thread_info()->sysenter_return; r = write_kern(ctx, file, &sysenter_return, sizeof(sysenter_return)); if (r != sizeof(sysenter_return)) goto err; } #endif return bytes; err: if (r >= 0) r = -EIO; return r; } int vmadump_restore_cpu(cr_rstrt_proc_req_t *ctx, struct file *file, struct pt_regs *regs) { struct vmadump_restore_tmps *x86tmps; struct thread_struct *threadtmp; struct pt_regs *regtmp; int r; #if HAVE_PT_REGS_XFS || HAVE_PT_REGS_FS unsigned long saved_fs; #endif #if HAVE_PT_REGS_XGS || HAVE_PT_REGS_GS unsigned long saved_gs; #endif /* XXX: Note allocation assumes i387tmp and threadtmp are never active at the same time */ x86tmps = kmalloc(sizeof(*x86tmps), GFP_KERNEL); if (!x86tmps) return -ENOMEM; regtmp = VMAD_REGTMP(x86tmps); threadtmp = VMAD_THREADTMP(x86tmps); r = read_kern(ctx, file, regtmp, sizeof(*regtmp)); if (r != sizeof(*regtmp)) goto bad_read; /* Don't let the user pick bogo-segregs. Restoring other values * will either lead us to fault while restoring or worse it might * allow users to do bad(tm) things in kernel space. */ #if HAVE_PT_REGS_XCS regtmp->xcs = __USER_CS; regtmp->xds = __USER_DS; regtmp->xes = __USER_DS; regtmp->xss = __USER_DS; #if HAVE_PT_REGS_XFS saved_fs = regtmp->xfs; /* restored after TLS and validation */ regtmp->xfs = 0; #endif #if HAVE_PT_REGS_XGS saved_gs = regtmp->xgs; /* restored after TLS and validation */ regtmp->xgs = 0; #endif #elif HAVE_PT_REGS_CS regtmp->cs = __USER_CS; regtmp->ds = __USER_DS; regtmp->es = __USER_DS; regtmp->ss = __USER_DS; #if HAVE_PT_REGS_FS saved_fs = regtmp->fs; /* restored after TLS and validation */ regtmp->fs = 0; #endif #if HAVE_PT_REGS_GS saved_gs = regtmp->gs; /* restored after TLS and validation */ regtmp->gs = 0; #endif #else #error "No x86 segments in pt_regs?" #endif /* Only restore bottom 9 bits of eflags. Restoring anything else * is bad bad mojo for security. (0x200 = interrupt enable) */ #if HAVE_PT_REGS_EFLAGS regtmp->eflags = 0x200 | (regtmp->eflags & 0x000000FF); #elif HAVE_PT_REGS_FLAGS regtmp->flags = 0x200 | (regtmp->flags & 0x000000FF); #else #error #endif memcpy(regs, regtmp, sizeof(*regtmp)); /* Restore FPU info (and later general "extended state") */ r = vmadump_restore_i387(ctx, file, VMAD_I387TMP(x86tmps)); if (r < 0) goto bad_read; /* XXX FIX ME: RESTORE DEBUG INFORMATION ?? */ /* Here we read it but ignore it. */ r = vmadump_restore_debugreg(ctx, file); if (r < 0) goto bad_read; /* Restore TLS information */ { unsigned long fs, gs; int i, idx, cpu; struct desc_struct tls_array[GDT_ENTRY_TLS_ENTRIES]; r = read_kern(ctx, file, tls_array, sizeof(tls_array)); if (r != sizeof(tls_array)) goto bad_read; #if !(HAVE_PT_REGS_XFS || HAVE_PT_REGS_FS) r = read_kern(ctx, file, &fs, sizeof(fs)); if (r != sizeof(fs)) goto bad_read; #else fs = saved_fs; #endif #if !(HAVE_PT_REGS_XGS || HAVE_PT_REGS_GS) r = read_kern(ctx, file, &gs, sizeof(gs)); if (r != sizeof(gs)) goto bad_read; #else gs = saved_gs; #endif /* Sanitize the TLS entries... * Make sure the following bits are set/not set: * bit 12 : S = 1 (code/data - not system) * bit 13-14: DPL = 11 (priv level = 3 (user)) * bit 21 : = 0 (reserved) * * If the entry isn't valid, zero the whole descriptor. */ for (i=0; i < GDT_ENTRY_TLS_ENTRIES; i++) { if ((tls_array[i].b & 0x00207000) != 0x00007000) tls_array[i].a = tls_array[i].b = 0; } /* Sanitize fs, gs. These segment descriptors should load one * of the TLS entries and have DPL = 3. If somebody is doing * some other LDT monkey business, I'm currently not * supporting that here. Also, I'm presuming that the offsets * to the GDT_ENTRY_TLS_MIN is the same in both kernels. */ idx = fs >> 3; if (idx < GDT_ENTRY_TLS_MIN || idx > GDT_ENTRY_TLS_MAX || (fs&7) != 3) fs = 0; idx = gs >> 3; if (idx < GDT_ENTRY_TLS_MIN || idx > GDT_ENTRY_TLS_MAX || (gs&7) != 3) gs = 0; /* Load the freshly sanitized entries */ memcpy(current->thread.tls_array, tls_array, sizeof(current->thread.tls_array)); /* load_TLS can't get pre-empted */ cpu = get_cpu(); load_TLS(¤t->thread, cpu); put_cpu(); /* this stuff will get stored in thread->fs,gs at the next * context switch. */ #if HAVE_PT_REGS_XFS regs->xfs = fs; #elif HAVE_PT_REGS_FS regs->fs = fs; #else loadsegment(fs, fs); #endif #if HAVE_PT_REGS_XGS regs->xgs = gs; #elif HAVE_PT_REGS_GS regs->gs = gs; #else loadsegment(gs, gs); #endif } #if HAVE_THREAD_INFO_SYSENTER_RETURN { void *sysenter_return; r = read_kern(ctx, file, &sysenter_return, sizeof(sysenter_return)); if (r != sizeof(sysenter_return)) goto bad_read; current_thread_info()->sysenter_return = sysenter_return; } #endif kfree(x86tmps); return 0; bad_read: kfree(x86tmps); if (r >= 0) return -EIO; return r; } #if VMAD_HAVE_ARCH_MAPS #include #if HAVE_ASM_VSYSCALL32_H #include #endif #if HAVE_MM_CONTEXT_VDSO #define vmad_vdso_base current->mm->context.vdso #elif HAVE_VSYSCALL_BASE #define vmad_vdso_base VSYSCALL_BASE #else #error "No support yet for VDSO on your kernel - please report as a BLCR bug" #endif int vmad_is_arch_map(const struct vm_area_struct *map) { return (map->vm_start == (unsigned long)vmad_vdso_base); } EXPORT_SYMBOL_GPL(vmad_is_arch_map); loff_t vmad_store_arch_map(cr_chkpt_proc_req_t *ctx, struct file *file, struct vm_area_struct *map, int flags) { loff_t r = 0; if (vmad_is_arch_map(map)) { /* Just write out a section header */ struct vmadump_vma_header head; head.start = map->vm_start; head.end = map->vm_end; head.flags = map->vm_flags; head.namelen = VMAD_NAMELEN_ARCH; head.pgoff = 0; up_read(¤t->mm->mmap_sem); r = write_kern(ctx, file, &head, sizeof(head)); down_read(¤t->mm->mmap_sem); if (r < 0) return r; if (r != sizeof(head)) r = -EIO; } return r; } int vmad_load_arch_map(cr_rstrt_proc_req_t *ctx, struct file *file, struct vmadump_vma_header *head) { long r; #if HAVE_THREAD_INFO_SYSENTER_RETURN /* Save against overwrite by arch_setup_additional_pages() */ void *sysenter_return = current_thread_info()->sysenter_return; #endif #if HAVE_MM_CONTEXT_VDSO vmad_vdso_base = (void *)(~0UL); #endif #if HAVE_2_ARG_ARCH_SETUP_ADDITIONAL_PAGES r = arch_setup_additional_pages(NULL, 0); if (r < 0) { CR_ERR_CTX(ctx, "arch_setup_additional_pages failed %d", (int)r); goto err; } #elif HAVE_4_ARG_ARCH_SETUP_ADDITIONAL_PAGES r = arch_setup_additional_pages(NULL, 0, 0, 0); if (r < 0) { CR_ERR_CTX(ctx, "arch_setup_additional_pages failed %d", (int)r); goto err; } #elif HAVE_MAP_VSYSCALL map_vsyscall(); #else #error "Unknown calling convention to map the VDSO" #endif #if HAVE_MM_CONTEXT_VDSO /* Call to arch_setup_additional_pages() or map_vsyscall() should have written * the new value to vmad_vdso_base. We relocate it here if different. */ if (vmad_vdso_base == (void *)(~0UL)) { /* The call above didn't overwrite mm->context.vdso. * Since no failure was indicatated we just fill it in below. */ } else if (vmad_vdso_base != (void *)head->start) { r = vmad_remap(ctx, (unsigned long)vmad_vdso_base, head->start, head->end - head->start); if (r) { CR_ERR_CTX(ctx, "vdso remap failed %d", (int)r); goto err; } } vmad_vdso_base = (void *)head->start; #else /* VSYSCALL_BASE is a fixed location */ #endif #if HAVE_THREAD_INFO_SYSENTER_RETURN current_thread_info()->sysenter_return = sysenter_return; #endif r = 0; err: return r; } #endif /* * Local variables: * c-basic-offset: 4 * End: */ blcr-0.8.5/vmadump4/vmadump.h0000664000000000000000000002406112064133251012716 00000000000000/*------------------------------------------------------------------------- * vmadump.h: Definitions for VMADump * * Copyright (C) 1999-2001 by Erik Hendriks * * 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 * * $Id: vmadump.h,v 1.47.4.2 2012/12/18 18:32:09 phargrov Exp $ * * THIS VERSION MODIFIED FOR BLCR *-----------------------------------------------------------------------*/ #ifndef _VMADUMP_H #define _VMADUMP_H /* Everything past this struct is architecture dependent */ struct vmadump_header { unsigned char magic[3]; unsigned char fmt_vers; /* version of dump format */ unsigned char arch; unsigned char major; /* Kernel rev dumped from */ unsigned char minor; unsigned char patch; }; struct vmadump_vma_header { unsigned long start; /* ~0 = end of list */ unsigned long end; unsigned long flags; unsigned long namelen; /* 0 = data follows */ unsigned long pgoff; /* file offset for mmap, in page units */ }; struct vmadump_page_header { unsigned long start; /* ~0 = end of list */ unsigned int num_pages; }; struct vmadump_mm_info { unsigned long start_code, end_code; unsigned long start_data, end_data; unsigned long start_brk, brk; unsigned long start_stack; unsigned long arg_start, arg_end; unsigned long env_start, env_end; }; struct vmadump_page_list_header { unsigned int fill; /* May add hash list or other data here later */ }; #define VMAD_CHUNKHEADER_SIZE PAGE_SIZE #define VMAD_CHUNKHEADER_MIN sizeof(struct vmadump_page_header) #define VMAD_END_OF_CHUNKS ~0UL #define VMAD_HOOK_TAG_LEN 16 struct vmadump_hook_header { char tag[VMAD_HOOK_TAG_LEN]; long size; /* NOT including the header */ }; #define VMAD_MAGIC {0x56,0x4d,0x41} #define VMAD_FMT_VERS 6 #define VMAD_ARCH_i386 1 #define VMAD_ARCH_sparc 2 #define VMAD_ARCH_alpha 3 #define VMAD_ARCH_ppc 4 #define VMAD_ARCH_x86_64 5 #define VMAD_ARCH_ppc64 6 #define VMAD_ARCH_arm 7 #define VMAD_ARCH_sparc64 8 #if defined(__i386__) #define VMAD_ARCH VMAD_ARCH_i386 #define HAVE_BINFMT_VMADUMP 1 #elif defined(__sparc__) && defined(__arch64__) #define VMAD_ARCH VMAD_ARCH_sparc64 #elif defined(__sparc__) #define VMAD_ARCH VMAD_ARCH_sparc #define HAVE_BINFMT_VMADUMP 1 #elif defined(__alpha__) #define VMAD_ARCH VMAD_ARCH_alpha /* Alpha execve doesn't save enough state on the way into the kernel * to support complete state restoration, so no binfmt_vmadump on * alpha. */ #undef HAVE_BINFMT_VMADUMP #elif defined(powerpc) #define VMAD_ARCH VMAD_ARCH_ppc #define HAVE_BINFMT_VMADUMP 1 #elif defined(__x86_64__) #define VMAD_ARCH VMAD_ARCH_x86_64 /* The complications of syscall return in the mixed mode world make * this one not worth it... */ #undef HAVE_BINFMT_VMADUMP #elif defined(__powerpc64__) #define VMAD_ARCH VMAD_ARCH_ppc64 #define HAVE_BINFMT_VMADUMP 1 #elif defined(__arm__) #define VMAD_ARCH VMAD_ARCH_arm #define HAVE_BINFMT_VMADUMP 1 #else #error VMADUMP does not support this architecture #endif /* Defs for the syscall interface */ #define VMAD_DO_DUMP 0x00 #define VMAD_DO_UNDUMP 0x01 #define VMAD_DO_EXECDUMP 0x02 #define VMAD_LIB_CLEAR 0x30 #define VMAD_LIB_ADD 0x31 #define VMAD_LIB_DEL 0x32 #define VMAD_LIB_LIST 0x33 #define VMAD_LIB_SIZE 0x34 /*--- Flags for dump/undump ---*/ #define VMAD_DUMP_LIBS 1 #define VMAD_DUMP_EXEC 2 #define VMAD_DUMP_OTHER 4 #define VMAD_DUMP_ALL 7 #define VMAD_FLAG_BPROC 8 /* These are the flags that the user is allowed to set */ #define VMAD_FLAG_USER_MASK 0x7 struct vmadump_execdump_args { const char *arg0; char * const *argv; char * const *envp; int fd; int flags; }; #include "blcr_vmadump.h" #ifdef __KERNEL__ #include extern int vmadump_init_module(void); extern void vmadump_cleanup_module(void); #if 0 /* BLCR uses its own "proc_req" structures in place of this structure */ struct vmadump_map_ctx { /* map_open: * given a file, open it. The file should be opened with * the given flags. The filename argument is a kernel space pointer. * The semantics should be identical to: * filp_open(filename, flags); * * map_name: * given a file structure, return the canonical name for it. The * semantics should be identical to: * d_path(file->f_dentry, file->f_vfsmnt, buffer, size); * * read_file, write_file: * Alternate file read/write routines. These should have the * same semantics as a blocking sys_read and sys_write. */ struct file *(*map_open) (struct vmadump_map_ctx *ctx, const char *filename, int flags); char *(*map_name) (struct vmadump_map_ctx *ctx, struct file *, char *buffer, int size); ssize_t (*read_file) (struct vmadump_map_ctx *, struct file *, void *, size_t); ssize_t (*write_file)(struct vmadump_map_ctx *, struct file *, const void *, size_t); void *private; }; #endif extern loff_t vmadump_store_page_list(cr_chkpt_proc_req_t *ctx, struct file *file, unsigned long start, unsigned long end); extern loff_t vmadump_store_dirty_page_list(cr_chkpt_proc_req_t *ctx, struct file *file, unsigned long start, unsigned long end); extern int vmadump_load_page_list(cr_rstrt_proc_req_t *ctx, struct file *file, int is_exec); extern loff_t vmadump_freeze_proc(cr_chkpt_proc_req_t *, struct file *file, struct pt_regs *regs, int flags); extern long vmadump_thaw_proc (cr_rstrt_proc_req_t *, struct file *file, struct pt_regs *regs, int flags); extern long vmad_remap(cr_rstrt_proc_req_t *ctx, unsigned long from_addr, unsigned long to_addr, unsigned long len); #if 0 /* Neither used nor maintened in BLCR */ extern long do_vmadump (long op, long arg0, long arg1, struct pt_regs *regs); #endif #if 0 /* Neither used nor maintened in BLCR */ /*--- Interface for modules installing vmadump hooks ---------------*/ struct vmadump_hook_handle; struct vmadump_hook { char *tag; /* name */ /* freeze: * * return value - total number of bytes written INCLUDING header(s) * * */ long (*freeze)(struct vmadump_hook_handle *h, struct pt_regs *regs, int flags); int (*thaw )(struct vmadump_hook_handle *h, struct vmadump_hook_header *hh, struct pt_regs *regs); }; extern int vmadump_add_hook(struct vmadump_hook *hook); extern int vmadump_del_hook(struct vmadump_hook *hook); /* Read/write routines for hooks */ extern ssize_t vmadump_read_u (struct vmadump_hook_handle *h, void *buf, size_t count); extern ssize_t vmadump_read_k (struct vmadump_hook_handle *h, void *buf, size_t count); extern ssize_t vmadump_write_u (struct vmadump_hook_handle *h, const void *buf, size_t count); extern ssize_t vmadump_write_k (struct vmadump_hook_handle *h, const void *buf, size_t count); #endif #ifdef __VMADUMP_INTERNAL__ #if 0 #if defined(__i386__) #define reg_arg0(r) ((r)->ebx) #define reg_arg1(r) ((r)->ecx) #define reg_arg2(r) ((r)->edx) #elif defined(__sparc__) #define reg_arg0(r) ((r)->u_regs[((r)->u_regs[UREG_G1]==0?1:0)+UREG_I0]) #define reg_arg1(r) ((r)->u_regs[((r)->u_regs[UREG_G1]==0?1:0)+UREG_I1]) #define reg_arg2(r) ((r)->u_regs[((r)->u_regs[UREG_G1]==0?1:0)+UREG_I2]) #elif defined(__alpha__) #define reg_arg0(r) ((r)->trap_a0) #define reg_arg1(r) ((r)->trap_a1) #define reg_arg2(r) ((r)->trap_a2) #elif defined(powerpc) #define reg_arg0(r) ((r)->gpr[3]) #define reg_arg1(r) ((r)->gpr[4]) #define reg_arg2(r) ((r)->gpr[5]) #elif defined(__x86_64__) #define reg_arg0(r) ((r)->rdi) #define reg_arg1(r) ((r)->rsi) #define reg_arg2(r) ((r)->rdx) #elif defined(__arm__) #define reg_arg0(r) ((r)->uregs[ 0 ]) #define reg_arg1(r) ((r)->uregs[ 1 ]) #define reg_arg2(r) ((r)->uregs[ 2 ]) #else #error reg_arg[0-2] needs to be defined for this arch #endif #endif #define CR_ERR_CTX CR_ERR_PROC_REQ #define CR_WARN_CTX CR_WARN_PROC_REQ int vmadump_arch_init (void); void vmadump_arch_cleanup(void); long vmadump_store_cpu (cr_chkpt_proc_req_t *ctx, struct file *file, struct pt_regs *regs); int vmadump_restore_cpu(cr_rstrt_proc_req_t *ctx, struct file *file, struct pt_regs *regs); #if 0 /* BLCR uses its own I/O paths */ extern ssize_t write_kern(struct vmadump_map_ctx *ctx, struct file *file, const void *buf, size_t count); extern ssize_t read_kern(struct vmadump_map_ctx *ctx, struct file *file, void *buf, size_t count); #else /* Wrapper for I/O error reporting from vmadump. */ #define io_wrap(_op,_ctx,_file,_buf,_count) \ cr_##_op((_ctx)->req->errbuf,(_file),(_buf),(_count)) #define write_kern(_ctx,_file,_buf,_count) io_wrap(kwrite,_ctx,_file,_buf,_count) #define read_kern(_ctx,_file,_buf,_count) io_wrap(kread,_ctx,_file,_buf,_count) #define write_user(_ctx,_file,_buf,_count) io_wrap(uwrite,_ctx,_file,_buf,_count) #define read_user(_ctx,_file,_buf,_count) io_wrap(uread,_ctx,_file,_buf,_count) #endif #if VMAD_HAVE_ARCH_MAPS extern loff_t vmad_store_arch_map(cr_chkpt_proc_req_t *ctx, struct file *file, struct vm_area_struct *map, int flags); extern int vmad_load_arch_map(cr_rstrt_proc_req_t *ctx, struct file *file, struct vmadump_vma_header *head); #endif /* if VMAD_HAVE_ARCH_MAPS */ #endif /* ifdef __VMADUMP_INTERNAL__ */ #endif /* ifdef __KERNEL__ */ #endif /* * Local variables: * c-basic-offset: 4 * End: */ blcr-0.8.5/vmadump4/vmadump_alpha.c0000664000000000000000000001443511431067213014063 00000000000000/*------------------------------------------------------------------------- * vmadump_alpha.c: alpha specific dumping/undumping routines * * Copyright (C) 1999-2001 by Erik Hendriks * * 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 * * $Id: vmadump_alpha.c,v 1.6.16.1 2010/08/12 21:58:35 phargrov Exp $ *-----------------------------------------------------------------------*/ #define __NO_VERSION__ #ifdef CR_NEED_AUTOCONF_H #include #endif #if defined(CONFIG_SMP) && ! defined(__SMP__) #define __SMP__ #endif #if defined(CONFIG_MODVERSIONS) && ! defined(MODVERSIONS) #define MODVERSIONS #endif #if defined(MODVERSIONS) #include #endif #include #include #include #define __VMADUMP_INTERNAL__ #include "vmadump.h" long vmadump_store_cpu(cr_chkpt_proc_req_t *ctx, struct file *file, struct pt_regs *regs) { struct switch_stack *ss; unsigned long usp; long bytes = 0, r; /* Store struct pt_regs */ r = write_kern(ctx, file, regs, sizeof(*regs)); if (r != sizeof(*regs)) goto err; bytes += r; /* Alpha has more registers than what's in struct ptregs to save * The 'switch_stack' structure contains the rest of the integer * registers and the floating point registers. Then we still have * to go after the user's stack pointer via the PAL code. */ /* Some pointer voodoo... the switch_stack structure got * pushed on top of the struct pt_regs.. */ ss = ((struct switch_stack *) regs)-1; usp = rdusp(); r = write_kern(ctx, file, ss, sizeof(*ss)); if (r != sizeof(*ss)) goto err; bytes += r; r = write_kern(ctx, file, &usp, sizeof(usp)); if (r != sizeof(usp)) goto err; bytes += r; return bytes; err: if (r >= 0) r = -EIO; return r; } int vmadump_restore_cpu(cr_rstrt_proc_req_t *ctx, struct file *file, struct pt_regs *regs) { struct pt_regs regtmp; struct switch_stack *ss, sstmp; unsigned long usp; int r; r = read_kern(ctx, file, ®tmp, sizeof(regtmp)); if (r != sizeof(regtmp)) goto bad_read; /* Read extra reg info for alpha */ ss = ((struct switch_stack *)regs)-1; r = read_kern(ctx, file, &sstmp, sizeof(sstmp)); if (r != sizeof(sstmp)) goto bad_read; r = read_kern(ctx, file, &usp, sizeof(usp)); if (r != sizeof(usp)) goto bad_read; /* These are the tid-bits we don't want to restore */ regtmp.ps = 8; /* Processor status 8 = user space */ regtmp.hae = regs->hae; /* XXX What is this reg? */ sstmp.r26 = ss->r26; /* Not actually the user r26(ra). That * one is in struct pt_regs. */ /* Ok, do restore */ memcpy(regs, ®tmp, sizeof(regtmp)); memcpy(ss, &sstmp, sizeof(sstmp)); /* Restores FP regs + saved regs */ wrusp(usp); return 0; bad_read: if (r >= 0) r = -EIO; return r; } #define SWITCH_STACK_SIZE "320" /* do_switch_stack/undo_switch_stack stolen from arch/alpha/kernel/entry.S */ asm( ".align 3 \n" ".ent save_switch_stack \n" "save_switch_stack: \n" " lda $30,-"SWITCH_STACK_SIZE"($30) \n" " stq $9,0($30) \n" " stq $10,8($30) \n" " stq $11,16($30) \n" " stq $12,24($30) \n" " stq $13,32($30) \n" " stq $14,40($30) \n" " stq $15,48($30) \n" " stq $26,56($30) \n" " stt $f0,64($30) \n" " stt $f1,72($30) \n" " stt $f2,80($30) \n" " stt $f3,88($30) \n" " stt $f4,96($30) \n" " stt $f5,104($30) \n" " stt $f6,112($30) \n" " stt $f7,120($30) \n" " stt $f8,128($30) \n" " stt $f9,136($30) \n" " stt $f10,144($30) \n" " stt $f11,152($30) \n" " stt $f12,160($30) \n" " stt $f13,168($30) \n" " stt $f14,176($30) \n" " stt $f15,184($30) \n" " stt $f16,192($30) \n" " stt $f17,200($30) \n" " stt $f18,208($30) \n" " stt $f19,216($30) \n" " stt $f20,224($30) \n" " stt $f21,232($30) \n" " stt $f22,240($30) \n" " stt $f23,248($30) \n" " stt $f24,256($30) \n" " stt $f25,264($30) \n" " stt $f26,272($30) \n" " stt $f27,280($30) \n" " mf_fpcr $f0 \n" " stt $f28,288($30) \n" " stt $f29,296($30) \n" " stt $f30,304($30) \n" " stt $f0,312($30) \n" " ldt $f0,64($30) \n" " ret $31,($1),1 \n" ".end save_switch_stack \n" "\n" ".align 3 \n" ".ent restore_switch_stack \n" "restore_switch_stack: \n" " ldq $9,0($30) \n" " ldq $10,8($30) \n" " ldq $11,16($30) \n" " ldq $12,24($30) \n" " ldq $13,32($30) \n" " ldq $14,40($30) \n" " ldq $15,48($30) \n" " ldq $26,56($30) \n" " ldt $f30,312($30) # get saved fpcr \n" " ldt $f0,64($30) \n" " ldt $f1,72($30) \n" " ldt $f2,80($30) \n" " ldt $f3,88($30) \n" " mt_fpcr $f30 # install saved fpcr \n" " ldt $f4,96($30) \n" " ldt $f5,104($30) \n" " ldt $f6,112($30) \n" " ldt $f7,120($30) \n" " ldt $f8,128($30) \n" " ldt $f9,136($30) \n" " ldt $f10,144($30) \n" " ldt $f11,152($30) \n" " ldt $f12,160($30) \n" " ldt $f13,168($30) \n" " ldt $f14,176($30) \n" " ldt $f15,184($30) \n" " ldt $f16,192($30) \n" " ldt $f17,200($30) \n" " ldt $f18,208($30) \n" " ldt $f19,216($30) \n" " ldt $f20,224($30) \n" " ldt $f21,232($30) \n" " ldt $f22,240($30) \n" " ldt $f23,248($30) \n" " ldt $f24,256($30) \n" " ldt $f25,264($30) \n" " ldt $f26,272($30) \n" " ldt $f27,280($30) \n" " ldt $f28,288($30) \n" " ldt $f29,296($30) \n" " ldt $f30,304($30) \n" " lda $30,"SWITCH_STACK_SIZE"($30) \n" " ret $31,($1),1 \n" ".end restore_switch_stack \n" " \n" ".align 3 \n" ".globl sys_vmadump \n" ".ent sys_vmadump \n" "sys_vmadump: \n" " ldgp $29,0($27) \n" " bsr $1,save_switch_stack \n" " lda $16,"SWITCH_STACK_SIZE"($30) \n" " jsr $26,do_vmadump \n" " bsr $1,restore_switch_stack \n" " ret $31,($26),1 \n" ".end sys_vmadump \n" ); /* * Local variables: * c-basic-offset: 4 * End: */ blcr-0.8.5/vmadump4/Makefile.am0000664000000000000000000000144411115077254013136 00000000000000# Note: build is done via cr_module/kbuild/Makefile.in EXTRA_DIST = license.txt vmadump_common.c \ vmadump_i386.c vmadump_x86_64.c \ vmadump_ppc.c vmadump_ppc64.c \ vmadump_sparc.c vmadump_sparc64.c \ vmadump_alpha.c vmadump_arm.c BPROC_VERSION = "4.0.0pre8" INCLUDES = -D__NR_vmadump=-1 -DBPROC_VERSION='$(BPROC_VERSION)' -I$(top_srcdir)/include AM_CFLAGS = -Wall -s # vmadcheck is needed only for cr_info and is currently broken -PHH 12.5.2003 if BUILD_CR_INFO vmadcheck = vmadcheck else vmadcheck = endif # vmadlib is not used with blcr if BUILD_VMADLIB vmadlib = vmadlib else vmadlib = endif libexec_PROGRAMS = $(vmadcheck) $(vmadlib) noinst_HEADERS = vmadump.h vmadump_x86.h check_PROGRAMS = vmadtest vmadstress AM_INSTALLCHECK_STD_OPTIONS_EXEMPT = $(libexec_PROGRAMS) blcr-0.8.5/vmadump4/vmadump_ppc64.c0000664000000000000000000001450712065262174013741 00000000000000/*------------------------------------------------------------------------- * vmadump_powerpc.c: powerpc specific dumping/undumping routines * * Copyright (C) 1999-2001 by Erik Hendriks * * 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 * * $Id: vmadump_ppc64.c,v 1.9.14.4 2012/12/22 07:42:52 phargrov Exp $ * * THIS VERSION MODIFIED FOR BLCR *-----------------------------------------------------------------------*/ #include #include #include #include #define __VMADUMP_INTERNAL__ #include "vmadump.h" #if HAVE_ASM_SWITCH_TO_H # include #endif long vmadump_store_cpu(cr_chkpt_proc_req_t *ctx, struct file *file, struct pt_regs *regs) { long bytes = 0, r; /* Store struct pt_regs */ r = write_kern(ctx, file, regs, sizeof(*regs)); if (r != sizeof(*regs)) goto err; bytes += r; /* Floating point regs */ if (regs->msr & MSR_FP) giveup_fpu(current); r = write_kern(ctx, file, ¤t->thread.fpr, sizeof(current->thread.fpr)); if (r != sizeof(current->thread.fpr)) goto err; bytes += r; r = write_kern(ctx, file, ¤t->thread.fpscr, sizeof(current->thread.fpscr)); if (r != sizeof(current->thread.fpscr)) goto err; bytes += r; #if HAVE_THREAD_VDSO_BASE /* unconditionally store the base of the VDSO library */ r = write_kern(ctx, file, ¤t->thread.vdso_base, sizeof(current->thread.vdso_base)); if (r != sizeof(current->thread.vdso_base)) goto err; bytes += r; #endif #ifdef CONFIG_ALTIVEC /* XXX I really need to find out if this is right */ if (regs->msr & MSR_VEC) giveup_altivec(current); r = write_kern(ctx, file, ¤t->thread.vr, sizeof(current->thread.vr)); if (r != sizeof(current->thread.vr)) goto err; bytes += r; r = write_kern(ctx, file, ¤t->thread.vscr, sizeof(current->thread.vscr)); if (r != sizeof(current->thread.vscr)) goto err; bytes += r; #endif return bytes; err: if (r >= 0) r = -EIO; return r; } int vmadump_restore_cpu(cr_rstrt_proc_req_t *ctx, struct file *file, struct pt_regs *regs) { struct pt_regs regtmp; int r; r = read_kern(ctx, file, ®tmp, sizeof(regtmp)); if (r != sizeof(regtmp)) goto bad_read; /* Don't restore machine state register since this is * unpriviledged user space stuff we're restoring. */ if (regtmp.msr & MSR_SF) { regtmp.msr = MSR_USER64; clear_thread_flag(TIF_32BIT); } else { regtmp.msr = MSR_USER32; set_thread_flag(TIF_32BIT); } memcpy(regs, ®tmp, sizeof(regtmp)); /* Floating point regs */ r = read_kern(ctx, file, ¤t->thread.fpr, sizeof(current->thread.fpr)); if (r != sizeof(current->thread.fpr)) goto bad_read; r = read_kern(ctx, file, ¤t->thread.fpscr, sizeof(current->thread.fpscr)); if (r != sizeof(current->thread.fpscr)) goto bad_read; #if HAVE_THREAD_VDSO_BASE /* unconditonally restore this */ r = read_kern(ctx, file, ¤t->thread.vdso_base, sizeof(current->thread.vdso_base)); if (r != sizeof(current->thread.vdso_base)) goto bad_read; #endif #ifdef CONFIG_ALTIVEC /* Restore Altivec */ r = read_kern(ctx, file, ¤t->thread.vr, sizeof(current->thread.vr)); if (r != sizeof(current->thread.vr)) goto bad_read; r = read_kern(ctx, file, ¤t->thread.vscr, sizeof(current->thread.vscr)); if (r != sizeof(current->thread.vscr)) goto bad_read; #endif current->thread.regs = regs; return 0; bad_read: if (r >= 0) r = -EIO; return r; } #if VMAD_HAVE_ARCH_MAPS #include #if HAVE_THREAD_VDSO_BASE #define vmad_vdso_base current->thread.vdso_base #elif HAVE_MM_CONTEXT_VDSO_BASE #define vmad_vdso_base current->mm->context.vdso_base #else #error "No support yet for VDSO on your kernel - please report as a BLCR bug" #endif int vmad_is_arch_map(const struct vm_area_struct *map) { return (map->vm_start == vmad_vdso_base); } EXPORT_SYMBOL_GPL(vmad_is_arch_map); loff_t vmad_store_arch_map(cr_chkpt_proc_req_t *ctx, struct file *file, struct vm_area_struct *map, int flags) { loff_t r = 0; if (vmad_is_arch_map(map)) { /* Just write out a section header */ struct vmadump_vma_header head; head.start = map->vm_start; head.end = map->vm_end; head.flags = map->vm_flags; head.namelen = VMAD_NAMELEN_ARCH; head.pgoff = 0; up_read(¤t->mm->mmap_sem); r = write_kern(ctx, file, &head, sizeof(head)); down_read(¤t->mm->mmap_sem); if (r < 0) return r; if (r != sizeof(head)) r = -EIO; } return r; } int vmad_load_arch_map(cr_rstrt_proc_req_t *ctx, struct file *file, struct vmadump_vma_header *head) { long r; #if HAVE_2_ARG_ARCH_SETUP_ADDITIONAL_PAGES r = arch_setup_additional_pages(NULL, 0); #elif HAVE_4_ARG_ARCH_SETUP_ADDITIONAL_PAGES r = arch_setup_additional_pages(NULL, 0, 0, 0); #else #error "Unknown calling convention to map the VDSO" #endif if (r < 0) { CR_ERR_CTX(ctx, "arch_setup_additional_pages failed %d", (int)r); goto err; } /* arch_setup_additional_pages() has overwritten vdso_base w/ the newly allocated one. * Here we check this new value against against the desired location (in head->start). */ if (head->start != vmad_vdso_base) { r = vmad_remap(ctx, (unsigned long)vmad_vdso_base, head->start, head->end - head->start); if (r) { CR_ERR_CTX(ctx, "vdso remap failed %d", (int)r); goto err; } vmad_vdso_base = head->start; } r = 0; err: return r; } #endif /* * Local variables: * c-basic-offset: 4 * End: */ blcr-0.8.5/vmadump4/vmadump_arm.c0000664000000000000000000001734312065403234013557 00000000000000/*------------------------------------------------------------------------- * vmadump_arm: ARM specific dumping/undumping routines * * Copyright (C) 1999-2001 by Erik Hendriks * * 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 * * $Id: vmadump_arm.c,v 1.8.16.5 2012/12/22 19:14:36 phargrov Exp $ * * Experimental ARM support contributed by Anton V. Uzunov * of the Australian Government * Department of Defence, Defence Science and Technology Organisation. * * ARM-specific questions should be directed to blcr-arm@hpcrd.lbl.gov. * * THIS FILE IS SPECIFIC TO BLCR *-----------------------------------------------------------------------*/ #include #include #include #define __VMADUMP_INTERNAL__ #include "vmadump.h" #if HAVE_ASM_TLS_H # include #endif #ifdef VMAD_DEBUG_FLAG #define VMAD_DEBUG(arg...) CR_KTRACE_DEBUG( arg ) #else #define VMAD_DEBUG(arg...) #endif long vmadump_store_cpu(cr_chkpt_proc_req_t *ctx, struct file *file, struct pt_regs *regs) { long bytes = 0; long r; int i; #if HAVE_THREAD_INFO_TP_VALUE struct thread_info *thread = current_thread_info(); #endif struct task_struct *tsk = current; struct thread_struct *thread_fault_info = &tsk->thread; // Store struct pt_regs r = write_kern(ctx, file, regs, sizeof(*regs)); if (r != sizeof(*regs)) goto err; bytes += r; // debug trace for (i = 0; i < 17; i++) { VMAD_DEBUG( "vmadump module: regs[ %d ] == %ld", i, regs->uregs[ i ] ); } // Store thread's fault info r = write_kern(ctx, file, &thread_fault_info->address, sizeof(thread_fault_info->address)); if (r != sizeof(thread_fault_info->address)) goto err; bytes += r; VMAD_DEBUG( "vmadump: thread_fault_info->address == %ld", thread_fault_info->address ); r = write_kern(ctx, file, &thread_fault_info->trap_no, sizeof(thread_fault_info->trap_no)); if (r != sizeof(thread_fault_info->trap_no)) goto err; bytes += r; VMAD_DEBUG( "vmadump: thread_fault_info->trap_no == %ld", thread_fault_info->trap_no ); r = write_kern(ctx, file, &thread_fault_info->error_code, sizeof(thread_fault_info->error_code)); if (r != sizeof(thread_fault_info->error_code)) goto err; bytes += r; VMAD_DEBUG( "vmadump: thread_fault_info->error_code == %ld", thread_fault_info->error_code ); #if HAVE_THREAD_INFO_TP_VALUE // Store thread-specific pointer r = write_kern(ctx, file, &thread->tp_value, sizeof(thread->tp_value)); if (r != sizeof(thread->tp_value)) goto err; bytes += r; VMAD_DEBUG( "vmadump: thread->tp_value == %ld", thread->tp_value ); #endif return( bytes ); err: if (r >= 0) r = -EIO; return( r ); } int vmadump_restore_cpu(cr_rstrt_proc_req_t *ctx, struct file *file, struct pt_regs *regs) { struct thread_info *thread = current_thread_info(); struct pt_regs regtmp; int r; int i; // read in pt_regs struct and make sure the regs are somewhat valid r = read_kern(ctx, file, ®tmp, sizeof(regtmp)); if (r != sizeof(regtmp) || !valid_user_regs(®tmp)) goto bad_read; // restore CPU registers memcpy(regs, ®tmp, sizeof(regtmp)); // debug trace for (i = 0; i < 17; i++) { VMAD_DEBUG( "vmadump module: regs[ %d ] == %ld", i, regs->uregs[ i ] ); } // restore thread fault info r = read_kern(ctx, file, ¤t->thread.address, sizeof(current->thread.address)); if (r != sizeof(current->thread.address)) goto bad_read; VMAD_DEBUG( "vmadump: current->thread.address == %ld", current->thread.address ); r = read_kern(ctx, file, ¤t->thread.trap_no, sizeof(current->thread.trap_no)); if (r != sizeof(current->thread.trap_no)) goto bad_read; VMAD_DEBUG( "vmadump: current->thread.trap_no == %ld", current->thread.trap_no ); r = read_kern(ctx, file, ¤t->thread.error_code, sizeof(current->thread.error_code)); if (r != sizeof(current->thread.error_code)) goto bad_read; VMAD_DEBUG( "vmadump: current->thread.error_code == %ld", current->thread.error_code ); #if HAVE_THREAD_INFO_TP_VALUE // retore thread-specific pointer r = read_kern(ctx, file, &thread->tp_value, sizeof(thread->tp_value)); if (r != sizeof(thread->tp_value)) goto bad_read; VMAD_DEBUG( "vmadump: thread->tp_value == %ld", thread->tp_value ); #if defined(has_tls_reg) /* Since 2.6.36 tls_emu and had_tls_reg are macros w/ value 0 or 1 */ if (tls_emu) { /* Do nothing */ } else if (has_tls_reg) { asm ("mcr p15, 0, %0, c13, c0, 3" : : "r" (thread->tp_value) ); } else { // Note: must be (much) later than 2.6.12 *((unsigned int *)0xffff0ff0) = (thread->tp_value); } #elif defined(CONFIG_TLS_REG_EMUL) /* Do nothing */ #elif defined(CONFIG_HAS_TLS_REG) asm ("mcr p15, 0, %0, c13, c0, 3" : : "r" (thread->tp_value) ); #elif defined(CR_KCODE___kuser_helper_start) // NPTL support code in 2.6.12 and later *((unsigned int *)0xffff0ff0) = (thread->tp_value); #else // The 2.6.11 kernel did this differently. *((unsigned int *)0xffff0ffc) = (thread->tp_value); #endif #endif return( 0 ); bad_read: if (r >= 0) r = -EIO; return( r ); } #if defined(ARCH_HAS_SETUP_ADDITIONAL_PAGES) int vmad_is_arch_map(const struct vm_area_struct *map) { return (map->vm_start == 0xffff0000); } EXPORT_SYMBOL_GPL(vmad_is_arch_map); loff_t vmad_store_arch_map(cr_chkpt_proc_req_t *ctx, struct file *file, struct vm_area_struct *map, int flags) { loff_t r = 0; if (vmad_is_arch_map(map)) { /* Just write out a section header */ struct vmadump_vma_header head; head.start = map->vm_start; head.end = map->vm_end; head.flags = map->vm_flags; head.namelen = VMAD_NAMELEN_ARCH; head.pgoff = 0; up_read(¤t->mm->mmap_sem); r = write_kern(ctx, file, &head, sizeof(head)); down_read(¤t->mm->mmap_sem); if (r < 0) return r; if (r != sizeof(head)) r = -EIO; } return r; } int vmad_load_arch_map(cr_rstrt_proc_req_t *ctx, struct file *file, struct vmadump_vma_header *head) { struct vm_area_struct *map; long r; /* First check if the mapping is still/already in place */ down_read(¤t->mm->mmap_sem); map = find_vma(current->mm, 0xffff0000); up_read(¤t->mm->mmap_sem); if (map != NULL) goto out; /* NOT REACHED - since in practice we'll never remove the mapping. */ #if HAVE_2_ARG_ARCH_SETUP_ADDITIONAL_PAGES r = arch_setup_additional_pages(NULL, 0); #elif HAVE_4_ARG_ARCH_SETUP_ADDITIONAL_PAGES r = arch_setup_additional_pages(NULL, 0, 0, 0); #else #error "Unknown calling convention to map the vectors page" #endif if (r < 0) { CR_ERR_CTX(ctx, "arch_setup_additional_pages failed %d", (int)r); goto err; } out: r = 0; err: return r; } #endif // defined(ARCH_HAS_SETUP_ADDITIONAL_PAGES) /* * Local variables: * c-basic-offset: 2 * End: */ blcr-0.8.5/vmadump4/vmadtest.c0000664000000000000000000001271310155426263013077 00000000000000/*------------------------------------------------------------------------- * vmadtest.c: vmadump test program * * Copyright (C) 1999-2001 by Erik Hendriks * * 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 * * $Id: vmadtest.c,v 1.3 2004/12/07 22:20:35 phargrov Exp $ *-----------------------------------------------------------------------*/ #include #include #include #include #include #include #include #include "vmadump.h" #ifndef __NR_vmadump #include #endif #define GROWCHUNK 10240 #define DEFAULT_FILE "dump" #if HAVE_BINFMT_VMADUMP #define DUMPMODE 0777 #else #define DUMPMODE 0666 #endif extern char **environ; void sighandler(void) { printf("In sighandler!\n"); } #ifdef __NR_vmadump int vmadump(int fd, int flags) { return syscall(__NR_vmadump, VMAD_DO_DUMP, fd, flags); } int vmaundump(int fd) { return syscall(__NR_vmadump, VMAD_DO_UNDUMP, fd); } int vmaexecdump(int fd, struct vmadump_execdump_args *args) { return syscall(__NR_vmadump, VMAD_DO_EXECDUMP, args); } #else int vmadump(int fd, int flags) { return bproc_dump(fd, flags); } int vmaundump(int fd) { return bproc_undump(fd); } int vmaexecdump(int fd, struct vmadump_execdump_args *args) { return bproc_execdump(fd, args->flags,args->arg0, args->argv, args->envp); } #endif void test_mm(void) { int i; printf("Testing basic memory ops like growing my stack\n" "and malloc'ing new RAM.\n"); for (i=0; i < 100; i++) { char *foo; foo = alloca(GROWCHUNK); memset(foo, 0, GROWCHUNK); printf("."); fflush(stdout); foo = malloc(GROWCHUNK); memset(foo, 0, GROWCHUNK); printf("+"); fflush(stdout); } printf("\n"); } void do_dump(char *filename, int flags) { int fd, r; printf("Dumping to: %s\n", filename); fd = open(filename, O_WRONLY|O_CREAT|O_TRUNC, DUMPMODE); if (fd == -1) { perror("open"); exit(1); } r = vmadump(fd,flags); printf("vmadump(%d,0x%x)=%d\n", fd, flags, r); if (r == -1) { perror("VMAD_DO_DUMP"); exit(1); } close(fd); if (r) { printf("dump complete - exiting.\n"); exit(0); } /* r == 0... Which means that we were dumped and we're getting * here because we've been undumped. */ printf("Whoo! I've been undumped! Kick ass!\n"); printf("New pid: %d\n", (int) getpid()); test_mm(); exit(0); } void do_execdump(char *filename, int flags, char **argv) { int fd; struct vmadump_execdump_args args; printf("Exec-dumping to: %s\n", filename); fd = open(filename, O_WRONLY|O_CREAT|O_TRUNC, DUMPMODE); if (fd == -1) { perror("open"); exit(1); } args.arg0 = argv[optind]; args.argv = argv+optind; args.envp = environ; args.fd = fd; vmaexecdump(fd,&args); perror("VMAD_DO_EXEC_DUMP"); exit(1); } void usage(char *arg0) { printf( "Usage: %s -d [-f file] [-e] [-l] [-o]\n" " %s -u [-f file]\n" "\n" " This program is a simple test program for the Beowulf VMAdump\n" " system. It will try to dump itself (with -d) or restore a dump\n" " with -u.\n" "\n" " -d Dump to a file.\n" " -u Undump from a file.\n" " -f file Dump to/from file instead of the default (%s)\n" " -F Perform a floating point operation before (un)dumping.\n" "\n" " The following options only affect dumping. (-d)\n" " -e Use VMAD_DUMP_EXEC flag.\n" " -l Use VMAD_DUMP_LIBS flag.\n" " -o Use VMAD_DUMP_OTHER flag.\n" , arg0, arg0, DEFAULT_FILE); } double c; int main(int argc, char *argv[]) { int fd, r,c ; int dump=-1; int dump_flags = 0; int fpop = 0; char *filename = DEFAULT_FILE; while ((c=getopt(argc, argv, "hvf:Fduelox")) != EOF) { switch (c) { case 'h': case 'v': usage(argv[0]); exit(0); case 'f': filename = optarg; break; case 'd': dump = 0; break; case 'u': dump = 1; break; case 'x': dump = 2; break; case 'e': dump_flags |= VMAD_DUMP_EXEC; break; case 'l': dump_flags |= VMAD_DUMP_LIBS; break; case 'o': dump_flags |= VMAD_DUMP_OTHER; break; case 'F': fpop = 1; break; default: exit(1); } } if (fpop) { double a, b; a = 5.3; b = getpid(); c = a * b; } switch (dump) { case 0: /* Set a sighandler to test sighandler save/restore */ signal(SIGUSR1, (void (*)(int)) sighandler); do_dump(filename, dump_flags); break; case 1: printf("Undumping from: %s\n", filename); fd = open(filename, O_RDONLY); if (fd == -1) { perror("open"); exit(1); } r = vmaundump(fd); printf("VMAD_DO_UNDUMP failed: err=%d (%s)\n", errno, strerror(errno)); break; case 2: do_execdump(filename, dump_flags, argv); break; default: usage(argv[0]); exit(0); } exit(1); } /* * Local variables: * c-basic-offset: 4 * End: */ blcr-0.8.5/vmadump4/vmadstress.c0000664000000000000000000000776210155426263013453 00000000000000/*------------------------------------------------------------------------- * vmadtest.c: vmadump test program * * Copyright (C) 1999-2001 by Erik Hendriks * * 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 * * $Id: vmadstress.c,v 1.3 2004/12/07 22:20:35 phargrov Exp $ *-----------------------------------------------------------------------*/ #include #include #include #include #include #include #include #include "vmadump.h" #define GROWCHUNK 10240 #define DEFAULT_FILE "dump" #if HAVE_BINFMT_VMADUMP #define DUMPMODE 0777 #else #define DUMPMODE 0666 #endif #ifdef __NR_vmadump int vmadump(int fd, int flags) { return syscall(__NR_vmadump, VMAD_DO_DUMP, fd, flags); } int vmaundump(int fd) { return syscall(__NR_vmadump, VMAD_DO_UNDUMP, fd); } #else #include int vmadump(int fd, int flags) { return bproc_dump(fd, flags); } int vmaundump(int fd) { return bproc_undump(fd); } #endif void test_mm(void) { fprintf(stderr, "Testing basic memory ops like growing my stack\n" "and malloc'ing new RAM.\n"); while(1) { char *foo; foo = alloca(GROWCHUNK); memset(foo, 0, GROWCHUNK); fprintf(stderr, "."); fflush(stderr); foo = malloc(GROWCHUNK); memset(foo, 0, GROWCHUNK); fprintf(stderr, "+"); fflush(stderr); sleep(1); /* lets not use all memory instantly, ok? */ } } int do_dump(char *filename, int flags) { int fd, r; fd = open(filename, O_WRONLY|O_CREAT|O_TRUNC, DUMPMODE); if (fd == -1) { perror("open"); exit(1); } r = vmadump(fd,flags); if (r == -1) { perror("VMAD_DO_DUMP"); exit(1); } close(fd); return r; } void do_undump(char *filename) { int fd, r; fd = open(filename, O_RDONLY); if (fd == -1) { perror("open"); exit(1); } r = vmaundump(fd); /* not reached if no error */ perror("VMAD_DO_DUMP"); exit(1); } void usage(char *arg0) { printf( "Usage: %s -d [-f file] [-e] [-l] [-o]\n" " %s -u [-f file]\n" "\n" " This program is a simple test program for the Beowulf VMAdump\n" " system. It will try to dump itself (with -d) or restore a dump\n" " with -u.\n" "\n" " -f file Dump to/from file instead of the default (%s)\n" "\n" " The following options only affect dumping. (-d)\n" " -e Use VMAD_DUMP_EXEC flag.\n" " -l Use VMAD_DUMP_LIBS flag.\n" " -o Use VMAD_DUMP_OTHER flag.\n" , arg0, arg0, DEFAULT_FILE); } int main(int argc, char *argv[]) { int c; int dump_flags = 0; char *filename = DEFAULT_FILE; while ((c=getopt(argc, argv, "hvf:elo")) != EOF) { switch (c) { case 'h': case 'v': usage(argv[0]); exit(0); case 'f': filename = optarg; break; case 'e': dump_flags |= VMAD_DUMP_EXEC; break; case 'l': dump_flags |= VMAD_DUMP_LIBS; break; case 'o': dump_flags |= VMAD_DUMP_OTHER; break; default: exit(1); } } while (1) { int r; printf("Doing vmadump(\"%s\", 0x%x)=", filename, dump_flags); fflush(stdout); r = do_dump(filename, dump_flags); if (r > 0) { printf("%d\n", r); printf("Doing vmaundump(\"%s\")\n", filename); fflush(stdout); do_undump(filename); /* not reached */ } close(3); /* hack to deal with the lack of close_on_exec */ } } /* * Local variables: * c-basic-offset: 4 * End: */ blcr-0.8.5/vmadump4/vmadump_sparc64.c0000664000000000000000000000251411115077254014260 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2008, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * 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 * * $Id: vmadump_sparc64.c,v 1.2 2008/12/02 00:17:48 phargrov Exp $ * * Experimental SPARC support contributed to BLCR by Vincentius Robby * and Andrea Pellegrini . */ #include "vmadump_sparc.c" blcr-0.8.5/vmadump4/vmadump_x86_64.c0000664000000000000000000003404612072744606013746 00000000000000/*------------------------------------------------------------------------- * vmadump_x86_64.c: x86-64 specific dumping/undumping routines * * Copyright (C) 1999-2001 by Erik Hendriks * * 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 * * $Id: vmadump_x86_64.c,v 1.50.8.8 2013/01/08 07:23:50 phargrov Exp $ * * THIS VERSION MODIFIED FOR BLCR *-----------------------------------------------------------------------*/ #ifdef CR_NEED_AUTOCONF_H #include #endif #if defined(CONFIG_SMP) && ! defined(__SMP__) #define __SMP__ #endif #define __FRAME_OFFSETS /* frame offset macros from ptrace.h */ #include #include #include #define __VMADUMP_INTERNAL__ #include "vmadump.h" #include "vmadump_x86.h" #ifndef savesegment #define savesegment(seg, value) \ asm volatile("mov %%" #seg ",%0":"=m" (*(int *)&(value))) #endif #ifndef checking_wrmsrl #define checking_wrmsrl wrmsrl_safe #endif #if HAVE_WRITE_PDA && HAVE_READ_PDA #define vmad_write_oldrsp(_val) write_pda(oldrsp, (_val)) #define vmad_read_oldrsp() read_pda(oldrsp) #elif HAVE_PERCPU_WRITE && HAVE_PERCPU_READ #define vmad_write_oldrsp(_val) percpu_write(old_rsp, (_val)) #define vmad_read_oldrsp() percpu_read(old_rsp) #elif HAVE_THIS_CPU_WRITE && HAVE_THIS_CPU_READ #define vmad_write_oldrsp(_val) this_cpu_write(old_rsp, (_val)) #define vmad_read_oldrsp() this_cpu_read(old_rsp) #else #error "No access to per-cpu data?" #endif long vmadump_store_cpu(cr_chkpt_proc_req_t *ctx, struct file *file, struct pt_regs *regs) { long bytes = 0, r; /* Store struct pt_regs */ #ifdef CONFIG_XEN /* Ensure CS and SS are not Xen-modified, others restore based on CS */ { struct pt_regs regtmp = *regs; if (test_thread_flag(TIF_IA32)) { regtmp.cs = __USER32_CS; regtmp.ss = __USER32_DS; } else { regtmp.cs = __USER_CS; regtmp.ss = __USER_DS; } r = write_kern(ctx, file, ®tmp, sizeof(regtmp)); } #else r = write_kern(ctx, file, regs, sizeof(*regs)); #endif if (r != sizeof(*regs)) goto err; bytes += r; /* Store FPU info (and later general "extended state") */ r = vmadump_store_i387(ctx, file); if (r <= 0) goto err; bytes += r; /* Store debugging state */ r = vmadump_store_debugreg(ctx, file); if (r < 0) goto err; bytes += r; /* user(r)sp, since we don't use the ptrace entry path in BLCR */ #if HAVE_THREAD_USERSP current->thread.usersp = vmad_read_oldrsp(); r = write_kern(ctx, file, ¤t->thread.usersp, sizeof(current->thread.usersp)); if (r != sizeof(current->thread.usersp)) goto err; #elif HAVE_THREAD_USERRSP current->thread.userrsp = vmad_read_oldrsp(); r = write_kern(ctx, file, ¤t->thread.userrsp, sizeof(current->thread.userrsp)); if (r != sizeof(current->thread.userrsp)) goto err; #else #error #endif bytes += r; /* Store all weird segmenty crap */ /* 64-bit offsets for FS and GS */ r = write_kern(ctx, file, ¤t->thread.fs, sizeof(current->thread.fs)); if (r != sizeof(current->thread.fs)) goto err; bytes += r; r = write_kern(ctx, file, ¤t->thread.gs, sizeof(current->thread.gs)); if (r != sizeof(current->thread.gs)) goto err; bytes += r; savesegment(fs,current->thread.fsindex); savesegment(gs,current->thread.gsindex); /* 32-bit segment descriptors for FS and GS */ r = write_kern(ctx, file, ¤t->thread.fsindex, sizeof(current->thread.fsindex)); if (r != sizeof(current->thread.fsindex)) goto err; bytes += r; r = write_kern(ctx, file, ¤t->thread.gsindex, sizeof(current->thread.gsindex)); if (r != sizeof(current->thread.gsindex)) goto err; bytes += r; /* TLS segment descriptors */ r = write_kern(ctx, file, ¤t->thread.tls_array, sizeof(current->thread.tls_array)); if (r != sizeof(current->thread.tls_array)) goto err; bytes += r; #if HAVE_THREAD_INFO_SYSENTER_RETURN { void *sysenter_return = current_thread_info()->sysenter_return; r = write_kern(ctx, file, &sysenter_return, sizeof(sysenter_return)); if (r != sizeof(sysenter_return)) goto err; } #endif return bytes; err: if (r >= 0) r = -EIO; return r; } int vmadump_restore_cpu(cr_rstrt_proc_req_t *ctx, struct file *file, struct pt_regs *regs) { struct vmadump_restore_tmps *x86tmps; struct thread_struct *threadtmp; struct pt_regs *regtmp; int r; int idx, i, cpu; uint16_t fsindex, gsindex; #if HAVE_STRUCT_N_DESC_STRUCT struct n_desc_struct tls_array[GDT_ENTRY_TLS_ENTRIES]; #else struct desc_struct tls_array[GDT_ENTRY_TLS_ENTRIES]; #endif /* XXX: Note allocation assumes i387tmp and threadtmp are never active at the same time */ x86tmps = kmalloc(sizeof(*x86tmps), GFP_KERNEL); if (!x86tmps) return -ENOMEM; regtmp = VMAD_REGTMP(x86tmps); threadtmp = VMAD_THREADTMP(x86tmps); r = read_kern(ctx, file, regtmp, sizeof(*regtmp)); if (r != sizeof(*regtmp)) goto bad_read; /* Don't let the user pick funky segments */ if ((regtmp->cs != __USER_CS && regtmp->cs != __USER32_CS) && (regtmp->ss != __USER_DS && regtmp->ss != __USER32_DS)) { r = -EINVAL; goto bad_read; } /* Set our process type */ if (regtmp->cs == __USER32_CS) set_thread_flag(TIF_IA32); else clear_thread_flag(TIF_IA32); /* Only restore bottom 9 bits of eflags. Restoring anything else * is bad bad mojo for security. (0x200 = interrupt enable) */ #if HAVE_PT_REGS_EFLAGS regtmp->eflags = 0x200 | (regtmp->eflags & 0x000000FF); #elif HAVE_PT_REGS_FLAGS regtmp->flags = 0x200 | (regtmp->flags & 0x000000FF); #else #error #endif memcpy(regs, regtmp, sizeof(*regtmp)); /* Restore FPU info (and later general "extended state") */ r = vmadump_restore_i387(ctx, file, VMAD_I387TMP(x86tmps)); if (r < 0) goto bad_read; /* XXX FIX ME: RESTORE DEBUG INFORMATION ?? */ /* Here we read it but ignore it. */ r = vmadump_restore_debugreg(ctx, file); if (r < 0) goto bad_read; /* user(r)sp, since we don't use the ptrace entry path in BLCR */ #if HAVE_THREAD_USERSP r = read_kern(ctx, file, &threadtmp->usersp, sizeof(threadtmp->usersp)); if (r != sizeof(threadtmp->usersp)) goto bad_read; current->thread.usersp = threadtmp->usersp; vmad_write_oldrsp(threadtmp->usersp); #elif HAVE_THREAD_USERRSP r = read_kern(ctx, file, &threadtmp->userrsp, sizeof(threadtmp->userrsp)); if (r != sizeof(threadtmp->userrsp)) goto bad_read; current->thread.userrsp = threadtmp->userrsp; vmad_write_oldrsp(threadtmp->userrsp); #else #error #endif /*-- restore segmentation related stuff */ /* Restore FS_BASE MSR */ r = read_kern(ctx, file, &threadtmp->fs, sizeof(threadtmp->fs)); if (r != sizeof(threadtmp->fs)) goto bad_read; if (threadtmp->fs >= TASK_SIZE) { r = -EINVAL; goto bad_read; } current->thread.fs = threadtmp->fs; /* Restore GS_KERNEL_BASE MSR */ r = read_kern(ctx, file, &threadtmp->gs, sizeof(threadtmp->gs)); if (r != sizeof(threadtmp->gs)) goto bad_read; if (threadtmp->gs >= TASK_SIZE) { r = -EINVAL; goto bad_read; } current->thread.gs = threadtmp->gs; /* Restore 32 bit segment stuff */ r = read_kern(ctx, file, &fsindex, sizeof(fsindex)); if (r != sizeof(fsindex)) goto bad_read; r = read_kern(ctx, file, &gsindex, sizeof(gsindex)); if (r != sizeof(gsindex)) goto bad_read; r = read_kern(ctx, file, tls_array, sizeof(tls_array)); if (r != sizeof(tls_array)) goto bad_read; /* Sanitize fs, gs. These segment descriptors should load one * of the TLS entries and have DPL = 3. If somebody is doing * some other LDT monkey business, I'm currently not * supporting that here. Also, I'm presuming that the offsets * to the GDT_ENTRY_TLS_MIN is the same in both kernels. */ idx = fsindex >> 3; if (idxGDT_ENTRY_TLS_MAX || (fsindex&7) != 3) fsindex = 0; idx = gsindex >> 3; if (idxGDT_ENTRY_TLS_MAX || (gsindex&7) != 3) gsindex = 0; /* Sanitize the TLS entries... * Make sure the following bits are set/not set: * bit 12 : S = 1 (code/data - not system) * bit 13-14: DPL = 11 (priv level = 3 (user)) * bit 21 : = 0 (reserved) * * If the entry isn't valid, zero the whole descriptor. */ for (i=0; i < GDT_ENTRY_TLS_ENTRIES; i++) { if (tls_array[i].b != 0 && (tls_array[i].b & 0x00207000) != 0x00007000) { r = -EINVAL; goto bad_read; } } /* Ok load this crap */ cpu = get_cpu(); /* load_TLS can't get pre-empted. */ memcpy(current->thread.tls_array, tls_array, sizeof(current->thread.tls_array)); current->thread.fsindex = fsindex; current->thread.gsindex = gsindex; load_TLS(¤t->thread, cpu); loadsegment(fs, current->thread.fsindex); load_gs_index(current->thread.gsindex); r = checking_wrmsrl(MSR_FS_BASE, threadtmp->fs); if (!r) /* preserve first error */ r = checking_wrmsrl(MSR_KERNEL_GS_BASE, threadtmp->gs); put_cpu(); if (r) goto bad_read; /* In case cr_restart and child don't have same ABI */ if (regtmp->cs == __USER32_CS) { loadsegment(ds, __USER32_DS); loadsegment(es, __USER32_DS); } else { loadsegment(ds, __USER_DS); loadsegment(es, __USER_DS); } #if HAVE_THREAD_INFO_SYSENTER_RETURN { void *sysenter_return; r = read_kern(ctx, file, &sysenter_return, sizeof(sysenter_return)); if (r != sizeof(sysenter_return)) goto bad_read; current_thread_info()->sysenter_return = sysenter_return; } #endif kfree(x86tmps); return 0; bad_read: kfree(x86tmps); if (r >= 0) r = -EIO; return r; } #if VMAD_HAVE_ARCH_MAPS #include #if HAVE_ASM_VSYSCALL32_H #include #endif #if HAVE_MM_CONTEXT_VDSO /* Used by both 32-bit and 64-bit since 2.6.23 */ #define vmad_vdso_base current->mm->context.vdso #elif defined(VSYSCALL32_BASE) /* 32-bit at a fixed offset */ #define vmad_vdso_base (test_thread_flag(TIF_IA32) ? VSYSCALL32_BASE : 1UL) #else #error "No support yet for VDSO on your kernel - please report as a BLCR bug" #endif int vmad_is_arch_map(const struct vm_area_struct *map) { unsigned long vdso_base = (unsigned long) vmad_vdso_base; #if HAVE_MM_CONTEXT_VDSO && defined(VSYSCALL32_BASE) /* Some RHEL5 kernels use fix the VSYSCALL32_BASE for 32-bit tasks and * current->mm->context.vdso for 64-bit tasks. Since we need to * assign to vmad_vdso_base, it isn't convenient to redefine it. */ if (test_thread_flag(TIF_IA32)) { vdso_base = VSYSCALL32_BASE; } #endif return (map->vm_start == vdso_base); } EXPORT_SYMBOL_GPL(vmad_is_arch_map); loff_t vmad_store_arch_map(cr_chkpt_proc_req_t *ctx, struct file *file, struct vm_area_struct *map, int flags) { loff_t r = 0; if (vmad_is_arch_map(map)) { /* Just write out a section header */ struct vmadump_vma_header head; head.start = map->vm_start; head.end = map->vm_end; head.flags = map->vm_flags; head.namelen = VMAD_NAMELEN_ARCH; head.pgoff = 0; up_read(¤t->mm->mmap_sem); r = write_kern(ctx, file, &head, sizeof(head)); down_read(¤t->mm->mmap_sem); if (r < 0) return r; if (r != sizeof(head)) r = -EIO; } return r; } int vmad_load_arch_map(cr_rstrt_proc_req_t *ctx, struct file *file, struct vmadump_vma_header *head) { long r; #if HAVE_THREAD_INFO_SYSENTER_RETURN /* Save against overwrite by arch_setup_additional_pages() */ void *sysenter_return = current_thread_info()->sysenter_return; #endif #if HAVE_MM_CONTEXT_VDSO vmad_vdso_base = (void *)(~0UL); #endif #if defined(CR_KCODE_syscall32_setup_pages) if (test_thread_flag(TIF_IA32)) { r = syscall32_setup_pages(NULL, 0); } else #endif { #if HAVE_2_ARG_ARCH_SETUP_ADDITIONAL_PAGES r = arch_setup_additional_pages(NULL, 0); #elif HAVE_4_ARG_ARCH_SETUP_ADDITIONAL_PAGES r = arch_setup_additional_pages(NULL, 0, 0, 0); #else r = -EINVAL; #endif } if (r < 0) { CR_ERR_CTX(ctx, "arch_setup_additional_pages failed %d", (int)r); goto err; } #if HAVE_MM_CONTEXT_VDSO /* Call above should have overwritten vmad_vdso_base with a new value. * Relocate if needed here. */ if (vmad_vdso_base == (void *)(~0UL)) { /* The call above didn't overwrite mm->context.vdso. * Since no failure was indictated we just fill it in. */ vmad_vdso_base = (void *)head->start; #if defined(VSYSCALL32_BASE) /* we probably didn't want to do that. */ if (test_thread_flag(TIF_IA32)) { /* this seems to work, is there a better way? */ vmad_vdso_base = (void *)(0UL); } #endif } else if (vmad_vdso_base != (void *)head->start) { r = vmad_remap(ctx, (unsigned long)vmad_vdso_base, head->start, head->end - head->start); if (r) { CR_ERR_CTX(ctx, "vdso remap failed %d", (int)r); goto err; } vmad_vdso_base = (void *)head->start; } #else /* VSYSCALL32_BASE is a fixed value */ #endif #if HAVE_THREAD_INFO_SYSENTER_RETURN current_thread_info()->sysenter_return = sysenter_return; #endif r = 0; err: return r; } #endif /* * Local variables: * c-basic-offset: 4 * End: */ blcr-0.8.5/vmadump4/vmadump_x86.h0000664000000000000000000002072112064133251013422 00000000000000/*------------------------------------------------------------------------- * vmadump_x86.h: Definitions for VMADump, shared by i386 and x86_64 * * Copyright (C) 1999-2001 by Erik Hendriks * * 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 * * $Id: vmadump_x86.h,v 1.9.8.3 2012/12/18 18:32:09 phargrov Exp $ * * THIS FILE ADDED FOR BLCR *-----------------------------------------------------------------------*/ #ifndef _VMADUMP_X86_H #define _VMADUMP_X86_H #include #include #if HAVE_LINUX_PERF_EVENT_H #include #endif /* set_used_math() first appears in 2.6.11 */ #ifndef set_used_math #define used_math() (current->used_math) #define clear_used_math() do { current->used_math = 0; } while (0) #define set_used_math() do { current->used_math = 1; } while (0) #endif /* The merge of x86 architectures yields thread.xstate in 2.6.26 and up */ #if HAVE_THREAD_I387 typedef union i387_union vmad_i387_t; #define vmad_task_i387(_task) (&(_task)->thread.i387) #elif HAVE_THREAD_XSTATE typedef union thread_xstate vmad_i387_t; #define vmad_task_i387(_task) ((_task)->thread.xstate) #elif HAVE_THREAD_FPU typedef union thread_xstate vmad_i387_t; #define vmad_task_i387(_task) ((_task)->thread.fpu.state) #else #error "Unknown i387 state type" #endif /* Space for all the temporaries used in vmadump_restore_cpu(). * They are too big to safely sit on the stack. */ struct vmadump_restore_tmps { struct pt_regs _regtmp; union { /* Never live at the same time */ struct thread_struct _threadtmp; vmad_i387_t _i387tmp; } _u; }; #define VMAD_REGTMP(_x86tmp) \ (&((_x86tmp)->_regtmp)) #define VMAD_THREADTMP(_x86tmp) \ (&((_x86tmp)->_u._threadtmp)) #define VMAD_I387TMP(_x86tmp) \ (&((_x86tmp)->_u._i387tmp)) #ifdef _ASM_EXTABLE /* Nothing to do here */ #elif VMAD_ARCH == VMAD_ARCH_x86_64 #define _ASM_EXTABLE(from,to) \ ".section __ex_table,\"a\" \n" \ " .align 8 \n" \ " .quad " #from "," #to " \n" \ ".previous \n" #elif VMAD_ARCH == VMAD_ARCH_i386 #define _ASM_EXTABLE(from,to) \ ".section __ex_table,\"a\" \n" \ " .align 4 \n" \ " .long " #from "," #to " \n" \ ".previous \n" #else #error "Unknown VMAD_ARCH" #endif static long vmadump_store_i387(cr_chkpt_proc_req_t *ctx, struct file *file) { vmad_i387_t i387tmp; long r, bytes = 0; char flag; flag = !!used_math(); r = write_kern(ctx, file, &flag, sizeof(flag)); if (r != sizeof(flag)) goto err; bytes += r; if (flag) { kernel_fpu_begin(); memcpy(&i387tmp, vmad_task_i387(current), sizeof(i387tmp)); kernel_fpu_end(); r = write_kern(ctx, file, &i387tmp, sizeof(i387tmp)); if (r != sizeof(i387tmp)) goto err; bytes += r; } return bytes; err: if (r >= 0) r = -EIO; return r; } static inline int vmad_check_fpu_state(void) { #if HAVE_RESTORE_FPU_CHECKING #if HAVE_2_6_0_RESTORE_FPU_CHECKING return restore_fpu_checking((struct i387_fxsave_struct *)vmad_task_i387(current)); #elif HAVE_2_6_28_RESTORE_FPU_CHECKING return restore_fpu_checking(current); #else #error "Don't know how to call restore_fpu_checking" #endif #else vmad_i387_t *i387tmp = vmad_task_i387(current); int r = 0; /* Invalid FPU states can blow us out of the water so we will do * the restore here in such a way that we trap the fault if the * restore fails. This modeled after get_user and put_user. */ if (cpu_has_fxsr) { asm volatile ("1: fxrstor %1 \n" "2: \n" ".section .fixup,\"ax\" \n" "3: movl %2, %0 \n" " jmp 2b \n" ".previous \n" _ASM_EXTABLE(1b, 3b) : "+r"(r) : "m" (i387tmp->fxsave), "i"(-EFAULT)); } else { asm volatile ("1: frstor %1 \n" "2: \n" ".section .fixup,\"ax\" \n" "3: movl %2, %0 \n" " jmp 2b \n" ".previous \n" _ASM_EXTABLE(1b, 3b) : "+r"(r) : "m" (i387tmp->fsave), "i"(-EFAULT)); } return r; #endif /* !HAVE_RESTORE_FPU_CHECKING */ } static int vmadump_restore_i387(cr_rstrt_proc_req_t *ctx, struct file *file, vmad_i387_t *i387tmp) { #if !defined(CR_KDATA_xstate_size) const unsigned int xstate_size = sizeof(vmad_i387_t); #endif char flag; int r; r = read_kern(ctx, file, &flag, sizeof(flag)); if (r != sizeof(flag)) goto bad_read; if (flag) { r = -ENOMEM; #if HAVE_THREAD_XSTATE || HAVE_THREAD_FPU /* Lazy allocation of FP state storage */ if (!vmad_task_i387(current)) { init_fpu(current); } #endif if (!vmad_task_i387(current)) { CR_ERR_CTX(ctx, "%d: FPU initialization failure.", current->pid); goto bad_read; } r = read_kern(ctx, file, i387tmp, sizeof(*i387tmp)); if (r != sizeof(*i387tmp)) { goto bad_read; } } /* Save the i387 state in thread_info and disable preemption * After kernel_fpu_begin(), we can ensure that * - TS_USEDFPU is clear * - TS is clear */ kernel_fpu_begin(); clear_used_math(); if (flag) { /* NOTE: memcpy only xstate_size, which might be smaller than vmad_i387t */ memcpy(vmad_task_i387(current), i387tmp, xstate_size); /* make sure the FPU state is good. */ r = vmad_check_fpu_state(); if (r) { CR_ERR_CTX(ctx, "%d: FPU restore failure %d.", current->pid, (int)r); } else { set_used_math(); /* TS_USEDFPU will be set by math_state_restore() the next time * we FPU trap, so no need to set it here. * * We only need to set current->used_math, so that * math_state_restore() knows that the FPU state in * thread.{i387,xstate} is good. */ } } /* kernel_fpu_end() should ensure TS is set */ kernel_fpu_end(); return 0; bad_read: if (r >= 0) r = -EIO; return r; } /* Save debugging state */ static long vmadump_store_debugreg(cr_chkpt_proc_req_t *ctx, struct file *file) { struct thread_struct *const thread = ¤t->thread; unsigned long debugregs[6]; long r, bytes = 0; #if HAVE_THREAD_DEBUGREGS { int i; for (i=0; i<6; ++i) debugregs[i] = thread->debugreg[i]; } #elif HAVE_THREAD_DEBUGREG0 debugregs[0] = thread->debugreg0; debugregs[1] = thread->debugreg1; debugregs[2] = thread->debugreg2; debugregs[3] = thread->debugreg3; debugregs[4] = thread->debugreg6; debugregs[5] = thread->debugreg7; #elif HAVE_THREAD_PTRACE_BPS { int i; for (i=0; i<4; ++i) { struct perf_event *bp = thread->ptrace_bps[i]; debugregs[i] = bp ? bp->hw.info.address : 0; } debugregs[4] = thread->debugreg6; debugregs[5] = thread->ptrace_dr7; /* XXX: is this correct? */ } #else #error #endif r = write_kern(ctx, file, &debugregs, sizeof(debugregs)); if (r != sizeof(debugregs)) goto err; bytes += r; return bytes; err: if (r >= 0) r = -EIO; return r; } /* Read (but don't restore) debugging state */ static int vmadump_restore_debugreg(cr_rstrt_proc_req_t *ctx, struct file *file) { unsigned long debugregs[6]; int r; r = read_kern(ctx, file, &debugregs, sizeof(debugregs)); if (r != sizeof(debugregs)) goto bad_read; return 0; bad_read: if (r >= 0) r = -EIO; return r; } #endif /* _VMADUMP_X86_H */ blcr-0.8.5/vmadump4/Makefile.in0000664000000000000000000004763012102070011013133 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ # Note: build is done via cr_module/kbuild/Makefile.in VPATH = @srcdir@ 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@ libexec_PROGRAMS = $(am__EXEEXT_1) $(am__EXEEXT_2) check_PROGRAMS = vmadtest$(EXEEXT) vmadstress$(EXEEXT) subdir = vmadump4 DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/blcr_config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = @BUILD_CR_INFO_TRUE@am__EXEEXT_1 = vmadcheck$(EXEEXT) @BUILD_VMADLIB_TRUE@am__EXEEXT_2 = vmadlib$(EXEEXT) am__installdirs = "$(DESTDIR)$(libexecdir)" PROGRAMS = $(libexec_PROGRAMS) vmadcheck_SOURCES = vmadcheck.c vmadcheck_OBJECTS = vmadcheck.$(OBJEXT) vmadcheck_LDADD = $(LDADD) vmadlib_SOURCES = vmadlib.c vmadlib_OBJECTS = vmadlib.$(OBJEXT) vmadlib_LDADD = $(LDADD) vmadstress_SOURCES = vmadstress.c vmadstress_OBJECTS = vmadstress.$(OBJEXT) vmadstress_LDADD = $(LDADD) vmadtest_SOURCES = vmadtest.c vmadtest_OBJECTS = vmadtest.$(OBJEXT) vmadtest_LDADD = $(LDADD) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/./config/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = vmadcheck.c vmadlib.c vmadstress.c vmadtest.c DIST_SOURCES = vmadcheck.c vmadlib.c vmadstress.c vmadtest.c HEADERS = $(noinst_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CONFIGURE_ARGS = @CONFIGURE_ARGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CR_ARCH = @CR_ARCH@ CR_CLIENT_LDADD = @CR_CLIENT_LDADD@ CR_CPU = @CR_CPU@ CR_FTB_INCLUDES = @CR_FTB_INCLUDES@ CR_FTB_LDADD = @CR_FTB_LDADD@ CR_FTB_LDFLAGS = @CR_FTB_LDFLAGS@ CR_KARCH = @CR_KARCH@ CR_KERNEL = @CR_KERNEL@ CR_KERNEL_BASE = @CR_KERNEL_BASE@ CR_LIBARCH = @CR_LIBARCH@ CR_LIBCR_CFLAGS = @CR_LIBCR_CFLAGS@ CR_MODULE_DIR = @CR_MODULE_DIR@ CR_MODULE_MAJOR = @CR_MODULE_MAJOR@ CR_MODULE_MINOR = @CR_MODULE_MINOR@ CR_MODULE_PATCH = @CR_MODULE_PATCH@ CR_MODULE_VERSION = @CR_MODULE_VERSION@ CR_NDEBUG = @CR_NDEBUG@ CR_RELEASE_MAJOR = @CR_RELEASE_MAJOR@ CR_RELEASE_MINOR = @CR_RELEASE_MINOR@ CR_RELEASE_PATCH = @CR_RELEASE_PATCH@ CR_RELEASE_VERSION = @CR_RELEASE_VERSION@ CR_SIGNUM = @CR_SIGNUM@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GMAKE_ELSE = @GMAKE_ELSE@ GMAKE_ENDIF = @GMAKE_ENDIF@ GMAKE_IFEQ = @GMAKE_IFEQ@ GMAKE_IFNEQ = @GMAKE_IFNEQ@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KBUILD_MAK = @KBUILD_MAK@ KBUILD_MAKE_ARGS = @KBUILD_MAKE_ARGS@ KCC = @KCC@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBCR_MAJOR = @LIBCR_MAJOR@ LIBCR_MINOR = @LIBCR_MINOR@ LIBCR_PATCH = @LIBCR_PATCH@ LIBCR_VERSION = @LIBCR_VERSION@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_AGE = @LIBTOOL_AGE@ LIBTOOL_INTERFACE = @LIBTOOL_INTERFACE@ LIBTOOL_REVISION = @LIBTOOL_REVISION@ LINUX_OBJ = @LINUX_OBJ@ LINUX_SRC = @LINUX_SRC@ LINUX_SYMTAB_CMD = @LINUX_SYMTAB_CMD@ LINUX_SYMTAB_CONF = @LINUX_SYMTAB_CONF@ LINUX_SYMTAB_FILE = @LINUX_SYMTAB_FILE@ LINUX_VER = @LINUX_VER@ LINUX_VERSION_H = @LINUX_VERSION_H@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKE = @MAKE@ MAKEINFO = @MAKEINFO@ 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_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PWD_PROG = @PWD_PROG@ RANLIB = @RANLIB@ RPMBUILD = @RPMBUILD@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TOP_BUILDDIR = @TOP_BUILDDIR@ TOP_SRCDIR = @TOP_SRCDIR@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ 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@ lt_ECHO = @lt_ECHO@ 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@ EXTRA_DIST = license.txt vmadump_common.c \ vmadump_i386.c vmadump_x86_64.c \ vmadump_ppc.c vmadump_ppc64.c \ vmadump_sparc.c vmadump_sparc64.c \ vmadump_alpha.c vmadump_arm.c BPROC_VERSION = "4.0.0pre8" INCLUDES = -D__NR_vmadump=-1 -DBPROC_VERSION='$(BPROC_VERSION)' -I$(top_srcdir)/include AM_CFLAGS = -Wall -s @BUILD_CR_INFO_FALSE@vmadcheck = # vmadcheck is needed only for cr_info and is currently broken -PHH 12.5.2003 @BUILD_CR_INFO_TRUE@vmadcheck = vmadcheck @BUILD_VMADLIB_FALSE@vmadlib = # vmadlib is not used with blcr @BUILD_VMADLIB_TRUE@vmadlib = vmadlib noinst_HEADERS = vmadump.h vmadump_x86.h AM_INSTALLCHECK_STD_OPTIONS_EXEMPT = $(libexec_PROGRAMS) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign vmadump4/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign vmadump4/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 install-libexecPROGRAMS: $(libexec_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(libexecdir)" || $(MKDIR_P) "$(DESTDIR)$(libexecdir)" @list='$(libexec_PROGRAMS)'; test -n "$(libexecdir)" || list=; \ 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)$(libexecdir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(libexecdir)$$dir" || exit $$?; \ } \ ; done uninstall-libexecPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(libexec_PROGRAMS)'; test -n "$(libexecdir)" || 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)$(libexecdir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(libexecdir)" && rm -f $$files clean-libexecPROGRAMS: @list='$(libexec_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 installcheck-libexecPROGRAMS: $(libexec_PROGRAMS) bad=0; pid=$$$$; list="$(libexec_PROGRAMS)"; for p in $$list; do \ case ' $(AM_INSTALLCHECK_STD_OPTIONS_EXEMPT) ' in \ *" $$p "* | *" $(srcdir)/$$p "*) continue;; \ esac; \ f=`echo "$$p" | \ sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ for opt in --help --version; do \ if "$(DESTDIR)$(libexecdir)/$$f" $$opt >c$${pid}_.out \ 2>c$${pid}_.err &2; bad=1; fi; \ done; \ done; rm -f c$${pid}_.???; exit $$bad vmadcheck$(EXEEXT): $(vmadcheck_OBJECTS) $(vmadcheck_DEPENDENCIES) @rm -f vmadcheck$(EXEEXT) $(LINK) $(vmadcheck_OBJECTS) $(vmadcheck_LDADD) $(LIBS) vmadlib$(EXEEXT): $(vmadlib_OBJECTS) $(vmadlib_DEPENDENCIES) @rm -f vmadlib$(EXEEXT) $(LINK) $(vmadlib_OBJECTS) $(vmadlib_LDADD) $(LIBS) vmadstress$(EXEEXT): $(vmadstress_OBJECTS) $(vmadstress_DEPENDENCIES) @rm -f vmadstress$(EXEEXT) $(LINK) $(vmadstress_OBJECTS) $(vmadstress_LDADD) $(LIBS) vmadtest$(EXEEXT): $(vmadtest_OBJECTS) $(vmadtest_DEPENDENCIES) @rm -f vmadtest$(EXEEXT) $(LINK) $(vmadtest_OBJECTS) $(vmadtest_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vmadcheck.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vmadlib.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vmadstress.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vmadtest.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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 CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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" 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 $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) check: check-am all-am: Makefile $(PROGRAMS) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(libexecdir)"; 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 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-libexecPROGRAMS \ 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-libexecPROGRAMS 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: installcheck-libexecPROGRAMS 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-libexecPROGRAMS .MAKE: check-am install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean \ clean-checkPROGRAMS clean-generic clean-libexecPROGRAMS \ clean-libtool ctags 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-libexecPROGRAMS \ install-man install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installcheck-libexecPROGRAMS installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-libexecPROGRAMS # 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: blcr-0.8.5/vmadump4/vmadump_sparc.c0000775000000000000000000000474111115103750014104 00000000000000/*------------------------------------------------------------------------- * vmadump_sparc.c: sparc specific dumping/undumping routines * * Copyright (C) 1999-2001 by Erik Hendriks * * 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 * * $Id: vmadump_sparc.c,v 1.4 2008/12/02 00:57:12 phargrov Exp $ * * THIS VERSION MODIFIED FOR BLCR * * Experimental SPARC support contributed to BLCR by Vincentius Robby * and Andrea Pellegrini . *-----------------------------------------------------------------------*/ #include #include #include #include #define __VMADUMP_INTERNAL__ #include "vmadump.h" long vmadump_store_cpu(cr_chkpt_proc_req_t *ctx, struct file *file, struct pt_regs *regs) { long bytes = 0, r; /* Store struct pt_regs */ r = write_kern(ctx, file, regs, sizeof(*regs)); if (r != sizeof(*regs)) goto err; bytes += r; return bytes; // apellegrini@umich.edu // 2008/08/28 // No FPU support at this point err: if (r >= 0) r = -EIO; return r; } int vmadump_restore_cpu(cr_rstrt_proc_req_t *ctx, struct file *file, struct pt_regs *regs) { struct pt_regs regtmp; int r; r = read_kern(ctx, file, ®tmp, sizeof(regtmp)); if (r != sizeof(regtmp)) goto bad_read; /* Only allow chages to certain bits of PSR/TSTATE */ #if defined(__arch64__) regtmp.tstate &= (TSTATE_ASI | TSTATE_ICC | TSTATE_XCC); regtmp.tstate |= (regs->tstate & ~(TSTATE_ASI | TSTATE_ICC | TSTATE_XCC)); #else regtmp.psr &= (PSR_ICC | PSR_EF); regtmp.psr |= (regs->psr & ~(PSR_ICC | PSR_EF)); #endif memcpy(regs, ®tmp, sizeof(regtmp)); return 0; bad_read: if (r >= 0) r = -EIO; return r; } blcr-0.8.5/vmadump4/vmadump_ppc.c0000664000000000000000000001427412065262174013570 00000000000000/*------------------------------------------------------------------------- * vmadump_powerpc.c: powerpc specific dumping/undumping routines * * Copyright (C) 1999-2001 by Erik Hendriks * * 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 * * $Id: vmadump_ppc.c,v 1.10.14.4 2012/12/22 07:42:52 phargrov Exp $ * * THIS VERSION MODIFIED FOR BLCR *-----------------------------------------------------------------------*/ #include #include #include #define __VMADUMP_INTERNAL__ #include "vmadump.h" #if HAVE_ASM_SWITCH_TO_H # include #endif long vmadump_store_cpu(cr_chkpt_proc_req_t *ctx, struct file *file, struct pt_regs *regs) { long bytes = 0, r; /* Store struct pt_regs */ r = write_kern(ctx, file, regs, sizeof(*regs)); if (r != sizeof(*regs)) goto err; bytes += r; /* Floating point regs */ if (regs->msr & MSR_FP) giveup_fpu(current); r = write_kern(ctx, file, ¤t->thread.fpr, sizeof(current->thread.fpr)); if (r != sizeof(current->thread.fpr)) goto err; bytes += r; r = write_kern(ctx, file, ¤t->thread.fpscr, sizeof(current->thread.fpscr)); if (r != sizeof(current->thread.fpscr)) goto err; bytes += r; #if HAVE_THREAD_VDSO_BASE /* unconditionally store the base of the VDSO library */ r = write_kern(ctx, file, ¤t->thread.vdso_base, sizeof(current->thread.vdso_base)); if (r != sizeof(current->thread.vdso_base)) goto err; bytes += r; #endif #ifdef CONFIG_ALTIVEC /* XXX I really need to find out if this is right */ if (regs->msr & MSR_VEC) giveup_altivec(current); r = write_kern(ctx, file, ¤t->thread.vr, sizeof(current->thread.vr)); if (r != sizeof(current->thread.vr)) goto err; bytes += r; r = write_kern(ctx, file, ¤t->thread.vscr, sizeof(current->thread.vscr)); if (r != sizeof(current->thread.vscr)) goto err; bytes += r; #endif return bytes; err: if (r >= 0) r = -EIO; return r; } int vmadump_restore_cpu(cr_rstrt_proc_req_t *ctx, struct file *file, struct pt_regs *regs) { struct pt_regs regtmp; int r; r = read_kern(ctx, file, ®tmp, sizeof(regtmp)); if (r != sizeof(regtmp)) goto bad_read; /* Don't restore machine state register since this is * unpriviledged user space stuff we're restoring. */ regtmp.msr = MSR_USER; /*regs->msr | MSR_PR;*/ memcpy(regs, ®tmp, sizeof(regtmp)); /* Floating point regs */ r = read_kern(ctx, file, ¤t->thread.fpr, sizeof(current->thread.fpr)); if (r != sizeof(current->thread.fpr)) goto bad_read; r = read_kern(ctx, file, ¤t->thread.fpscr, sizeof(current->thread.fpscr)); if (r != sizeof(current->thread.fpscr)) goto bad_read; #if HAVE_THREAD_VDSO_BASE /* unconditonally restore this */ r = read_kern(ctx, file, ¤t->thread.vdso_base, sizeof(current->thread.vdso_base)); if (r != sizeof(current->thread.vdso_base)) goto bad_read; #endif #ifdef CONFIG_ALTIVEC /* Restore Altivec */ r = read_kern(ctx, file, ¤t->thread.vr, sizeof(current->thread.vr)); if (r != sizeof(current->thread.vr)) goto bad_read; r = read_kern(ctx, file, ¤t->thread.vscr, sizeof(current->thread.vscr)); if (r != sizeof(current->thread.vscr)) goto bad_read; #endif current->thread.regs = regs; return 0; bad_read: if (r >= 0) r = -EIO; return r; } #if VMAD_HAVE_ARCH_MAPS #include #if HAVE_THREAD_VDSO_BASE #define vmad_vdso_base current->thread.vdso_base #elif HAVE_MM_CONTEXT_VDSO_BASE #define vmad_vdso_base current->mm->context.vdso_base #else #error "No support yet for VDSO on your kernel - please report as a BLCR bug" #endif int vmad_is_arch_map(const struct vm_area_struct *map) { return (map->vm_start == vmad_vdso_base); } EXPORT_SYMBOL_GPL(vmad_is_arch_map); loff_t vmad_store_arch_map(cr_chkpt_proc_req_t *ctx, struct file *file, struct vm_area_struct *map, int flags) { loff_t r = 0; if (vmad_is_arch_map(map)) { /* Just write out a section header */ struct vmadump_vma_header head; head.start = map->vm_start; head.end = map->vm_end; head.flags = map->vm_flags; head.namelen = VMAD_NAMELEN_ARCH; head.pgoff = 0; up_read(¤t->mm->mmap_sem); r = write_kern(ctx, file, &head, sizeof(head)); down_read(¤t->mm->mmap_sem); if (r < 0) return r; if (r != sizeof(head)) r = -EIO; } return r; } int vmad_load_arch_map(cr_rstrt_proc_req_t *ctx, struct file *file, struct vmadump_vma_header *head) { long r; #if HAVE_2_ARG_ARCH_SETUP_ADDITIONAL_PAGES r = arch_setup_additional_pages(NULL, 0); #elif HAVE_4_ARG_ARCH_SETUP_ADDITIONAL_PAGES r = arch_setup_additional_pages(NULL, 0, 0, 0); #else #error "Unknown calling convention to map the VDSO" #endif if (r < 0) { CR_ERR_CTX(ctx, "arch_setup_additional_pages failed %d", (int)r); goto err; } /* arch_setup_additional_pages() has overwritten vdso_base w/ the newly allocated one. * Here we check this new value against against the desired location (in head->start). */ if (head->start != vmad_vdso_base) { r = vmad_remap(ctx, (unsigned long)vmad_vdso_base, head->start, head->end - head->start); if (r) { CR_ERR_CTX(ctx, "vdso remap failed %d", (int)r); goto err; } vmad_vdso_base = head->start; } r = 0; err: return r; } #endif /* * Local variables: * c-basic-offset: 4 * End: */ blcr-0.8.5/vmadump4/vmadump_common.c0000664000000000000000000021322712102027107014260 00000000000000/*------------------------------------------------------------------------- * vmadump.c: Virtual Memory Area dump/restore routines * * Copyright (C) 1999-2001 by Erik Hendriks * * 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 * * $Id: vmadump_common.c,v 1.86.4.14 2013/01/29 20:17:11 phargrov Exp $ * * THIS VERSION MODIFIED FOR BLCR *-----------------------------------------------------------------------*/ #include #include #include #include "blcr_config.h" #include #include #include #include #include #include #if !HAVE_FILE_F_LOCK #include #endif #include #include #include #include #include #include #include #include #include #include #include #define __VMADUMP_INTERNAL__ #include "vmadump.h" static char vmad_magic[3] = VMAD_MAGIC; MODULE_AUTHOR("Erik Hendriks and the BLCR Team http://ftg.lbl.gov/checkpoint"); MODULE_DESCRIPTION("VMADump - Virtual Memory Area Dumper (modified for " PACKAGE_STRING ")"); MODULE_LICENSE("GPL"); /* A note about symbols... * * This module requires the following extra symbols from the kernel: * * sys_mprotect * do_exit * do_sigaction * do_execve * [and more w/ BLCR...] */ # if 0 /* BLCR uses its own I/O paths instead */ /*-------------------------------------------------------------------- * Some utility stuff for reading and writing and misc kernel syscalls. *------------------------------------------------------------------*/ static ssize_t default_read_file(struct vmadump_map_ctx *ctx, struct file *file, void *buf, size_t count) { return vfs_read(file, buf, count, &file->f_pos); } static ssize_t read_user(struct vmadump_map_ctx *ctx, struct file *file, void *buf, size_t count) { ssize_t r, bytes = count; ssize_t (*rfunc)(struct vmadump_map_ctx *ctx, struct file *file, void *buf, size_t count); rfunc = (ctx && ctx->read_file) ? ctx->read_file : default_read_file; while (bytes) { #if BITS_PER_LONG == 32 /* Avoid accidentally negative return values */ r = rfunc(ctx, file, buf, ((bytes > 0x40000000) ? 0x40000000 : bytes)); #elif BITS_PER_LONG == 64 r = rfunc(ctx, file, buf, bytes); #else #error "Unknown BITS_PER_LONG" #endif if (r < 0) return r; if (r == 0) return count - bytes; bytes -= r; buf = (char *)buf + r; } return count; } ssize_t read_kern(struct vmadump_map_ctx *ctx, struct file *file, void *buf, size_t count) { ssize_t err; mm_segment_t oldfs; oldfs = get_fs(); set_fs(KERNEL_DS); err = read_user(ctx, file, buf, count); set_fs(oldfs); return err; } static ssize_t default_write_file(struct vmadump_map_ctx *ctx, struct file *file, const void *buf, size_t count) { return vfs_write(file, buf, count, &file->f_pos); } static ssize_t write_user(struct vmadump_map_ctx *ctx, struct file *file, const void *buf, size_t count) { ssize_t w, bytes = count; ssize_t (*wfunc)(struct vmadump_map_ctx *ctx, struct file *file, const void *buf, size_t count); wfunc = (ctx && ctx->write_file) ? ctx->write_file : default_write_file; while (bytes) { #if BITS_PER_LONG == 32 /* Avoid accidentally negative return values */ w = wfunc(ctx, file, buf, ((bytes > 0x40000000) ? 0x40000000 : bytes)); #elif BITS_PER_LONG == 64 w = wfunc(ctx, file, buf, bytes); #else #error "Unknown BITS_PER_LONG" #endif if (w < 0) return w; if (w == 0) return count - bytes; bytes -= w; buf = (char *)buf + w; } return count; } ssize_t write_kern(struct vmadump_map_ctx *ctx, struct file *file, const void *buf, size_t count) { ssize_t err; mm_segment_t oldfs; oldfs = get_fs(); set_fs(KERNEL_DS); err = write_user(ctx, file, buf, count); set_fs(oldfs); return err; } #endif #if 0 /* Not needed/maintained for BLCR */ /*-------------------------------------------------------------------- * Library list stuff. *------------------------------------------------------------------*/ /* XXX This should be more configurable than this - this is idea of * figuring out what's a library */ struct liblist_entry { struct list_head list; char libname[0]; }; static LIST_HEAD(liblist); static void liblist_clear(void) { struct liblist_entry *entry; while (!list_empty(&liblist)) { entry = list_entry(liblist.next, struct liblist_entry, list); list_del(liblist.next); kfree(entry); } } static struct liblist_entry * liblist_find(const char *filename) { struct list_head *p; struct liblist_entry *entry; p = liblist.next; while (p != &liblist) { entry = list_entry(p, struct liblist_entry, list); if (strcmp(entry->libname, filename) == 0) return entry; p = p->next; } return 0; } static int liblist_add(char *filename) { struct liblist_entry *entry; /* Don't add things twice */ if (liblist_find(filename)) return 0; entry = kmalloc(sizeof(*entry)+strlen(filename)+1, GFP_KERNEL); if (!entry) return -ENOMEM; strcpy(entry->libname, filename); list_add(&entry->list, &liblist); return 0; } static int liblist_del(char *filename) { struct liblist_entry *entry; entry = liblist_find(filename); if (entry) { list_del(&entry->list); kfree(entry); return 0; } return -ENOENT; } /* Returns the size of our library list converted to text */ static int liblist_size(void) { int len; struct list_head *p; struct liblist_entry *entry; len = 0; p = liblist.next; while (p != &liblist) { entry = list_entry(p, struct liblist_entry, list); len += strlen(entry->libname)+1; p = p->next; } len++; /* for trailing null. */ return len; } static int do_lib_op(int request, char *buf, int size) { int err, len; char *filename; struct list_head *p; struct liblist_entry *entry; switch(request) { case VMAD_LIB_CLEAR: if (!capable(CAP_SYS_ADMIN)) return -EPERM; liblist_clear(); return 0; case VMAD_LIB_ADD: if (!capable(CAP_SYS_ADMIN)) return -EPERM; filename = getname(buf); if (IS_ERR(filename)) return PTR_ERR(filename); err = liblist_add(filename); putname(filename); return err; case VMAD_LIB_DEL: if (!capable(CAP_SYS_ADMIN)) return -EPERM; filename = getname(buf); if (IS_ERR(filename)) return PTR_ERR(filename); err = liblist_del(filename); putname(filename); return err; case VMAD_LIB_SIZE: return liblist_size(); case VMAD_LIB_LIST: len = liblist_size(); if (len > size) return -ENOSPC; size = len; /* Copy all those strings out to user space. */ p = liblist.next; while (p != &liblist) { entry = list_entry(p, struct liblist_entry, list); len = strlen(entry->libname); if (copy_to_user(buf, entry->libname, len)) return EFAULT; buf += len; put_user('\0', buf++); p = p->next; } put_user('\0', buf); return size; default: return -EINVAL; } } #endif static char *default_map_name(struct file *f, char *buffer, int size) { #if HAVE_NAMEIDATA_DENTRY return d_path(f->f_dentry, f->f_vfsmnt, buffer, size); #elif HAVE_NAMEIDATA_PATH return d_path(&f->f_path, buffer, size); #else #error #endif } #if 0 /* Not needed/maintained for BLCR */ /* this is gonna be handled with contexts too */ static int is_library(const char *filename) { return (liblist_find(filename) != 0); } #else #define is_library(FILE) 0 #endif static struct file *default_map_open(cr_rstrt_proc_req_t *ctx, const char *filename, int flags) { struct file *filp; const char *reloc_filename; reloc_filename = cr_relocate_path(ctx->req->relocate, filename, 0); if (IS_ERR(reloc_filename)) { filp = (struct file *)reloc_filename; goto out; } filp = filp_open(reloc_filename, flags, 0); if (IS_ERR(filp)) { if (reloc_filename != filename) { CR_ERR_CTX(ctx, "failed to open '%s', relocated from '%s'", reloc_filename, filename); } /* Caller prints flags and return value */ } if (reloc_filename != filename) { __putname(reloc_filename); } out: return filp; } #if 0 /* Hooks code not needed/maintained for BLCR */ /*-------------------------------------------------------------------- * Dump hook stuff. *------------------------------------------------------------------*/ struct hook_t { struct list_head list; struct vmadump_hook *hook; }; struct vmadump_hook_handle { int rw; /* for checking on the user */ struct vmadump_map_ctx *ctx; struct file *file; }; static struct rw_semaphore hook_lock; static LIST_HEAD(hooks); int vmadump_add_hook(struct vmadump_hook *hook) { struct hook_t *h, *new_h; struct list_head *l; new_h = kmalloc(sizeof(*new_h), GFP_KERNEL); new_h->hook = hook; down_write(&hook_lock); /* check to make sure that this hook isn't being added twice */ for (l = hooks.next; l != &hooks; l = l->next) { h = list_entry(l, struct hook_t, list); if (h->hook == hook) { up_write(&hook_lock); kfree(new_h); return -EEXIST; } } list_add_tail(&new_h->list, &hooks); up_write(&hook_lock); printk(KERN_INFO "vmadump: Registered hook \"%s\"\n", hook->tag); return 0; } int vmadump_del_hook(struct vmadump_hook *hook) { struct hook_t *h; struct list_head *l; down_write(&hook_lock); for (l = hooks.next; l != &hooks; l = l->next) { h = list_entry(l, struct hook_t, list); if (h->hook == hook) { list_del(&h->list); up_write(&hook_lock); printk(KERN_INFO "vmadump: Unregistered hook \"%s\"\n", hook->tag); kfree(h); return 0; } } up_write(&hook_lock); return -ENOENT; } struct vmadump_callback_handle { int rw; struct vmadump_map_ctx *ctx; struct file *file; }; /* Call every hook freeze function */ static int do_freeze_hooks(struct vmadump_map_ctx *ctx, struct file *file, struct pt_regs *regs, int flags) { long bytes = 0, r; struct hook_t *h; struct list_head *l; struct vmadump_hook_header hookhdr; struct vmadump_hook_handle hh = { 1, ctx, file}; down_read(&hook_lock); for (l = hooks.next; l != &hooks; l = l->next) { h = list_entry(l, struct hook_t, list); r = h->hook->freeze(&hh, regs, flags); if (r < 0) { up_read(&hook_lock); return r; } bytes += r; } up_read(&hook_lock); /* Terminate the list of hooks */ memset(&hookhdr, 0, sizeof(hookhdr)); r = write_kern(ctx, file, &hookhdr, sizeof(hookhdr)); if (r < 0) return r; if (r != sizeof(hookhdr)) return -EIO; bytes += r; return bytes; } static long skip_data(struct vmadump_map_ctx *ctx, struct file *file, long len) { long r = 0; void *page; page = (void *) __get_free_page(GFP_KERNEL); if (!page) return -ENOMEM; while (len > 0) { r = read_kern(ctx, file, page, (len>PAGE_SIZE) ? PAGE_SIZE : len); if (r <= 0) break; len -= r; } free_page((long) page); if (r == 0) r = -EIO; /* end of file.... */ return 0; } static int do_thaw_hooks(struct vmadump_map_ctx *ctx, struct file *file, struct pt_regs *regs) { long r; struct hook_t *h; struct list_head *l; struct vmadump_hook_header hookhdr; struct vmadump_hook_handle hh = { 0, ctx, file}; r = read_kern(ctx, file, &hookhdr, sizeof(hookhdr)); if (r != sizeof(hookhdr)) goto err; while (hookhdr.tag[0]) { /* Do a bit of sanity checking on this dump header */ hookhdr.tag[VMAD_HOOK_TAG_LEN-1] = 0; /* null terminate that string... */ if (hookhdr.size <= 0) { r = -EINVAL; goto err; } /* See if we find a matching hook */ down_read(&hook_lock); for (l = hooks.next; l != &hooks; l = l->next) { h = list_entry(l, struct hook_t, list); if (strcmp(hookhdr.tag, h->hook->tag) == 0) { r = h->hook->thaw(&hh, &hookhdr, regs); break; } } if (l == &hooks) r = skip_data(ctx, file, hookhdr.size); up_read(&hook_lock); if (r) goto err; r = read_kern(ctx, file, &hookhdr, sizeof(hookhdr)); if (r != sizeof(hookhdr)) goto err; } return 0; err: if (r >= 0) r = -EIO; return r; } /* read/write calls for use by hooks */ ssize_t vmadump_read_u(struct vmadump_hook_handle *h, void *buf, size_t count){ if (h->rw != 0) return -EINVAL; return read_user(h->ctx, h->file, buf, count); } ssize_t vmadump_read_k(struct vmadump_hook_handle *h, void *buf, size_t count){ ssize_t err; mm_segment_t oldfs; oldfs = get_fs(); set_fs(KERNEL_DS); err = vmadump_read_u(h, buf, count); set_fs(oldfs); return err; } ssize_t vmadump_write_u(struct vmadump_hook_handle *h, const void *buf, size_t count) { if (h->rw != 1) return -EINVAL; return write_user(h->ctx, h->file, buf, count); } ssize_t vmadump_write_k(struct vmadump_hook_handle *h, const void *buf, size_t count) { ssize_t err; mm_segment_t oldfs; oldfs = get_fs(); set_fs(KERNEL_DS); err = vmadump_write_u(h, buf, count); set_fs(oldfs); return err; } #endif /* directio_avail * * Boolean return: non-zero if directio_start will succeed */ static int directio_avail(struct file *filp) { int result = 0; /* assume failure */ /* * This was basically ripped out of setfl() in 2.6.22, with some #if's * added based on 2.6.1->2 and 2.6.7->8 changes to that function. * And for 2.6.29->30 changes (file.f_lock) * * The alternative is to call sys_fcntl() directly. This is a good idea. * But right now I'm not in the mood to walk the fd array to identify the * proper file descriptor. * * XXX: Do that. */ /* Cannot perform alignment unless f_pos is being advanced */ if (!filp->f_pos) goto out; #if HAVE_FILE_F_MAPPING /* Order matters, if kernel has both f_mapping and i_mapping use f_mapping */ if (!filp->f_mapping || !filp->f_mapping->a_ops || !filp->f_mapping->a_ops->direct_IO) goto out; #elif HAVE_INODE_I_MAPPING struct inode *inode = filp->f_dentry->d_inode; if (!inode->i_mapping || !inode->i_mapping->a_ops || !inode->i_mapping->a_ops->direct_IO) goto out; #else #error #endif #if HAVE_FILE_OPERATIONS_CHECK_FLAGS if (filp->f_op && filp->f_op->check_flags && filp->f_op->check_flags(filp->f_flags | O_DIRECT)) goto out; #else /* OK */ #endif result = 1; out: return result; } /* * directio_start * * The caller MUST ensure that the filp is aligned properly (usually to * 512 bytes) before calling this routine. I've aligned everything to page * size. */ static unsigned int directio_start(struct file *filp) { unsigned int saved_flags = filp->f_flags; /* * This was basically ripped out of setfl() in 2.6.22, with some #if's * added based on 2.6.1->2 and 2.6.7->8 changes to that function. * And for 2.6.29->30 changes (file.f_lock) * * The alternative is to call sys_fcntl() directly. This is a good idea. * But right now I'm not in the mood to walk the fd array to identify the * proper file descriptor. * * XXX: Do that. */ #if HAVE_FILE_F_LOCK spin_lock(&filp->f_lock); filp->f_flags |= O_DIRECT; spin_unlock(&filp->f_lock); #else /* The lock_kernel() does appear necessary here because both * setfl() and ioctl() use it when modifying f_flags. So, to * prevent corruption of f_flags, we take the lock too. * Of course if somebody is changing f_flags on the context * fd while we are actively writing... not good. */ lock_kernel(); filp->f_flags |= O_DIRECT; unlock_kernel(); #endif return saved_flags; } static void directio_stop(struct file *filp, unsigned int saved_flags) { #if HAVE_FILE_F_LOCK spin_lock(&filp->f_lock); filp->f_flags = saved_flags; spin_unlock(&filp->f_lock); #else lock_kernel(); filp->f_flags = saved_flags; unlock_kernel(); #endif } /* sys_prctl "by value" */ int vmadump_prctl_v(int option, unsigned long arg2) { return sys_prctl(option, arg2, 0, 0, 0); } /* sys_prctl "by reference" */ int vmadump_prctl_k(int option, void *arg2) { int err; mm_segment_t oldfs; oldfs = get_fs(); set_fs(KERNEL_DS); err = sys_prctl(option, (unsigned long)arg2, 0, 0, 0); set_fs(oldfs); return err; } int vmadump_sigaltstack_k(const stack_t *ss, stack_t *oss) { int err; mm_segment_t oldfs; oldfs = get_fs(); set_fs(KERNEL_DS); err = do_sigaltstack(ss, oss, 0); set_fs(oldfs); return err; } /*-------------------------------------------------------------------- * Process "thawing" routines. *------------------------------------------------------------------*/ long vmad_remap(cr_rstrt_proc_req_t *ctx, unsigned long from_addr, unsigned long to_addr, unsigned long len) { long r; unsigned long new_addr; unsigned long diff = (from_addr > to_addr) ? (from_addr - to_addr) : (to_addr - from_addr); if (diff < len) { /* Check for overlap case */ unsigned long tmp_addr; tmp_addr = cr_mmap_pgoff(NULL, 0, len, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, 0); r = (tmp_addr & (PAGE_SIZE-1)); if (r) { CR_ERR_CTX(ctx, "vmad_remap failed to allocate temporary %d", (int)r); goto err; } new_addr = sys_mremap(from_addr, len, len, MREMAP_FIXED|MREMAP_MAYMOVE, tmp_addr); if (new_addr != tmp_addr) { r = (new_addr & (PAGE_SIZE-1)) ? new_addr : -ENOMEM; CR_ERR_CTX(ctx, "vmad_remap failed to use temporary %d", (int)r); goto err; } from_addr = tmp_addr; } new_addr = sys_mremap(from_addr, len, len, MREMAP_FIXED|MREMAP_MAYMOVE, to_addr); if (new_addr != to_addr) { r = (new_addr & (PAGE_SIZE-1)) ? new_addr : -ENOMEM; CR_ERR_CTX(ctx, "vmad_remap failed %d", (int)r); goto err; } r = 0; err: return r; } static int mmap_file(cr_rstrt_proc_req_t *ctx, const struct vmadump_vma_header *head, char *filename, unsigned long flags) { struct file *file; long mapaddr; int open_flags; unsigned long prot; if (head->flags & VM_MAYSHARE) { if (head->flags & VM_MAYWRITE) { open_flags = (head->flags & (VM_MAYREAD|VM_MAYEXEC)) ? O_RDWR : O_WRONLY; prot = PROT_WRITE; } else { open_flags = O_RDONLY; prot = 0; } if (head->flags & VM_MAYREAD) prot |= PROT_READ; if (head->flags & VM_MAYEXEC) prot |= PROT_EXEC; } else { open_flags = O_RDONLY; prot = PROT_READ|PROT_WRITE|PROT_EXEC; } /* This is a lot like open w/o a file descriptor */ #if 0 /* Not supported in BLCR */ if (ctx && ctx->map_open) file = ctx->map_open(ctx, filename, open_flags); else #endif file = default_map_open(ctx, filename, open_flags); if (IS_ERR(file)) { CR_ERR_CTX(ctx, "open('%s', 0x%x) failed: %d", filename, open_flags, (int)PTR_ERR(file)); return PTR_ERR(file); } down_write(¤t->mm->mmap_sem); mapaddr = cr_mmap_pgoff(file, head->start, head->end - head->start, prot, flags, head->pgoff); up_write(¤t->mm->mmap_sem); fput(file); if (mapaddr != head->start) CR_ERR_CTX(ctx, "mmap(, %p, %p, ...) failed: %p", (void *) head->start, (void *) (head->end-head->start), (void *) mapaddr); return (mapaddr == head->start) ? 0 : mapaddr; } /* Reads in the header giving the the number of bytes of "fill" to * achieve alignment, and returns that value in *buf_len. * ONLY if "fill" is less than VMAD_CHUNKHEADER_MIN bytes is the * corresponding padding read here. */ static long load_page_list_header(cr_rstrt_proc_req_t * ctx, struct file *file, void *buf, unsigned int *buf_len, int *use_directio) { struct vmadump_page_list_header header; long bytes = 0; long r; /* load in the header so we know how many bytes of alignment there are */ r = read_kern(ctx, file, &header, sizeof(header)); if (r != sizeof(header)) goto err; bytes += r; /* determine if O_DIRECT should be used to read this pages */ if (header.fill == PAGE_SIZE) { /* PAGE_SIZE means directio was NOT used at checkpoint time */ use_directio = 0; header.fill = 0; } else { *use_directio = directio_avail(file); } /* now read in the padding if too small to fit page headers */ if (!header.fill) { /* No padding at all */ } else if (header.fill < VMAD_CHUNKHEADER_MIN) { /* TODO: use cr_skip(), which may someday seek */ r = read_kern(ctx, file, buf, header.fill); if (r != header.fill) goto err; bytes += r; } else { /* Padding is large enough to use for the page headers */ *buf_len = header.fill; } return bytes; err: if (r >= 0) r = -EIO; /* map short reads to EIO */ return r; } /* * Returns 0 or 1 on success. * 0 = EOF, meaning no more pages are available * 1 = Caller must call again to load more pages * <0 Some error */ long load_page_chunks(cr_rstrt_proc_req_t * ctx, struct file *file, struct vmadump_page_header *headers, int sizeof_headers, int is_exec, int use_directio) { unsigned long old_filp_flags = 0; long r = 1; const int max_chunks = sizeof_headers/sizeof(*headers); int i; /* Now load the chunk page */ r = read_kern(ctx, file, headers, sizeof_headers); if (r != sizeof_headers) { goto bad_read; } /* spin up direct IO */ if (use_directio) old_filp_flags = directio_start(file); /* load each chunk */ for (i = 0; i < max_chunks; ++i) { const long len = (long)headers[i].num_pages << PAGE_SHIFT; const unsigned long page_start = headers[i].start; if (page_start == VMAD_END_OF_CHUNKS) { /* EOF */ r = 0; break; } r = read_user(ctx, file, (void *) page_start, len); if (r != len) { goto bad_read; } if (is_exec) { flush_icache_range(page_start, page_start + len); } r = 1; } /* disable direct IO */ if (use_directio) directio_stop(file, old_filp_flags); return r; bad_read: if (r >= 0) { r = -EIO; } /* map short reads to EIO */ return r; } int vmadump_load_page_list(cr_rstrt_proc_req_t *ctx, struct file *file, int is_exec) { struct vmadump_page_header *chunks; long r; unsigned int sizeof_chunks = VMAD_CHUNKHEADER_SIZE; int use_directio = 0; chunks = (struct vmadump_page_header *) kmalloc(sizeof_chunks, GFP_KERNEL); if (chunks == NULL) { r = -ENOMEM; goto err; } /* handle alignment padding - either skip it or use it for first batch of chunks */ r = load_page_list_header(ctx, file, chunks, &sizeof_chunks, &use_directio); if (r < 0) { goto out_free; } /* now load all the page chunks */ do { r = load_page_chunks(ctx, file, chunks, sizeof_chunks, is_exec, use_directio); if (r < 0) { goto out_free; } sizeof_chunks = VMAD_CHUNKHEADER_SIZE; /* After the first, all chunk arrays are this size */ } while (r > 0); out_free: kfree(chunks); err: return r; } static int load_map(cr_rstrt_proc_req_t *ctx, struct file *file, struct vmadump_vma_header *head) { long r; unsigned long mmap_prot, mmap_flags, addr; if (head->namelen == VMAD_NAMELEN_ARCH) { #if VMAD_HAVE_ARCH_MAPS return vmad_load_arch_map(ctx, file, head); #else CR_ERR_CTX(ctx, "Found an arch-specific mapping in a kernel without any???"); return -EINVAL; #endif } mmap_prot = 0; mmap_flags = MAP_FIXED | ((head->flags & VM_MAYSHARE) ? MAP_SHARED : MAP_PRIVATE); if (head->flags & VM_READ) mmap_prot |= PROT_READ; if (head->flags & VM_WRITE) mmap_prot |= PROT_WRITE; if (head->flags & VM_EXEC) mmap_prot |= PROT_EXEC; if (head->flags & VM_GROWSDOWN) mmap_flags |= MAP_GROWSDOWN; #ifdef VM_EXECUTABLE if (head->flags & VM_EXECUTABLE) mmap_flags |= MAP_EXECUTABLE; #endif if (head->flags & VM_DENYWRITE) mmap_flags |= MAP_DENYWRITE; if (head->namelen > 0) { char *filename; if (head->namelen > PAGE_SIZE) { CR_ERR_CTX(ctx, "thaw: bogus namelen %d", (int) head->namelen); return -EINVAL; } filename = kmalloc(head->namelen+1,GFP_KERNEL); if (!filename) { r = -ENOMEM; goto err; } r = read_kern(ctx, file, filename, head->namelen); if (r != head->namelen) { kfree(filename); goto err; } filename[head->namelen] = 0; r = mmap_file(ctx, head, filename, mmap_flags); if (r) { CR_ERR_CTX(ctx, "mmap failed: %s", filename); kfree(filename); return r; } kfree(filename); } else { /* Load the data from the dump file */ down_write(¤t->mm->mmap_sem); addr = cr_mmap_pgoff(0, head->start, head->end - head->start, mmap_prot|PROT_WRITE, mmap_flags, 0); up_write(¤t->mm->mmap_sem); if (addr != head->start) { CR_ERR_CTX(ctx, "mmap(0, %08lx, %08lx, ...) = 0x%08lx (failed)", head->start, head->end - head->start, addr); if ((addr != head->start) && IS_ERR((void *) addr)) { r = PTR_ERR((void *) addr); } else { r = -EINVAL; } return r; } } /* Read in patched pages */ r = vmadump_load_page_list(ctx, file, (mmap_prot & PROT_EXEC)); if (r) goto err; if (sys_mprotect(head->start,head->end - head->start, mmap_prot)) CR_ERR_CTX(ctx, "thaw: mprotect failed. (ignoring)"); return 0; err: if (r >= 0) r = -EIO; /* map short reads to EIO */ return r; } static int vmadump_load_sigpending(cr_rstrt_proc_req_t *ctx, struct file *file, struct sigpending *sigpending, int shared) { sigset_t pending_set; int flags; long r; r = read_kern(ctx, file, &flags, sizeof(flags)); if (r != sizeof(flags)) goto bad_read; while (flags != -1) { struct siginfo info; r = read_kern(ctx, file, &info, sizeof(info)); if (r != sizeof(info)) goto bad_read; /* XXX: if/when we do support posix timers directly, we might * need to deal with SIGQUEUE_PREALLOC in flags. * For now there is no harm in ignoring it. */ if (shared) { read_lock(&tasklist_lock); r = group_send_sig_info(info.si_signo, &info, current); read_unlock(&tasklist_lock); } else { r = send_sig_info(info.si_signo, &info, current); } r = read_kern(ctx, file, &flags, sizeof(flags)); if (r != sizeof(flags)) goto bad_read; } /* Corresponding signal set comes last */ r = read_kern(ctx, file, &pending_set, sizeof(pending_set)); if (r != sizeof(pending_set)) goto bad_read; spin_lock_irq(¤t->sighand->siglock); sigorsets(&sigpending->signal, &sigpending->signal, &pending_set); recalc_sigpending(); spin_unlock_irq(¤t->sighand->siglock); return 0; bad_read: if (r >= 0) r = -EIO; /* Map short writes to EIO */ return r; } /* Values of (struct vmad_prctl).type */ enum vmad_prctl_type { vmad_prctl_int_ref, /* integer read by reference, written by value*/ vmad_prctl_int_val, /* integer read and written by value */ vmad_prctl_bool, /* integer read and written by value, write must be 0 or 1 */ vmad_prctl_comm, /* string of length TASK_COMM_LEN, set by reference */ }; struct vmad_prctl { int option; /* First argument to prctl() to set */ int type; /* How to handle 2nd argument */ }; static int vmadump_load_prctl(cr_rstrt_proc_req_t *ctx, struct file *file) { struct vmad_prctl header; long r; r = read_kern(ctx, file, &header, sizeof(header)); if (r != sizeof(header)) goto bad_read; while (header.option) { /* option==0 is end of the list */ switch (header.type) { case vmad_prctl_bool: case vmad_prctl_int_val: case vmad_prctl_int_ref: { unsigned int value; r = read_kern(ctx, file, &value, sizeof(value)); if (r != sizeof(value)) goto bad_read; r = vmadump_prctl_v(header.option, value); break; } case vmad_prctl_comm: { #if defined(PR_SET_NAME) char value[TASK_COMM_LEN]; r = read_kern(ctx, file, &value, sizeof(value)); if (r != sizeof(value)) goto bad_read; r = vmadump_prctl_k(header.option, &value); #else if (sizeof(current->comm) != TASK_COMM_LEN) { CR_ERR_CTX(ctx, "vmadump: TASK_COMM_LEN changed?"); r = -EINVAL; goto bad_read; } r = read_kern(ctx, file, current->comm, TASK_COMM_LEN); if (r != TASK_COMM_LEN) goto bad_read; #endif break; } default: CR_ERR_CTX(ctx, "vmadump: prtcl %d has unknown type code %d", header.option, header.type); goto bad_read; } #if 0 /* Confusing when issued, for instance, for PR_SET_SECCOMP where permission is denied */ if (r < 0) { CR_WARN_CTX(ctx, "vmadump warning: failed to set prtcl(%d) err %ld", header.option, r); } #endif r = read_kern(ctx, file, &header, sizeof(header)); if (r != sizeof(header)) goto bad_read; } bad_read: if (r >= 0) r = -EIO; /* Map short writes to EIO */ return r; } long vmadump_thaw_proc(cr_rstrt_proc_req_t *ctx, struct file *file, struct pt_regs *regs, int flags) { long r; pid_t pid; #if BITS_PER_LONG == 64 unsigned long orig_personality = personality(current->personality); #endif { struct vmadump_header header; /*--- First some sanity checking ---*/ r = read_kern(ctx, file, &header, sizeof(header)); if (r != sizeof(header)) { CR_ERR_CTX(ctx, "vmadump: failed to read header: %ld", r); return -EINVAL; } if (memcmp(header.magic, vmad_magic, sizeof(header.magic))) { CR_ERR_CTX(ctx, "vmadump: invalid signature"); return -EINVAL; } if (header.fmt_vers != VMAD_FMT_VERS) { CR_ERR_CTX(ctx, "vmadump: dump version mistmatch. dump=%d; " "kernel=%d", (int)header.fmt_vers, (int)VMAD_FMT_VERS); return -EINVAL; } if (header.arch != VMAD_ARCH) { CR_ERR_CTX(ctx, "vmadump: architecture mismatch."); return -EINVAL; } if (header.major != ((LINUX_VERSION_CODE >> 16) & 0xFF) || header.minor != ((LINUX_VERSION_CODE >> 8) & 0xFF) #if defined(STRICT_VERSION_CHECK) && STRICT_VERSION_CHECK ||header.patch != (LINUX_VERSION_CODE & 0xFF) #endif ) { CR_ERR_CTX(ctx, "vmadump: kernel version mismatch."); return -EINVAL; } } /* Ummm... Point of no-return is here.... maybe try to move this * down a bit? */ #if 0 /* Now handled w/ other prctl values */ if (!(flags & VMAD_DUMP_REGSONLY)) { /* Read our new comm */ r = read_kern(ctx, file, current->comm, sizeof(current->comm)); if (r != sizeof(current->comm)) goto bad_read; } #endif vmadump_load_prctl(ctx, file); /* PID, provided only for the benefit of our caller */ { r = read_kern(ctx, file, &pid, sizeof(pid)); if (r != sizeof(pid)) goto bad_read; } /* Credentials, important to do before we try to open any files */ { r = cr_load_creds(ctx); if (r < 0) goto bad_read; } /* * CPU-specific register restore stuff * * Note that we're not presuming that our current regs pointer * points to anything even vaguely reasonable. This is done to * support bproc type kernel threads that have never been user * processes before. */ r = vmadump_restore_cpu(ctx, file, regs); if (r) goto bad_read; /*--- Signal information ---------------------------------------*/ { int i; stack_t sig_stack; sigset_t sig_blocked; struct k_sigaction sig_action; /* Restore sigaltstack */ r = read_kern(ctx, file, &sig_stack, sizeof(sig_stack)); if (r != sizeof(sig_stack)) goto bad_read; r = vmadump_sigaltstack_k(&sig_stack, NULL); if (r < 0) goto bad_read; /* Install sets of blocked and pending signals */ r = read_kern(ctx, file, &sig_blocked, sizeof(sig_blocked)); if (r != sizeof(sig_blocked)) goto bad_read; sigdelsetmask(&sig_blocked, sigmask(SIGKILL)|sigmask(SIGSTOP)); spin_lock_irq(¤t->sighand->siglock); memcpy(¤t->blocked, &sig_blocked, sizeof(sig_blocked)); recalc_sigpending(); spin_unlock_irq(¤t->sighand->siglock); r = vmadump_load_sigpending(ctx, file, ¤t->pending, 0); if (r < 0) goto bad_read; if (!(flags & VMAD_DUMP_REGSONLY)) { /* Restore shared queue if not actually shared, or if we are the "leader" */ r = vmadump_load_sigpending(ctx, file, ¤t->signal->shared_pending, 1); if (r < 0) goto bad_read; } if (!(flags & VMAD_DUMP_REGSONLY)) { for (i=0; i < _NSIG; i++) { r = read_kern(ctx, file, &sig_action, sizeof(sig_action)); if (r != sizeof(sig_action)) goto bad_read; if (i != SIGKILL-1 && i != SIGSTOP-1) { r = do_sigaction(i+1, &sig_action, 0); if (r) goto bad_read; } } } } /*--- Misc other stuff -----------------------------------------*/ { /* our tid ptr */ r = read_kern(ctx, file, ¤t->clear_child_tid, sizeof(current->clear_child_tid)); if (r != sizeof(current->clear_child_tid)) { goto bad_read; } } { /* personality */ unsigned long tmp_personality; r = read_kern(ctx, file, &tmp_personality, sizeof(tmp_personality)); if (r != sizeof(tmp_personality)) { goto bad_read; } set_personality(tmp_personality); } /*--- Memory map meta data -------------------------------------*/ if (!(flags & VMAD_DUMP_REGSONLY)) { struct mm_struct *mm; struct vm_area_struct *map; struct vmadump_mm_info mm_info; struct vmadump_vma_header mapheader; #if HAVE_MM_MMAP_BASE unsigned long mmap_base; #endif int map_count; #if BITS_PER_LONG == 64 /* If restarting a 32-bit application from a 64-bit cr_restart, we need * to reset TIF_32BIT when unmapping the pages, otherwise do_munmap * enters an infinite loop! */ #if defined(TIF_ADDR32) /* Nothing to do here */ #elif defined(TIF_32BIT) #define TIF_ADDR32 TIF_32BIT #elif defined(TIF_IA32) #define TIF_ADDR32 TIF_IA32 #endif int fiddle_tif_addr32 = test_thread_flag(TIF_ADDR32) && (orig_personality != PER_LINUX32); #endif mm = current->mm; r = read_kern(ctx, file, &mm_info, sizeof(mm_info)); if (r != sizeof(mm_info)) { goto bad_read; } #if HAVE_MM_MMAP_BASE r = read_kern(ctx, file, &mmap_base, sizeof(mmap_base)); if (r != sizeof(mmap_base)) { goto bad_read; } #endif #if BITS_PER_LONG == 64 if (fiddle_tif_addr32) { clear_thread_flag(TIF_ADDR32); } #endif /* Purge current maps - I'm sure there's a way to keep theses around * incase creation of the new ones fails in some unfortunate way... */ while(mm->mmap) { map = mm->mmap; map_count = mm->map_count; if (map->vm_start >= TASK_SIZE) { /* a special high mapping - leave it in place */ BUG_ON(map->vm_next); break; } r = do_munmap(mm, map->vm_start, map->vm_end - map->vm_start); if (r) { CR_ERR_CTX(ctx, "do_munmap(%lx, %lx) = %d", map->vm_start, map->vm_end-map->vm_start, (int)r); } if (map_count == mm->map_count) { CR_ERR_CTX(ctx, "do_munmap() loop stuck."); r = -EINVAL; goto bad_read; } } #if BITS_PER_LONG == 64 if (fiddle_tif_addr32) { set_thread_flag(TIF_ADDR32); } #endif /* (re)set mm paramaters which influence get_unmapped_area() */ down_write(¤t->mm->mmap_sem); #if HAVE_MM_TASK_SIZE mm->task_size = TASK_SIZE; #endif #if defined(CR_KCODE_arch_pick_mmap_layout) arch_pick_mmap_layout(mm); #endif #if HAVE_MM_MMAP_BASE /* want to restore these even if arch_pick_mmap_layout() set them */ mm->mmap_base = mmap_base; mm->free_area_cache = mmap_base; #else mm->free_area_cache = TASK_UNMAPPED_BASE; #endif #if HAVE_MM_CACHED_HOLE_SIZE mm->cached_hole_size = ~0UL; #endif up_write(¤t->mm->mmap_sem); /* Load new map data */ r = read_kern(ctx, file, &mapheader, sizeof(mapheader)); while (r == sizeof(mapheader) && (mapheader.start != ~0 || mapheader.end != ~0)) { if ((r = load_map(ctx, file, &mapheader))) goto bad_read; r = read_kern(ctx, file, &mapheader, sizeof(mapheader)); } if (r != sizeof(mapheader)) goto bad_read; down_write(¤t->mm->mmap_sem); mm->start_code = mm_info.start_code; mm->end_code = mm_info.end_code; mm->start_data = mm_info.start_data; mm->end_data = mm_info.end_data; mm->start_brk = mm_info.start_brk; mm->brk = mm_info.brk; mm->start_stack= mm_info.start_stack; /* FIX ME: validate these pointers */ mm->arg_start = mm_info.arg_start; mm->arg_end = mm_info.arg_end; mm->env_start = mm_info.env_start; mm->env_end = mm_info.env_end; up_write(¤t->mm->mmap_sem); } #if 0 /* Hooks code not needed/maintained for BLCR */ /*--- Call external thaw hooks ---------------------------------*/ r = do_thaw_hooks(ctx, file, regs); if (r) goto bad_read; #endif return pid; bad_read: if (r >= 0) r = -EIO; return r; } /*-------------------------------------------------------------------- * Process "freezing" routines *------------------------------------------------------------------*/ /* This routine walks the page tables. * If addr is a huge page, returns NULL and sets *pagep non-null * If addr is not in the page tables, returns NULL and sets *pagep=NULL * Otherwise returns non-NULL (w/ *pagep undefined) and caller must pte_unmap(). */ static inline pte_t *vmad_follow_addr(struct page **pagep, struct mm_struct *mm, unsigned long addr) { pgd_t *pgd; #ifdef PTRS_PER_PUD pud_t *pud; #endif pmd_t *pmd; #if !defined(CONFIG_HUGETLBFS) /* Nothing to do here */ #elif HAVE_4_ARG_FOLLOW_HUGE_ADDR struct vm_area_struct *vma = hugepage_vma(mm, addr); if (vma) { *pagep = follow_huge_addr(mm, vma, addr, 0); return NULL; } #elif HAVE_3_ARG_FOLLOW_HUGE_ADDR struct page *pg = follow_huge_addr(mm, addr, 0); if (!IS_ERR(pg)) { *pagep = pg; return NULL; } #else #error "No way to call follow_huge_addr()" #endif *pagep = NULL; pgd = pgd_offset(mm, addr); if (pgd_none(*pgd)) return NULL; #ifdef PTRS_PER_PUD pud = pud_offset(pgd, addr); if (pud_none(*pud)) return NULL; pmd = pmd_offset(pud, addr); #else pmd = pmd_offset(pgd, addr); #endif if (pmd_none(*pmd)) return NULL; #ifdef CONFIG_HUGETLBFS if (pmd_huge(*pmd)) { *pagep = follow_huge_pmd(mm, addr, pmd, 0); return NULL; } #endif return pte_offset_map(pmd, addr); } /* This routine checks if a page from a filemap has been copied via * copy on write. Basically, this is just checking to see if the page * is still a member of the map or not. Note this this should not end * up copying random things from VM_IO regions. */ static int addr_copied(struct mm_struct *mm, unsigned long addr) { pte_t *ptep; struct page *pg; int ret; #if !HAVE_PAGEANON #define PageAnon(pg) (!(pg)->mapping) #endif spin_lock(&mm->page_table_lock); ptep = vmad_follow_addr(&pg, mm, addr); if (ptep) { pte_t pte = *ptep; pte_unmap(ptep); if (pte_present(pte)) { pg = pte_page(pte); ret = PageAnon(pg); } else { /* pte_none is false for a swapped (written) page */ ret = !pte_none(pte); } } else { ret = pg && PageAnon(pg); } spin_unlock(&mm->page_table_lock); return ret; } /* This is the version for working on a region that is a file map. In * this case we need to fault the page in to check for zero. This * isn't a big deal since we'll be faulting in for sending anyway if * it's not. */ static int addr_nonzero_file(struct mm_struct *mm, unsigned long addr) { int i; unsigned long val = 0; /* Simple zero check */ for (i=0; i < (PAGE_SIZE/sizeof(long)); i++) { /* We ignore EFAULT and presume that it's zero here */ get_user(val, (((long*)addr)+i)); if (val) return 1; } return 0; } /* This version is for use on regions which are *NOT* file maps. Here * we look at the page tables to see if a page is zero. If it's never * been faulted in, we know it's zero - and we don't fault it in while * checking for this. */ static int addr_nonzero(struct mm_struct *mm, unsigned long addr) { int i; struct page *pg; pte_t *ptep; unsigned long val; spin_lock(&mm->page_table_lock); ptep = vmad_follow_addr(&pg, mm, addr); if (ptep) { pte_t pte = *ptep; pte_unmap(ptep); if (pte_none(pte)) goto out_zero; /* Never faulted */ if (pte_present(pte) && (pte_page(pte) == ZERO_PAGE(addr))) goto out_zero; /* Only READ faulted */ } else if (!pg) { goto out_zero; } spin_unlock(&mm->page_table_lock); /* Ok, the page could be non-zero - check it... */ for (i=0; i < (PAGE_SIZE/sizeof(long)); i++) { get_user(val, (((long*)addr)+i)); if (val) return 1; } return 0; out_zero: spin_unlock(&mm->page_table_lock); return 0; } /* Writes out the header giving the reader the number of bytes of * "fill", and returns that value in *buf_len. * ONLY if "fill" is smaller than VMAD_CHUNKHEADER_MIN bytes is * the corresponding padding written here. * A "fill" of PAGE_SIZE means we are NOT going to use O_DIRECT */ static long store_page_list_header(cr_chkpt_proc_req_t *ctx, struct file *file, void *buf, unsigned int *buf_len, int *use_directio) { struct vmadump_page_list_header header; long bytes = 0; long r; unsigned int fill; const int have_directio = directio_avail(file); fill = have_directio ? PAGE_SIZE - ((file->f_pos + sizeof(header)) & (PAGE_SIZE - 1)) : PAGE_SIZE; header.fill = fill; r = write_kern(ctx, file, &header, sizeof(header)); if (r != sizeof(header)) goto bad_write; bytes += r; if (!fill || (fill == PAGE_SIZE)) { /* no padding at all */ } else if (fill < VMAD_CHUNKHEADER_MIN) { /* TODO: seek when possible? */ r = write_kern(ctx, file, buf, fill); if (r != fill) goto bad_write; bytes += r; } else { /* Padding is large enough to use for the page headers */ *buf_len = fill; } *use_directio = have_directio; return bytes; bad_write: if (r >= 0) r = -EIO; /* Map short writes to EIO */ return r; } /* * Returns < 0 on failure, or written byte count on success. */ static long store_page_chunks(cr_chkpt_proc_req_t *ctx, struct file *file, struct vmadump_page_header *headers, int sizeof_headers, int use_directio) { unsigned long old_filp_flags = 0; unsigned long chunk_start; long r, bytes = 0; int i; const int num_headers = sizeof_headers/sizeof(*headers); r = write_kern(ctx, file, headers, sizeof_headers); if (r != sizeof_headers) goto bad_write; bytes += r; /* Avoid directio_start/stop if there is no page I/O */ if (headers[0].start == VMAD_END_OF_CHUNKS) goto empty; /* * attempt to set up direct IO for the chunk writes. */ if (use_directio) old_filp_flags = directio_start(file); for (i=0; i= 0) r = -EIO; /* Map short writes to EIO */ return r; } /* Add an element to the chunks array, and if its full or "finished" then * write the chunks array. Elements with zero pages are omitted. * "Finished" is defined as having start == VMAD_END_OF_CHUNKS in this chunk. * * Returns the number of bytes written (could be zero), or <0 on error. * If data was written, then sizeof_chunks and chunk_number are reset. * * chunks - the chunks array to write * *sizeof_chunks - length of chunks in BYTES * *chunk_number - next unoccupied entry in array */ static inline loff_t write_chunk(cr_chkpt_proc_req_t *ctx, struct file *file, struct vmadump_page_header *chunks, unsigned int *sizeof_chunks, int *chunk_number, unsigned long start, unsigned long num_pages, int use_directio) { long r = 0; /* Add an element to the array unless is would be empty*/ if (num_pages || (start == VMAD_END_OF_CHUNKS)) { const int max_chunks = *sizeof_chunks/sizeof(*chunks); int index; index = (*chunk_number)++; chunks[index].start = start; chunks[index].num_pages = num_pages; /* Write the array if full or finished */ if (((index + 1) >= max_chunks) || (start == VMAD_END_OF_CHUNKS)) { r = store_page_chunks(ctx, file, chunks, *sizeof_chunks, use_directio); *sizeof_chunks = VMAD_CHUNKHEADER_SIZE; *chunk_number = 0; } } return r; } /* * SOMEDAY: we may want a field in vmadump_page_header for page hashes * * SOMEDAY: add a buffer argument through some of these routines * so that we can put compression in there. */ static loff_t store_page_list(cr_chkpt_proc_req_t * ctx, struct file *file, unsigned long start, unsigned long end, int (*need_to_save) (struct mm_struct * mm, unsigned long)) { long r; loff_t bytes = 0; unsigned long addr; unsigned long chunk_start, chunk_end, num_contig_pages; struct vmadump_page_header *chunks; int chunk_number; unsigned int sizeof_chunks = VMAD_CHUNKHEADER_SIZE; int use_directio = 0; /* A page 'chunk' is a contiguous range of pages in virtual memory. * * We identify the chunks, and store them in the chunks array. * Our calls to write_chunk() will write all of the chunks out when needed, * and will start filling the chunks array back from the beginning. */ chunks = (struct vmadump_page_header *) cr_kzalloc(sizeof_chunks, GFP_KERNEL); if (chunks == NULL) { r = -ENOMEM; } /* * TODO: Move this alignment step outward, perhaps as far as freeze_proc? */ /* Handle alignment of the current file pointer to a page boundary for direct IO. * The "fill" required to acheive alignment is used for the first array of chunks * if large enough. Otherwise it is written as zeros for padding. */ r = store_page_list_header(ctx, file, chunks, &sizeof_chunks, &use_directio); if (r < 0) { goto out_kfree; } bytes += r; /* * Ok, this loop does all the work. We're going to make a pass through. */ chunk_start = chunk_end = start; num_contig_pages = 0; chunk_number = 0; for (addr = start; addr < end; addr += PAGE_SIZE) { /* The topmost if clause (need_to_save) is to identify things like * unmodified pages that can be reread from disk, or pages that were * allocated and never touched (zero pages). */ if (need_to_save(current->mm, addr)) { /* test for contiguous pages. (chunk_end == addr) * * break up a contiguous page range if too large, (num < ...) */ if (chunk_end == addr) { num_contig_pages++; } else { r = write_chunk(ctx, file, chunks, &sizeof_chunks, &chunk_number, chunk_start, num_contig_pages, use_directio); if (r < 0) goto out_io; bytes += r; /* Start a new chunk */ chunk_start = addr; num_contig_pages = 1; } /* this is part of the current chunk */ chunk_end = addr + PAGE_SIZE; } } /* store the last chunk */ r = write_chunk(ctx, file, chunks, &sizeof_chunks, &chunk_number, chunk_start, num_contig_pages, use_directio); if (r < 0) goto out_io; bytes += r; /* now store a record marking the end of the chunks, * which should force writting of the chunks array */ r = write_chunk(ctx, file, chunks, &sizeof_chunks, &chunk_number, VMAD_END_OF_CHUNKS, 0, use_directio); if (r < 0) goto out_io; if (r == 0) { /* This absolutely should not happen. At the very least an EOF * record should have been written. */ printk("write_chunks unexpectedly returned 0!\n"); } bytes += r; out_io: out_kfree: kfree(chunks); if (r < 0) { return r; } else { return bytes; } } loff_t vmadump_store_page_list(cr_chkpt_proc_req_t *ctx, struct file *file, unsigned long start, unsigned long end) { return store_page_list(ctx, file, start, end, addr_nonzero_file); } loff_t vmadump_store_dirty_page_list(cr_chkpt_proc_req_t *ctx, struct file *file, unsigned long start, unsigned long end) { return store_page_list(ctx, file, start, end, addr_copied); } static loff_t store_map(cr_chkpt_proc_req_t *ctx, struct file *file, struct vm_area_struct *map, int flags) { loff_t bytes; struct vmadump_vma_header head; char *filename=0; char *buffer = 0; loff_t r; unsigned long start, end; int isfilemap = 0; #if VMAD_HAVE_ARCH_MAPS r = vmad_store_arch_map(ctx, file, map, flags); if (r) return r; #endif /* Never store a VM_IO region */ if (map->vm_flags & VM_IO) { return 0; } head.start = map->vm_start; head.end = map->vm_end; head.flags = map->vm_flags; head.namelen = 0; head.pgoff = map->vm_pgoff; /* Decide Whether or not we're gonna store the map's contents or * a reference to the file they came from */ if (map->vm_file) { buffer = (char *) __get_free_page(GFP_KERNEL); if (!buffer) { return -ENOMEM; } #if 0 /* Not supported in BLCR */ if (ctx && ctx->map_name) filename = ctx->map_name(ctx, map->vm_file, buffer, PAGE_SIZE); else #endif filename = default_map_name(map->vm_file, buffer, PAGE_SIZE); head.namelen = strlen(filename); if (vmad_is_special_mmap(map, flags)) { /* Let BLCR deal with it */ free_page((long)buffer); return 0; } else if (vmad_dentry_unlinked(map->vm_file->f_dentry)) { /* Region is an unlinked file - store contents, not filename */ head.namelen = 0; } else if (vmad_is_exe(map)) { /* Region is an executable */ if (flags & VMAD_DUMP_EXEC) head.namelen = 0; } else if (is_library(filename)) { /* Region is a library */ if (flags & VMAD_DUMP_LIBS) head.namelen = 0; } else { /* Region is something else */ if (flags & VMAD_DUMP_OTHER) head.namelen=0; } isfilemap = 1; } start = map->vm_start; end = map->vm_end; /* Release the mm_sem here to avoid deadlocks with page faults and * write locks that may happen during the writes. (We can't use * the "map" pointer beyond this point. */ up_read(¤t->mm->mmap_sem); /* Spit out the section header */ r = write_kern(ctx, file, &head, sizeof(head)); if (r != sizeof(head)) goto err; bytes = r; if (head.namelen > 0) { /* Store the filename */ r = write_kern(ctx, file, filename, head.namelen); if (r != head.namelen) goto err; bytes += r; r = store_page_list(ctx, file, start, end, addr_copied); if (r < 0) goto err; bytes += r; } else { /* Store the contents of the VMA as defined by start, end */ r = store_page_list(ctx, file, start, end, isfilemap ? addr_nonzero_file : addr_nonzero); if (r < 0) goto err; bytes += r; } if (buffer) free_page((long)buffer); down_read(¤t->mm->mmap_sem); return bytes; err: if (r >= 0) r = -EIO; /* Map short writes to EIO */ if (buffer) free_page((long)buffer); down_read(¤t->mm->mmap_sem); return r; } static long vmadump_store_sigpending(cr_chkpt_proc_req_t *ctx, struct file *file, struct sigpending *sigpending) { sigset_t pending_set; long bytes = 0, r; struct list_head *elem; int flags; /* We know the list can't shrink (as all threads are stopped), * So, we are playing a bit loose w/ the locking. */ spin_lock_irq(¤t->sighand->siglock); list_for_each(elem, &sigpending->list) { struct sigqueue *q = list_entry(elem, struct sigqueue, list); struct siginfo tmp_info, info; mm_segment_t oldfs; flags = q->flags; tmp_info = q->info; spin_unlock_irq(¤t->sighand->siglock); /* copy_siginfo_to_user() copies only non-padding fields */ memset(&info, 0, sizeof(info)); oldfs = get_fs(); set_fs(KERNEL_DS); r = copy_siginfo_to_user(&info, &tmp_info); set_fs(oldfs); if (r) goto err; r = write_kern(ctx, file, &flags, sizeof(flags)); if (r != sizeof(flags)) goto err; bytes += r; r = write_kern(ctx, file, &info, sizeof(info)); if (r != sizeof(info)) goto err; bytes += r; spin_lock_irq(¤t->sighand->siglock); } memcpy(&pending_set, &sigpending->signal, sizeof(pending_set)); spin_unlock_irq(¤t->sighand->siglock); /* Flags == -1 marks end of the list */ flags = -1; r = write_kern(ctx, file, &flags, sizeof(flags)); if (r != sizeof(flags)) goto err; bytes += r; /* Corresponding signal set comes last */ r = write_kern(ctx, file, &pending_set, sizeof(pending_set)); if (r != sizeof(pending_set)) goto err; bytes += r; return bytes; err: if (r >= 0) r = -EIO; /* Map short writes to EIO */ return r; } static long vmadump_store_prctl_aux(cr_chkpt_proc_req_t *ctx, struct file *file, int option, int type, void *addr, int len) { struct vmad_prctl header; long r; long bytes = 0; header.option = option; header.type = type; r = write_kern(ctx, file, &header, sizeof(header)); if (r != sizeof(header)) goto err; bytes += r; if (len) { r = write_kern(ctx, file, addr, len); if (r != len) goto err; bytes += r; } return bytes; err: if (r >= 0) r = -EIO; /* Map short writes to EIO */ return r; } static int vmadump_store_prctl(cr_chkpt_proc_req_t *ctx, struct file *file) { long r; long bytes = 0; int i; const static struct { int type; int get_option; int set_option; } vmad_prctl_tbl[] = { #if defined(PR_GET_PDEATHSIG) {vmad_prctl_int_ref, PR_GET_PDEATHSIG, PR_SET_PDEATHSIG}, #endif #if defined(PR_GET_DUMPABLE) {vmad_prctl_bool, PR_GET_DUMPABLE, PR_SET_DUMPABLE}, #endif #if defined(PR_GET_UNALIGN) && defined(GET_UNALIGN_CTL) {vmad_prctl_int_ref, PR_GET_UNALIGN, PR_SET_UNALIGN}, #endif #if defined(PR_GET_KEEPCAPS) {vmad_prctl_bool, PR_GET_KEEPCAPS, PR_SET_KEEPCAPS}, #endif #if defined(PR_GET_FPEMU) && defined(GET_FPEMU_CTL) {vmad_prctl_int_ref, PR_GET_FPEMU, PR_SET_FPEMU}, #endif #if defined(PR_GET_FPEXC) && defined(GET_FPEXC_CTL) {vmad_prctl_int_ref, PR_GET_FPEXC, PR_SET_FPEXC}, #endif #if defined(PR_GET_TIMING) {vmad_prctl_int_val, PR_GET_TIMING, PR_SET_TIMING}, #endif #if defined(PR_GET_ENDIAN) && defined(GET_ENDIAN) {vmad_prctl_int_ref, PR_GET_ENDIAN, PR_SET_ENDIAN}, #endif #if defined(PR_GET_SECCOMP) {vmad_prctl_int_val, PR_GET_SECCOMP, PR_SET_SECCOMP}, #endif #if defined(PR_GET_TSC) && defined(GET_TSC_CTL) {vmad_prctl_int_ref, PR_GET_TSC, PR_SET_TSC}, #endif #if defined(PR_GET_TIMERSLACK) {vmad_prctl_int_val, PR_GET_TIMERSLACK, PR_SET_TIMERSLACK}, #endif }; /* First the comm, which was not handled via prctl prior to 2.6.9 */ #if defined(PR_GET_NAME) { char value[TASK_COMM_LEN]; r = vmadump_prctl_k(PR_GET_NAME, &value); if (r < 0) goto err; r = vmadump_store_prctl_aux(ctx, file, PR_SET_NAME, vmad_prctl_comm, &value, sizeof(value)); if (r < 0) goto err; bytes += r; } #else /* Value of header.option is ignored, but use PR_SET_NAME to lessen confusion */ if (sizeof(current->comm) != TASK_COMM_LEN) { CR_ERR_CTX(ctx, "vmadump: TASK_COMM_LEN changed?"); r = -EINVAL; goto err; } r = vmadump_store_prctl_aux(ctx, file, 15 /* PR_SET_NAME */, vmad_prctl_comm, ¤t->comm, TASK_COMM_LEN); if (r < 0) goto err; bytes += r; #endif /* Now all the rest */ for (i = 0; i < sizeof(vmad_prctl_tbl)/sizeof(vmad_prctl_tbl[0]); ++i) { unsigned int value; const int type = vmad_prctl_tbl[i].type; const int get = vmad_prctl_tbl[i].get_option; const int set = vmad_prctl_tbl[i].set_option; switch (type) { case vmad_prctl_bool: r = vmadump_prctl_v(get, 0); if (!IS_ERR((void *)r)) { /* ICK */ value = r ? 1 : 0; r = 0; } break; case vmad_prctl_int_val: r = vmadump_prctl_v(get, 0); if (!IS_ERR((void *)r)) { /* ICK */ value = (unsigned int)r; r = 0; } break; case vmad_prctl_int_ref: r = vmadump_prctl_k(get, &value); break; } if (r < 0) { #if 0 /* Confusing when issued, for instance, for PR_GET_ENDIAN where CPU lacks support */ CR_WARN_CTX(ctx, "vmadump warning: failed to read prtcl(%d) err %ld", get, r); #endif continue; } r = vmadump_store_prctl_aux(ctx, file, set, type, &value, sizeof(value)); if (r < 0) goto err; bytes += r; } /* Write the list terminator */ r = vmadump_store_prctl_aux(ctx, file, 0, 0, NULL, 0); if (r < 0) goto err; bytes += r; return bytes; err: if (r >= 0) r = -EIO; /* Map short writes to EIO */ return r; } loff_t vmadump_freeze_proc(cr_chkpt_proc_req_t *ctx, struct file *file, struct pt_regs *regs, int flags) { loff_t r, bytes=0; static struct vmadump_header header ={VMAD_MAGIC, VMAD_FMT_VERS, VMAD_ARCH, (LINUX_VERSION_CODE >> 16) & 0xFF, (LINUX_VERSION_CODE >> 8) & 0xFF, LINUX_VERSION_CODE & 0xFF }; /*--- Write out the file header ---*/ r = write_kern(ctx, file, &header, sizeof(header)); if (r != sizeof(header)) goto err; bytes += r; #if 0 /* Now handled w/ other prctl values */ if (!(flags & VMAD_DUMP_REGSONLY)) { r = write_kern(ctx, file, current->comm, sizeof(current->comm)); if (r != sizeof(current->comm)) goto err; bytes += r; } #endif vmadump_store_prctl(ctx, file); /*--- PID ---*/ r = write_kern(ctx, file, ¤t->pid, sizeof(current->pid)); if (r != sizeof(current->pid)) goto err; bytes += r; /*--- Credentials (uids, gids and supplemental ids) ---*/ r = cr_save_creds(ctx); if (r < 0) goto err; bytes += r; /*--- CPU State Information ------------------------------------*/ r = vmadump_store_cpu(ctx, file, regs); if (r < 0) goto err; bytes += r; /*--- Signal information ---------------------------------------*/ { int i; stack_t sig_stack; sigset_t sig_blocked; struct k_sigaction sig_action; r = vmadump_sigaltstack_k(NULL, &sig_stack); if (r < 0) goto err; r = write_kern(ctx, file, &sig_stack, sizeof(sig_stack)); if (r != sizeof(sig_stack)) goto err; bytes += r; spin_lock_irq(¤t->sighand->siglock); memcpy(&sig_blocked, ¤t->blocked, sizeof(sig_blocked)); spin_unlock_irq(¤t->sighand->siglock); r = write_kern(ctx, file, &sig_blocked, sizeof(sig_blocked)); if (r != sizeof(sig_blocked)) goto err; bytes += r; r = vmadump_store_sigpending(ctx, file, ¤t->pending); if (r < 0) goto err; bytes += r; if (!(flags & VMAD_DUMP_REGSONLY)) { /* Dump shared queue if not actually shared, or if we are the "leader" */ r = vmadump_store_sigpending(ctx, file, ¤t->signal->shared_pending); if (r < 0) goto err; bytes += r; } if (!(flags & VMAD_DUMP_REGSONLY)) { for (i=0; i < _NSIG; i++) { spin_lock_irq(¤t->sighand->siglock); memcpy(&sig_action, ¤t->sighand->action[i], sizeof(sig_action)); spin_unlock_irq(¤t->sighand->siglock); r = write_kern(ctx, file, &sig_action, sizeof(sig_action)); if (r != sizeof(sig_action)) goto err; bytes += r; } } } /*--- Misc other stuff -----------------------------------------*/ r = write_kern(ctx, file, ¤t->clear_child_tid, sizeof(current->clear_child_tid)); if (r != sizeof(current->clear_child_tid)) goto err; bytes += r; { /* personality */ unsigned long tmp_personality = current->personality; r = write_kern(ctx, file, &tmp_personality, sizeof(tmp_personality)); if (r != sizeof(tmp_personality)) goto err; bytes += r; } /* XXX Will we need FUTEX related stuff here as well? */ /*--- Memory Information ---------------------------------------*/ if (!(flags & VMAD_DUMP_REGSONLY)) { struct vm_area_struct *map, *next_map; struct vmadump_mm_info mm_info; struct mm_struct *mm = current->mm; struct vmadump_vma_header term; unsigned long next_addr; #if HAVE_MM_MMAP_BASE unsigned long mmap_base; #endif down_read(&mm->mmap_sem); mm_info.start_code = mm->start_code; mm_info.end_code = mm->end_code; mm_info.start_data = mm->start_data; mm_info.end_data = mm->end_data; mm_info.start_brk = mm->start_brk; mm_info.brk = mm->brk; mm_info.start_stack = mm->start_stack; mm_info.arg_start = mm->arg_start; mm_info.arg_end = mm->arg_end; mm_info.env_start = mm->env_start; mm_info.env_end = mm->env_end; #if HAVE_MM_MMAP_BASE mmap_base = mm->mmap_base; #endif up_read(&mm->mmap_sem); r = write_kern(ctx, file, &mm_info, sizeof(mm_info)); if (r != sizeof(mm_info)) goto err; bytes += r; #if HAVE_MM_MMAP_BASE r = write_kern(ctx, file, &mmap_base, sizeof(mmap_base)); if (r != sizeof(mmap_base)) goto err; bytes += r; #endif down_read(&mm->mmap_sem); next_map = mm->mmap; next_addr = next_map ? next_map->vm_start : 0; while (next_map) { /* Call vma_find() to find the map we're looking for. We * have to do it this way because store_map needs to release * the mmap_sem. */ map = find_vma(mm, next_addr); if (map != next_map) break; next_map = map->vm_next; next_addr = next_map ? next_map->vm_start : 0; r = store_map(ctx, file, map, flags); if (r < 0) { up_read(&mm->mmap_sem); goto err; } bytes += r; } up_read(&mm->mmap_sem); /* Terminate maps list */ term.start = term.end = ~0L; r = write_kern(ctx, file, &term, sizeof(term)); if (r != sizeof(term)) goto err; bytes += r; } #if 0 /* Hooks code not needed/maintained for BLCR */ /*--- Call freeze hooks ----------------------------------------*/ r = do_freeze_hooks(ctx, file, regs, flags); if (r < 0) goto err; bytes += r; #endif return bytes; err: if (r >= 0) r = -EIO; /* Map short writes to EIO */ return r; } /*-------------------------------------------------------------------- * syscall interface *------------------------------------------------------------------*/ #if 0 /* Not needed/maintained for BLCR */ long do_vmadump(long op, long arg0, long arg1, struct pt_regs *regs) { long retval; struct file *file; switch (op) { case VMAD_DO_DUMP: if (arg1 & ~VMAD_FLAG_USER_MASK) { retval = -EINVAL; break; } if ((file = fget(arg0))) { retval = vmadump_freeze_proc(0, file, regs, arg1, 1); fput(file); } else retval = -EBADF; break; case VMAD_DO_UNDUMP: if ((file = fget(arg0))) { retval = vmadump_thaw_proc(0, file, regs, 0, NULL); fput(file); } else retval = -EBADF; /* Un-dump is a whole lot like exec() */ if (retval == 0) { if (current->euid == current->uid && current->egid == current->gid) current->mm->dumpable = 1; current->did_exec = 1; current->self_exec_id++; if (current->ptrace & PT_PTRACED) send_sig(SIGTRAP, current, 0); } break; case VMAD_DO_EXECDUMP: { struct vmadump_execdump_args args; char * filename; if (copy_from_user(&args, (void *) arg0, sizeof(args))) { retval = -EFAULT; break; } if (args.flags & ~VMAD_FLAG_USER_MASK) { retval = -EINVAL; break; } filename = getname(args.arg0); retval = PTR_ERR(filename); if (IS_ERR(filename)) break; file = fget(args.fd); if (!file) { retval = -EBADF; putname(filename); break; } retval = do_execve(filename, (char **)args.argv, (char **)args.envp, regs); putname(filename); if (retval) { fput(file); break; } /* Check to make sure we're actually allowed to dump :) */ if (!current->mm->dumpable) { fput(file); do_exit(-EPERM); } retval = vmadump_freeze_proc(0, file, regs, args.flags, 1); fput(file); if (retval > 0) retval = 0; do_exit(retval); /* Ok, we're done... */ /* NOT REACHED */ } break; case VMAD_LIB_CLEAR: case VMAD_LIB_ADD: case VMAD_LIB_DEL: case VMAD_LIB_LIST: case VMAD_LIB_SIZE: lock_kernel(); /* very very lazy... */ retval = do_lib_op(op, (char *) arg0, arg1); unlock_kernel(); break; default: retval = -EINVAL; } return retval; } #endif /*-------------------------------------------------------------------- * New binary format code *------------------------------------------------------------------*/ #ifdef HAVE_BINFMT_VMADUMP static int load_vmadump(struct linux_binprm *bprm, struct pt_regs *regs) { int retval; struct vmadump_header *header; header = (struct vmadump_header *) bprm->buf; if (memcmp(header->magic, vmad_magic, sizeof(header->magic)) != 0 || header->fmt_vers != VMAD_FMT_VERS || header->major != ((LINUX_VERSION_CODE >> 16) & 0xFF) || header->minor != ((LINUX_VERSION_CODE >> 8) & 0xFF) #if defined(STRICT_VERSION_CHECK) && STRICT_VERSION_CHECK || header->patch != (LINUX_VERSION_CODE & 0xFF) #endif ) return -ENOEXEC; if (!bprm->file->f_op || !bprm->file->f_op->mmap) return -ENOEXEC; retval = vmadump_thaw_proc(0, bprm->file, regs, 0, NULL); if (retval == 0) { if (current->euid == current->uid && current->egid == current->gid) current->mm->dumpable = 1; current->did_exec = 1; current->self_exec_id++; #if 0 if (current->exec_domain && current->exec_domain->module) __MOD_DEC_USE_COUNT(current->exec_domain->module); if (current->binfmt && current->binfmt->module) __MOD_DEC_USE_COUNT(current->binfmt->module); current->exec_domain = 0; #endif current->binfmt = 0; } return retval; } struct linux_binfmt vmadump_fmt = { 0,THIS_MODULE,load_vmadump,0,0,0 }; #endif /* This is some stuff that allows vmadump to latch onto the BProc * syscall for testing purposes. */ #ifdef CONFIG_BPROC static int syscall = 0; MODULE_PARM(syscall, "i"); MODULE_PARM_DESC(syscall, "Syscall number to allow calling VMADump directly. The default (0) means " "no VMADump syscall. There is no bounds check on the syscall number so " "be careful with this option."); #endif int __init vmadump_init_module(void) { CR_INFO("vmadump: (from bproc-%s) Erik Hendriks " "", __stringify(BPROC_VERSION)); CR_INFO("vmadump: Modified for %s <%s>", PACKAGE_STRING, PACKAGE_BUGREPORT); /* Check for correct blcr_imports */ if (strcmp(blcr_config_timestamp, BLCR_CONFIG_TIMESTAMP)) { CR_ERR("vmadump: Module blcr_imports timestamp (%s) does not match that of blcr_vmadump (" BLCR_CONFIG_TIMESTAMP ").", blcr_config_timestamp); return -EINVAL; } #if 0 /* Not needed/maintained for BLCR */ init_rwsem(&hook_lock); #endif #ifdef CONFIG_BPROC { /*extern struct rw_semaphore do_bproc_lock;*/ extern long (*do_bproc_ptr)(long,long,long,struct pt_regs *); /*down_write(&do_bproc_lock);*/ do_bproc_ptr = 0; if (syscall) { if (do_bproc_ptr) printk("vmadump: BProc syscall hook is occupied. " "Can't attach to BProc syscall.\n"); else { do_bproc_ptr = do_vmadump; printk("vmadump: Attached to BProc syscall.\n"); } } /*up_write(&do_bproc_lock);*/ } #endif #ifdef HAVE_BINFMT_VMADUMP register_binfmt(&vmadump_fmt); #endif return 0; } void __exit vmadump_cleanup_module(void) { #if 0 /* Not needed/maintained for BLCR */ liblist_clear(); #endif #ifdef HAVE_BINFMT_VMADUMP unregister_binfmt(&vmadump_fmt); #endif #ifdef CONFIG_BPROC { /*extern struct rw_semaphore do_bproc_lock;*/ extern long (*do_bproc_ptr)(long,long,long,struct pt_regs *); if (syscall) { /*down_write(&do_bproc_lock);*/ if (do_bproc_ptr == do_vmadump) do_bproc_ptr = 0; /*up_write(&do_bproc_lock);*/ } } #endif } #if 0 /* EXPORTs are not needed/maintained for BLCR */ EXPORT_SYMBOL(vmadump_freeze_proc); EXPORT_SYMBOL(vmadump_thaw_proc); EXPORT_SYMBOL(do_vmadump); EXPORT_SYMBOL(vmadump_add_hook); EXPORT_SYMBOL(vmadump_del_hook); EXPORT_SYMBOL(vmadump_read_u); EXPORT_SYMBOL(vmadump_read_k); EXPORT_SYMBOL(vmadump_write_u); EXPORT_SYMBOL(vmadump_write_k); #endif /* * Local variables: * c-basic-offset: 4 * End: */ blcr-0.8.5/vmadump4/license.txt0000664000000000000000000000143710155436066013272 00000000000000This 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 If you are recieving this as part of BLCR, you will find the GNU GPL in the file COPYING in the top-level BLCR directory. blcr-0.8.5/vmadump4/vmadlib.c0000664000000000000000000001053610155426263012667 00000000000000/*------------------------------------------------------------------------- * vmadlib.c: vmadump library management program * * Copyright (C) 1999-2001 by Erik Hendriks * * 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 * * $Id: vmadlib.c,v 1.3 2004/12/07 22:20:35 phargrov Exp $ *-----------------------------------------------------------------------*/ #include #include #include #include #include #include #include "vmadump.h" void usage(char *arg0) { printf( "Usage: %s -c\n" " %s -a [libs...] \n" " %s -d [libs...] \n" " %s -l\n" "\n" " This program manages the VMAdump in-kernel library list.\n" " -h Display this message and exit.\n" " -v Display version information and exit.\n" " -c Clear kernel library list.\n" " -a [libs...] Add to the kernel library list.\n" " -d [libs...] Delete from the kernel library list.\n" " -l Print the contents of the kernel library list.\n", arg0, arg0, arg0, arg0); } enum { MODE_CLEAR, MODE_ADD, MODE_DEL, MODE_LIST }; #ifdef __NR_vmadump static void add_lib(char *libname) { if (syscall(__NR_vmadump, VMAD_LIB_ADD, libname) == -1) { perror(libname); exit(1); } } static void remove_lib(char *libname) { if (syscall(__NR_vmadump, VMAD_LIB_DEL, libname) == -1) { perror(libname); /*exit(1);*/ } } static void clear_libs(void) { if (syscall(__NR_vmadump, VMAD_LIB_CLEAR) == -1) { perror("VMAD_LIB_CLEAR"); exit(1); } } #else static void add_lib(char *libname) { if (bproc_libadd(libname)) { perror(libname); exit(1); } } static void remove_lib(char *libname) { if (bproc_libdel(libname)) { perror(libname); } } static void clear_libs(vois) { if (bproc_libclear()) { perror("VMAD_LIB_CLEAR"); exit(1); } } #endif static void remove_trailing_newline(char *line) { int len; len = strlen(line); if (line[len-1] == '\n') line[len-1] = 0; } int main(int argc, char *argv[]) { int c,i; int mode = -1; int len; char buf[PATH_MAX]; char *listbuf, *p; while((c=getopt(argc, argv, "hvclad")) != EOF) { switch(c) { case 'h': usage(argv[0]); exit(0); case 'v': printf("%s version %s\n", argv[0], PACKAGE_VERSION); exit(0); case 'c': mode = MODE_CLEAR; break; case 'l': mode = MODE_LIST; break; case 'a': mode = MODE_ADD; break; case 'd': mode = MODE_DEL; break; default: exit(1); } } switch(mode) { case MODE_CLEAR: if (argc - optind != 0) { fprintf(stderr, "No library names allowed with -c\n"); exit(1); } clear_libs(); break; case MODE_ADD: for (i=optind; i < argc; i++) { if (strcmp(argv[i], "-") == 0) { while (fgets(buf, PATH_MAX, stdin)) { remove_trailing_newline(buf); add_lib(buf); } } else add_lib(argv[i]); } break; case MODE_DEL: for (i=optind; i < argc; i++) { if (strcmp(argv[i], "-") == 0) { while (fgets(buf, PATH_MAX, stdin)) { remove_trailing_newline(buf); remove_lib(buf); } } else { remove_lib(argv[i]); } } break; case MODE_LIST: len = syscall(__NR_vmadump, VMAD_LIB_SIZE); if (len == -1) { perror("VMAD_LIB_SIZE"); exit(1); } listbuf = malloc(len); if (!listbuf) { fprintf(stderr, "Out of memory.\n"); exit(1); } if (syscall(__NR_vmadump, VMAD_LIB_LIST, listbuf, len) == -1) { perror("VMAD_LIB_LIST"); exit(1); } /* print out the null delimited list of libraries */ for (p = listbuf; *p; p += strlen(p)+1) printf("%s\n", p); break; default: usage(argv[0]); } exit(0); } /* * Local variables: * c-basic-offset: 4 * End: */ blcr-0.8.5/configure0000775000000000000000000611531112102070003011237 00000000000000#! /bin/sh # From acinclude.m4 Revision: 1.177.14.17 . # From configure.ac Revision: 1.410.2.52 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.63 for blcr 0.8.5. # # Report bugs to . # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. # # # Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) # 2012, The Regents of the University of California, through Lawrence # Berkeley National Laboratory (subject to receipt of any required # approvals from the U.S. Dept. of Energy). All rights reserved. # # Portions may be copyrighted by others, as may be noted in specific # copyright notices within specific files. # # 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 # ## --------------------- ## ## 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 # PATH needs CR # 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_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 if (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 # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false 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. 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); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # Required to use basename. 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 # Name of the executable. 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'` # CDPATH. $as_unset CDPATH if test "x$CONFIG_SHELL" = x; then if (eval ":") 2>/dev/null; then as_have_required=yes else as_have_required=no fi if test $as_have_required = yes && (eval ": (as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=\$LINENO as_lineno_2=\$LINENO test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } ") 2> /dev/null; then : else as_candidate_shells= as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. case $as_dir in /*) for as_base in sh bash ksh sh5; do as_candidate_shells="$as_candidate_shells $as_dir/$as_base" done;; esac done IFS=$as_save_IFS for as_shell in $as_candidate_shells $SHELL; do # Try only shells that exist, to save several forks. if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { ("$as_shell") 2> /dev/null <<\_ASEOF 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 : _ASEOF }; then CONFIG_SHELL=$as_shell as_have_required=yes if { "$as_shell" 2> /dev/null <<\_ASEOF 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_func_return () { (exit $1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = "$1" ); then : else exitcode=1 echo positional parameters were not saved. fi test $exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } _ASEOF }; then break fi fi done if test "x$CONFIG_SHELL" != x; then for as_var in BASH_ENV ENV do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done export CONFIG_SHELL exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi if test $as_have_required = no; then echo This script requires a shell more modern than all the echo shells that I found on your system. Please install a echo modern shell, or manually run the script under such a echo shell if you do have one. { (exit 1); exit 1; } fi fi fi (eval "as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0") || { echo No shell found that supports shell functions. echo Please tell bug-autoconf@gnu.org about your system, echo including any error possibly output before this message. echo This can help us improve future autoconf versions. echo Configuration will now proceed without shell functions. } as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. 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 { (exit 1); exit 1; }; } # 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 } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi 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 -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi else as_ln_s='cp -p' 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=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # 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'" # Check that we are running under the correct shell. SHELL=${CONFIG_SHELL-/bin/sh} case X$lt_ECHO in X*--fallback-echo) # Remove one level of quotation (which was required for Make). ECHO=`echo "$lt_ECHO" | sed 's,\\\\\$\\$0,'$0','` ;; esac ECHO=${lt_ECHO-echo} if test "X$1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X$1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then # Yippee, $ECHO works! : else # Restart under the correct shell. exec $SHELL "$0" --no-reexec ${1+"$@"} fi if test "X$1" = X--fallback-echo; then # used as fallback echo shift cat <<_LT_EOF $* _LT_EOF exit 0 fi # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH if test -z "$lt_ECHO"; then if test "X${echo_test_string+set}" != Xset; then # find a string as large as possible, as long as the shell can cope with it for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... if { echo_test_string=`eval $cmd`; } 2>/dev/null && { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null then break fi done fi if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then : else # The Solaris, AIX, and Digital Unix default echo programs unquote # backslashes. This makes it impossible to quote backslashes using # echo "$something" | sed 's/\\/\\\\/g' # # So, first we look for a working echo in the user's PATH. lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for dir in $PATH /usr/ucb; do IFS="$lt_save_ifs" if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then ECHO="$dir/echo" break fi done IFS="$lt_save_ifs" if test "X$ECHO" = Xecho; then # We didn't find a better echo, so look for alternatives. if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' && echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # This shell has a builtin print -r that does the trick. ECHO='print -r' elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } && test "X$CONFIG_SHELL" != X/bin/ksh; then # If we have ksh, try running configure again with it. ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} export ORIGINAL_CONFIG_SHELL CONFIG_SHELL=/bin/ksh export CONFIG_SHELL exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"} else # Try using printf. ECHO='printf %s\n' if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # Cool, printf works : elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL export CONFIG_SHELL SHELL="$CONFIG_SHELL" export SHELL ECHO="$CONFIG_SHELL $0 --fallback-echo" elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then ECHO="$CONFIG_SHELL $0 --fallback-echo" else # maybe with a smaller string... prev=: for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null then break fi prev="$cmd" done if test "$prev" != 'sed 50q "$0"'; then echo_test_string=`eval $prev` export echo_test_string exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"} else # Oops. We lost completely, so just stick with echo. ECHO=echo fi fi fi fi fi fi # Copy echo and quote the copy suitably for passing to libtool from # the Makefile, instead of quoting the original, which is used later. lt_ECHO=$ECHO if test "X$lt_ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then lt_ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo" fi exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, 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= SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='blcr' PACKAGE_TARNAME='blcr' PACKAGE_VERSION='0.8.5' PACKAGE_STRING='blcr 0.8.5' PACKAGE_BUGREPORT='http://ftg.lbl.gov/checkpoint' ac_unique_file="cr_module/cr_module.c" # 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 CR_BUILD_CONTRIB_FALSE CR_BUILD_CONTRIB_TRUE CR_BUILD_EXAMPLES_FALSE CR_BUILD_EXAMPLES_TRUE CR_BUILD_TESTS_FALSE CR_BUILD_TESTS_TRUE CR_BUILD_INCLUDE_FALSE CR_BUILD_INCLUDE_TRUE CR_BUILD_LIBCR_FALSE CR_BUILD_LIBCR_TRUE CR_BUILD_UTIL_FALSE CR_BUILD_UTIL_TRUE CR_BUILD_MODULES_FALSE CR_BUILD_MODULES_TRUE BUILD_VMADLIB_FALSE BUILD_VMADLIB_TRUE BUILD_CR_INFO_FALSE BUILD_CR_INFO_TRUE KBUILD_MAK GMAKE_ENDIF GMAKE_ELSE GMAKE_IFNEQ GMAKE_IFEQ CR_HAVE_CXX_FALSE CR_HAVE_CXX_TRUE CR_HAVE_FTB_FALSE CR_HAVE_FTB_TRUE CR_BUILD_MAN_FALSE CR_BUILD_MAN_TRUE CR_HAVE_SYSTEM_MAP_FALSE CR_HAVE_SYSTEM_MAP_TRUE KBUILD_MAKE_ARGS CR_KARCH LINUX_SYMTAB_CONF LINUX_SYMTAB_CMD LINUX_SYMTAB_FILE CR_MODULE_DIR LINUX_VERSION_H CR_KERNEL_BASE CR_KERNEL LINUX_VER LINUX_OBJ LINUX_SRC CR_BUILD_LIBCR32_FALSE CR_BUILD_LIBCR32_TRUE CR_LIBARCH CR_SIGNUM CR_FTB_LDADD CR_FTB_LDFLAGS CR_FTB_INCLUDES CR_CLIENT_LDADD CR_LIBCR_CFLAGS HAVE_RPMBUILD_FALSE HAVE_RPMBUILD_TRUE CR_ENABLE_SHARED_FALSE CR_ENABLE_SHARED_TRUE CR_ENABLE_STATIC_FALSE CR_ENABLE_STATIC_TRUE OTOOL64 OTOOL LIPO NMEDIT DSYMUTIL lt_ECHO AR OBJDUMP NM ac_ct_DUMPBIN DUMPBIN LD FGREP SED LIBTOOL EGREP GREP CPP CXXCPP am__fastdepCXX_FALSE am__fastdepCXX_TRUE CXXDEPMODE ac_ct_CXX CXXFLAGS CXX am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__quote am__include DEPDIR OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC LN_S RANLIB KCC RPMBUILD MAKE PERL CR_BUILD_TESTSUITE_FALSE CR_BUILD_TESTSUITE_TRUE CR_INSTALLED_UTIL_FALSE CR_INSTALLED_UTIL_TRUE CR_INSTALLED_LIBCR_FALSE CR_INSTALLED_LIBCR_TRUE CR_BUILD_ETC_FALSE CR_BUILD_ETC_TRUE CR_KERNEL_TRACING_FALSE CR_KERNEL_TRACING_TRUE LIBCR_TRACING_FALSE LIBCR_TRACING_TRUE CR_NDEBUG CRI_DEBUG_FALSE CRI_DEBUG_TRUE CR_CPU CR_ARCH host_os host_vendor host_cpu host build_os build_vendor build_cpu build TOP_SRCDIR TOP_BUILDDIR PWD_PROG 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 CONFIGURE_ARGS LIBTOOL_REVISION LIBTOOL_AGE LIBTOOL_INTERFACE CR_MODULE_VERSION CR_MODULE_PATCH CR_MODULE_MINOR CR_MODULE_MAJOR LIBCR_VERSION LIBCR_PATCH LIBCR_MINOR LIBCR_MAJOR CR_RELEASE_VERSION CR_RELEASE_PATCH CR_RELEASE_MINOR CR_RELEASE_MAJOR 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_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='CR_KSYM_IMPORT_DECLS CR_KSYM_IMPORT_CALLS' ac_user_opts=' enable_option_checking with_components with_linux with_linux_src with_system_map with_vmlinux with_kmod_dir with_kernel_type enable_config_report enable_kbuild_verbose enable_debug enable_libcr_tracing enable_kernel_tracing enable_multilib enable_init_script enable_restore_ids with_installed_libcr with_installed_util with_installed_modules enable_testsuite enable_all_static enable_cr_info with_ftb with_bug2524 enable_dependency_tracking enable_static enable_shared with_pic enable_fast_install with_gnu_ld enable_libtool_lock ' ac_precious_vars='build_alias host_alias target_alias PERL MAKE RPMBUILD KCC CC CFLAGS LDFLAGS LIBS CPPFLAGS CXX CXXFLAGS CCC CXXCPP CPP' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *) ac_optarg=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_echo "$as_me: error: invalid feature name: $ac_useropt" >&2 { (exit 1); exit 1; }; } 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_echo "$as_me: error: invalid feature name: $ac_useropt" >&2 { (exit 1); exit 1; }; } 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_echo "$as_me: error: invalid package name: $ac_useropt" >&2 { (exit 1); exit 1; }; } 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_echo "$as_me: error: invalid package name: $ac_useropt" >&2 { (exit 1); exit 1; }; } 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_echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { $as_echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } 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_echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) { $as_echo "$as_me: error: unrecognized options: $ac_unrecognized_opts" >&2 { (exit 1); exit 1; }; } ;; *) $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_echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; } 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 $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 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_echo "$as_me: error: working directory cannot be determined" >&2 { (exit 1); exit 1; }; } test "X$ac_ls_di" = "X$ac_pwd_ls_di" || { $as_echo "$as_me: error: pwd does not report name of working directory" >&2 { (exit 1); exit 1; }; } # 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_echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || { $as_echo "$as_me: error: $ac_msg" >&2 { (exit 1); exit 1; }; } 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 blcr 0.8.5 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/blcr] --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 blcr 0.8.5:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-config-report enable report at the conclusion of the configure script (default is yes) --enable-kbuild-verbose enable verbose output from the kbuild facility. (default is no) --enable-debug enable debugging of BLCR (default is no) --enable-libcr-tracing enable debugging/tracing output from libcr, controlled by the 'LIBCR_TRACE_MASK' environment variable (default is no) --enable-kernel-tracing enable debugging/tracing output from kernel modules, controlled by the 'cr_ktrace_mask' module option (default is no) --enable-multilib enable both 32- and 64-bit libs from a single build (default is no) --enable-init-script install /etc/init.d/blcr to load modules at boot time (default is no) --enable-restore-ids enable restoring uid, gid and supplemental groups when invoked by root (default is no) --enable-testsuite enable installation of the BLCR testsuite (default is no) --enable-all-static enable linking programs (utilities, tests and examples) with -static flag (default is no) --enable-cr-info build cr_info utility (default is no, because this is currently broken) --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --enable-static[=PKGS] build static libraries [default=no] --enable-shared[=PKGS] build shared libraries [default=yes] --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-linux=DIR specify Linux kernel release (e.g. 2.6.7-123) or full path to build directory (default is to search for currently running kernel in some standard locations) --with-linux-src=DIR specify full path to Linux kernel source directory if needed (default is to search in some standard locations) --with-system-map=FILE specify location of Linux kernel System.map file (default is to search some standard locations) --with-vmlinux=FILE specify location of kernel image (default is to search some standard locations) --with-kmod-dir=DIR specify location to install kernel modules --with-kernel-type=TYPE specify kernel type (UP, SMP, BIGMEM, HUGEMEM, etc.) to override /boot/kernel.h when present (default is not to override) --with-installed-libcr link executables against an existing libcr in $includedir and $libdir. Assumes LD_LIBRARY_PATH is set correctly. (default is to build the library) --with-installed-util run tests using utilities installed in $bindir (default is to build the utilities) --with-installed-modules use existing blcr kernel modules in $libdir (default is to build the kernel modules) --with-ftb specify path to optional FTB headers and libraries (default /usr/local/ftb) --with-bug2524 request that blcr use a work around for bug 2524 (ppc specific) --with-pic try to use only PIC/non-PIC objects [default=use both] --with-gnu-ld assume the C compiler uses GNU ld [default=no] Some influential environment variables: PERL perl interpreter (required: for configure, build and testsuite) MAKE GNU make (required: for configure and build only) RPMBUILD rpmbuild command (optional: for building RPMs) KCC C compiler command to build kernel modules (default: '$CC') 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 C/C++/Objective C preprocessor flags, e.g. -I if you have headers in a nonstandard directory CXX C++ compiler command CXXFLAGS C++ compiler flags CXXCPP C++ preprocessor CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to . _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF blcr configure 0.8.5 generated by GNU Autoconf 2.63 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) 2012, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy). All rights reserved. Portions may be copyrighted by others, as may be noted in specific copyright notices within specific files. 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 _ACEOF exit fi 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 blcr $as_me 0.8.5, which was generated by GNU Autoconf 2.63. 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) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$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 ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export 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 cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX 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:$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= ;; #( *) $as_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 cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX 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 cat <<\_ASBOX ## ------------------- ## ## File substitutions. ## ## ------------------- ## _ASBOX 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 cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX 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'; { (exit 1); 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 # 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 # 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 ac_site_file1=$CONFIG_SITE 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 -r "$ac_site_file"; then { $as_echo "$as_me:$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" 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. if test -f "$cache_file"; then { $as_echo "$as_me:$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:$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:$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:$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:$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:$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:$LINENO: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:$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. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:$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_echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 $as_echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } 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 # 2. Library version: # ------------------- # Determines which versions of the library are compatible with one another. # # 'major' number: increment if backward-compatibility has just been broken # - set MINOR and PATCH to 0 whenever MAJOR is incremented. # 'minor' number: increment if added new feature, but still backward-compatible # - set PATCH to 0 whenever MINOR incremented. # 'patch' number: increment if changes are bug fixes, not interface changes. # # Note: automake doesn't detect changes to the interface number, so you need to # 'make clean' and rebuild everything to see the new library names. LIBCR_MAJOR=0 LIBCR_MINOR=5 LIBCR_PATCH=5 # 3. Kernel module version # ------------------------ # Determines if a particular version of our library/utilities will work with the # the checkpoint module that's loaded in the kernel. # # A library/utility should die if the kernel's major number is different that # the one it was built to run against. If the kernel's minor number is less # than the interface it expects, it can either die, or restrict its kernel calls # to those supported by the older interface. # # Observe same rules as for library (ie patch->0 when changing minor, etc). CR_MODULE_MAJOR=0 CR_MODULE_MINOR=10 CR_MODULE_PATCH=3 # Derived version variables ### # - Exported, so you can use @CR_FOO@ to get them in any files that configure # generates. # - They are all also #defined in blcr_common.h. CR_RELEASE_MAJOR=0 CR_RELEASE_MINOR=8 CR_RELEASE_PATCH=5 CR_RELEASE_VERSION="$CR_RELEASE_MAJOR.$CR_RELEASE_MINOR.$CR_RELEASE_PATCH" LIBCR_VERSION="$LIBCR_MAJOR.$LIBCR_MINOR.$LIBCR_PATCH" CR_MODULE_VERSION="$CR_MODULE_MAJOR.$CR_MODULE_MINOR.$CR_MODULE_PATCH" # Libtool versioning: they just had to be different... LIBTOOL_INTERFACE=`expr $LIBCR_MAJOR + $LIBCR_MINOR` LIBTOOL_AGE=$LIBCR_MINOR LIBTOOL_REVISION=$LIBCR_PATCH # Save our ARGS for use in an RPM spec file CONFIGURE_ARGS=$ac_configure_args ### rest of init setup ac_aux_dir= for ac_dir in ./config "$srcdir"/./config; 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_echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in ./config \"$srcdir\"/./config" >&5 $as_echo "$as_me: error: cannot find install-sh or install.sh in ./config \"$srcdir\"/./config" >&2;} { (exit 1); exit 1; }; } 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. am__api_version='1.11' # 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:$LINENO: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; 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 { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$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:$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:$LINENO: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } # Just in case sleep 1 echo timestamp > conftest.file # 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_echo "$as_me:$LINENO: error: unsafe absolute working directory name" >&5 $as_echo "$as_me: error: unsafe absolute working directory name" >&2;} { (exit 1); exit 1; }; };; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) { { $as_echo "$as_me:$LINENO: error: unsafe srcdir value: \`$srcdir'" >&5 $as_echo "$as_me: error: unsafe srcdir value: \`$srcdir'" >&2;} { (exit 1); exit 1; }; };; 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 ( 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 rm -f conftest.file 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_echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&5 $as_echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&2;} { (exit 1); exit 1; }; } fi test "$2" = conftest.file ) then # Ok. : else { { $as_echo "$as_me:$LINENO: error: newly created file is older than distributed files! Check your system clock" >&5 $as_echo "$as_me: error: newly created file is older than distributed files! Check your system clock" >&2;} { (exit 1); exit 1; }; } fi { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } 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 --run true"; then am_missing_run="$MISSING --run " else am_missing_run= { $as_echo "$as_me:$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:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_STRIP+set}" = set; 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:$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:$LINENO: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:$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:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:$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:$LINENO: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:$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:$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:$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 test "${ac_cv_path_mkdir+set}" = set; 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 { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$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 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. test -d ./--version && rmdir ./--version MKDIR_P="$ac_install_sh -d" fi fi { $as_echo "$as_me:$LINENO: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } mkdir_p="$MKDIR_P" case $mkdir_p in [\\/$]* | ?:[\\/]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac 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:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_AWK+set}" = set; 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:$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:$LINENO: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done { $as_echo "$as_me:$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 { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; 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:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:$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 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_echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 $as_echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} { (exit 1); exit 1; }; } 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='blcr' VERSION='0.8.5' cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # We need awk for the "check" target. The system "awk" is bad on # some platforms. # Always define AMTAR for backward compatibility. AMTAR=${AMTAR-"${am_missing_run}tar"} am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' ################################################################################ # Boilerplate for versions and copyrights in generated files ################################################################################ ################################################################################ # Absolute paths to build and source dirs # need to substitute these into cscope script ################################################################################ # Extract the first word of "pwd", so it can be a program name with args. set dummy pwd; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_PWD_PROG+set}" = set; then $as_echo_n "(cached) " >&6 else case $PWD_PROG in [\\/]* | ?:[\\/]*) ac_cv_path_PWD_PROG="$PWD_PROG" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PWD_PROG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_PWD_PROG" && ac_cv_path_PWD_PROG=""pwd -P"" ;; esac fi PWD_PROG=$ac_cv_path_PWD_PROG if test -n "$PWD_PROG"; then { $as_echo "$as_me:$LINENO: result: $PWD_PROG" >&5 $as_echo "$PWD_PROG" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi TOP_BUILDDIR=`${PWD_PROG}` TOP_SRCDIR=`cd $srcdir && $PWD_PROG` ################################################################################ # Check which components are enabled. ################################################################################ # Check whether --with-components was given. if test "${with_components+set}" = set; then withval=$with_components; fi case x"$with_components" in xyes) { { $as_echo "$as_me:$LINENO: error: --with-components requires an argument. Known components are: modules util libcr include tests examples contrib" >&5 $as_echo "$as_me: error: --with-components requires an argument. Known components are: modules util libcr include tests examples contrib" >&2;} { (exit 1); exit 1; }; }; ;; x) for cr_lcv in modules util libcr include tests examples contrib; do eval cr_build_${cr_lcv}=yes done ;; *) for cr_lcv in modules util libcr include tests examples contrib; do if expr "$with_components" : '.*'"$cr_lcv" >/dev/null; then eval cr_build_${cr_lcv}=yes else eval cr_build_${cr_lcv}=no fi done ;; esac ################################################################################ # Check platform ################################################################################ # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || { { $as_echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5 $as_echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;} { (exit 1); exit 1; }; } { $as_echo "$as_me:$LINENO: checking build system type" >&5 $as_echo_n "checking build system type... " >&6; } if test "${ac_cv_build+set}" = set; 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_echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 $as_echo "$as_me: error: cannot guess build type; you must specify one" >&2;} { (exit 1); exit 1; }; } ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5 $as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;} { (exit 1); exit 1; }; } fi { $as_echo "$as_me:$LINENO: result: $ac_cv_build" >&5 $as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical build" >&5 $as_echo "$as_me: error: invalid value of canonical build" >&2;} { (exit 1); exit 1; }; };; 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:$LINENO: checking host system type" >&5 $as_echo_n "checking host system type... " >&6; } if test "${ac_cv_host+set}" = set; 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_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5 $as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;} { (exit 1); exit 1; }; } fi fi { $as_echo "$as_me:$LINENO: result: $ac_cv_host" >&5 $as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical host" >&5 $as_echo "$as_me: error: invalid value of canonical host" >&2;} { (exit 1); exit 1; }; };; 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 case $host_os in linux*) ;; *) 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:$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= ;; #( *) $as_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 test "x$cache_file" != "x/dev/null" && { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache { { $as_echo "$as_me:$LINENO: error: the host system must be Linux (have $host_os)" >&5 $as_echo "$as_me: error: the host system must be Linux (have $host_os)" >&2;} { (exit 1); exit 1; }; } ;; esac CR_ARCH=$host_cpu CR_CPU=$host_cpu case $host_cpu in i386) 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:$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= ;; #( *) $as_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 test "x$cache_file" != "x/dev/null" && { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache { { $as_echo "$as_me:$LINENO: error: i386 not supported, i486 or higher is required" >&5 $as_echo "$as_me: error: i386 not supported, i486 or higher is required" >&2;} { (exit 1); exit 1; }; } ;; i?86) CR_ARCH=i386 cr_wordsize=4 ;; x86_64) CR_ARCH32=i686 CR_LIBARCH32=i386 cr_wordsize=8 ;; ppc64|powerpc64) CR_ARCH=ppc64 CR_CPU=ppc64 CR_ARCH32=ppc cr_wordsize=8 cr_arch_experimental=yes ;; ppc|powerpc) CR_ARCH=ppc CR_CPU=ppc cr_wordsize=4 cr_arch_experimental=yes ;; arm|armv*) CR_ARCH=arm CR_CPU=arm cr_wordsize=4 cr_arch_experimental=yes ;; sparc) CR_ARCH=sparc cr_wordsize=4 cr_arch_incomplete=yes ;; sparc64) CR_ARCH=sparc64 CR_ARCH32=sparc cr_wordsize=8 cr_arch_incomplete=yes ;; *) { { $as_echo "$as_me:$LINENO: error: Sorry, architecture $host_cpu is not supported at this time." >&5 $as_echo "$as_me: error: Sorry, architecture $host_cpu is not supported at this time." >&2;} { (exit 1); exit 1; }; } ;; esac ################################################################################ # Parse user args into variables # Try not to call any actual configuration probes yet. ################################################################################ # Let user specify location of Linux kernel headers and build # Check whether --with-linux was given. if test "${with_linux+set}" = set; then withval=$with_linux; if test x"$with_linux" != xyes; then LINUX_OBJ_ARG=$with_linux fi fi # Check whether --with-linux-src was given. if test "${with_linux_src+set}" = set; then withval=$with_linux_src; if test x"$with_linux_src" != xyes; then LINUX_SRC_ARG=$with_linux_src fi fi # Let user specify location of kernel System.map and/or vmlinux # Check whether --with-system-map was given. if test "${with_system_map+set}" = set; then withval=$with_system_map; if test x"$with_system_map" != xyes; then LINUX_SYSTEM_MAP=$with_system_map fi fi # Check whether --with-vmlinux was given. if test "${with_vmlinux+set}" = set; then withval=$with_vmlinux; if test x"$with_vmlinux" != xyes; then LINUX_VMLINUX=$with_vmlinux fi fi # Let user specify dir to install kernel modules # Check whether --with-kmod-dir was given. if test "${with_kmod_dir+set}" = set; then withval=$with_kmod_dir; if test x"$with_kmod_dir" != xyes; then CR_MODULE_DIR=$with_kmod_dir fi fi # Let user force UP, SMP or HUGEMEM kernel configs on RH (and similar) systems # Check whether --with-kernel-type was given. if test "${with_kernel_type+set}" = set; then withval=$with_kernel_type; fi # Let user supress the printing of the final configuration report # Check whether --enable-config-report was given. if test "${enable_config_report+set}" = set; then enableval=$enable_config_report; : else enable_config_report=yes fi # Let the user request/supress use of V=1 with kbuild # Check whether --enable-kbuild-verbose was given. if test "${enable_kbuild_verbose+set}" = set; then enableval=$enable_kbuild_verbose; : else enable_kbuild_verbose=no fi # Debugging (implies tracing enabled by default) # Check whether --enable-debug was given. if test "${enable_debug+set}" = set; then enableval=$enable_debug; : else enable_debug=no fi if test x$enable_debug = xyes; then CRI_DEBUG_TRUE= CRI_DEBUG_FALSE='#' else CRI_DEBUG_TRUE='#' CRI_DEBUG_FALSE= fi if test x$enable_debug = xyes; then cat >>confdefs.h <<\_ACEOF #define CRI_DEBUG 1 _ACEOF else cat >>confdefs.h <<\_ACEOF #define CRI_DEBUG 0 _ACEOF fi if test x$enable_debug = xyes; then CR_NDEBUG="" else CR_NDEBUG="-DNDEBUG" fi # Feature libcr-tracing # Check whether --enable-libcr-tracing was given. if test "${enable_libcr_tracing+set}" = set; then enableval=$enable_libcr_tracing; : else enable_libcr_tracing=$enable_debug fi if test x$enable_libcr_tracing = xyes; then LIBCR_TRACING_TRUE= LIBCR_TRACING_FALSE='#' else LIBCR_TRACING_TRUE='#' LIBCR_TRACING_FALSE= fi if test x$enable_libcr_tracing = xyes; then cat >>confdefs.h <<\_ACEOF #define LIBCR_TRACING 1 _ACEOF else cat >>confdefs.h <<\_ACEOF #define LIBCR_TRACING 0 _ACEOF fi # Feature kernel-tracing # Check whether --enable-kernel-tracing was given. if test "${enable_kernel_tracing+set}" = set; then enableval=$enable_kernel_tracing; : else enable_kernel_tracing=$enable_debug fi if test x$enable_kernel_tracing = xyes; then CR_KERNEL_TRACING_TRUE= CR_KERNEL_TRACING_FALSE='#' else CR_KERNEL_TRACING_TRUE='#' CR_KERNEL_TRACING_FALSE= fi if test x$enable_kernel_tracing = xyes; then cat >>confdefs.h <<\_ACEOF #define CR_KERNEL_TRACING 1 _ACEOF else cat >>confdefs.h <<\_ACEOF #define CR_KERNEL_TRACING 0 _ACEOF fi # Multilib support # Check whether --enable-multilib was given. if test "${enable_multilib+set}" = set; then enableval=$enable_multilib; : else enable_multilib=no fi # Optional /etc/init.d/blcr file # Check whether --enable-init-script was given. if test "${enable_init_script+set}" = set; then enableval=$enable_init_script; : else enable_init_script=no fi if test x$enable_init_script = xyes; then CR_BUILD_ETC_TRUE= CR_BUILD_ETC_FALSE='#' else CR_BUILD_ETC_TRUE='#' CR_BUILD_ETC_FALSE= fi # Check is restoring uid, gid and supplemental groups is requested # Check whether --enable-restore-ids was given. if test "${enable_restore_ids+set}" = set; then enableval=$enable_restore_ids; : else enable_restore_ids=no fi if test x$enable_restore_ids = xyes; then cat >>confdefs.h <<\_ACEOF #define CR_RESTORE_IDS 1 _ACEOF else cat >>confdefs.h <<\_ACEOF #define CR_RESTORE_IDS 0 _ACEOF fi # Let user build against an already installed libcr # Check whether --with-installed-libcr was given. if test "${with_installed_libcr+set}" = set; then withval=$with_installed_libcr; cr_build_libcr=no cr_build_include=no fi if test x$with_installed_libcr = xyes; then CR_INSTALLED_LIBCR_TRUE= CR_INSTALLED_LIBCR_FALSE='#' else CR_INSTALLED_LIBCR_TRUE='#' CR_INSTALLED_LIBCR_FALSE= fi # Let user build/test against already installed utilities # Check whether --with-installed-util was given. if test "${with_installed_util+set}" = set; then withval=$with_installed_util; cr_build_util=no fi if test x$with_installed_util = xyes; then CR_INSTALLED_UTIL_TRUE= CR_INSTALLED_UTIL_FALSE='#' else CR_INSTALLED_UTIL_TRUE='#' CR_INSTALLED_UTIL_FALSE= fi # Let user build/run/test against already installed kernel modules # Check whether --with-installed-modules was given. if test "${with_installed_modules+set}" = set; then withval=$with_installed_modules; cr_build_modules=no fi # Let user request installation of the test suite # Check whether --enable-testsuite was given. if test "${enable_testsuite+set}" = set; then enableval=$enable_testsuite; : else enable_testsuite=no fi if test x$enable_testsuite = xyes; then CR_BUILD_TESTSUITE_TRUE= CR_BUILD_TESTSUITE_FALSE='#' else CR_BUILD_TESTSUITE_TRUE='#' CR_BUILD_TESTSUITE_FALSE= fi # Let user request static utils, tests and examples # Check whether --enable-all-static was given. if test "${enable_all_static+set}" = set; then enableval=$enable_all_static; : else enable_all_static=no fi # Let user request optional "cr_info" util # Check whether --enable-cr-info was given. if test "${enable_cr_info+set}" = set; then enableval=$enable_cr_info; : else enable_cr_info=no fi # Let user specify location of optional FTB headers & libs # Check whether --with-ftb was given. if test "${with_ftb+set}" = set; then withval=$with_ftb; FTB_HOME=$withval; cr_force_ftb=yes else FTB_HOME='/usr/local/ftb' fi #XXX: HACK to disable FTB unless explictly requested if test x"$cr_force_ftb" != xyes; then FTB_HOME=no; fi # Let user request work-around for bug 2524 (ppc only) # TODO: automate when building both kernel modules and libcr if expr $CR_ARCH : ppc >/dev/null; then # Check whether --with-bug2524 was given. if test "${with_bug2524+set}" = set; then withval=$with_bug2524; force_bug2524=$withval fi fi ################################################################################ # Check and configure the build environment (compiler, linker, etc.) ################################################################################ # Collect doc strings together here # XXX: need to verify version of perl? for ac_prog in perl5 perl 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:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_PERL+set}" = set; then $as_echo_n "(cached) " >&6 else case $PERL in [\\/]* | ?:[\\/]*) ac_cv_path_PERL="$PERL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PERL="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi PERL=$ac_cv_path_PERL if test -n "$PERL"; then { $as_echo "$as_me:$LINENO: result: $PERL" >&5 $as_echo "$PERL" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi test -n "$PERL" && break done if test -z "$PERL"; then { { $as_echo "$as_me:$LINENO: error: cannot find a version of perl - please install perl and/or set \$PERL to indicate where it's located" >&5 $as_echo "$as_me: error: cannot find a version of perl - please install perl and/or set \$PERL to indicate where it's located" >&2;} { (exit 1); exit 1; }; } fi PERL=$PERL # Check for GNU make for ac_prog in gmake make 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:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_MAKE+set}" = set; then $as_echo_n "(cached) " >&6 else case $MAKE in [\\/]* | ?:[\\/]*) ac_cv_path_MAKE="$MAKE" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_MAKE="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi MAKE=$ac_cv_path_MAKE if test -n "$MAKE"; then { $as_echo "$as_me:$LINENO: result: $MAKE" >&5 $as_echo "$MAKE" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi test -n "$MAKE" && break done if test -n "$MAKE"; then { $as_echo "$as_me:$LINENO: checking if $MAKE is GNU make" >&5 $as_echo_n "checking if $MAKE is GNU make... " >&6; } MAKE_VERSTR=`$MAKE --version | grep GNU 2> /dev/null` if test -z "$MAKE_VERSTR" ; then { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } else #MAKE_VER=`echo "$MAKE_VERSTR" | perl -n -e 'if (/([[0-9]]+)\.([[0-9]]+)(\.[[0-9]]+)?/) { $maj=$1; $min=$2; $pat=$3; printf "%i%03i%03i",($maj,$min,($pat?$pat=~s/\.//:0)) }'` MAKE_VERSION=`echo "$MAKE_VERSTR" | perl -n -e 'if (/(([0-9]+)\.([0-9]+)(\.[0-9]+)?)/) { print $1 }'` { $as_echo "$as_me:$LINENO: result: yes ($MAKE_VERSION)" >&5 $as_echo "yes ($MAKE_VERSION)" >&6; } fi fi if test -z "$MAKE_VERSTR" ; then { { $as_echo "$as_me:$LINENO: error: cannot find a version of GNU make - please install GNU make and/or set \$MAKE to indicate where it's located" >&5 $as_echo "$as_me: error: cannot find a version of GNU make - please install GNU make and/or set \$MAKE to indicate where it's located" >&2;} { (exit 1); exit 1; }; } fi # What language(s) do we need ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # For static convenience libs 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:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_RANLIB+set}" = set; 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $as_echo "$as_me:$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:$LINENO: result: $RANLIB" >&5 $as_echo "$RANLIB" >&6; } else { $as_echo "$as_me:$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:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:$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:$LINENO: result: $ac_ct_RANLIB" >&5 $as_echo "$ac_ct_RANLIB" >&6; } else { $as_echo "$as_me:$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:$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 # For symbolic links { $as_echo "$as_me:$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:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:$LINENO: result: no, using $LN_S" >&5 $as_echo "no, using $LN_S" >&6; } fi # Need our own probe prior to any done in AC_PROG_LIBTOOL # Note bug 2619 reports that we can't call this conditionally: 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:$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:$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='\' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_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 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:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:$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:$LINENO: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:$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:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:$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:$LINENO: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:$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:$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:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:$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:$LINENO: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:$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:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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:$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:$LINENO: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:$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:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:$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:$LINENO: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:$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:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:$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:$LINENO: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:$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:$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:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 $as_echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; }; } # Provide some information about the compiler. $as_echo "$as_me:$LINENO: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* 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:$LINENO: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 { $as_echo "$as_me:$LINENO: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } if test -z "$ac_file"; then $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 $as_echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; }; } fi ac_exeext=$ac_cv_exeext # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:$LINENO: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 $as_echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; }; } fi fi fi { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } { $as_echo "$as_me:$LINENO: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } { $as_echo "$as_me:$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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 $as_echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; }; } fi rm -f conftest$ac_cv_exeext { $as_echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT { $as_echo "$as_me:$LINENO: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if test "${ac_cv_objext+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 $as_echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:$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 test "${ac_cv_c_compiler_gnu+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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:$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:$LINENO: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if test "${ac_cv_prog_cc_g+set}" = set; 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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CFLAGS="" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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:$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:$LINENO: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* 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" 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_c89=$ac_arg else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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:$LINENO: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:$LINENO: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CC" am_compiler_list= { $as_echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if test "${am_cv_CC_dependencies_compiler_type+set}" = set; 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'. 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 8's {/usr,}/bin/sh. touch 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 ;; 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:$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=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:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CXX+set}" = set; 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" $as_echo "$as_me:$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:$LINENO: result: $CXX" >&5 $as_echo "$CXX" >&6; } else { $as_echo "$as_me:$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:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_CXX+set}" = set; 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CXX="$ac_prog" $as_echo "$as_me:$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:$LINENO: result: $ac_ct_CXX" >&5 $as_echo "$ac_ct_CXX" >&6; } else { $as_echo "$as_me:$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:$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:$LINENO: checking for C++ compiler version" >&5 set X $ac_compile ac_compiler=$2 { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { $as_echo "$as_me:$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 test "${ac_cv_cxx_compiler_gnu+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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:$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:$LINENO: checking whether $CXX accepts -g" >&5 $as_echo_n "checking whether $CXX accepts -g... " >&6; } if test "${ac_cv_prog_cxx_g+set}" = set; 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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cxx_g=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CXXFLAGS="" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cxx_werror_flag=$ac_save_cxx_werror_flag CXXFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cxx_g=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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:$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=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CXX" am_compiler_list= { $as_echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; 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'. 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 8's {/usr,}/bin/sh. touch 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 ;; 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:$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 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:$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 test "${ac_cv_prog_CXXCPP+set}" = set; 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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then : else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f 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:$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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then : else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} CXX=no; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:$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 test "${ac_cv_prog_CPP+set}" = set; 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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f 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:$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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 $as_echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; }; } 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:$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 test "${ac_cv_path_GREP+set}" = set; 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" { test -f "$ac_path_GREP" && $as_test_x "$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 ac_count=`expr $ac_count + 1` 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_echo "$as_me:$LINENO: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 $as_echo "$as_me: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:$LINENO: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if test "${ac_cv_path_EGREP+set}" = set; 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" { test -f "$ac_path_EGREP" && $as_test_x "$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 ac_count=`expr $ac_count + 1` 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_echo "$as_me:$LINENO: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 $as_echo "$as_me: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:$LINENO: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if test "${ac_cv_header_stdc+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_header_stdc=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* 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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* 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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* 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 rm -f 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : 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 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi { $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF #define STDC_HEADERS 1 _ACEOF 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` { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then eval "$as_ac_Header=yes" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done # Totally gross way to perform a non-fatal probe for CXX # Now validate the choice if test "x$CXX" != xno; then 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 # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { $as_echo "$as_me:$LINENO: checking size of void *" >&5 $as_echo_n "checking size of void *... " >&6; } if test "${ac_cv_sizeof_void_p+set}" = set; then $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long int) (sizeof (void *))) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long int) (sizeof (void *))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long int) (sizeof (void *))) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long int) (sizeof (void *))) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long int) (sizeof (void *))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_void_p=$ac_lo;; '') if test "$ac_cv_type_void_p" = yes; then { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (void *) See \`config.log' for more details." >&5 $as_echo "$as_me: error: cannot compute sizeof (void *) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; }; } else ac_cv_sizeof_void_p=0 fi ;; esac else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default static long int longval () { return (long int) (sizeof (void *)); } static unsigned long int ulongval () { return (long int) (sizeof (void *)); } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if (((long int) (sizeof (void *))) < 0) { long int i = longval (); if (i != ((long int) (sizeof (void *)))) return 1; fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); if (i != ((long int) (sizeof (void *)))) return 1; fprintf (f, "%lu", i); } /* Do not output a trailing newline, as this causes \r\n confusion on some platforms. */ return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF rm -f 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_void_p=`cat conftest.val` 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 ( exit $ac_status ) if test "$ac_cv_type_void_p" = yes; then { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (void *) See \`config.log' for more details." >&5 $as_echo "$as_me: error: cannot compute sizeof (void *) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; }; } else ac_cv_sizeof_void_p=0 fi fi rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi { $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_void_p" >&5 $as_echo "$ac_cv_sizeof_void_p" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_VOID_P $ac_cv_sizeof_void_p _ACEOF 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:$LINENO: checking whether CXX='$CXX' acts like a C++ compiler" >&5 $as_echo_n "checking whether CXX='$CXX' acts like a C++ compiler... " >&6; } if test "${cr_cv_cxx_is_cxx+set}" = set; then $as_echo_n "(cached) " >&6 else cr_cv_cxx_is_cxx=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifndef __cplusplus #error __cplusplus must be defined in a C++ compilation! #endif int main () { int x = 1; ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then cr_cv_cxx_is_cxx=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $cr_cv_cxx_is_cxx" >&5 $as_echo "$cr_cv_cxx_is_cxx" >&6; } if test x"$cr_cv_cxx_is_cxx" = xyes; then { $as_echo "$as_me:$LINENO: checking whether CXX='$CXX' matches wordsize of CC" >&5 $as_echo_n "checking whether CXX='$CXX' matches wordsize of CC... " >&6; } if test "${cr_cv_cxx_voidp+set}" = set; then $as_echo_n "(cached) " >&6 else cr_cv_cxx_voidp=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifndef __cplusplus #error __cplusplus must be defined in a C++ compilation! #endif int main () { int a[(($ac_cv_sizeof_void_p == sizeof(void *))? 1 : -1)]; ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then cr_cv_cxx_voidp=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $cr_cv_cxx_voidp" >&5 $as_echo "$cr_cv_cxx_voidp" >&6; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test x"$cr_cv_cxx_is_cxx$cr_cv_cxx_voidp" != xyesyes; then CXX=no fi fi # We use libtool to build # - only build shared lib for now # 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=no fi case `pwd` in *\ * | *\ *) { $as_echo "$as_me:$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.2.6b' macro_revision='1.3017' ltmain="$ac_aux_dir/ltmain.sh" { $as_echo "$as_me:$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 test "${ac_cv_path_SED+set}" = set; 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 $as_unset ac_script || 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" { test -f "$ac_path_SED" && $as_test_x "$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 ac_count=`expr $ac_count + 1` 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_echo "$as_me:$LINENO: error: no acceptable sed could be found in \$PATH" >&5 $as_echo "$as_me: error: no acceptable sed could be found in \$PATH" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_SED=$SED fi fi { $as_echo "$as_me:$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:$LINENO: checking for fgrep" >&5 $as_echo_n "checking for fgrep... " >&6; } if test "${ac_cv_path_FGREP+set}" = set; 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" { test -f "$ac_path_FGREP" && $as_test_x "$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 ac_count=`expr $ac_count + 1` 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_echo "$as_me:$LINENO: error: no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 $as_echo "$as_me: error: no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_FGREP=$FGREP fi fi fi { $as_echo "$as_me:$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:$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:$LINENO: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else { $as_echo "$as_me:$LINENO: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi if test "${lt_cv_path_LD+set}" = set; 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:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi test -z "$LD" && { { $as_echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 $as_echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} { (exit 1); exit 1; }; } { $as_echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if test "${lt_cv_prog_gnu_ld+set}" = set; 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:$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 test "${lt_cv_path_NM+set}" = set; 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:$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 "$ac_tool_prefix"; then for ac_prog in "dumpbin -symbols" "link -dump -symbols" 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:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_DUMPBIN+set}" = set; 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" $as_echo "$as_me:$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:$LINENO: result: $DUMPBIN" >&5 $as_echo "$DUMPBIN" >&6; } else { $as_echo "$as_me:$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 -symbols" "link -dump -symbols" 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:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_DUMPBIN+set}" = set; 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" $as_echo "$as_me:$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:$LINENO: result: $ac_ct_DUMPBIN" >&5 $as_echo "$ac_ct_DUMPBIN" >&6; } else { $as_echo "$as_me:$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:$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 if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" fi fi test -z "$NM" && NM=nm { $as_echo "$as_me:$LINENO: checking the name lister ($NM) interface" >&5 $as_echo_n "checking the name lister ($NM) interface... " >&6; } if test "${lt_cv_nm_interface+set}" = set; 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:7353: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 (eval echo "\"\$as_me:7356: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 (eval echo "\"\$as_me:7359: 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:$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:$LINENO: checking the maximum length of command line arguments" >&5 $as_echo_n "checking the maximum length of command line arguments... " >&6; } if test "${lt_cv_sys_max_cmd_len+set}" = set; 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; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8 ; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test "X"`$SHELL $0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \ = "XX$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac fi if test -n $lt_cv_sys_max_cmd_len ; then { $as_echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5 $as_echo "$lt_cv_sys_max_cmd_len" >&6; } else { $as_echo "$as_me:$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:$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"}, \ = c,a/b,, \ && eval 'test $(( 1 + 1 )) -eq 2 \ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ && xsi_shell=yes { $as_echo "$as_me:$LINENO: result: $xsi_shell" >&5 $as_echo "$xsi_shell" >&6; } { $as_echo "$as_me:$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:$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:$LINENO: checking for $LD option to reload object files" >&5 $as_echo_n "checking for $LD option to reload object files... " >&6; } if test "${lt_cv_ld_reload_flag+set}" = set; then $as_echo_n "(cached) " >&6 else lt_cv_ld_reload_flag='-r' fi { $as_echo "$as_me:$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 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:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_OBJDUMP+set}" = set; 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" $as_echo "$as_me:$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:$LINENO: result: $OBJDUMP" >&5 $as_echo "$OBJDUMP" >&6; } else { $as_echo "$as_me:$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:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_OBJDUMP+set}" = set; 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_OBJDUMP="objdump" $as_echo "$as_me:$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:$LINENO: result: $ac_ct_OBJDUMP" >&5 $as_echo "$ac_ct_OBJDUMP" >&6; } else { $as_echo "$as_me:$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:$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:$LINENO: checking how to recognize dependent libraries" >&5 $as_echo_n "checking how to recognize dependent libraries... " >&6; } if test "${lt_cv_deplibs_check_method+set}" = set; 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. if ( file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; gnu*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]' lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[3-9]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be Linux ELF. linux* | k*bsd*-gnu) 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:$LINENO: result: $lt_cv_deplibs_check_method" >&5 $as_echo "$lt_cv_deplibs_check_method" >&6; } 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}ar", so it can be a program name with args. set dummy ${ac_tool_prefix}ar; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_AR+set}" = set; 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AR="${ac_tool_prefix}ar" $as_echo "$as_me:$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:$LINENO: result: $AR" >&5 $as_echo "$AR" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_AR"; then ac_ct_AR=$AR # Extract the first word of "ar", so it can be a program name with args. set dummy ar; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_AR+set}" = set; 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_AR="ar" $as_echo "$as_me:$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:$LINENO: result: $ac_ct_AR" >&5 $as_echo "$ac_ct_AR" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_AR" = x; then AR="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:$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 else AR="$ac_cv_prog_AR" fi test -z "$AR" && AR=ar test -z "$AR_FLAGS" && AR_FLAGS=cru 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:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_STRIP+set}" = set; 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:$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:$LINENO: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:$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:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:$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:$LINENO: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:$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:$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:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_RANLIB+set}" = set; 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $as_echo "$as_me:$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:$LINENO: result: $RANLIB" >&5 $as_echo "$RANLIB" >&6; } else { $as_echo "$as_me:$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:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:$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:$LINENO: result: $ac_ct_RANLIB" >&5 $as_echo "$ac_ct_RANLIB" >&6; } else { $as_echo "$as_me:$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:$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 \$oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" fi # 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:$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 test "${lt_cv_sys_global_symbol_pipe+set}" = set; 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};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ " {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ " s[1]~/^[@?]/{print s[1], s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Now try to grab the symbols. nlist=conftest.nm if { (eval echo "$as_me:$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:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ const struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_save_LIBS="$LIBS" lt_save_CFLAGS="$CFLAGS" LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS="$lt_save_LIBS" CFLAGS="$lt_save_CFLAGS" else echo "cannot find nm_test_func in $nlist" >&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:$LINENO: result: failed" >&5 $as_echo "failed" >&6; } else { $as_echo "$as_me:$LINENO: result: ok" >&5 $as_echo "ok" >&6; } fi # 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:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 8553 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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:$LINENO: checking whether the C compiler needs -belf" >&5 $as_echo_n "checking whether the C compiler needs -belf... " >&6; } if test "${lt_cv_cc_needs_belf+set}" = set; 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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then lt_cv_cc_needs_belf=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 lt_cv_cc_needs_belf=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ 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:$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 ;; sparc*-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) LD="${LD-ld} -m elf64_sparc" ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks="$enable_libtool_lock" 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:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_DSYMUTIL+set}" = set; 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" $as_echo "$as_me:$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:$LINENO: result: $DSYMUTIL" >&5 $as_echo "$DSYMUTIL" >&6; } else { $as_echo "$as_me:$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:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_DSYMUTIL+set}" = set; 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" $as_echo "$as_me:$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:$LINENO: result: $ac_ct_DSYMUTIL" >&5 $as_echo "$ac_ct_DSYMUTIL" >&6; } else { $as_echo "$as_me:$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:$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:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_NMEDIT+set}" = set; 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" $as_echo "$as_me:$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:$LINENO: result: $NMEDIT" >&5 $as_echo "$NMEDIT" >&6; } else { $as_echo "$as_me:$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:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_NMEDIT+set}" = set; 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_NMEDIT="nmedit" $as_echo "$as_me:$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:$LINENO: result: $ac_ct_NMEDIT" >&5 $as_echo "$ac_ct_NMEDIT" >&6; } else { $as_echo "$as_me:$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:$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:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_LIPO+set}" = set; 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_LIPO="${ac_tool_prefix}lipo" $as_echo "$as_me:$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:$LINENO: result: $LIPO" >&5 $as_echo "$LIPO" >&6; } else { $as_echo "$as_me:$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:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_LIPO+set}" = set; 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_LIPO="lipo" $as_echo "$as_me:$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:$LINENO: result: $ac_ct_LIPO" >&5 $as_echo "$ac_ct_LIPO" >&6; } else { $as_echo "$as_me:$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:$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:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_OTOOL+set}" = set; 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_OTOOL="${ac_tool_prefix}otool" $as_echo "$as_me:$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:$LINENO: result: $OTOOL" >&5 $as_echo "$OTOOL" >&6; } else { $as_echo "$as_me:$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:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_OTOOL+set}" = set; 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_OTOOL="otool" $as_echo "$as_me:$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:$LINENO: result: $ac_ct_OTOOL" >&5 $as_echo "$ac_ct_OTOOL" >&6; } else { $as_echo "$as_me:$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:$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:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_OTOOL64+set}" = set; 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" $as_echo "$as_me:$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:$LINENO: result: $OTOOL64" >&5 $as_echo "$OTOOL64" >&6; } else { $as_echo "$as_me:$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:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_OTOOL64+set}" = set; 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_OTOOL64="otool64" $as_echo "$as_me:$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:$LINENO: result: $ac_ct_OTOOL64" >&5 $as_echo "$ac_ct_OTOOL64" >&6; } else { $as_echo "$as_me:$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:$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:$LINENO: checking for -single_module linker flag" >&5 $as_echo_n "checking for -single_module linker flag... " >&6; } if test "${lt_cv_apple_cc_single_mod+set}" = set; 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 test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 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:$LINENO: result: $lt_cv_apple_cc_single_mod" >&5 $as_echo "$lt_cv_apple_cc_single_mod" >&6; } { $as_echo "$as_me:$LINENO: checking for -exported_symbols_list linker flag" >&5 $as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } if test "${lt_cv_ld_exported_symbols_list+set}" = set; 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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then lt_cv_ld_exported_symbols_list=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 lt_cv_ld_exported_symbols_list=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:$LINENO: result: $lt_cv_ld_exported_symbols_list" >&5 $as_echo "$lt_cv_ld_exported_symbols_list" >&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" != ":"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac for ac_header in dlfcn.h do as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then eval "$as_ac_Header=yes" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi 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 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:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CXX+set}" = set; 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" $as_echo "$as_me:$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:$LINENO: result: $CXX" >&5 $as_echo "$CXX" >&6; } else { $as_echo "$as_me:$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:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_CXX+set}" = set; 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CXX="$ac_prog" $as_echo "$as_me:$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:$LINENO: result: $ac_ct_CXX" >&5 $as_echo "$ac_ct_CXX" >&6; } else { $as_echo "$as_me:$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:$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:$LINENO: checking for C++ compiler version" >&5 set X $ac_compile ac_compiler=$2 { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { $as_echo "$as_me:$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 test "${ac_cv_cxx_compiler_gnu+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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:$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:$LINENO: checking whether $CXX accepts -g" >&5 $as_echo_n "checking whether $CXX accepts -g... " >&6; } if test "${ac_cv_prog_cxx_g+set}" = set; 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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cxx_g=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CXXFLAGS="" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cxx_werror_flag=$ac_save_cxx_werror_flag CXXFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cxx_g=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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:$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=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CXX" am_compiler_list= { $as_echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; 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'. 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 8's {/usr,}/bin/sh. touch 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 ;; 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:$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 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:$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 test "${ac_cv_prog_CXXCPP+set}" = set; 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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then : else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f 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:$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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then : else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} _lt_caught_CXX_error=yes; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu else _lt_caught_CXX_error=yes fi # 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 --with-pic was given. if test "${with_pic+set}" = set; then withval=$with_pic; pic_mode="$withval" 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:$LINENO: checking for objdir" >&5 $as_echo_n "checking for objdir... " >&6; } if test "${lt_cv_objdir+set}" = set; 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:$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 # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. sed_quote_subst='s/\(["`$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld="$lt_cv_prog_gnu_ld" old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` # 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:$LINENO: checking for ${ac_tool_prefix}file" >&5 $as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } if test "${lt_cv_path_MAGIC_CMD+set}" = set; 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:$LINENO: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:$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:$LINENO: checking for file" >&5 $as_echo_n "checking for file... " >&6; } if test "${lt_cv_path_MAGIC_CMD+set}" = set; 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:$LINENO: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:$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* if test -n "$compiler"; then lt_prog_compiler_no_builtin_flag= if test "$GCC" = yes; then lt_prog_compiler_no_builtin_flag=' -fno-builtin' { $as_echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 $as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; 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:10625: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:10629: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_rtti_exceptions=yes fi fi $RM conftest* fi { $as_echo "$as_me:$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= { $as_echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 $as_echo_n "checking for $compiler option to produce PIC... " >&6; } 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' ;; 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 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) 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' ;; pgcc* | pgf77* | pgf90* | pgf95*) # 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*) # IBM XL C 8.0/Fortran 10.1 on PPC lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-qpic' lt_prog_compiler_static='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Wl,' ;; *Sun\ F*) # 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='' ;; 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*) 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:$LINENO: result: $lt_prog_compiler_pic" >&5 $as_echo "$lt_prog_compiler_pic" >&6; } # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then { $as_echo "$as_me:$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 test "${lt_cv_prog_compiler_pic_works+set}" = set; 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:10964: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:10968: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works=yes fi fi $RM conftest* fi { $as_echo "$as_me:$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:$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 test "${lt_cv_prog_compiler_static_works+set}" = set; 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 "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then 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:$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:$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 test "${lt_cv_prog_compiler_c_o+set}" = set; 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:11069: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:11073: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_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:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } { $as_echo "$as_me:$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 test "${lt_cv_prog_compiler_c_o+set}" = set; 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:11124: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:11128: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_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:$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:$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:$LINENO: result: $hard_links" >&5 $as_echo "$hard_links" >&6; } if test "$hard_links" = no; then { $as_echo "$as_me:$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:$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_flag_spec_ld= 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 if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH 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 *\ [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.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to modify your PATH *** so that a non-GNU linker is found, and then restart. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support 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' 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/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' 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 ;; 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) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test "$tmp_diet" = no then tmp_addflag= tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 whole_archive_flag_spec= tmp_sharedflag='--shared' ;; xl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' 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*) # 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= hardcode_libdir_flag_spec_ld='-rpath $libdir' archive_cmds='$LD -shared $libobjs $deplibs $compiler_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 $compiler_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 $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' 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 $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 ;; 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 $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 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 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")) && (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. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/ p } }' aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; 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 $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; 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. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/ p } }' aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; 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' # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec='$convenience' 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. 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 `$ECHO "X$deplibs" | $Xsed -e '\''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' fix_srcfile_path='`cygpath -w "$srcfile"`' enable_shared_with_static_runtimes=yes ;; darwin* | rhapsody*) archive_cmds_need_lc=no hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported whole_archive_flag_spec='' 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=echo 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 ;; freebsd1*) ld_shlibs=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 -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 -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else 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 -a "$with_gnu_ld" = no; then archive_cmds='$CC -shared -fPIC ${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_flag_spec_ld='+b $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 -a "$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 -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) 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' ;; *) archive_cmds='$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 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 $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" cat >conftest.$ac_ext <<_ACEOF int foo(void) {} _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LDFLAGS="$save_LDFLAGS" else archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' fi 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" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${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" && $ECHO "X-set_version $verstring" | $Xsed` -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} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' 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" && $ECHO "X-set_version $verstring" | $Xsed` -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 "X-set_version $verstring" | $Xsed` -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 ${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 ${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:$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:$LINENO: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } 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:$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:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } then archive_cmds_need_lc=no else archive_cmds_need_lc=yes fi allow_undefined_flag=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* { $as_echo "$as_me:$LINENO: result: $archive_cmds_need_lc" >&5 $as_echo "$archive_cmds_need_lc" >&6; } ;; esac fi ;; esac { $as_echo "$as_me:$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 lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"` if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'` else lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path/$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" else test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO $lt_tmp_lt_search_path_spec | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo="/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[lt_foo]++; } if (lt_freq[lt_foo] == 1) { print lt_foo; } }'` sys_lib_search_path_spec=`$ECHO $lt_search_path_spec` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix[4-9]*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[123]*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; interix[3-9]*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux* | k*bsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then shlibpath_overrides_runpath=yes fi else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Add ABI-specific directories to the system library path. sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib" # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $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 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { $as_echo "$as_me:$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:$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:$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:$LINENO: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if test "${ac_cv_lib_dl_dlopen+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* 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 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_dl_dlopen=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = x""yes; 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 ;; *) { $as_echo "$as_me:$LINENO: checking for shl_load" >&5 $as_echo_n "checking for shl_load... " >&6; } if test "${ac_cv_func_shl_load+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define shl_load to an innocuous variant, in case declares shl_load. For example, HP-UX 11i declares gettimeofday. */ #define shl_load innocuous_shl_load /* System header to define __stub macros and hopefully few prototypes, which can conflict with char shl_load (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef shl_load /* 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 (); /* 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_shl_load || defined __stub___shl_load choke me #endif int main () { return shl_load (); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_func_shl_load=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_shl_load=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 $as_echo "$ac_cv_func_shl_load" >&6; } if test "x$ac_cv_func_shl_load" = x""yes; then lt_cv_dlopen="shl_load" else { $as_echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 $as_echo_n "checking for shl_load in -ldld... " >&6; } if test "${ac_cv_lib_dld_shl_load+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* 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 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_dld_shl_load=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_shl_load=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$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" = x""yes; then lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" else { $as_echo "$as_me:$LINENO: checking for dlopen" >&5 $as_echo_n "checking for dlopen... " >&6; } if test "${ac_cv_func_dlopen+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define dlopen to an innocuous variant, in case declares dlopen. For example, HP-UX 11i declares gettimeofday. */ #define dlopen innocuous_dlopen /* System header to define __stub macros and hopefully few prototypes, which can conflict with char dlopen (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef dlopen /* 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 (); /* 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_dlopen || defined __stub___dlopen choke me #endif int main () { return dlopen (); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_func_dlopen=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_dlopen=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 $as_echo "$ac_cv_func_dlopen" >&6; } if test "x$ac_cv_func_dlopen" = x""yes; then lt_cv_dlopen="dlopen" else { $as_echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if test "${ac_cv_lib_dl_dlopen+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* 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 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_dl_dlopen=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = x""yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else { $as_echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 $as_echo_n "checking for dlopen in -lsvld... " >&6; } if test "${ac_cv_lib_svld_dlopen+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* 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 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_svld_dlopen=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_svld_dlopen=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5 $as_echo "$ac_cv_lib_svld_dlopen" >&6; } if test "x$ac_cv_lib_svld_dlopen" = x""yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" else { $as_echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 $as_echo_n "checking for dld_link in -ldld... " >&6; } if test "${ac_cv_lib_dld_dld_link+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* 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 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_dld_dld_link=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_dld_link=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$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" = x""yes; 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:$LINENO: checking whether a program can dlopen itself" >&5 $as_echo_n "checking whether a program can dlopen itself... " >&6; } if test "${lt_cv_dlopen_self+set}" = set; 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 13927 "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && 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:$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:$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 test "${lt_cv_dlopen_self_static+set}" = set; 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 14023 "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && 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:$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:$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:$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:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi ;; *) { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } ;; esac fi # Report which library types will actually be built { $as_echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 $as_echo_n "checking if libtool supports shared libraries... " >&6; } { $as_echo "$as_me:$LINENO: result: $can_build_shared" >&5 $as_echo "$can_build_shared" >&6; } { $as_echo "$as_me:$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:$LINENO: result: $enable_shared" >&5 $as_echo "$enable_shared" >&6; } { $as_echo "$as_me:$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:$LINENO: result: $enable_static" >&5 $as_echo "$enable_static" >&6; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC="$lt_save_CC" ac_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_flag_spec_ld_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 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_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} compiler=$CC 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 "X$cc_temp" | $Xsed -e 's%.*/%%' -e "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:$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:$LINENO: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else { $as_echo "$as_me:$LINENO: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi if test "${lt_cv_path_LD+set}" = set; 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:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi test -z "$LD" && { { $as_echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 $as_echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} { (exit 1); exit 1; }; } { $as_echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if test "${lt_cv_prog_gnu_ld+set}" = set; 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 -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -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 "\-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:$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. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/ p } }' aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; 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 $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; 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. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/ p } }' aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; 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' # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec_CXX='$convenience' 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*) # _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' 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 ;; darwin* | rhapsody*) archive_cmds_need_lc_CXX=no hardcode_direct_CXX=no hardcode_automatic_CXX=yes hardcode_shlibpath_var_CXX=unsupported whole_archive_flag_spec_CXX='' 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=echo 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 ;; freebsd[12]*) # 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*) ;; 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; $ECHO "X$list" | $Xsed' ;; *) if test "$GXX" = yes; then archive_cmds_CXX='$RM $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support 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; $ECHO "X$list" | $Xsed' ;; *) 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 -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support 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" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. 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 -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` -o $lib' fi fi 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) 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; $ECHO "X$list" | $Xsed' 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 | $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 | $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 | $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 | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; *) # Version 6 will 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; $ECHO \"$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=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' ;; xl*) # IBM XL 8.0 on PPC, with GNU ld 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; $ECHO \"$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='echo' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. 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=echo 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" && $ECHO "X${wl}-set_version $verstring" | $Xsed` -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" && $ECHO "X-set_version $verstring" | $Xsed` -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 "X-set_version $verstring" | $Xsed` -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=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then 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" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; *) archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; esac 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 "\-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*) # 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='echo' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. 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 -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 -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. 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 "\-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' ;; *) 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:$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 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do case $p in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test $p = "-L" || test $p = "-R"; then prev=$p continue else prev= fi if test "$pre_test_object_deps_done" = no; then case $p in -L* | -R*) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$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 ;; *.$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 # 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*) # 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= { $as_echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 $as_echo_n "checking for $compiler option to produce PIC... " >&6; } # 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= ;; 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 ;; 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) 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*) # IBM XL 8.0 on PPC 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*) # 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:$LINENO: result: $lt_prog_compiler_pic_CXX" >&5 $as_echo "$lt_prog_compiler_pic_CXX" >&6; } # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic_CXX"; then { $as_echo "$as_me:$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 test "${lt_cv_prog_compiler_pic_works_CXX+set}" = set; 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:16043: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:16047: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works_CXX=yes fi fi $RM conftest* fi { $as_echo "$as_me:$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:$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 test "${lt_cv_prog_compiler_static_works_CXX+set}" = set; 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 "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then 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:$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:$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 test "${lt_cv_prog_compiler_c_o_CXX+set}" = set; 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:16142: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:16146: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_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:$LINENO: result: $lt_cv_prog_compiler_c_o_CXX" >&5 $as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; } { $as_echo "$as_me:$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 test "${lt_cv_prog_compiler_c_o_CXX+set}" = set; 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:16194: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:16198: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_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:$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:$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:$LINENO: result: $hard_links" >&5 $as_echo "$hard_links" >&6; } if test "$hard_links" = no; then { $as_echo "$as_me:$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:$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' case $host_os in aix[4-9]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (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*) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;/^.*[ ]__nm__/s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' ;; *) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' { $as_echo "$as_me:$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:$LINENO: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } 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:$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:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } then archive_cmds_need_lc_CXX=no else 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* { $as_echo "$as_me:$LINENO: result: $archive_cmds_need_lc_CXX" >&5 $as_echo "$archive_cmds_need_lc_CXX" >&6; } ;; esac fi ;; esac { $as_echo "$as_me:$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 library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix[4-9]*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[123]*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; interix[3-9]*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux* | k*bsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl_CXX\"; \ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec_CXX\"" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then shlibpath_overrides_runpath=yes fi else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Add ABI-specific directories to the system library path. sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib" # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $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 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { $as_echo "$as_me:$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:$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:$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 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=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_config_commands="$ac_config_commands libtool" # Only expand once: if test x"$enable_static$enable_all_static" = xnoyes; then { { $as_echo "$as_me:$LINENO: error: You cannot pass --enable-all-static without one of --enable-static or --disable-shared" >&5 $as_echo "$as_me: error: You cannot pass --enable-all-static without one of --enable-static or --disable-shared" >&2;} { (exit 1); exit 1; }; } fi if test $enable_static = yes; then CR_ENABLE_STATIC_TRUE= CR_ENABLE_STATIC_FALSE='#' else CR_ENABLE_STATIC_TRUE='#' CR_ENABLE_STATIC_FALSE= fi if test $enable_shared = yes; then CR_ENABLE_SHARED_TRUE= CR_ENABLE_SHARED_FALSE='#' else CR_ENABLE_SHARED_TRUE='#' CR_ENABLE_SHARED_FALSE= fi # Check for rpmbuild for ac_prog in rpmbuild rpmb rpm 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:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_RPMBUILD+set}" = set; then $as_echo_n "(cached) " >&6 else case $RPMBUILD in [\\/]* | ?:[\\/]*) ac_cv_path_RPMBUILD="$RPMBUILD" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_dummy="$PATH:/usr/lib/rpm" for as_dir in $as_dummy do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_RPMBUILD="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi RPMBUILD=$ac_cv_path_RPMBUILD if test -n "$RPMBUILD"; then { $as_echo "$as_me:$LINENO: result: $RPMBUILD" >&5 $as_echo "$RPMBUILD" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi test -n "$RPMBUILD" && break done test -n "$RPMBUILD" || RPMBUILD="none" if $RPMBUILD -bs 2>&1 | grep 'no spec' >/dev/null 2>/dev/null; then : else RPMBUILD=none fi if test $RPMBUILD != none; then HAVE_RPMBUILD_TRUE= HAVE_RPMBUILD_FALSE='#' else HAVE_RPMBUILD_TRUE='#' HAVE_RPMBUILD_FALSE= fi # Check for a GNU C compiler (or a work alike?) 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:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:$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:$LINENO: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:$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:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:$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:$LINENO: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:$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:$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:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:$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:$LINENO: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:$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:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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:$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:$LINENO: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:$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:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:$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:$LINENO: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:$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:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:$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:$LINENO: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:$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:$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:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 $as_echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; }; } # Provide some information about the compiler. $as_echo "$as_me:$LINENO: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { $as_echo "$as_me:$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 test "${ac_cv_c_compiler_gnu+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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:$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:$LINENO: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if test "${ac_cv_prog_cc_g+set}" = set; 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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CFLAGS="" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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:$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:$LINENO: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* 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" 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_c89=$ac_arg else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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:$LINENO: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:$LINENO: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CC" am_compiler_list= { $as_echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if test "${am_cv_CC_dependencies_compiler_type+set}" = set; 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'. 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 8's {/usr,}/bin/sh. touch 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 ;; 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:$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 if test "$GCC" = yes; then : else 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:$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= ;; #( *) $as_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 test "x$cache_file" != "x/dev/null" && { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache { { $as_echo "$as_me:$LINENO: error: the C compiler '$CC' is not a GNU C compiler." >&5 $as_echo "$as_me: error: the C compiler '$CC' is not a GNU C compiler." >&2;} { (exit 1); exit 1; }; } fi # Configure inlining (XXX: need to probe gcc for support?) cat >>confdefs.h <<\_ACEOF #define CR_INLINE static __inline__ __attribute__ ((__unused__)) _ACEOF # Check for additional flags needed when building libcr if test x"$cr_build_libcr" = xyes; then CR_LIBCR_CFLAGS="" { $as_echo "$as_me:$LINENO: checking whether gcc accepts -Wall" >&5 $as_echo_n "checking whether gcc accepts -Wall... " >&6; } if test "${cr_cv_gcc_flag_WALL+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CFLAGS=$CFLAGS CFLAGS="$CFLAGS -Wall" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then cr_cv_gcc_flag_WALL=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cr_cv_gcc_flag_WALL=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS=$SAVE_CFLAGS fi { $as_echo "$as_me:$LINENO: result: $cr_cv_gcc_flag_WALL" >&5 $as_echo "$cr_cv_gcc_flag_WALL" >&6; } if eval test $cr_cv_gcc_flag_WALL = yes; then CR_LIBCR_CFLAGS="$CR_LIBCR_CFLAGS -Wall" else : fi { $as_echo "$as_me:$LINENO: checking whether gcc accepts -Wno-unused-function" >&5 $as_echo_n "checking whether gcc accepts -Wno-unused-function... " >&6; } if test "${cr_cv_gcc_flag_WNO_UNUSED_FUNCTION+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CFLAGS=$CFLAGS CFLAGS="$CFLAGS -Wno-unused-function" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then cr_cv_gcc_flag_WNO_UNUSED_FUNCTION=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cr_cv_gcc_flag_WNO_UNUSED_FUNCTION=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS=$SAVE_CFLAGS fi { $as_echo "$as_me:$LINENO: result: $cr_cv_gcc_flag_WNO_UNUSED_FUNCTION" >&5 $as_echo "$cr_cv_gcc_flag_WNO_UNUSED_FUNCTION" >&6; } if eval test $cr_cv_gcc_flag_WNO_UNUSED_FUNCTION = yes; then CR_LIBCR_CFLAGS="$CR_LIBCR_CFLAGS -Wno-unused-function" else : fi fi # cr_build_libcr # Additional flags needed when linking utils, tests and examples CR_CLIENT_LDADD="" if test x"$enable_all_static" = xyes; then CR_CLIENT_LDADD="$CR_CLIENT_LDADD -all-static" fi ################################################################################ # Check libraries ################################################################################ if test x"$cr_build_libcr" = xyes; then # Check for a sufficiently new glibc # XXX: What is our true lower bound? { $as_echo "$as_me:$LINENO: checking for GNU libc version >= 2.2" >&5 $as_echo_n "checking for GNU libc version >= 2.2... " >&6; } if test "${cr_cv_check_glibc_2_2_or_higher+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef __GLIBC_PREREQ #define __GLIBC_PREREQ(maj, min) \ ((__GLIBC__ << 16) + __GLIBC_MINOR__ >= ((maj) << 16) + (min)) #endif #if !__GLIBC_PREREQ(2, 2) #error "Bad glibc version" #endif extern int gnu_get_libc_version(void); /* Ensures this *is* glibc */ int main () { return !gnu_get_libc_version(); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then cr_cv_check_glibc_2_2_or_higher=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cr_cv_check_glibc_2_2_or_higher=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $cr_cv_check_glibc_2_2_or_higher" >&5 $as_echo "$cr_cv_check_glibc_2_2_or_higher" >&6; } if eval test $cr_cv_check_glibc_2_2_or_higher = yes; then : else 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:$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= ;; #( *) $as_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 test "x$cache_file" != "x/dev/null" && { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache { { $as_echo "$as_me:$LINENO: error: the C library does not appear to be glibc 2.2 or higher." >&5 $as_echo "$as_me: error: the C library does not appear to be glibc 2.2 or higher." >&2;} { (exit 1); exit 1; }; } fi # Checks for required libraries and fail if they are not found # Note that we are NOT adding them to LIBS, just verifying their presence. { $as_echo "$as_me:$LINENO: checking for dlsym in -ldl" >&5 $as_echo_n "checking for dlsym in -ldl... " >&6; } if test "${ac_cv_lib_dl_dlsym+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* 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 dlsym (); int main () { return dlsym (); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_dl_dlsym=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlsym=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlsym" >&5 $as_echo "$ac_cv_lib_dl_dlsym" >&6; } if test "x$ac_cv_lib_dl_dlsym" = x""yes; then : else 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:$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= ;; #( *) $as_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 test "x$cache_file" != "x/dev/null" && { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache { { $as_echo "$as_me:$LINENO: error: required library libdl not found." >&5 $as_echo "$as_me: error: required library libdl not found." >&2;} { (exit 1); exit 1; }; } fi { $as_echo "$as_me:$LINENO: checking for pthread_create in -lpthread" >&5 $as_echo_n "checking for pthread_create in -lpthread... " >&6; } if test "${ac_cv_lib_pthread_pthread_create+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* 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 pthread_create (); int main () { return pthread_create (); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_pthread_pthread_create=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_pthread_pthread_create=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_create" >&5 $as_echo "$ac_cv_lib_pthread_pthread_create" >&6; } if test "x$ac_cv_lib_pthread_pthread_create" = x""yes; then : else 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:$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= ;; #( *) $as_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 test "x$cache_file" != "x/dev/null" && { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache { { $as_echo "$as_me:$LINENO: error: required library libpthread not found." >&5 $as_echo "$as_me: error: required library libpthread not found." >&2;} { (exit 1); exit 1; }; } fi # Prep a variable for possible use in messages below if test x"$enable_multilib" = xyes; then ldsuggest='-L/usr/lib/nptl -L/usr/lib64/nptl' elif test x"$ac_cv_sizeof_void_p" = x8; then ldsuggest='-L/usr/lib64/nptl' else ldsuggest='-L/usr/lib/nptl' fi # Helper for LinuxThreads probes # CR_LT_PROBE(cv_varname, cross_varname) # Look for LinuxThreads in the default (probably dynamic) library { $as_echo "$as_me:$LINENO: checking whether default pthreads library is LinuxThreads" >&5 $as_echo_n "checking whether default pthreads library is LinuxThreads... " >&6; } if test "${cr_cv_pt_default_lt+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_LIBS="$LIBS" LIBS="-lpthread $LIBS" if test "$cross_compiling" = yes; then if test "${cross_linuxthreads-unset}" = unset; then { { $as_echo "$as_me:$LINENO: error: When cross-compiling, variable cross_linuxthreads must be set." >&5 $as_echo "$as_me: error: When cross-compiling, variable cross_linuxthreads must be set." >&2;} { (exit 1); exit 1; }; } fi if test x"$cross_linuxthreads" != x0; then cr_cv_pt_default_lt=yes else cr_cv_pt_default_lt=no fi else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include static void *thread_pid(void *arg) { return (void *)(long)getpid(); } int main(void) { pthread_t th; void *join_val; if (0 != pthread_create(&th, NULL, &thread_pid, NULL)) { fputs("Error calling pthread_create()\n", stderr); return -1; } if (0 != pthread_join(th, &join_val)) { fputs("Error calling pthread_join()\n", stderr); return -1; } /* zero = NOT equal pids = LinuxThreads */ return ((long)join_val == (long)getpid()); } _ACEOF rm -f 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cr_cv_pt_default_lt=yes 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 ( exit $ac_status ) cr_cv_pt_default_lt=no fi rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi LIBS="$SAVE_LIBS" fi { $as_echo "$as_me:$LINENO: result: $cr_cv_pt_default_lt" >&5 $as_echo "$cr_cv_pt_default_lt" >&6; } if test x"$cr_cv_pt_default_lt" = xyes; then { { $as_echo "$as_me:$LINENO: error: linking of BLCR to LinuxThreads is NOT supported. Please try LDFLAGS='$ldsuggest' (or similar) on the configure command line to get NPTL." >&5 $as_echo "$as_me: error: linking of BLCR to LinuxThreads is NOT supported. Please try LDFLAGS='$ldsuggest' (or similar) on the configure command line to get NPTL." >&2;} { (exit 1); exit 1; }; } fi # Now look for LinuxThreads in the static libs if we are building static ones ourself if test x"$enable_static" = xyes; then # Look for LinuxThreads in the static library { $as_echo "$as_me:$LINENO: checking whether static pthreads library is LinuxThreads" >&5 $as_echo_n "checking whether static pthreads library is LinuxThreads... " >&6; } if test "${cr_cv_pt_static_lt+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_LIBS="$LIBS" SAVE_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -static" LIBS="-lpthread $LIBS" if test "$cross_compiling" = yes; then if test "${cross_linuxthreads_static-unset}" = unset; then { { $as_echo "$as_me:$LINENO: error: When cross-compiling, variable cross_linuxthreads_static must be set." >&5 $as_echo "$as_me: error: When cross-compiling, variable cross_linuxthreads_static must be set." >&2;} { (exit 1); exit 1; }; } fi if test x"$cross_linuxthreads_static" != x0; then cr_cv_pt_static_lt=yes else cr_cv_pt_static_lt=no fi else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include static void *thread_pid(void *arg) { return (void *)(long)getpid(); } int main(void) { pthread_t th; void *join_val; if (0 != pthread_create(&th, NULL, &thread_pid, NULL)) { fputs("Error calling pthread_create()\n", stderr); return -1; } if (0 != pthread_join(th, &join_val)) { fputs("Error calling pthread_join()\n", stderr); return -1; } /* zero = NOT equal pids = LinuxThreads */ return ((long)join_val == (long)getpid()); } _ACEOF rm -f 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cr_cv_pt_static_lt=yes 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 ( exit $ac_status ) cr_cv_pt_static_lt=no fi rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi LIBS="$SAVE_LIBS" LDFLAGS="$SAVE_LDFLAGS" fi { $as_echo "$as_me:$LINENO: result: $cr_cv_pt_static_lt" >&5 $as_echo "$cr_cv_pt_static_lt" >&6; } if test x"$cr_cv_pt_static_lt" = xyes; then { $as_echo "$as_me:$LINENO: WARNING: static linking with pthreads appears to yield LinuxThreads, but BLCR supports only NPTL." >&5 $as_echo "$as_me: WARNING: static linking with pthreads appears to yield LinuxThreads, but BLCR supports only NPTL." >&2;} cr_static_link_warning="yes" if test x"$enable_all_static" = xyes; then 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:$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= ;; #( *) $as_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 test "x$cache_file" != "x/dev/null" && { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache { { $as_echo "$as_me:$LINENO: error: static linking of BLCR to LinuxThreads is NOT supported. Please try LDFLAGS='$ldsuggest' (or similar) on the configure command line to get NPTL." >&5 $as_echo "$as_me: error: static linking of BLCR to LinuxThreads is NOT supported. Please try LDFLAGS='$ldsuggest' (or similar) on the configure command line to get NPTL." >&2;} { (exit 1); exit 1; }; } fi fi fi # Check for atfork handling for ac_func in __register_atfork do as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 $as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* 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 $ac_func (); /* 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_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then eval "$as_ac_var=yes" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } as_val=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done # Check for call to disable NSCD for ac_func in __nss_disable_nscd do as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 $as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* 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 $ac_func (); /* 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_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then eval "$as_ac_var=yes" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } as_val=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done # Check for pthread_attr_setstacksize SAVE_LIBS="$LIBS" LIBS="-lpthread $LIBS" for ac_func in pthread_attr_setstacksize do as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 $as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* 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 $ac_func (); /* 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_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then eval "$as_ac_var=yes" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } as_val=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done LIBS="$SAVE_LIBS" # Look for prctl(PR_SET_PDEATHSIG, ...) { $as_echo "$as_me:$LINENO: checking for pctrl()" >&5 $as_echo_n "checking for pctrl()... " >&6; } if test "${cr_cv_prctl+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { int rc = prctl(PR_SET_PDEATHSIG, 0); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then cr_cv_prctl=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cr_cv_prctl=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $cr_cv_prctl" >&5 $as_echo "$cr_cv_prctl" >&6; } if test x$cr_cv_prctl = xyes; then cat >>confdefs.h <<\_ACEOF #define HAVE_PRCTL 1 _ACEOF else cat >>confdefs.h <<\_ACEOF #define HAVE_PRCTL 0 _ACEOF fi # Check various constants needed for asm SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -I${TOP_SRCDIR}/include" CR_ASM_OP_HAND_CHKPT="" { $as_echo "$as_me:$LINENO: checking for value for CR_ASM_OP_HAND_CHKPT" >&5 $as_echo_n "checking for value for CR_ASM_OP_HAND_CHKPT... " >&6; } if test "${cr_cv_compute_int_CR_ASM_OP_HAND_CHKPT+set}" = set; then $as_echo_n "(cached) " >&6 else cr_cv_compute_int_CR_ASM_OP_HAND_CHKPT="not found" if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include "blcr_ioctl.h" int main () { static int test_array [1 - 2 * !((CR_OP_HAND_CHKPT) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include "blcr_ioctl.h" int main () { static int test_array [1 - 2 * !((CR_OP_HAND_CHKPT) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include "blcr_ioctl.h" int main () { static int test_array [1 - 2 * !((CR_OP_HAND_CHKPT) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include "blcr_ioctl.h" int main () { static int test_array [1 - 2 * !((CR_OP_HAND_CHKPT) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include "blcr_ioctl.h" int main () { static int test_array [1 - 2 * !((CR_OP_HAND_CHKPT) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) cr_cv_compute_int_CR_ASM_OP_HAND_CHKPT=$ac_lo;; '') ;; esac else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include "blcr_ioctl.h" static long int longval () { return CR_OP_HAND_CHKPT; } static unsigned long int ulongval () { return CR_OP_HAND_CHKPT; } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if ((CR_OP_HAND_CHKPT) < 0) { long int i = longval (); if (i != (CR_OP_HAND_CHKPT)) return 1; fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); if (i != (CR_OP_HAND_CHKPT)) return 1; fprintf (f, "%lu", i); } /* Do not output a trailing newline, as this causes \r\n confusion on some platforms. */ return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF rm -f 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cr_cv_compute_int_CR_ASM_OP_HAND_CHKPT=`cat conftest.val` 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 fi rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi { $as_echo "$as_me:$LINENO: result: $cr_cv_compute_int_CR_ASM_OP_HAND_CHKPT" >&5 $as_echo "$cr_cv_compute_int_CR_ASM_OP_HAND_CHKPT" >&6; } if test "$cr_cv_compute_int_CR_ASM_OP_HAND_CHKPT" != "not found"; then CR_ASM_OP_HAND_CHKPT="$cr_cv_compute_int_CR_ASM_OP_HAND_CHKPT" fi if test -n "$CR_ASM_OP_HAND_CHKPT"; then cat >>confdefs.h <<_ACEOF #define CR_ASM_OP_HAND_CHKPT $CR_ASM_OP_HAND_CHKPT _ACEOF fi CR_ASM_CHECKPOINT_STUB="" { $as_echo "$as_me:$LINENO: checking for value for CR_ASM_CHECKPOINT_STUB" >&5 $as_echo_n "checking for value for CR_ASM_CHECKPOINT_STUB... " >&6; } if test "${cr_cv_compute_int_CR_ASM_CHECKPOINT_STUB+set}" = set; then $as_echo_n "(cached) " >&6 else cr_cv_compute_int_CR_ASM_CHECKPOINT_STUB="not found" if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include "blcr_common.h.in" int main () { static int test_array [1 - 2 * !((_CR_CHECKPOINT_STUB) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include "blcr_common.h.in" int main () { static int test_array [1 - 2 * !((_CR_CHECKPOINT_STUB) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include "blcr_common.h.in" int main () { static int test_array [1 - 2 * !((_CR_CHECKPOINT_STUB) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include "blcr_common.h.in" int main () { static int test_array [1 - 2 * !((_CR_CHECKPOINT_STUB) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include "blcr_common.h.in" int main () { static int test_array [1 - 2 * !((_CR_CHECKPOINT_STUB) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) cr_cv_compute_int_CR_ASM_CHECKPOINT_STUB=$ac_lo;; '') ;; esac else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include "blcr_common.h.in" static long int longval () { return _CR_CHECKPOINT_STUB; } static unsigned long int ulongval () { return _CR_CHECKPOINT_STUB; } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if ((_CR_CHECKPOINT_STUB) < 0) { long int i = longval (); if (i != (_CR_CHECKPOINT_STUB)) return 1; fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); if (i != (_CR_CHECKPOINT_STUB)) return 1; fprintf (f, "%lu", i); } /* Do not output a trailing newline, as this causes \r\n confusion on some platforms. */ return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF rm -f 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cr_cv_compute_int_CR_ASM_CHECKPOINT_STUB=`cat conftest.val` 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 fi rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi { $as_echo "$as_me:$LINENO: result: $cr_cv_compute_int_CR_ASM_CHECKPOINT_STUB" >&5 $as_echo "$cr_cv_compute_int_CR_ASM_CHECKPOINT_STUB" >&6; } if test "$cr_cv_compute_int_CR_ASM_CHECKPOINT_STUB" != "not found"; then CR_ASM_CHECKPOINT_STUB="$cr_cv_compute_int_CR_ASM_CHECKPOINT_STUB" fi if test -n "$CR_ASM_CHECKPOINT_STUB"; then cat >>confdefs.h <<_ACEOF #define CR_ASM_CHECKPOINT_STUB $CR_ASM_CHECKPOINT_STUB _ACEOF fi # ICK! CR_ASM_OP_HAND_ABORT="" { $as_echo "$as_me:$LINENO: checking for value for CR_ASM_OP_HAND_ABORT" >&5 $as_echo_n "checking for value for CR_ASM_OP_HAND_ABORT... " >&6; } if test "${cr_cv_compute_int_CR_ASM_OP_HAND_ABORT+set}" = set; then $as_echo_n "(cached) " >&6 else cr_cv_compute_int_CR_ASM_OP_HAND_ABORT="not found" if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include "blcr_ioctl.h" int main () { static int test_array [1 - 2 * !((CR_OP_HAND_ABORT) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include "blcr_ioctl.h" int main () { static int test_array [1 - 2 * !((CR_OP_HAND_ABORT) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include "blcr_ioctl.h" int main () { static int test_array [1 - 2 * !((CR_OP_HAND_ABORT) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include "blcr_ioctl.h" int main () { static int test_array [1 - 2 * !((CR_OP_HAND_ABORT) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include "blcr_ioctl.h" int main () { static int test_array [1 - 2 * !((CR_OP_HAND_ABORT) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) cr_cv_compute_int_CR_ASM_OP_HAND_ABORT=$ac_lo;; '') ;; esac else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include "blcr_ioctl.h" static long int longval () { return CR_OP_HAND_ABORT; } static unsigned long int ulongval () { return CR_OP_HAND_ABORT; } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if ((CR_OP_HAND_ABORT) < 0) { long int i = longval (); if (i != (CR_OP_HAND_ABORT)) return 1; fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); if (i != (CR_OP_HAND_ABORT)) return 1; fprintf (f, "%lu", i); } /* Do not output a trailing newline, as this causes \r\n confusion on some platforms. */ return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF rm -f 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cr_cv_compute_int_CR_ASM_OP_HAND_ABORT=`cat conftest.val` 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 fi rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi { $as_echo "$as_me:$LINENO: result: $cr_cv_compute_int_CR_ASM_OP_HAND_ABORT" >&5 $as_echo "$cr_cv_compute_int_CR_ASM_OP_HAND_ABORT" >&6; } if test "$cr_cv_compute_int_CR_ASM_OP_HAND_ABORT" != "not found"; then CR_ASM_OP_HAND_ABORT="$cr_cv_compute_int_CR_ASM_OP_HAND_ABORT" fi if test -n "$CR_ASM_OP_HAND_ABORT"; then cat >>confdefs.h <<_ACEOF #define CR_ASM_OP_HAND_ABORT $CR_ASM_OP_HAND_ABORT _ACEOF fi CR_ASM_CHECKPOINT_OMIT="" { $as_echo "$as_me:$LINENO: checking for value for CR_ASM_CHECKPOINT_OMIT" >&5 $as_echo_n "checking for value for CR_ASM_CHECKPOINT_OMIT... " >&6; } if test "${cr_cv_compute_int_CR_ASM_CHECKPOINT_OMIT+set}" = set; then $as_echo_n "(cached) " >&6 else cr_cv_compute_int_CR_ASM_CHECKPOINT_OMIT="not found" if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include "blcr_common.h.in" int main () { static int test_array [1 - 2 * !((CR_CHECKPOINT_OMIT) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include "blcr_common.h.in" int main () { static int test_array [1 - 2 * !((CR_CHECKPOINT_OMIT) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include "blcr_common.h.in" int main () { static int test_array [1 - 2 * !((CR_CHECKPOINT_OMIT) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include "blcr_common.h.in" int main () { static int test_array [1 - 2 * !((CR_CHECKPOINT_OMIT) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include "blcr_common.h.in" int main () { static int test_array [1 - 2 * !((CR_CHECKPOINT_OMIT) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) cr_cv_compute_int_CR_ASM_CHECKPOINT_OMIT=$ac_lo;; '') ;; esac else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include "blcr_common.h.in" static long int longval () { return CR_CHECKPOINT_OMIT; } static unsigned long int ulongval () { return CR_CHECKPOINT_OMIT; } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if ((CR_CHECKPOINT_OMIT) < 0) { long int i = longval (); if (i != (CR_CHECKPOINT_OMIT)) return 1; fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); if (i != (CR_CHECKPOINT_OMIT)) return 1; fprintf (f, "%lu", i); } /* Do not output a trailing newline, as this causes \r\n confusion on some platforms. */ return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF rm -f 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cr_cv_compute_int_CR_ASM_CHECKPOINT_OMIT=`cat conftest.val` 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 fi rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi { $as_echo "$as_me:$LINENO: result: $cr_cv_compute_int_CR_ASM_CHECKPOINT_OMIT" >&5 $as_echo "$cr_cv_compute_int_CR_ASM_CHECKPOINT_OMIT" >&6; } if test "$cr_cv_compute_int_CR_ASM_CHECKPOINT_OMIT" != "not found"; then CR_ASM_CHECKPOINT_OMIT="$cr_cv_compute_int_CR_ASM_CHECKPOINT_OMIT" fi if test -n "$CR_ASM_CHECKPOINT_OMIT"; then cat >>confdefs.h <<_ACEOF #define CR_ASM_CHECKPOINT_OMIT $CR_ASM_CHECKPOINT_OMIT _ACEOF fi # ICK! CR_ASM_SI_PID_OFFSET="" { $as_echo "$as_me:$LINENO: checking for value for CR_ASM_SI_PID_OFFSET" >&5 $as_echo_n "checking for value for CR_ASM_SI_PID_OFFSET... " >&6; } if test "${cr_cv_compute_int_CR_ASM_SI_PID_OFFSET+set}" = set; then $as_echo_n "(cached) " >&6 else cr_cv_compute_int_CR_ASM_SI_PID_OFFSET="not found" if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #ifndef offsetof #define offsetof(TYPE, MEMBER) ((unsigned long) &((TYPE *)0)->MEMBER) #endif int main () { static int test_array [1 - 2 * !((offsetof(siginfo_t, si_pid)) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #ifndef offsetof #define offsetof(TYPE, MEMBER) ((unsigned long) &((TYPE *)0)->MEMBER) #endif int main () { static int test_array [1 - 2 * !((offsetof(siginfo_t, si_pid)) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #ifndef offsetof #define offsetof(TYPE, MEMBER) ((unsigned long) &((TYPE *)0)->MEMBER) #endif int main () { static int test_array [1 - 2 * !((offsetof(siginfo_t, si_pid)) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #ifndef offsetof #define offsetof(TYPE, MEMBER) ((unsigned long) &((TYPE *)0)->MEMBER) #endif int main () { static int test_array [1 - 2 * !((offsetof(siginfo_t, si_pid)) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #ifndef offsetof #define offsetof(TYPE, MEMBER) ((unsigned long) &((TYPE *)0)->MEMBER) #endif int main () { static int test_array [1 - 2 * !((offsetof(siginfo_t, si_pid)) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) cr_cv_compute_int_CR_ASM_SI_PID_OFFSET=$ac_lo;; '') ;; esac else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #ifndef offsetof #define offsetof(TYPE, MEMBER) ((unsigned long) &((TYPE *)0)->MEMBER) #endif static long int longval () { return offsetof(siginfo_t, si_pid); } static unsigned long int ulongval () { return offsetof(siginfo_t, si_pid); } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if ((offsetof(siginfo_t, si_pid)) < 0) { long int i = longval (); if (i != (offsetof(siginfo_t, si_pid))) return 1; fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); if (i != (offsetof(siginfo_t, si_pid))) return 1; fprintf (f, "%lu", i); } /* Do not output a trailing newline, as this causes \r\n confusion on some platforms. */ return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF rm -f 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cr_cv_compute_int_CR_ASM_SI_PID_OFFSET=`cat conftest.val` 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 fi rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi { $as_echo "$as_me:$LINENO: result: $cr_cv_compute_int_CR_ASM_SI_PID_OFFSET" >&5 $as_echo "$cr_cv_compute_int_CR_ASM_SI_PID_OFFSET" >&6; } if test "$cr_cv_compute_int_CR_ASM_SI_PID_OFFSET" != "not found"; then CR_ASM_SI_PID_OFFSET="$cr_cv_compute_int_CR_ASM_SI_PID_OFFSET" fi if test -n "$CR_ASM_SI_PID_OFFSET"; then cat >>confdefs.h <<_ACEOF #define CR_ASM_SI_PID_OFFSET $CR_ASM_SI_PID_OFFSET _ACEOF fi CR_ASM_NR_ioctl="" { $as_echo "$as_me:$LINENO: checking for value for CR_ASM_NR_ioctl" >&5 $as_echo_n "checking for value for CR_ASM_NR_ioctl... " >&6; } if test "${cr_cv_compute_int_CR_ASM_NR_ioctl+set}" = set; then $as_echo_n "(cached) " >&6 else cr_cv_compute_int_CR_ASM_NR_ioctl="not found" if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { static int test_array [1 - 2 * !((__NR_ioctl) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { static int test_array [1 - 2 * !((__NR_ioctl) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { static int test_array [1 - 2 * !((__NR_ioctl) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { static int test_array [1 - 2 * !((__NR_ioctl) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { static int test_array [1 - 2 * !((__NR_ioctl) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) cr_cv_compute_int_CR_ASM_NR_ioctl=$ac_lo;; '') ;; esac else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include static long int longval () { return __NR_ioctl; } static unsigned long int ulongval () { return __NR_ioctl; } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if ((__NR_ioctl) < 0) { long int i = longval (); if (i != (__NR_ioctl)) return 1; fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); if (i != (__NR_ioctl)) return 1; fprintf (f, "%lu", i); } /* Do not output a trailing newline, as this causes \r\n confusion on some platforms. */ return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF rm -f 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cr_cv_compute_int_CR_ASM_NR_ioctl=`cat conftest.val` 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 fi rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi { $as_echo "$as_me:$LINENO: result: $cr_cv_compute_int_CR_ASM_NR_ioctl" >&5 $as_echo "$cr_cv_compute_int_CR_ASM_NR_ioctl" >&6; } if test "$cr_cv_compute_int_CR_ASM_NR_ioctl" != "not found"; then CR_ASM_NR_ioctl="$cr_cv_compute_int_CR_ASM_NR_ioctl" fi if test -n "$CR_ASM_NR_ioctl"; then cat >>confdefs.h <<_ACEOF #define CR_ASM_NR_ioctl $CR_ASM_NR_ioctl _ACEOF fi CR_ASM_NR_rt_sigreturn="" { $as_echo "$as_me:$LINENO: checking for value for CR_ASM_NR_rt_sigreturn" >&5 $as_echo_n "checking for value for CR_ASM_NR_rt_sigreturn... " >&6; } if test "${cr_cv_compute_int_CR_ASM_NR_rt_sigreturn+set}" = set; then $as_echo_n "(cached) " >&6 else cr_cv_compute_int_CR_ASM_NR_rt_sigreturn="not found" if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { static int test_array [1 - 2 * !((__NR_rt_sigreturn) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { static int test_array [1 - 2 * !((__NR_rt_sigreturn) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { static int test_array [1 - 2 * !((__NR_rt_sigreturn) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { static int test_array [1 - 2 * !((__NR_rt_sigreturn) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { static int test_array [1 - 2 * !((__NR_rt_sigreturn) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) cr_cv_compute_int_CR_ASM_NR_rt_sigreturn=$ac_lo;; '') ;; esac else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include static long int longval () { return __NR_rt_sigreturn; } static unsigned long int ulongval () { return __NR_rt_sigreturn; } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if ((__NR_rt_sigreturn) < 0) { long int i = longval (); if (i != (__NR_rt_sigreturn)) return 1; fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); if (i != (__NR_rt_sigreturn)) return 1; fprintf (f, "%lu", i); } /* Do not output a trailing newline, as this causes \r\n confusion on some platforms. */ return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF rm -f 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cr_cv_compute_int_CR_ASM_NR_rt_sigreturn=`cat conftest.val` 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 fi rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi { $as_echo "$as_me:$LINENO: result: $cr_cv_compute_int_CR_ASM_NR_rt_sigreturn" >&5 $as_echo "$cr_cv_compute_int_CR_ASM_NR_rt_sigreturn" >&6; } if test "$cr_cv_compute_int_CR_ASM_NR_rt_sigreturn" != "not found"; then CR_ASM_NR_rt_sigreturn="$cr_cv_compute_int_CR_ASM_NR_rt_sigreturn" fi if test -n "$CR_ASM_NR_rt_sigreturn"; then cat >>confdefs.h <<_ACEOF #define CR_ASM_NR_rt_sigreturn $CR_ASM_NR_rt_sigreturn _ACEOF fi CFLAGS="$SAVE_CFLAGS" # Probe for direction of stack growth { $as_echo "$as_me:$LINENO: checking for direction of stack growth" >&5 $as_echo_n "checking for direction of stack growth... " >&6; } if test "${cr_cv_check_stack_direction+set}" = set; then $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then if test "${cross_stack_direction-unset}" = unset; then { { $as_echo "$as_me:$LINENO: error: When cross-compiling, variable cross_stack_direction must be set." >&5 $as_echo "$as_me: error: When cross-compiling, variable cross_stack_direction must be set." >&2;} { (exit 1); exit 1; }; } fi if test $cross_stack_direction = 1; then cr_cv_check_stack_direction=up else cr_cv_check_stack_direction=down fi else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int find_stack_direction (void) { static char *addr = 0; auto char dummy; if (addr == 0) { addr = &dummy; return find_stack_direction(); } else { return (&dummy > addr) ? 0 : 1; } } int main(void) { return find_stack_direction(); } _ACEOF rm -f 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cr_cv_check_stack_direction=up 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 ( exit $ac_status ) cr_cv_check_stack_direction=down fi rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi { $as_echo "$as_me:$LINENO: result: $cr_cv_check_stack_direction" >&5 $as_echo "$cr_cv_check_stack_direction" >&6; } if test $cr_cv_check_stack_direction = up; then cr_stack_direction=1 else cr_stack_direction=-1 fi cat >>confdefs.h <<_ACEOF #define CR_STACK_GROWTH $cr_stack_direction _ACEOF # Look for FTB header and libs cr_have_ftb=no if test x"$FTB_HOME" != xno; then cr_have_ftb=yes SAVE_CPPFLAGS="$CPPFLAGS" SAVE_LDFLAGS="$LDFLAGS" SAVE_LIBS="$LIBS" CR_FTB_INCLUDES="" CR_FTB_LDFLAGS="" { $as_echo "$as_me:$LINENO: checking for FTB headers" >&5 $as_echo_n "checking for FTB headers... " >&6; } if test "${cr_cv_ftb_incdir+set}" = set; then $as_echo_n "(cached) " >&6 else cr_result=no for cr_tmp in "" "${FTB_HOME}/include"; do CPPFLAGS="$SAVE_CPPFLAGS${cr_tmp:+ -I$cr_tmp}" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { FTB_client_t x; ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then cr_result="$cr_tmp"; break else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done if test -z "$cr_result"; then cr_cv_ftb_incdir="default" else cr_cv_ftb_incdir="$cr_result" fi fi { $as_echo "$as_me:$LINENO: result: $cr_cv_ftb_incdir" >&5 $as_echo "$cr_cv_ftb_incdir" >&6; } if test x"$cr_cv_ftb_incdir" = xno; then cr_have_ftb=no elif test x"$cr_cv_ftb_incdir" != "xdefault"; then CR_FTB_INCLUDES="-I$cr_cv_ftb_incdir" fi { $as_echo "$as_me:$LINENO: checking for FTB libs" >&5 $as_echo_n "checking for FTB libs... " >&6; } if test "${cr_cv_ftb_libdir+set}" = set; then $as_echo_n "(cached) " >&6 else CPPFLAGS="$SAVE_CPPFLAGS $CR_FTB_INCLUDES" LIBS="-lftb -lpthread $SAVE_LIBS" cr_result=no for cr_tmp in "" "${FTB_HOME}/lib64" "${FTB_HOME}/lib32" "${FTB_HOME}/lib"; do LDFLAGS="$SAVE_LDFLAGS${cr_tmp:+-L$cr_tmp}" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { return FTB_Connect(NULL, NULL); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then cr_result="$cr_tmp"; break else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext done if test -z "$cr_result"; then cr_cv_ftb_libdir="default" else cr_cv_ftb_libdir="$cr_result" fi fi { $as_echo "$as_me:$LINENO: result: $cr_cv_ftb_libdir" >&5 $as_echo "$cr_cv_ftb_libdir" >&6; } if test x"$cr_cv_ftb_libdir" = xno; then cr_have_ftb=no elif test x"$cr_cv_ftb_libdir" != "xdefault"; then CR_FTB_LDFLAGS="-L$cr_cv_ftb_libdir" CR_FTB_LDADD="-lftb" fi LIBS="$SAVE_LIBS" LDFLAGS="$SAVE_LDFLAGS" CPPFLAGS="$SAVE_CPPFLAGS" if test x"$cr_have_ftb$cr_force_ftb" = xnoyes; then { { $as_echo "$as_me:$LINENO: error: Configured with --with-ftb='$FTB_HOME', but unable to build FTB test case" >&5 $as_echo "$as_me: error: Configured with --with-ftb='$FTB_HOME', but unable to build FTB test case" >&2;} { (exit 1); exit 1; }; } fi fi if test x$cr_have_ftb = xyes; then cat >>confdefs.h <<\_ACEOF #define HAVE_FTB 1 _ACEOF else cat >>confdefs.h <<\_ACEOF #define HAVE_FTB 0 _ACEOF fi fi # cr_build_libcr # Probe libc for the RT signal number to use { $as_echo "$as_me:$LINENO: checking for value of CR_SIGNUM" >&5 $as_echo_n "checking for value of CR_SIGNUM... " >&6; } if test "${cr_cv_check_cr_signum+set}" = set; then $as_echo_n "(cached) " >&6 else cr_cv_check_cr_signum="failed" SAVE_LIBS="$LIBS" LIBS="-ldl -lpthread $LIBS" if test "$cross_compiling" = yes; then if test "${cross_signum-unset}" = unset; then { { $as_echo "$as_me:$LINENO: error: When cross-compiling, variable cross_signum must be set." >&5 $as_echo "$as_me: error: When cross-compiling, variable cross_signum must be set." >&2;} { (exit 1); exit 1; }; } fi cr_cv_check_cr_signum=$cross_signum else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include extern int __libc_allocate_rtsig(int); int main() { int s = -1; FILE *f=fopen("conftestval", "w"); void *dlhandle = dlopen(NULL, RTLD_LAZY); if (dlhandle) { int *tmp = (int *)dlsym(dlhandle, "cri_signum"); dlclose(dlhandle); if (tmp) s = *tmp; } if (s <= 0) { s=__libc_allocate_rtsig(0); } if (!f || s<=0) return(1); fprintf(f, "%d\n", s); return(0); } _ACEOF rm -f 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cr_cv_check_cr_signum=`cat conftestval` 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 ( exit $ac_status ) { { $as_echo "$as_me:$LINENO: error: Failed to probe CR_SIGNUM" >&5 $as_echo "$as_me: error: Failed to probe CR_SIGNUM" >&2;} { (exit 1); exit 1; }; } fi rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi LIBS="$SAVE_LIBS" fi { $as_echo "$as_me:$LINENO: result: $cr_cv_check_cr_signum" >&5 $as_echo "$cr_cv_check_cr_signum" >&6; } CR_SIGNUM=$cr_cv_check_cr_signum # Check for 32- or 64-bit architecture # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { $as_echo "$as_me:$LINENO: checking size of void *" >&5 $as_echo_n "checking size of void *... " >&6; } if test "${ac_cv_sizeof_void_p+set}" = set; then $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long int) (sizeof (void *))) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long int) (sizeof (void *))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long int) (sizeof (void *))) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long int) (sizeof (void *))) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long int) (sizeof (void *))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_void_p=$ac_lo;; '') if test "$ac_cv_type_void_p" = yes; then { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (void *) See \`config.log' for more details." >&5 $as_echo "$as_me: error: cannot compute sizeof (void *) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; }; } else ac_cv_sizeof_void_p=0 fi ;; esac else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default static long int longval () { return (long int) (sizeof (void *)); } static unsigned long int ulongval () { return (long int) (sizeof (void *)); } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if (((long int) (sizeof (void *))) < 0) { long int i = longval (); if (i != ((long int) (sizeof (void *)))) return 1; fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); if (i != ((long int) (sizeof (void *)))) return 1; fprintf (f, "%lu", i); } /* Do not output a trailing newline, as this causes \r\n confusion on some platforms. */ return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF rm -f 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_void_p=`cat conftest.val` 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 ( exit $ac_status ) if test "$ac_cv_type_void_p" = yes; then { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (void *) See \`config.log' for more details." >&5 $as_echo "$as_me: error: cannot compute sizeof (void *) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; }; } else ac_cv_sizeof_void_p=0 fi fi rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi { $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_void_p" >&5 $as_echo "$ac_cv_sizeof_void_p" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_VOID_P $ac_cv_sizeof_void_p _ACEOF CR_LIBARCH=$CR_ARCH if test $ac_cv_sizeof_void_p != $cr_wordsize; then if test $cr_wordsize = 8; then CR_LIBARCH=${CR_LIBARCH32:-$CR_ARCH32} else { { $as_echo "$as_me:$LINENO: error: CC='$CC' yields sizeof(void *) = $ac_cv_sizeof_void_p when expecting $cr_wordsize.$clue" >&5 $as_echo "$as_me: error: CC='$CC' yields sizeof(void *) = $ac_cv_sizeof_void_p when expecting $cr_wordsize.$clue" >&2;} { (exit 1); exit 1; }; } fi fi ################################################################################ # Sub-configure for 32-bit libs on 64-bit platforms ################################################################################ cr_build_libcr32=no if test x"$enable_multilib" = xyes; then if test x"$cr_build_libcr" != xyes; then { { $as_echo "$as_me:$LINENO: error: --enable-multilib requested but not building libcr" >&5 $as_echo "$as_me: error: --enable-multilib requested but not building libcr" >&2;} { (exit 1); exit 1; }; } elif test -f "${TOP_BUILDDIR}/configure.ac"; then # More robust than TOP_BUILDDIR == TOP_SRCDIR { { $as_echo "$as_me:$LINENO: error: When requesting --enable-multilib, you must configure/build in a directory other than the one holding the BLCR sources" >&5 $as_echo "$as_me: error: When requesting --enable-multilib, you must configure/build in a directory other than the one holding the BLCR sources" >&2;} { (exit 1); exit 1; }; } elif test -z "$CR_ARCH32"; then { { $as_echo "$as_me:$LINENO: error: --enable-multilib not supported on architecture $CR_ARCH" >&5 $as_echo "$as_me: error: --enable-multilib not supported on architecture $CR_ARCH" >&2;} { (exit 1); exit 1; }; } elif test $ac_cv_sizeof_void_p = 4; then { { $as_echo "$as_me:$LINENO: error: --enable-multilib requested but CC='$CC' generates 32-bit objects. Perhaps try configuring with CC='$CC -m64' or similar." >&5 $as_echo "$as_me: error: --enable-multilib requested but CC='$CC' generates 32-bit objects. Perhaps try configuring with CC='$CC -m64' or similar." >&2;} { (exit 1); exit 1; }; } elif test \! -d /lib64; then { { $as_echo "$as_me:$LINENO: error: --enable-multilib requested but /lib64 does not exist" >&5 $as_echo "$as_me: error: --enable-multilib requested but /lib64 does not exist" >&2;} { (exit 1); exit 1; }; } fi if test -z "$libdir32"; then if expr "$libdir" : '.*/lib64$' >/dev/null; then libdir32=`echo $libdir | sed -e 's/64$//'` elif test "$libdir" = '${exec_prefix}/lib'; then libdir32='${exec_prefix}/lib' libdir='${exec_prefix}/lib64' else { { $as_echo "$as_me:$LINENO: error: --enable-multilib requested but libdir='$libdir' does not end in 'lib64'" >&5 $as_echo "$as_me: error: --enable-multilib requested but libdir='$libdir' does not end in 'lib64'" >&2;} { (exit 1); exit 1; }; }; fi fi SUBCMD="${TOP_SRCDIR}/configure '--srcdir=${TOP_SRCDIR}' '--build=${CR_ARCH32}-linux' '--libdir=${libdir32}' --with-components=libcr,tests,examples" eval set -- $ac_configure_args for x in "$@"; do case "$x" in --host=*|--build=*|--target=*|host_alias=*|build_alias=*|target_alias=*|--libdir=*|--srcdir=*|--with-components=*|--enable-multilib|--enable-testsuite|--enable-init-script|CFLAGS=*|CXXFLAGS=*) # skip ;; *) # keep as-is SUBCMD="$SUBCMD '$x'" ;; esac done # Strip -m64 out of CFLAGS and CXXFLAGS, if present if test -n "$CFLAGS32"; then SUBCMD="$SUBCMD 'CFLAGS=$CFLAGS32'" elif test -n "$CFLAGS"; then set -- for x in $CFLAGS; do test x"$x" = "x-m64" || set -- "$@" "$x"; done SUBCMD="$SUBCMD 'CFLAGS=$@'" fi if test -n "$CXXFLAGS32"; then SUBCMD="$SUBCMD 'CXXFLAGS=$CXXFLAGS32'" elif test -n "$CXXFLAGS"; then set -- for x in $CXXFLAGS; do test x"$x" = "x-m64" || set -- "$@" "$x"; done SUBCMD="$SUBCMD 'CXXFLAGS=$@'" fi # Strip -m64 from definitions of CC and CXX, adding -m32 if test -n "$CC32"; then SUBCMD="$SUBCMD 'CC=$CC32'" else set -- for x in $CC; do test x"$x" = "x-m64" || set -- "$@" "$x"; done SUBCMD="$SUBCMD 'CC=$@ -m32'" fi if test -n "$CXX32"; then SUBCMD="$SUBCMD 'CXX=$CXX32'" elif test -n "$CXX" -a "$CXX" != no; then set -- for x in $CXX; do test x"$x" = "x-m64" || set -- "$@" "$x"; done SUBCMD="$SUBCMD 'CXX=$@ -m32'" fi # Look for 32-bit versions of remaining bin tools if test -n "$CPP32"; then SUBCMD="$SUBCMD 'CPP=$CPP32'" fi if test -n "$LD32"; then SUBCMD="$SUBCMD 'LD=$LD32'" fi if test -n "$AR32"; then SUBCMD="$SUBCMD 'AR=$AR32'" fi if test -n "$NM32"; then SUBCMD="$SUBCMD 'NM=$NM32'" fi if test -n "$RANLIB32"; then SUBCMD="$SUBCMD 'RANLIB=$RANLIB32'" fi # Others? { $as_echo "$as_me:$LINENO: >>>> BEGIN sub-configure for 32-bit libs >>>>" >&5 $as_echo "$as_me: >>>> BEGIN sub-configure for 32-bit libs >>>>" >&6;} { $as_echo "$as_me:$LINENO: ${SUBCMD}" >&5 $as_echo "$as_me: ${SUBCMD}" >&6;} ( mkdir -p libcr32 && cd libcr32 && ln -sf ../util . && eval "${SUBCMD}" ) if test "$?" = 0; then { $as_echo "$as_me:$LINENO: <<<< END sub-configure for 32-bit libs <<<<" >&5 $as_echo "$as_me: <<<< END sub-configure for 32-bit libs <<<<" >&6;} cr_build_libcr32=yes else rm -rf libcr32 { { $as_echo "$as_me:$LINENO: error: --enable-multilib requested but FAILED sub-configure for 32-bit libs" >&5 $as_echo "$as_me: error: --enable-multilib requested but FAILED sub-configure for 32-bit libs" >&2;} { (exit 1); exit 1; }; } fi fi if test x$cr_build_libcr32 = xyes; then CR_BUILD_LIBCR32_TRUE= CR_BUILD_LIBCR32_FALSE='#' else CR_BUILD_LIBCR32_TRUE='#' CR_BUILD_LIBCR32_FALSE= fi ################################################################################ # Check kernel (source location, symbol table, features, etc.) ################################################################################ if test x"$cr_build_modules" = xyes; then # Compiler to build kernel modules { $as_echo "$as_me:$LINENO: checking compiler to build kernel modules" >&5 $as_echo_n "checking compiler to build kernel modules... " >&6; } if test -n "${KCC}"; then { $as_echo "$as_me:$LINENO: result: $KCC (user setting)" >&5 $as_echo "$KCC (user setting)" >&6; } else KCC=$CC { $as_echo "$as_me:$LINENO: result: $KCC (default)" >&5 $as_echo "$KCC (default)" >&6; } fi # Find BSD-compatible NM command { $as_echo "$as_me:$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 test "${lt_cv_path_NM+set}" = set; 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:$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 "$ac_tool_prefix"; then for ac_prog in "dumpbin -symbols" "link -dump -symbols" 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:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_DUMPBIN+set}" = set; 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" $as_echo "$as_me:$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:$LINENO: result: $DUMPBIN" >&5 $as_echo "$DUMPBIN" >&6; } else { $as_echo "$as_me:$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 -symbols" "link -dump -symbols" 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:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_DUMPBIN+set}" = set; 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" $as_echo "$as_me:$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:$LINENO: result: $ac_ct_DUMPBIN" >&5 $as_echo "$ac_ct_DUMPBIN" >&6; } else { $as_echo "$as_me:$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:$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 if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" fi fi test -z "$NM" && NM=nm { $as_echo "$as_me:$LINENO: checking the name lister ($NM) interface" >&5 $as_echo_n "checking the name lister ($NM) interface... " >&6; } if test "${lt_cv_nm_interface+set}" = set; 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:22992: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 (eval echo "\"\$as_me:22995: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 (eval echo "\"\$as_me:22998: 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:$LINENO: result: $lt_cv_nm_interface" >&5 $as_echo "$lt_cv_nm_interface" >&6; } NM=$NM # First deal with user-specified kernel type (UP, SMP, BIGMEM, etc.) if any. case x"$with_kernel_type" in x|xyes|xno) ;; *) cr_kernel_type=`echo "$with_kernel_type" | tr 'a-z' 'A-Z'` cr_header="/boot/kernel.h" { $as_echo "$as_me:$LINENO: checking for $cr_header" >&5 $as_echo_n "checking for $cr_header... " >&6; }; cr_result=ok if test \! -e "$cr_header"; then cr_result='missing' elif test \! -r "$cr_header"; then cr_result='not readable' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } if test "$cr_result" != "ok"; then { { $as_echo "$as_me:$LINENO: error: You have requested '--with-kernel-type=$cr_kernel_type', but $cr_header is $cr_result." >&5 $as_echo "$as_me: error: You have requested '--with-kernel-type=$cr_kernel_type', but $cr_header is $cr_result." >&2;} { (exit 1); exit 1; }; } fi cr_kernel_var="__BOOT_KERNEL_$cr_kernel_type" if test -z "`grep \"$cr_kernel_var\" $cr_header 2>/dev/null`"; then { { $as_echo "$as_me:$LINENO: error: You have requested '--with-kernel-type=$cr_kernel_type', but $cr_header does not appear to support that type." >&5 $as_echo "$as_me: error: You have requested '--with-kernel-type=$cr_kernel_type', but $cr_header does not appear to support that type." >&2;} { (exit 1); exit 1; }; } fi # The following sed command transforms all the #ifndef lines from kernel.h into # corresponding preprocessor flags (on one line) which select the desired kernel type. # Note use of [] for m4 quoting of a sed command containing [ and ] CR_KTYPE_CPPFLAGS=`sed -n -e '/^#ifndef \('$cr_kernel_var'\)$/ {s//-D\1=1 /;H;}' \ -e '/^#ifndef \(__BOOT_KERNEL_[A-Z]*\)$/ {s//-D\1=0 /;H;}' \ -e '$ {x;s/[ \t\n]\+/ /g;s/^ //;s/ $//;p;}' \ $cr_header` esac # Checks for required kernel src/obj dirs and fail if they are not found if test "${LINUX_OBJ_ARG+set}${cr_cv_var_LINUX_OBJ_ARG+set}" = setset; then if test "$LINUX_OBJ_ARG" != "$cr_cv_var_LINUX_OBJ_ARG"; then { { $as_echo "$as_me:$LINENO: error: Cached LINUX_OBJ_ARG ($cr_cv_var_LINUX_OBJ_ARG) does not match current value ($LINUX_OBJ_ARG). Remove '$cache_file' before re-running configure." >&5 $as_echo "$as_me: error: Cached LINUX_OBJ_ARG ($cr_cv_var_LINUX_OBJ_ARG) does not match current value ($LINUX_OBJ_ARG). Remove '$cache_file' before re-running configure." >&2;} { (exit 1); exit 1; }; } fi elif test "${cr_cv_var_LINUX_OBJ_ARG+set}" = set; then LINUX_OBJ_ARG="$cr_cv_var_LINUX_OBJ_ARG" fi if expr X"$LINUX_OBJ_ARG" : X/ >/dev/null; then # User provided a path { $as_echo "$as_me:$LINENO: checking for Linux kernel build in ${LINUX_OBJ_ARG}" >&5 $as_echo_n "checking for Linux kernel build in ${LINUX_OBJ_ARG}... " >&6; } cr_cvname=cr_cv_kernel_obj_`$as_echo "${LINUX_OBJ_ARG}" | $as_tr_sh` if { as_var=${cr_cvname}; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else if test -d "${LINUX_OBJ_ARG}"; then # Check for version.h for cr_version_h in ${LINUX_OBJ_ARG}/include/linux/version.h ${LINUX_OBJ_ARG}/include/generated/uapi/linux/version.h none; do test -r $cr_version_h && break done if test $cr_version_h = none; then cr_tmp='version.h missing' else cr_tmp=` $PERL -- - "${LINUX_OBJ_ARG}" "$KCC -E -I${LINUX_OBJ_ARG}/include -D__KERNEL__ -DMODULE $CR_KTYPE_CPPFLAGS $CPPFLAGS" <<'_EOF_' my ($srcdir, $cpp_cmd) = @ARGV; my $stamp = time; $cpp_cmd =~ s/([#()])/\\${LINUX_OBJ_ARG}/g; # quote problematic shell metachars FILE: foreach my $file (qw(linux/version.h linux/utsrelease.h generated/utsrelease.h)) { my $path = "$srcdir/include/$file"; next FILE unless (-f $path); open(F, "echo '=${stamp}->UTS_RELEASE<-' | ${cpp_cmd} -include ${path} - |") || exit 1; LINE: while () { next LINE if(/^#/); if ((my $uts) = /=${stamp}->"((2\.6|3\.[0-9]+)\.[0-9].*)"<-/o) { print "$uts\n"; exit 0; } } close(F) || exit 1; } exit 1; _EOF_ ` test $? = 0 || cr_tmp='no UTS_RELEASE could be extracted' LINUX_VERSION_H=$cr_version_h fi # Check for .config if required if expr "$cr_tmp" : '\(2\.6\|3\.[0-9][0-9]*\)\.' >/dev/null; then test -r "${LINUX_OBJ_ARG}/.config" || cr_tmp='.config missing' fi else cr_tmp='not found' fi eval "$cr_cvname='$cr_tmp'" unset cr_tmp fi eval "cr_result=\$$cr_cvname" unset cr_cvname if expr "$cr_result" : '\(2\.6\|3\.[0-9][0-9]*\)\.' >/dev/null; then { $as_echo "$as_me:$LINENO: result: found version $cr_result" >&5 $as_echo "found version $cr_result" >&6; } else { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } fi # Check that version appears acceptible if expr "$cr_result" : '\(2\.6\|3\.[0-9][0-9]*\)\.' >/dev/null; then cr_linux_obj_ver="$cr_result" else cr_linux_obj_ver='' fi if test -z "$cr_linux_obj_ver"; then { { $as_echo "$as_me:$LINENO: error: Directory ${LINUX_OBJ_ARG} does not appear to contain a Linux kernel build" >&5 $as_echo "$as_me: error: Directory ${LINUX_OBJ_ARG} does not appear to contain a Linux kernel build" >&2;} { (exit 1); exit 1; }; } else : fi LINUX_OBJ="${LINUX_OBJ_ARG}" else if test -z "$LINUX_OBJ_ARG"; then cr_tmp_ver=`uname -r` elif expr "$LINUX_OBJ_ARG" : '\(2\.6\|3\.[0-9][0-9]*\)\.' >/dev/null; then cr_tmp_ver="$LINUX_OBJ_ARG" else { { $as_echo "$as_me:$LINENO: error: --with-linux argument '$LINUX_OBJ_ARG' is neither a kernel version string nor a full path" >&5 $as_echo "$as_me: error: --with-linux argument '$LINUX_OBJ_ARG' is neither a kernel version string nor a full path" >&2;} { (exit 1); exit 1; }; } fi cr_ver_patt="`echo $cr_tmp_ver | sed -e 's/\./\\\\./g;'`\$" # Search standard locations for cr_linux_dir in \ /lib/modules/${cr_tmp_ver}/build \ /usr/src/linux-${cr_tmp_ver}-obj \ /usr/src/linux-${cr_tmp_ver} \ /usr/src/linux-headers-${cr_tmp_ver} \ /usr/src/kernels/${cr_tmp_ver} \ ; do { $as_echo "$as_me:$LINENO: checking for Linux kernel build in ${cr_linux_dir}" >&5 $as_echo_n "checking for Linux kernel build in ${cr_linux_dir}... " >&6; } cr_cvname=cr_cv_kernel_obj_`$as_echo "${cr_linux_dir}" | $as_tr_sh` if { as_var=${cr_cvname}; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else if test -d "${cr_linux_dir}"; then # Check for version.h for cr_version_h in ${cr_linux_dir}/include/linux/version.h ${cr_linux_dir}/include/generated/uapi/linux/version.h none; do test -r $cr_version_h && break done if test $cr_version_h = none; then cr_tmp='version.h missing' else cr_tmp=` $PERL -- - "${cr_linux_dir}" "$KCC -E -I${cr_linux_dir}/include -D__KERNEL__ -DMODULE $CR_KTYPE_CPPFLAGS $CPPFLAGS" <<'_EOF_' my ($srcdir, $cpp_cmd) = @ARGV; my $stamp = time; $cpp_cmd =~ s/([#()])/\\${cr_linux_dir}/g; # quote problematic shell metachars FILE: foreach my $file (qw(linux/version.h linux/utsrelease.h generated/utsrelease.h)) { my $path = "$srcdir/include/$file"; next FILE unless (-f $path); open(F, "echo '=${stamp}->UTS_RELEASE<-' | ${cpp_cmd} -include ${path} - |") || exit 1; LINE: while () { next LINE if(/^#/); if ((my $uts) = /=${stamp}->"((2\.6|3\.[0-9]+)\.[0-9].*)"<-/o) { print "$uts\n"; exit 0; } } close(F) || exit 1; } exit 1; _EOF_ ` test $? = 0 || cr_tmp='no UTS_RELEASE could be extracted' LINUX_VERSION_H=$cr_version_h fi # Check for .config if required if expr "$cr_tmp" : '\(2\.6\|3\.[0-9][0-9]*\)\.' >/dev/null; then test -r "${cr_linux_dir}/.config" || cr_tmp='.config missing' fi else cr_tmp='not found' fi eval "$cr_cvname='$cr_tmp'" unset cr_tmp fi eval "cr_result=\$$cr_cvname" unset cr_cvname if expr "$cr_result" : '\(2\.6\|3\.[0-9][0-9]*\)\.' >/dev/null; then { $as_echo "$as_me:$LINENO: result: found version $cr_result" >&5 $as_echo "found version $cr_result" >&6; } else { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } fi # Check that version appears acceptible if expr "$cr_result" : ${cr_ver_patt} >/dev/null; then cr_linux_obj_ver="$cr_result" else cr_linux_obj_ver='' fi if test -n "$cr_linux_obj_ver"; then LINUX_OBJ="${cr_linux_dir}" break fi done if test -z "$cr_linux_obj_ver"; then { { $as_echo "$as_me:$LINENO: error: Could not find a directory containing a Linux kernel ${cr_tmp_ver} build. Perhaps try --with-linux=FULL_PATH_TO_KERNEL_BUILD" >&5 $as_echo "$as_me: error: Could not find a directory containing a Linux kernel ${cr_tmp_ver} build. Perhaps try --with-linux=FULL_PATH_TO_KERNEL_BUILD" >&2;} { (exit 1); exit 1; }; } else : fi unset cr_tmp_ver fi if test -n "$cr_linux_obj_ver"; then cr_linux_src_ver='' if test "${LINUX_SRC_ARG+set}${cr_cv_var_LINUX_SRC_ARG+set}" = setset; then if test "$LINUX_SRC_ARG" != "$cr_cv_var_LINUX_SRC_ARG"; then { { $as_echo "$as_me:$LINENO: error: Cached LINUX_SRC_ARG ($cr_cv_var_LINUX_SRC_ARG) does not match current value ($LINUX_SRC_ARG). Remove '$cache_file' before re-running configure." >&5 $as_echo "$as_me: error: Cached LINUX_SRC_ARG ($cr_cv_var_LINUX_SRC_ARG) does not match current value ($LINUX_SRC_ARG). Remove '$cache_file' before re-running configure." >&2;} { (exit 1); exit 1; }; } fi elif test "${cr_cv_var_LINUX_SRC_ARG+set}" = set; then LINUX_SRC_ARG="$cr_cv_var_LINUX_SRC_ARG" fi if expr X"$LINUX_SRC_ARG" : X/ >/dev/null; then cr_list="$LINUX_SRC_ARG" elif test -n "$LINUX_SRC_ARG"; then { { $as_echo "$as_me:$LINENO: error: --with-linux-src argument '$LINUX_SRC_ARG' is not a full path" >&5 $as_echo "$as_me: error: --with-linux-src argument '$LINUX_SRC_ARG' is not a full path" >&2;} { (exit 1); exit 1; }; } else # Search standard locations cr_list="${LINUX_OBJ} \ /lib/modules/$cr_linux_obj_ver/source \ /usr/src/linux-$cr_linux_obj_ver \ /usr/src/linux-headers-$cr_linux_obj_ver \ /usr/src/kernels/$cr_linux_obj_ver" fi for cr_linux_dir in $cr_list; do { $as_echo "$as_me:$LINENO: checking for Linux kernel source in $cr_linux_dir" >&5 $as_echo_n "checking for Linux kernel source in $cr_linux_dir... " >&6; } cr_cvname=cr_cv_kernel_src_`$as_echo "$cr_linux_dir" | $as_tr_sh` if { as_var=${cr_cvname}; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else cr_tmp='' if test -e "$cr_linux_dir/Makefile"; then # First try using version.h, as some distros play odd games w/ the Makefile for cr_version_h in $cr_linux_dir/include/linux/version.h $cr_linux_dir/include/generated/uapi/linux/version.h none; do test -r $cr_version_h && break done if test $cr_version_h = none; then cr_tmp='version.h missing' else cr_tmp=` $PERL -- - "$cr_linux_dir" "$KCC -E -I$cr_linux_dir/include -D__KERNEL__ -DMODULE $CR_KTYPE_CPPFLAGS $CPPFLAGS" <<'_EOF_' my ($srcdir, $cpp_cmd) = @ARGV; my $stamp = time; $cpp_cmd =~ s/([#()])/\\$cr_linux_dir/g; # quote problematic shell metachars FILE: foreach my $file (qw(linux/version.h linux/utsrelease.h generated/utsrelease.h)) { my $path = "$srcdir/include/$file"; next FILE unless (-f $path); open(F, "echo '=${stamp}->UTS_RELEASE<-' | ${cpp_cmd} -include ${path} - |") || exit 1; LINE: while () { next LINE if(/^#/); if ((my $uts) = /=${stamp}->"((2\.6|3\.[0-9]+)\.[0-9].*)"<-/o) { print "$uts\n"; exit 0; } } close(F) || exit 1; } exit 1; _EOF_ ` test $? = 0 || cr_tmp='no UTS_RELEASE could be extracted' LINUX_VERSION_H=$cr_version_h fi # Now trim EXTRAVERSION, or yield empty if no pattern match cr_tmp=`echo $cr_tmp | sed -n -e '/^\(\(2\.6\|3\.[0-9][0-9]*\)\.[0-9]\+\).*$/ {s//\1/p;q;}'` # Next try "asking" the Makefile if test -z "$cr_tmp"; then # If a dependency does not exist, then make may complain. # The -k and 2>/dev/null take care of that. cr_tmp=`(make -k echo_kver --no-print-directory -C $cr_linux_dir -f - 2>/dev/null | grep '^\(2\.6\|3\.[0-9][0-9]*\)\.') <<'_EOF_' echo_kver: @echo '$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)' include Makefile _EOF_` expr "$cr_tmp" : '\(2\.6\|3\.[0-9][0-9]*\)\.' >/dev/null || cr_tmp='' # Reject if not matched to pattern fi # Finally try grepping the Makefile if test -z "$cr_tmp"; then # Note the use of [] for m4 quoting, since the pattern contains [ and ] cr_linux_ver1=`sed -n -e '/^VERSION[ \t]*=[ \t]*\([0-9]\+\).*$/ {s//\1/p;q;}' "$cr_linux_dir/Makefile"` cr_linux_ver2=`sed -n -e '/^PATCHLEVEL[ \t]*=[ \t]*\([0-9]\+\).*$/ {s//\1/p;q;}' "$cr_linux_dir/Makefile"` cr_linux_ver3=`sed -n -e '/^SUBLEVEL[ \t]*=[ \t]*\([0-9]\+\).*$/ {s//\1/p;q;}' "$cr_linux_dir/Makefile"` cr_tmp="${cr_linux_ver1}.${cr_linux_ver2}.${cr_linux_ver3}" expr "$cr_tmp" : '\(2\.6\|3\.[0-9][0-9]*\)\.' >/dev/null || cr_tmp='' # Reject if not matched to pattern fi test -n "$cr_tmp" || cr_tmp='not found' elif test -d "$cr_linux_dir"; then cr_tmp='Makefile missing' else cr_tmp='not found' fi eval "$cr_cvname='$cr_tmp'" unset cr_tmp fi eval "cr_result=\$$cr_cvname" unset cr_cvname if expr "$cr_result" : '\(2\.6\|3\.[0-9][0-9]*\)\.' >/dev/null; then { $as_echo "$as_me:$LINENO: result: found version $cr_result" >&5 $as_echo "found version $cr_result" >&6; } else { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } fi # Check that version is acceptible (exact match, or a prefix with the next char non-numeric) case "$cr_linux_obj_ver" in ${cr_result}|${cr_result}[!0-9]*) # the outer [] is m4 quoting cr_linux_src_ver="$cr_result";; *) cr_linux_src_ver='';; esac if test -n "$cr_linux_src_ver"; then LINUX_SRC="$cr_linux_dir" break fi done if test -z "$cr_linux_src_ver"; then { { $as_echo "$as_me:$LINENO: error: Could not locate source directory corresponding to build directory '${LINUX_OBJ}'. Please use --with-linux-src=FULL_PATH_TO_KERNEL_SRC" >&5 $as_echo "$as_me: error: Could not locate source directory corresponding to build directory '${LINUX_OBJ}'. Please use --with-linux-src=FULL_PATH_TO_KERNEL_SRC" >&2;} { (exit 1); exit 1; }; } else : fi else : fi if test -n "$cr_linux_src_ver" -a -n "$cr_linux_obj_ver"; then case "$cr_linux_obj_ver" in 2.6.*) HAVE_LINUX_2_6=yes;; 3.*.*) HAVE_LINUX_3=yes;; esac LINUX_VER="$cr_linux_obj_ver" CR_KERNEL=`echo $cr_linux_obj_ver | tr - _` CR_KERNEL_BASE=`echo $CR_KERNEL | sed -e 's:smp\|enterprise\|bigmem\|hugemem::g'` test -n "$LINUX_SRC_ARG" && cr_cv_var_LINUX_SRC_ARG="$LINUX_SRC_ARG" test -n "$LINUX_OBJ_ARG" && cr_cv_var_LINUX_OBJ_ARG="$LINUX_OBJ_ARG" if test -z "$cache_file" || \ test "$cache_file" = /dev/null || \ cmp "${LINUX_OBJ}/.config" .cached_kconfig >/dev/null 2>/dev/null; then : # OK - either not caching or cached version still matches else if test -f .cached_kconfig; then { $as_echo "$as_me:$LINENO: WARNING: kernel configuration has changed... discarding cached results." >&5 $as_echo "$as_me: WARNING: kernel configuration has changed... discarding cached results." >&2;} rm -f .cached_kconfig fi for cr_var in cr_cv_kconfig__NON_EMPTY_HACK `(set) | grep "^cr_cv_kconfig_" | cut -d= -f1`; do unset $cr_var done cp "${LINUX_OBJ}/.config" .cached_kconfig fi else : fi if test -z "${HAVE_LINUX_2_6}" -a -z "${HAVE_LINUX_3}"; then 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:$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= ;; #( *) $as_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 test "x$cache_file" != "x/dev/null" && { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache { { $as_echo "$as_me:$LINENO: error: required Linux 2.6.x or 3.x.y kernel headers and/or build not found." >&5 $as_echo "$as_me: error: required Linux 2.6.x or 3.x.y kernel headers and/or build not found." >&2;} { (exit 1); exit 1; }; } fi # Module install dir { $as_echo "$as_me:$LINENO: checking directory to install kernel modules" >&5 $as_echo_n "checking directory to install kernel modules... " >&6; } if test -n "${CR_MODULE_DIR}"; then cr_why='passed via --with-kmod-dir' elif test ${sysconfdir} = /etc; then CR_MODULE_DIR="/lib/modules/${LINUX_VER}/extra" cr_why='default when sysconfdir=/etc' else CR_MODULE_DIR="${libdir}/${PACKAGE}/${LINUX_VER}" cr_why='default' fi { $as_echo "$as_me:$LINENO: result: ${CR_MODULE_DIR} ($cr_why)" >&5 $as_echo "${CR_MODULE_DIR} ($cr_why)" >&6; } # Checks for matching (we hope) symbol table { $as_echo "$as_me:$LINENO: checking for Linux kernel symbol table" >&5 $as_echo_n "checking for Linux kernel symbol table... " >&6; } if test "${LINUX_SYSTEM_MAP+set}${cr_cv_var_LINUX_SYSTEM_MAP+set}" = setset; then if test "$LINUX_SYSTEM_MAP" != "$cr_cv_var_LINUX_SYSTEM_MAP"; then { { $as_echo "$as_me:$LINENO: error: Cached LINUX_SYSTEM_MAP ($cr_cv_var_LINUX_SYSTEM_MAP) does not match current value ($LINUX_SYSTEM_MAP). Remove '$cache_file' before re-running configure." >&5 $as_echo "$as_me: error: Cached LINUX_SYSTEM_MAP ($cr_cv_var_LINUX_SYSTEM_MAP) does not match current value ($LINUX_SYSTEM_MAP). Remove '$cache_file' before re-running configure." >&2;} { (exit 1); exit 1; }; } fi elif test "${cr_cv_var_LINUX_SYSTEM_MAP+set}" = set; then LINUX_SYSTEM_MAP="$cr_cv_var_LINUX_SYSTEM_MAP" fi if test "${LINUX_VMLINUX+set}${cr_cv_var_LINUX_VMLINUX+set}" = setset; then if test "$LINUX_VMLINUX" != "$cr_cv_var_LINUX_VMLINUX"; then { { $as_echo "$as_me:$LINENO: error: Cached LINUX_VMLINUX ($cr_cv_var_LINUX_VMLINUX) does not match current value ($LINUX_VMLINUX). Remove '$cache_file' before re-running configure." >&5 $as_echo "$as_me: error: Cached LINUX_VMLINUX ($cr_cv_var_LINUX_VMLINUX) does not match current value ($LINUX_VMLINUX). Remove '$cache_file' before re-running configure." >&2;} { (exit 1); exit 1; }; } fi elif test "${cr_cv_var_LINUX_VMLINUX+set}" = set; then LINUX_VMLINUX="$cr_cv_var_LINUX_VMLINUX" fi LINUX_SYMTAB_CMD="" # First try validating the user's (or cached) selection if test -n "$LINUX_SYSTEM_MAP" ; then if test -n ""$LINUX_SYSTEM_MAP"" -a -r ""$LINUX_SYSTEM_MAP"" && grep -e '[TD] sys_open' -e '[AB] _end' <""$LINUX_SYSTEM_MAP"" >/dev/null 2>/dev/null; then if grep -B1 '[AB] _end' <""$LINUX_SYSTEM_MAP"" | grep _stext >/dev/null 2>/dev/null; then # Reject "stripped" files (such as in FC2) # Recognized (poorly) by _stext and _end as last two entries. cr_stripped_maps="$cr_stripped_maps "$LINUX_SYSTEM_MAP"" else LINUX_SYSTEM_MAP=""$LINUX_SYSTEM_MAP"" LINUX_SYMTAB_FILE=""$LINUX_SYSTEM_MAP"" LINUX_SYMTAB_CMD="cat "$LINUX_SYSTEM_MAP" 2>/dev/null" fi fi if test -z "$LINUX_SYMTAB_CMD"; then # The user specified a file, but we can't use it. Abort. { $as_echo "$as_me:$LINENO: result: failed" >&5 $as_echo "failed" >&6; } { { $as_echo "$as_me:$LINENO: error: Failed to validate \"$LINUX_SYSTEM_MAP\"" >&5 $as_echo "$as_me: error: Failed to validate \"$LINUX_SYSTEM_MAP\"" >&2;} { (exit 1); exit 1; }; } fi fi if test -z "$LINUX_SYMTAB_CMD" -a -n "$LINUX_VMLINUX" ; then if test -n ""$LINUX_VMLINUX"" -a -r ""$LINUX_VMLINUX"" && ($NM ""$LINUX_VMLINUX"" | grep -e '[TD] sys_open' -e '[AB] _end') >/dev/null 2>/dev/null; then LINUX_VMLINUX=""$LINUX_VMLINUX"" LINUX_SYMTAB_FILE=""$LINUX_VMLINUX"" LINUX_SYMTAB_CMD="$NM "$LINUX_VMLINUX" 2>/dev/null" fi if test -z "$LINUX_SYMTAB_CMD"; then # The user specified a file, but we can't use it. Abort. { $as_echo "$as_me:$LINENO: result: failed" >&5 $as_echo "failed" >&6; } { { $as_echo "$as_me:$LINENO: error: Failed to validate \"$LINUX_VMLINUX\"" >&5 $as_echo "$as_me: error: Failed to validate \"$LINUX_VMLINUX\"" >&2;} { (exit 1); exit 1; }; } fi fi # Next try searching for System.map or vmlinux in standard locations # Note we use the kernel version found in the headers, not `uname -r` if test -z "$LINUX_SYMTAB_CMD" ; then for cr_file_pattern in "$LINUX_OBJ/@-$LINUX_VER" \ "/boot/@-$LINUX_VER" \ "/@-$LINUX_VER" \ "$LINUX_OBJ/@" \ "/usr/lib/debug/boot/@-$LINUX_VER" \ "/usr/lib/debug/lib/modules/$LINUX_VER/@" \ ; do # Try System.map in the given location cr_file=`echo $cr_file_pattern | sed -e 's|@|System.map|'` if test -n "$cr_file" -a -r "$cr_file" && grep -e '[TD] sys_open' -e '[AB] _end' <"$cr_file" >/dev/null 2>/dev/null; then if grep -B1 '[AB] _end' <"$cr_file" | grep _stext >/dev/null 2>/dev/null; then # Reject "stripped" files (such as in FC2) # Recognized (poorly) by _stext and _end as last two entries. cr_stripped_maps="$cr_stripped_maps $cr_file" else LINUX_SYSTEM_MAP="$cr_file" LINUX_SYMTAB_FILE="$cr_file" LINUX_SYMTAB_CMD="cat $cr_file 2>/dev/null" fi fi if test -n "$LINUX_SYMTAB_CMD"; then break fi # Try vmlinux in the given location cr_file=`echo $cr_file_pattern | sed -e 's|@|vmlinux|'` if test -n "$cr_file" -a -r "$cr_file" && ($NM "$cr_file" | grep -e '[TD] sys_open' -e '[AB] _end') >/dev/null 2>/dev/null; then LINUX_VMLINUX="$cr_file" LINUX_SYMTAB_FILE="$cr_file" LINUX_SYMTAB_CMD="$NM $cr_file 2>/dev/null" fi if test -n "$LINUX_SYMTAB_CMD"; then break fi done fi # Announce our result if test -z "$LINUX_SYMTAB_CMD"; then LINUX_SYMTAB_CMD="true" { $as_echo "$as_me:$LINENO: result: failed" >&5 $as_echo "failed" >&6; } 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:$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= ;; #( *) $as_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 test "x$cache_file" != "x/dev/null" && { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache if test -n "$cr_stripped_maps"; then { $as_echo "$as_me:$LINENO: WARNING: Skipped stripped System.map file(s): $cr_stripped_maps" >&5 $as_echo "$as_me: WARNING: Skipped stripped System.map file(s): $cr_stripped_maps" >&2;} { { $as_echo "$as_me:$LINENO: error: Failed to locate kernel symbol table. Try installing the kernel-debuginfo package matching your kernel, or using --with-system-map or --with-vmlinux." >&5 $as_echo "$as_me: error: Failed to locate kernel symbol table. Try installing the kernel-debuginfo package matching your kernel, or using --with-system-map or --with-vmlinux." >&2;} { (exit 1); exit 1; }; } else { { $as_echo "$as_me:$LINENO: error: Failed to locate kernel symbol table. Try using --with-system-map or --with-vmlinux." >&5 $as_echo "$as_me: error: Failed to locate kernel symbol table. Try using --with-system-map or --with-vmlinux." >&2;} { (exit 1); exit 1; }; } fi else { $as_echo "$as_me:$LINENO: result: $LINUX_SYMTAB_FILE" >&5 $as_echo "$LINUX_SYMTAB_FILE" >&6; } test -n "$LINUX_SYSTEM_MAP" && cr_cv_var_LINUX_SYSTEM_MAP="$LINUX_SYSTEM_MAP" test -n "$LINUX_VMLINUX" && cr_cv_var_LINUX_VMLINUX="$LINUX_VMLINUX" if test -z "$cache_file" || \ test "$cache_file" = /dev/null || \ cmp "${LINUX_SYMTAB_FILE}" .cached_ksymtab >/dev/null 2>/dev/null; then : # OK - either not caching or cached version still matches else if test -f .cached_ksymtab; then { $as_echo "$as_me:$LINENO: WARNING: kernel symbol table has changed... discarding cached results." >&5 $as_echo "$as_me: WARNING: kernel symbol table has changed... discarding cached results." >&2;} rm -f .cached_ksymtab fi for cr_var in cr_cv_ksymtab__NON_EMPTY_HACK `(set) | grep "^cr_cv_ksymtab_" | cut -d= -f1`; do unset $cr_var done cp "${LINUX_SYMTAB_FILE}" .cached_ksymtab fi fi # Setup CR_KARCH to enable 32-bit user-space on 64-bit kernels CR_KARCH=$CR_ARCH if test $cr_wordsize = 4; then # Count pointer hex digits in the System.map to id a 64-bit kernel # Based on logic provided by Alan Woodland { $as_echo "$as_me:$LINENO: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if test "${ac_cv_path_EGREP+set}" = set; 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" { test -f "$ac_path_EGREP" && $as_test_x "$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 ac_count=`expr $ac_count + 1` 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_echo "$as_me:$LINENO: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 $as_echo "$as_me: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:$LINENO: checking if kernel and user-space wordsize match" >&5 $as_echo_n "checking if kernel and user-space wordsize match... " >&6; } if eval $LINUX_SYMTAB_CMD | head | $EGREP '^[a-f0-9]{16}' >/dev/null 2>&1;then { $as_echo "$as_me:$LINENO: result: no (32-bit user-space with 64-bit kernel)" >&5 $as_echo "no (32-bit user-space with 64-bit kernel)" >&6; } case $CR_KARCH in i386) CR_KARCH=x86_64;; ppc) CR_KARCH=ppc64;; sparc) CR_KARCH=sparc64;; esac else { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } fi fi # Configure automake/kbuild glue { $as_echo "$as_me:$LINENO: checking for parameters to interface GNU automake with Linux kbuild" >&5 $as_echo_n "checking for parameters to interface GNU automake with Linux kbuild... " >&6; } if test "${cr_cv_KBUILD_MAKE_ARGS+set}" = set; then $as_echo_n "(cached) " >&6 else if grep KBUILD_EXTMOD ${LINUX_SRC}/Makefile >/dev/null 2>/dev/null; then cr_cv_KBUILD_MAKE_ARGS='KBUILD_EXTMOD=$(builddir)' else cr_cv_KBUILD_MAKE_ARGS='SUBDIRS=$(builddir) modules' fi if test "${LINUX_OBJ}" != "${LINUX_SRC}"; then cr_cv_KBUILD_MAKE_ARGS="${cr_cv_KBUILD_MAKE_ARGS} O=${LINUX_OBJ}" fi if test x$enable_kbuild_verbose = xyes; then cr_cv_KBUILD_MAKE_ARGS="${cr_cv_KBUILD_MAKE_ARGS} V=1" fi if test x$cross_compiling = xyes; then cr_cv_KBUILD_MAKE_ARGS="$cr_cv_KBUILD_MAKE_ARGS ARCH=$CR_KARCH CROSS_COMPILE=$host_alias-" fi fi { $as_echo "$as_me:$LINENO: result: $cr_cv_KBUILD_MAKE_ARGS" >&5 $as_echo "$cr_cv_KBUILD_MAKE_ARGS" >&6; } KBUILD_MAKE_ARGS="$cr_cv_KBUILD_MAKE_ARGS" # Note: we'll actually try the result in CR_SET_KCFLAGS # Configure module compile flags and perform a sanity check case "$CR_KARCH" in ppc64) CR_KSYM_PATTERN_DATA='[bBdDgGrRsStTvV] ' CR_KSYM_PATTERN_CODE='[dD] ' ;; *) CR_KSYM_PATTERN_DATA='[bBdDgGrRsStTvV] ' CR_KSYM_PATTERN_CODE='[tT] ' ;; esac CR_KSYM_IMPORT_DECLS="${TOP_BUILDDIR}/.import_decls" echo '/* This file is autogenerated - do not edit or remove */' > $CR_KSYM_IMPORT_DECLS CR_KSYM_IMPORT_CALLS="${TOP_BUILDDIR}/.import_calls" echo '/* This file is autogenerated - do not edit or remove */' > $CR_KSYM_IMPORT_CALLS { $as_echo "$as_me:$LINENO: checking for flags to compile Linux kernel probes" >&5 $as_echo_n "checking for flags to compile Linux kernel probes... " >&6; } if test "${cr_cv_kconfig_kcflags+set}" = set; then $as_echo_n "(cached) " >&6 else rm -rf conftestdir mkdir conftestdir echo '#include ' > conftestdir/conftest.c echo 'int foo = 0;' >> conftestdir/conftest.c echo 'obj-m := conftest.o' >conftestdir/Makefile unset cr_tmp echo "make -C ${LINUX_SRC} builddir=\"`pwd`/conftestdir\" ${KBUILD_MAKE_ARGS} CC=\"${KCC}\" V=1" >&5 make -C ${LINUX_SRC} builddir="`pwd`/conftestdir" ${KBUILD_MAKE_ARGS} CC="${KCC}" V=1 >conftestdir/output 2>&1 &5 if test "${cr_tmp:+OK}" != OK; then { $as_echo "$as_me:$LINENO: result: FAILED" >&5 $as_echo "FAILED" >&6; } cat conftestdir/output if $EGREP 'include/(asm|linux)/[a-zA-Z0-9_-]+\.h:' conftestdir/output >/dev/null 2>&1; then { $as_echo "$as_me:$LINENO: WARNING: Apparent compilation problem in ${LINUX_SRC}" >&5 $as_echo "$as_me: WARNING: Apparent compilation problem in ${LINUX_SRC}" >&2;} ver=`$KCC --version | head -1` { $as_echo "$as_me:$LINENO: WARNING: Perhaps KCC='$KCC' ($ver) is not compatible with this kernel source" >&5 $as_echo "$as_me: WARNING: Perhaps KCC='$KCC' ($ver) is not compatible with this kernel source" >&2;} if test $cr_wordsize -gt $ac_cv_sizeof_void_p; then echo "$KCC" | grep -e '-m64' >/dev/null 2>/dev/null if test $? != 0; then { $as_echo "$as_me:$LINENO: WARNING: You might try setting KCC='$KCC -m64'" >&5 $as_echo "$as_me: WARNING: You might try setting KCC='$KCC -m64'" >&2;} fi fi fi if grep -i 'permission denied' conftestdir/output >/dev/null 2>&1; then { $as_echo "$as_me:$LINENO: WARNING: Apparent permissions problem in ${LINUX_SRC}" >&5 $as_echo "$as_me: WARNING: Apparent permissions problem in ${LINUX_SRC}" >&2;} fi rm -rf conftestdir { { $as_echo "$as_me:$LINENO: error: Failed test run of kernel make/kbuild failed (see above)" >&5 $as_echo "$as_me: error: Failed test run of kernel make/kbuild failed (see above)" >&2;} { (exit 1); exit 1; }; } fi rm -rf conftestdir cr_cv_kconfig_kcflags='' prev_del='' prev_inc='' for arg in ${cr_tmp}; do if test -n "$prev_del"; then # skip this arg at request of prev arg prev_del='' continue fi arg=`echo $arg | tr -d "\"'"` # remove quote marks if test -n "$prev_inc"; then # prev arg says this arg is an -include prev_inc='' case "$arg" in *include/linux/modversions.h) continue;; /*) arg="-include $arg";; *) arg="-include ${LINUX_OBJ}/$arg";; esac else case "$arg" in -o) prev_del=1; continue;; -include) prev_inc=1; continue;; -c) continue;; conftest.c) continue;; /*/conftest.c) continue;; -Wp,-MD,*) continue;; -Wp,-MMD,*) continue;; -I/*) ;; -I*) arg=`echo $arg | sed -e "s:-I:-I${LINUX_OBJ}/:"`;; esac fi cr_cv_kconfig_kcflags="$cr_cv_kconfig_kcflags $arg" done fi { $as_echo "$as_me:$LINENO: result: $cr_cv_kconfig_kcflags" >&5 $as_echo "$cr_cv_kconfig_kcflags" >&6; } KCFLAGS="$cr_cv_kconfig_kcflags" { $as_echo "$as_me:$LINENO: checking if autoconf.h or kconfig.h is included implicitly" >&5 $as_echo_n "checking if autoconf.h or kconfig.h is included implicitly... " >&6; } if echo "$KCFLAGS" | grep -e 'include [^ ]*/autoconf\.h' -e 'include [^ ]*/kconfig\.h' >/dev/null 2>&1; then { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "yes" >&6; }; else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; }; cat >>confdefs.h <<\_ACEOF #define CR_NEED_AUTOCONF_H 1 _ACEOF fi # Do these init steps early, in case first CR_FIND_KSYM is a conditional call # Now we can check if SYMTAB matches the kernel { $as_echo "$as_me:$LINENO: checking for SMP kernel source" >&5 $as_echo_n "checking for SMP kernel source... " >&6; } if test "${cr_cv_kconfig_smp_source+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #ifdef CR_NEED_AUTOCONF_H #include #endif #ifndef CONFIG_SMP choke me #endif int main () { ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_smp_source=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_smp_source=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_smp_source if test $cr_result = yes; then : else : fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; }; cr_kernel_smp=$cr_result { $as_echo "$as_me:$LINENO: checking for SMP kernel symbol table" >&5 $as_echo_n "checking for SMP kernel symbol table... " >&6; } cr_symtab_smp=no if test -n "`eval $LINUX_SYMTAB_CMD | grep del_timer_sync 2>/dev/null | grep -v try_to_del_`"; then cr_symtab_smp=yes fi { $as_echo "$as_me:$LINENO: result: $cr_symtab_smp" >&5 $as_echo "$cr_symtab_smp" >&6; }; if test "$cr_kernel_smp" != "$cr_symtab_smp"; then echo "======================================================================" echo "Please review the following configuration information:" echo " Kernel source directory = $LINUX_SRC" echo " Kernel build directory = $LINUX_OBJ" echo " Kernel symbol table = ${LINUX_SYSTEM_MAP}${LINUX_VMLINUX}" echo " Kernel version probed from kernel build = $LINUX_VER" echo " Kernel running currently = `uname -r`" echo "======================================================================" if test "$cr_kernel_smp" = yes; then { { $as_echo "$as_me:$LINENO: error: Kernel source is configured SMP but the kernel symbol table is not. Consider specifying a symbol table with --with-system-map or --with-vmlinux. Or, if using kernel sources that are configured by /boot/kernel.h, you may try --with-kernel-type=UP to force a uni-processor interpretation of the sources." >&5 $as_echo "$as_me: error: Kernel source is configured SMP but the kernel symbol table is not. Consider specifying a symbol table with --with-system-map or --with-vmlinux. Or, if using kernel sources that are configured by /boot/kernel.h, you may try --with-kernel-type=UP to force a uni-processor interpretation of the sources." >&2;} { (exit 1); exit 1; }; } else { { $as_echo "$as_me:$LINENO: error: Kernel source is configured uni-processor but the kernel symbol table is SMP. Consider specifying a symbol table with --with-system-map or --with-vmlinux. Or, if using kernel sources that are configured by /boot/kernel.h, you may try --with-kernel-type=SMP to force an SMP interpretation of the sources." >&5 $as_echo "$as_me: error: Kernel source is configured uni-processor but the kernel symbol table is SMP. Consider specifying a symbol table with --with-system-map or --with-vmlinux. Or, if using kernel sources that are configured by /boot/kernel.h, you may try --with-kernel-type=SMP to force an SMP interpretation of the sources." >&2;} { (exit 1); exit 1; }; } fi fi ## Check for optional kernel headers... { $as_echo "$as_me:$LINENO: checking kernel for linux/syscalls.h" >&5 $as_echo_n "checking kernel for linux/syscalls.h... " >&6; } if test "${cr_cv_kconfig_HAVE_LINUX_SYSCALLS_H+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_LINUX_SYSCALLS_H=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_LINUX_SYSCALLS_H=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_LINUX_SYSCALLS_H if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_LINUX_SYSCALLS_H 1 _ACEOF HAVE_LINUX_SYSCALLS_H=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_LINUX_SYSCALLS_H 0 _ACEOF HAVE_LINUX_SYSCALLS_H='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel for linux/pspace.h" >&5 $as_echo_n "checking kernel for linux/pspace.h... " >&6; } if test "${cr_cv_kconfig_HAVE_LINUX_PSPACE_H+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_LINUX_PSPACE_H=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_LINUX_PSPACE_H=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_LINUX_PSPACE_H if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_LINUX_PSPACE_H 1 _ACEOF HAVE_LINUX_PSPACE_H=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_LINUX_PSPACE_H 0 _ACEOF HAVE_LINUX_PSPACE_H='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel for linux/pid_namespace.h" >&5 $as_echo_n "checking kernel for linux/pid_namespace.h... " >&6; } if test "${cr_cv_kconfig_HAVE_LINUX_PID_NAMESPACE_H+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_LINUX_PID_NAMESPACE_H=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_LINUX_PID_NAMESPACE_H=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_LINUX_PID_NAMESPACE_H if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_LINUX_PID_NAMESPACE_H 1 _ACEOF HAVE_LINUX_PID_NAMESPACE_H=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_LINUX_PID_NAMESPACE_H 0 _ACEOF HAVE_LINUX_PID_NAMESPACE_H='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel for linux/lockdep.h" >&5 $as_echo_n "checking kernel for linux/lockdep.h... " >&6; } if test "${cr_cv_kconfig_HAVE_LINUX_LOCKDEP_H+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_LINUX_LOCKDEP_H=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_LINUX_LOCKDEP_H=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_LINUX_LOCKDEP_H if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_LINUX_LOCKDEP_H 1 _ACEOF HAVE_LINUX_LOCKDEP_H=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_LINUX_LOCKDEP_H 0 _ACEOF HAVE_LINUX_LOCKDEP_H='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel for linux/compile.h" >&5 $as_echo_n "checking kernel for linux/compile.h... " >&6; } if test "${cr_cv_kconfig_HAVE_LINUX_COMPILE_H+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_LINUX_COMPILE_H=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_LINUX_COMPILE_H=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_LINUX_COMPILE_H if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_LINUX_COMPILE_H 1 _ACEOF HAVE_LINUX_COMPILE_H=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_LINUX_COMPILE_H 0 _ACEOF HAVE_LINUX_COMPILE_H='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel for linux/fdtable.h" >&5 $as_echo_n "checking kernel for linux/fdtable.h... " >&6; } if test "${cr_cv_kconfig_HAVE_LINUX_FDTABLE_H+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_LINUX_FDTABLE_H=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_LINUX_FDTABLE_H=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_LINUX_FDTABLE_H if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_LINUX_FDTABLE_H 1 _ACEOF HAVE_LINUX_FDTABLE_H=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_LINUX_FDTABLE_H 0 _ACEOF HAVE_LINUX_FDTABLE_H='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel for linux/utrace.h" >&5 $as_echo_n "checking kernel for linux/utrace.h... " >&6; } if test "${cr_cv_kconfig_HAVE_LINUX_UTRACE_H+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_LINUX_UTRACE_H=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_LINUX_UTRACE_H=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_LINUX_UTRACE_H if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_LINUX_UTRACE_H 1 _ACEOF HAVE_LINUX_UTRACE_H=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_LINUX_UTRACE_H 0 _ACEOF HAVE_LINUX_UTRACE_H='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel for linux/perf_event.h" >&5 $as_echo_n "checking kernel for linux/perf_event.h... " >&6; } if test "${cr_cv_kconfig_HAVE_LINUX_PERF_EVENT_H+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_LINUX_PERF_EVENT_H=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_LINUX_PERF_EVENT_H=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_LINUX_PERF_EVENT_H if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_LINUX_PERF_EVENT_H 1 _ACEOF HAVE_LINUX_PERF_EVENT_H=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_LINUX_PERF_EVENT_H 0 _ACEOF HAVE_LINUX_PERF_EVENT_H='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel for linux/audit.h" >&5 $as_echo_n "checking kernel for linux/audit.h... " >&6; } if test "${cr_cv_kconfig_HAVE_LINUX_AUDIT_H+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_LINUX_AUDIT_H=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_LINUX_AUDIT_H=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_LINUX_AUDIT_H if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_LINUX_AUDIT_H 1 _ACEOF HAVE_LINUX_AUDIT_H=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_LINUX_AUDIT_H 0 _ACEOF HAVE_LINUX_AUDIT_H='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel for asm/elf.h" >&5 $as_echo_n "checking kernel for asm/elf.h... " >&6; } if test "${cr_cv_kconfig_HAVE_ASM_ELF_H+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_ASM_ELF_H=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_ASM_ELF_H=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_ASM_ELF_H if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_ASM_ELF_H 1 _ACEOF HAVE_ASM_ELF_H=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_ASM_ELF_H 0 _ACEOF HAVE_ASM_ELF_H='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel for asm/desc.h" >&5 $as_echo_n "checking kernel for asm/desc.h... " >&6; } if test "${cr_cv_kconfig_HAVE_ASM_DESC_H+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include #include int main () { ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_ASM_DESC_H=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_ASM_DESC_H=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_ASM_DESC_H if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_ASM_DESC_H 1 _ACEOF HAVE_ASM_DESC_H=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_ASM_DESC_H 0 _ACEOF HAVE_ASM_DESC_H='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel for asm/vsyscall32.h" >&5 $as_echo_n "checking kernel for asm/vsyscall32.h... " >&6; } if test "${cr_cv_kconfig_HAVE_ASM_VSYSCALL32_H+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_ASM_VSYSCALL32_H=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_ASM_VSYSCALL32_H=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_ASM_VSYSCALL32_H if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_ASM_VSYSCALL32_H 1 _ACEOF HAVE_ASM_VSYSCALL32_H=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_ASM_VSYSCALL32_H 0 _ACEOF HAVE_ASM_VSYSCALL32_H='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel for asm/i387.h" >&5 $as_echo_n "checking kernel for asm/i387.h... " >&6; } if test "${cr_cv_kconfig_HAVE_ASM_I387_H+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_ASM_I387_H=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_ASM_I387_H=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_ASM_I387_H if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_ASM_I387_H 1 _ACEOF HAVE_ASM_I387_H=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_ASM_I387_H 0 _ACEOF HAVE_ASM_I387_H='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel for asm/switch_to.h" >&5 $as_echo_n "checking kernel for asm/switch_to.h... " >&6; } if test "${cr_cv_kconfig_HAVE_ASM_SWITCH_TO_H+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_ASM_SWITCH_TO_H=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_ASM_SWITCH_TO_H=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_ASM_SWITCH_TO_H if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_ASM_SWITCH_TO_H 1 _ACEOF HAVE_ASM_SWITCH_TO_H=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_ASM_SWITCH_TO_H 0 _ACEOF HAVE_ASM_SWITCH_TO_H='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel for asm/tls.h" >&5 $as_echo_n "checking kernel for asm/tls.h... " >&6; } if test "${cr_cv_kconfig_HAVE_ASM_TLS_H+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_ASM_TLS_H=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_ASM_TLS_H=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_ASM_TLS_H if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_ASM_TLS_H 1 _ACEOF HAVE_ASM_TLS_H=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_ASM_TLS_H 0 _ACEOF HAVE_ASM_TLS_H='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel for linux/utsrelease.h" >&5 $as_echo_n "checking kernel for linux/utsrelease.h... " >&6; } if test "${cr_cv_kconfig_HAVE_LINUX_UTSRELEASE_H+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_LINUX_UTSRELEASE_H=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_LINUX_UTSRELEASE_H=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_LINUX_UTSRELEASE_H if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_LINUX_UTSRELEASE_H 1 _ACEOF HAVE_LINUX_UTSRELEASE_H=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_LINUX_UTSRELEASE_H 0 _ACEOF HAVE_LINUX_UTSRELEASE_H='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel for generated/utsrelease.h" >&5 $as_echo_n "checking kernel for generated/utsrelease.h... " >&6; } if test "${cr_cv_kconfig_HAVE_GENERATED_UTSRELEASE_H+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_GENERATED_UTSRELEASE_H=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_GENERATED_UTSRELEASE_H=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_GENERATED_UTSRELEASE_H if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_GENERATED_UTSRELEASE_H 1 _ACEOF HAVE_GENERATED_UTSRELEASE_H=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_GENERATED_UTSRELEASE_H 0 _ACEOF HAVE_GENERATED_UTSRELEASE_H='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } ## Now we check for specific kernel features... if test "$CR_ARCH" = 'arm'; then { $as_echo "$as_me:$LINENO: checking kernel for CONFIG_THUMB2_KERNEL" >&5 $as_echo_n "checking kernel for CONFIG_THUMB2_KERNEL... " >&6; } if test "${cr_cv_kconfig_HAVE_CONFIG_THUMB2_KERNEL+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include int main () { #ifndef CONFIG_THUMB2_KERNEL choke me #endif ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_CONFIG_THUMB2_KERNEL=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_CONFIG_THUMB2_KERNEL=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_CONFIG_THUMB2_KERNEL if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_CONFIG_THUMB2_KERNEL 1 _ACEOF HAVE_CONFIG_THUMB2_KERNEL=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_CONFIG_THUMB2_KERNEL 0 _ACEOF HAVE_CONFIG_THUMB2_KERNEL='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } fi { $as_echo "$as_me:$LINENO: checking kernel symbol table for timeval_to_jiffies" >&5 $as_echo_n "checking kernel symbol table for timeval_to_jiffies... " >&6; } # Our cacheval is encoded with 'Y' or 'N' as the first char to indicate # if a declaration was found or not, and the address or 0 as the rest. if test "${cr_cv_ksymtab_timeval_to_jiffies+set}" = set; then $as_echo_n "(cached) " >&6 else cr_cv_ksymtab_timeval_to_jiffies=`eval $LINUX_SYMTAB_CMD | sed -n -e "/${CR_KSYM_PATTERN_CODE}timeval_to_jiffies$/ {s/ .*//p;q;}"` if test -n "$cr_cv_ksymtab_timeval_to_jiffies"; then if eval $LINUX_SYMTAB_CMD | grep " __ksymtab_timeval_to_jiffies\$" >/dev/null ; then cr_cv_ksymtab_timeval_to_jiffies=0 else if test "CODE${HAVE_CONFIG_THUMB2_KERNEL}" = 'CODE1'; then cr_cv_ksymtab_timeval_to_jiffies=`$PERL -e "printf '%x', 1 | hex '$cr_cv_ksymtab_timeval_to_jiffies';"` fi fi SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #define IN_CONFIGURE 1 #include "${TOP_SRCDIR}/include/blcr_imports.h.in" int main () { int x = sizeof(&timeval_to_jiffies); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_timeval_to_jiffies="Y$cr_cv_ksymtab_timeval_to_jiffies" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_timeval_to_jiffies="N$cr_cv_ksymtab_timeval_to_jiffies" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi fi cr_addr='' if test -z "$cr_cv_ksymtab_timeval_to_jiffies"; then cr_result='not found' else if expr "$cr_cv_ksymtab_timeval_to_jiffies" : N >/dev/null; then { { $as_echo "$as_me:$LINENO: error: Found symbol timeval_to_jiffies but no declaration -- please file a bug report." >&5 $as_echo "$as_me: error: Found symbol timeval_to_jiffies but no declaration -- please file a bug report." >&2;} { (exit 1); exit 1; }; } fi cr_result=`echo $cr_cv_ksymtab_timeval_to_jiffies | tr -d 'YN'` if test $cr_result = 0; then cr_result=exported cr_addr=0 else cr_addr="0x$cr_result" echo "_CR_IMPORT_KCODE(timeval_to_jiffies, $cr_addr)" >>$CR_KSYM_IMPORT_CALLS fi cat >>confdefs.h <<_ACEOF #define CR_KCODE_timeval_to_jiffies $cr_addr _ACEOF fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel symbol table for jiffies_to_timeval" >&5 $as_echo_n "checking kernel symbol table for jiffies_to_timeval... " >&6; } # Our cacheval is encoded with 'Y' or 'N' as the first char to indicate # if a declaration was found or not, and the address or 0 as the rest. if test "${cr_cv_ksymtab_jiffies_to_timeval+set}" = set; then $as_echo_n "(cached) " >&6 else cr_cv_ksymtab_jiffies_to_timeval=`eval $LINUX_SYMTAB_CMD | sed -n -e "/${CR_KSYM_PATTERN_CODE}jiffies_to_timeval$/ {s/ .*//p;q;}"` if test -n "$cr_cv_ksymtab_jiffies_to_timeval"; then if eval $LINUX_SYMTAB_CMD | grep " __ksymtab_jiffies_to_timeval\$" >/dev/null ; then cr_cv_ksymtab_jiffies_to_timeval=0 else if test "CODE${HAVE_CONFIG_THUMB2_KERNEL}" = 'CODE1'; then cr_cv_ksymtab_jiffies_to_timeval=`$PERL -e "printf '%x', 1 | hex '$cr_cv_ksymtab_jiffies_to_timeval';"` fi fi SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #define IN_CONFIGURE 1 #include "${TOP_SRCDIR}/include/blcr_imports.h.in" int main () { int x = sizeof(&jiffies_to_timeval); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_jiffies_to_timeval="Y$cr_cv_ksymtab_jiffies_to_timeval" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_jiffies_to_timeval="N$cr_cv_ksymtab_jiffies_to_timeval" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi fi cr_addr='' if test -z "$cr_cv_ksymtab_jiffies_to_timeval"; then cr_result='not found' else if expr "$cr_cv_ksymtab_jiffies_to_timeval" : N >/dev/null; then { { $as_echo "$as_me:$LINENO: error: Found symbol jiffies_to_timeval but no declaration -- please file a bug report." >&5 $as_echo "$as_me: error: Found symbol jiffies_to_timeval but no declaration -- please file a bug report." >&2;} { (exit 1); exit 1; }; } fi cr_result=`echo $cr_cv_ksymtab_jiffies_to_timeval | tr -d 'YN'` if test $cr_result = 0; then cr_result=exported cr_addr=0 else cr_addr="0x$cr_result" echo "_CR_IMPORT_KCODE(jiffies_to_timeval, $cr_addr)" >>$CR_KSYM_IMPORT_CALLS fi cat >>confdefs.h <<_ACEOF #define CR_KCODE_jiffies_to_timeval $cr_addr _ACEOF fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel for struct fdtable" >&5 $as_echo_n "checking kernel for struct fdtable... " >&6; } if test "${cr_cv_kconfig_HAVE_STRUCT_FDTABLE+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include #include #if HAVE_LINUX_FDTABLE_H #include #endif int main () { struct fdtable y; int x = sizeof(y); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_STRUCT_FDTABLE=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_STRUCT_FDTABLE=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_STRUCT_FDTABLE if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_STRUCT_FDTABLE 1 _ACEOF HAVE_STRUCT_FDTABLE=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_STRUCT_FDTABLE 0 _ACEOF HAVE_STRUCT_FDTABLE='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } if test -n "${HAVE_STRUCT_FDTABLE}"; then { $as_echo "$as_me:$LINENO: checking kernel for open_fds.fds_bits" >&5 $as_echo_n "checking kernel for open_fds.fds_bits... " >&6; } if test "${cr_cv_kconfig_HAVE_OPEN_FDS_FDS_BITS+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include #include #if HAVE_LINUX_FDTABLE_H #include #endif int main () { struct fdtable x; unsigned long tc_1 = *(x.open_fds->fds_bits); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_OPEN_FDS_FDS_BITS=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_OPEN_FDS_FDS_BITS=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_OPEN_FDS_FDS_BITS if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_OPEN_FDS_FDS_BITS 1 _ACEOF HAVE_OPEN_FDS_FDS_BITS=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_OPEN_FDS_FDS_BITS 0 _ACEOF HAVE_OPEN_FDS_FDS_BITS='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel for fd_is_open" >&5 $as_echo_n "checking kernel for fd_is_open... " >&6; } if test "${cr_cv_kconfig_HAVE_FD_IS_OPEN+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include #include #if HAVE_LINUX_FDTABLE_H #include #endif int main () { #ifdef fd_is_open /* OK, it exists and is a macro */ #else /* Check for function case */ int x = sizeof(&fd_is_open); #endif ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_FD_IS_OPEN=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_FD_IS_OPEN=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_FD_IS_OPEN if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_FD_IS_OPEN 1 _ACEOF HAVE_FD_IS_OPEN=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_FD_IS_OPEN 0 _ACEOF HAVE_FD_IS_OPEN='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel for __set_open_fd" >&5 $as_echo_n "checking kernel for __set_open_fd... " >&6; } if test "${cr_cv_kconfig_HAVE___SET_OPEN_FD+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include #include #if HAVE_LINUX_FDTABLE_H #include #endif int main () { #ifdef __set_open_fd /* OK, it exists and is a macro */ #else /* Check for function case */ int x = sizeof(&__set_open_fd); #endif ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE___SET_OPEN_FD=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE___SET_OPEN_FD=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE___SET_OPEN_FD if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE___SET_OPEN_FD 1 _ACEOF HAVE___SET_OPEN_FD=1 else cat >>confdefs.h <<\_ACEOF #define HAVE___SET_OPEN_FD 0 _ACEOF HAVE___SET_OPEN_FD='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel for close_on_exec" >&5 $as_echo_n "checking kernel for close_on_exec... " >&6; } if test "${cr_cv_kconfig_HAVE_CLOSE_ON_EXEC+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include #include #if HAVE_LINUX_FDTABLE_H #include #endif int main () { #ifdef close_on_exec /* OK, it exists and is a macro */ #else /* Check for function case */ int x = sizeof(&close_on_exec); #endif ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_CLOSE_ON_EXEC=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_CLOSE_ON_EXEC=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_CLOSE_ON_EXEC if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_CLOSE_ON_EXEC 1 _ACEOF HAVE_CLOSE_ON_EXEC=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_CLOSE_ON_EXEC 0 _ACEOF HAVE_CLOSE_ON_EXEC='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel for __set_close_on_exec" >&5 $as_echo_n "checking kernel for __set_close_on_exec... " >&6; } if test "${cr_cv_kconfig_HAVE___SET_CLOSE_ON_EXEC+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include #include #if HAVE_LINUX_FDTABLE_H #include #endif int main () { #ifdef __set_close_on_exec /* OK, it exists and is a macro */ #else /* Check for function case */ int x = sizeof(&__set_close_on_exec); #endif ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE___SET_CLOSE_ON_EXEC=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE___SET_CLOSE_ON_EXEC=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE___SET_CLOSE_ON_EXEC if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE___SET_CLOSE_ON_EXEC 1 _ACEOF HAVE___SET_CLOSE_ON_EXEC=1 else cat >>confdefs.h <<\_ACEOF #define HAVE___SET_CLOSE_ON_EXEC 0 _ACEOF HAVE___SET_CLOSE_ON_EXEC='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } # OK if those are missing else { $as_echo "$as_me:$LINENO: checking kernel for open_fds.fds_bits" >&5 $as_echo_n "checking kernel for open_fds.fds_bits... " >&6; } if test "${cr_cv_kconfig_HAVE_OPEN_FDS_FDS_BITS+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include #include #if HAVE_LINUX_FDTABLE_H #include #endif int main () { struct files_struct x; unsigned long tc_1 = *(x.open_fds->fds_bits); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_OPEN_FDS_FDS_BITS=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_OPEN_FDS_FDS_BITS=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_OPEN_FDS_FDS_BITS if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_OPEN_FDS_FDS_BITS 1 _ACEOF HAVE_OPEN_FDS_FDS_BITS=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_OPEN_FDS_FDS_BITS 0 _ACEOF HAVE_OPEN_FDS_FDS_BITS='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } fi { $as_echo "$as_me:$LINENO: checking kernel for files_struct.next_fd" >&5 $as_echo_n "checking kernel for files_struct.next_fd... " >&6; } if test "${cr_cv_kconfig_HAVE_FILES_STRUCT_NEXT_FD+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include #include #if HAVE_LINUX_FDTABLE_H #include #endif int main () { struct files_struct x; int tc_1 = x.next_fd; ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_FILES_STRUCT_NEXT_FD=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_FILES_STRUCT_NEXT_FD=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_FILES_STRUCT_NEXT_FD if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_FILES_STRUCT_NEXT_FD 1 _ACEOF HAVE_FILES_STRUCT_NEXT_FD=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_FILES_STRUCT_NEXT_FD 0 _ACEOF HAVE_FILES_STRUCT_NEXT_FD='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel for fdtable.next_fd" >&5 $as_echo_n "checking kernel for fdtable.next_fd... " >&6; } if test "${cr_cv_kconfig_HAVE_FDTABLE_NEXT_FD+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include #include #if HAVE_LINUX_FDTABLE_H #include #endif int main () { struct fdtable x; int tc_1 = x.next_fd; ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_FDTABLE_NEXT_FD=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_FDTABLE_NEXT_FD=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_FDTABLE_NEXT_FD if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_FDTABLE_NEXT_FD 1 _ACEOF HAVE_FDTABLE_NEXT_FD=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_FDTABLE_NEXT_FD 0 _ACEOF HAVE_FDTABLE_NEXT_FD='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } # Allow only exactly one match if test "${HAVE_FILES_STRUCT_NEXT_FD}${HAVE_FDTABLE_NEXT_FD}" != "1"; then 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:$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= ;; #( *) $as_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 test "x$cache_file" != "x/dev/null" && { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache echo "======================================================================" echo "Please review the following configuration information:" echo " Kernel source directory = $LINUX_SRC" echo " Kernel build directory = $LINUX_OBJ" echo " Kernel symbol table = ${LINUX_SYSTEM_MAP}${LINUX_VMLINUX}" echo " Kernel version probed from kernel build = $LINUX_VER" echo " Kernel running currently = `uname -r`" echo "======================================================================" { { $as_echo "$as_me:$LINENO: error: Unable to use kernel $LINUX_VER - unable to determine where to find next_fd" >&5 $as_echo "$as_me: error: Unable to use kernel $LINUX_VER - unable to determine where to find next_fd" >&2;} { (exit 1); exit 1; }; } fi { $as_echo "$as_me:$LINENO: checking kernel for files_struct.max_fdset" >&5 $as_echo_n "checking kernel for files_struct.max_fdset... " >&6; } if test "${cr_cv_kconfig_HAVE_FILES_STRUCT_MAX_FDSET+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include #include #if HAVE_LINUX_FDTABLE_H #include #endif int main () { struct files_struct x; int tc_1 = x.max_fdset; ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_FILES_STRUCT_MAX_FDSET=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_FILES_STRUCT_MAX_FDSET=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_FILES_STRUCT_MAX_FDSET if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_FILES_STRUCT_MAX_FDSET 1 _ACEOF HAVE_FILES_STRUCT_MAX_FDSET=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_FILES_STRUCT_MAX_FDSET 0 _ACEOF HAVE_FILES_STRUCT_MAX_FDSET='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel for struct path" >&5 $as_echo_n "checking kernel for struct path... " >&6; } if test "${cr_cv_kconfig_HAVE_STRUCT_PATH+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { struct path y; int x = sizeof(y); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_STRUCT_PATH=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_STRUCT_PATH=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_STRUCT_PATH if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_STRUCT_PATH 1 _ACEOF HAVE_STRUCT_PATH=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_STRUCT_PATH 0 _ACEOF HAVE_STRUCT_PATH='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel for nameidata.path" >&5 $as_echo_n "checking kernel for nameidata.path... " >&6; } if test "${cr_cv_kconfig_HAVE_NAMEIDATA_PATH+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include #include #include #include #include int main () { /* Expect "struct path pwd" in fs_struct */ struct fs_struct s1; struct path t1 = s1.pwd; /* Expect "struct path path" used in nameidata */ struct nameidata s2; struct path t2 = s2.path; /* Expect d_path() and set_fs_pwd() to pass path */ (void)d_path(&t1, NULL, 0); (void)set_fs_pwd(&s1, &t2); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_NAMEIDATA_PATH=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_NAMEIDATA_PATH=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_NAMEIDATA_PATH if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_NAMEIDATA_PATH 1 _ACEOF HAVE_NAMEIDATA_PATH=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_NAMEIDATA_PATH 0 _ACEOF HAVE_NAMEIDATA_PATH='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel for nameidata.dentry" >&5 $as_echo_n "checking kernel for nameidata.dentry... " >&6; } if test "${cr_cv_kconfig_HAVE_NAMEIDATA_DENTRY+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include #include #include #include #include int main () { /* Expect "struct dentry *pwd" in fs_struct */ struct fs_struct s1; struct dentry t1 = *s1.pwd; /* Expect "struct dentry *dentry" in nameidata */ struct nameidata s2; struct dentry t2 = *s2.dentry; /* Expect d_path() and set_fs_pwd() to pass dentry */ (void)d_path(&t1, NULL, NULL, 0); (void)set_fs_pwd(&s1, NULL, &t2); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_NAMEIDATA_DENTRY=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_NAMEIDATA_DENTRY=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_NAMEIDATA_DENTRY if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_NAMEIDATA_DENTRY 1 _ACEOF HAVE_NAMEIDATA_DENTRY=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_NAMEIDATA_DENTRY 0 _ACEOF HAVE_NAMEIDATA_DENTRY='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } if test "${HAVE_NAMEIDATA_PATH}${HAVE_NAMEIDATA_DENTRY}" != "1"; then 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:$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= ;; #( *) $as_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 test "x$cache_file" != "x/dev/null" && { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache echo "======================================================================" echo "Please review the following configuration information:" echo " Kernel source directory = $LINUX_SRC" echo " Kernel build directory = $LINUX_OBJ" echo " Kernel symbol table = ${LINUX_SYSTEM_MAP}${LINUX_VMLINUX}" echo " Kernel version probed from kernel build = $LINUX_VER" echo " Kernel running currently = `uname -r`" echo "======================================================================" { { $as_echo "$as_me:$LINENO: error: Unable to use kernel $LINUX_VER - unable to determine composition of struct nameidata" >&5 $as_echo "$as_me: error: Unable to use kernel $LINUX_VER - unable to determine composition of struct nameidata" >&2;} { (exit 1); exit 1; }; } fi { $as_echo "$as_me:$LINENO: checking kernel for path_lookup" >&5 $as_echo_n "checking kernel for path_lookup... " >&6; } if test "${cr_cv_kconfig_HAVE_PATH_LOOKUP+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { #ifdef path_lookup /* OK, it exists and is a macro */ #else /* Check for function case */ int x = sizeof(&path_lookup); #endif ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_PATH_LOOKUP=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_PATH_LOOKUP=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_PATH_LOOKUP if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_PATH_LOOKUP 1 _ACEOF HAVE_PATH_LOOKUP=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_PATH_LOOKUP 0 _ACEOF HAVE_PATH_LOOKUP='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel for kern_path" >&5 $as_echo_n "checking kernel for kern_path... " >&6; } if test "${cr_cv_kconfig_HAVE_KERN_PATH+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { #ifdef kern_path /* OK, it exists and is a macro */ #else /* Check for function case */ int x = sizeof(&kern_path); #endif ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_KERN_PATH=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_KERN_PATH=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_KERN_PATH if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_KERN_PATH 1 _ACEOF HAVE_KERN_PATH=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_KERN_PATH 0 _ACEOF HAVE_KERN_PATH='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } # Require 1 or more match if test -z "${HAVE_PATH_LOOKUP}{HAVE_KERN_PATH}"; then 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:$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= ;; #( *) $as_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 test "x$cache_file" != "x/dev/null" && { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache echo "======================================================================" echo "Please review the following configuration information:" echo " Kernel source directory = $LINUX_SRC" echo " Kernel build directory = $LINUX_OBJ" echo " Kernel symbol table = ${LINUX_SYSTEM_MAP}${LINUX_VMLINUX}" echo " Kernel version probed from kernel build = $LINUX_VER" echo " Kernel running currently = `uname -r`" echo "======================================================================" { { $as_echo "$as_me:$LINENO: error: Unable to use kernel $LINUX_VER - unable to find either path_lookup() or kern_path()" >&5 $as_echo "$as_me: error: Unable to use kernel $LINUX_VER - unable to find either path_lookup() or kern_path()" >&2;} { (exit 1); exit 1; }; } fi { $as_echo "$as_me:$LINENO: checking kernel for __putname" >&5 $as_echo_n "checking kernel for __putname... " >&6; } if test "${cr_cv_kconfig_HAVE___PUTNAME+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { #ifdef __putname /* OK, it exists and is a macro */ #else /* Check for function case */ int x = sizeof(&__putname); #endif ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE___PUTNAME=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE___PUTNAME=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE___PUTNAME if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE___PUTNAME 1 _ACEOF HAVE___PUTNAME=1 else cat >>confdefs.h <<\_ACEOF #define HAVE___PUTNAME 0 _ACEOF HAVE___PUTNAME='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel for struct delayed_work" >&5 $as_echo_n "checking kernel for struct delayed_work... " >&6; } if test "${cr_cv_kconfig_HAVE_STRUCT_DELAYED_WORK+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { struct delayed_work y; int x = sizeof(y); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_STRUCT_DELAYED_WORK=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_STRUCT_DELAYED_WORK=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_STRUCT_DELAYED_WORK if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_STRUCT_DELAYED_WORK 1 _ACEOF HAVE_STRUCT_DELAYED_WORK=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_STRUCT_DELAYED_WORK 0 _ACEOF HAVE_STRUCT_DELAYED_WORK='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } # Order for "best" match { $as_echo "$as_me:$LINENO: checking kernel for do_each_pid_task" >&5 $as_echo_n "checking kernel for do_each_pid_task... " >&6; } if test "${cr_cv_kconfig_HAVE_DO_EACH_PID_TASK+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { #ifndef do_each_pid_task choke me #endif ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_DO_EACH_PID_TASK=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_DO_EACH_PID_TASK=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_DO_EACH_PID_TASK if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_DO_EACH_PID_TASK 1 _ACEOF HAVE_DO_EACH_PID_TASK=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_DO_EACH_PID_TASK 0 _ACEOF HAVE_DO_EACH_PID_TASK='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel for do_each_task_pid" >&5 $as_echo_n "checking kernel for do_each_task_pid... " >&6; } if test "${cr_cv_kconfig_HAVE_DO_EACH_TASK_PID+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { #ifndef do_each_task_pid choke me #endif ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_DO_EACH_TASK_PID=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_DO_EACH_TASK_PID=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_DO_EACH_TASK_PID if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_DO_EACH_TASK_PID 1 _ACEOF HAVE_DO_EACH_TASK_PID=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_DO_EACH_TASK_PID 0 _ACEOF HAVE_DO_EACH_TASK_PID='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } if test -z "${HAVE_DO_EACH_TASK_PID}"; then { $as_echo "$as_me:$LINENO: checking kernel for for_each_task_pid" >&5 $as_echo_n "checking kernel for for_each_task_pid... " >&6; } if test "${cr_cv_kconfig_HAVE_FOR_EACH_TASK_PID+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { #ifndef for_each_task_pid choke me #endif ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_FOR_EACH_TASK_PID=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_FOR_EACH_TASK_PID=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_FOR_EACH_TASK_PID if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_FOR_EACH_TASK_PID 1 _ACEOF HAVE_FOR_EACH_TASK_PID=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_FOR_EACH_TASK_PID 0 _ACEOF HAVE_FOR_EACH_TASK_PID='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } fi # Require 1 or more match if test -z "${HAVE_DO_EACH_PID_TASK}${HAVE_DO_EACH_TASK_PID}${HAVE_FOR_EACH_TASK_PID}"; then 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:$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= ;; #( *) $as_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 test "x$cache_file" != "x/dev/null" && { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache echo "======================================================================" echo "Please review the following configuration information:" echo " Kernel source directory = $LINUX_SRC" echo " Kernel build directory = $LINUX_OBJ" echo " Kernel symbol table = ${LINUX_SYSTEM_MAP}${LINUX_VMLINUX}" echo " Kernel version probed from kernel build = $LINUX_VER" echo " Kernel running currently = `uname -r`" echo "======================================================================" { { $as_echo "$as_me:$LINENO: error: Unable to use kernel $LINUX_VER - unable to find a task iterator" >&5 $as_echo "$as_me: error: Unable to use kernel $LINUX_VER - unable to find a task iterator" >&2;} { (exit 1); exit 1; }; } fi { $as_echo "$as_me:$LINENO: checking kernel for 2.6.0 task ids" >&5 $as_echo_n "checking kernel for 2.6.0 task ids... " >&6; } if test "${cr_cv_kconfig_HAVE_2_6_0_TASK_IDS+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { struct task_struct x; int tc_1 = x.__pgrp; ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_2_6_0_TASK_IDS=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_2_6_0_TASK_IDS=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_2_6_0_TASK_IDS if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_2_6_0_TASK_IDS 1 _ACEOF HAVE_2_6_0_TASK_IDS=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_2_6_0_TASK_IDS 0 _ACEOF HAVE_2_6_0_TASK_IDS='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel for 2.6.6 task ids" >&5 $as_echo_n "checking kernel for 2.6.6 task ids... " >&6; } if test "${cr_cv_kconfig_HAVE_2_6_6_TASK_IDS+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { struct task_struct x; int tc_1 = x.signal->session; ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_2_6_6_TASK_IDS=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_2_6_6_TASK_IDS=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_2_6_6_TASK_IDS if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_2_6_6_TASK_IDS 1 _ACEOF HAVE_2_6_6_TASK_IDS=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_2_6_6_TASK_IDS 0 _ACEOF HAVE_2_6_6_TASK_IDS='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel for 2.6.20 task ids" >&5 $as_echo_n "checking kernel for 2.6.20 task ids... " >&6; } if test "${cr_cv_kconfig_HAVE_2_6_20_TASK_IDS+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { #ifndef process_session /* Must be macro or have a decl */ int x = sizeof(&process_session); #endif int tc_1 = process_session(NULL); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_2_6_20_TASK_IDS=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_2_6_20_TASK_IDS=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_2_6_20_TASK_IDS if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_2_6_20_TASK_IDS 1 _ACEOF HAVE_2_6_20_TASK_IDS=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_2_6_20_TASK_IDS 0 _ACEOF HAVE_2_6_20_TASK_IDS='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel for 2.6.24 task ids" >&5 $as_echo_n "checking kernel for 2.6.24 task ids... " >&6; } if test "${cr_cv_kconfig_HAVE_2_6_24_TASK_IDS+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { #ifndef task_session_vnr /* Must be macro or have a decl */ int x = sizeof(&task_session_vnr); #endif int tc_1 = task_session_vnr(NULL); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_2_6_24_TASK_IDS=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_2_6_24_TASK_IDS=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_2_6_24_TASK_IDS if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_2_6_24_TASK_IDS 1 _ACEOF HAVE_2_6_24_TASK_IDS=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_2_6_24_TASK_IDS 0 _ACEOF HAVE_2_6_24_TASK_IDS='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } # Should allow only exactly one match, except that 2.6.6 and 2.6.20/24 overlap during transitional period case "${HAVE_2_6_0_TASK_IDS}X${HAVE_2_6_6_TASK_IDS}X${HAVE_2_6_20_TASK_IDS}${HAVE_2_6_24_TASK_IDS}" in 1XX|X1X|X1X1|XX1) # OK ;; *) 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:$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= ;; #( *) $as_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 test "x$cache_file" != "x/dev/null" && { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache echo "======================================================================" echo "Please review the following configuration information:" echo " Kernel source directory = $LINUX_SRC" echo " Kernel build directory = $LINUX_OBJ" echo " Kernel symbol table = ${LINUX_SYSTEM_MAP}${LINUX_VMLINUX}" echo " Kernel version probed from kernel build = $LINUX_VER" echo " Kernel running currently = `uname -r`" echo "======================================================================" { { $as_echo "$as_me:$LINENO: error: Unable to use kernel $LINUX_VER - can't find pgrp/session of a task_struct" >&5 $as_echo "$as_me: error: Unable to use kernel $LINUX_VER - can't find pgrp/session of a task_struct" >&2;} { (exit 1); exit 1; }; } ;; esac { $as_echo "$as_me:$LINENO: checking kernel for set_task_pgrp" >&5 $as_echo_n "checking kernel for set_task_pgrp... " >&6; } if test "${cr_cv_kconfig_HAVE_SET_TASK_PGRP+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { #ifdef set_task_pgrp /* OK, it exists and is a macro */ #else /* Check for function case */ int x = sizeof(&set_task_pgrp); #endif ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_SET_TASK_PGRP=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_SET_TASK_PGRP=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_SET_TASK_PGRP if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_SET_TASK_PGRP 1 _ACEOF HAVE_SET_TASK_PGRP=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_SET_TASK_PGRP 0 _ACEOF HAVE_SET_TASK_PGRP='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel for set_task_session" >&5 $as_echo_n "checking kernel for set_task_session... " >&6; } if test "${cr_cv_kconfig_HAVE_SET_TASK_SESSION+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { #ifdef set_task_session /* OK, it exists and is a macro */ #else /* Check for function case */ int x = sizeof(&set_task_session); #endif ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_SET_TASK_SESSION=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_SET_TASK_SESSION=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_SET_TASK_SESSION if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_SET_TASK_SESSION 1 _ACEOF HAVE_SET_TASK_SESSION=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_SET_TASK_SESSION 0 _ACEOF HAVE_SET_TASK_SESSION='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel for valid_signal" >&5 $as_echo_n "checking kernel for valid_signal... " >&6; } if test "${cr_cv_kconfig_HAVE_VALID_SIGNAL+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { #ifdef valid_signal /* OK, it exists and is a macro */ #else /* Check for function case */ int x = sizeof(&valid_signal); #endif ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_VALID_SIGNAL=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_VALID_SIGNAL=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_VALID_SIGNAL if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_VALID_SIGNAL 1 _ACEOF HAVE_VALID_SIGNAL=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_VALID_SIGNAL 0 _ACEOF HAVE_VALID_SIGNAL='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel for REMOVE_LINKS" >&5 $as_echo_n "checking kernel for REMOVE_LINKS... " >&6; } if test "${cr_cv_kconfig_HAVE_REMOVE_LINKS+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { #ifndef REMOVE_LINKS choke me #endif ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_REMOVE_LINKS=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_REMOVE_LINKS=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_REMOVE_LINKS if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_REMOVE_LINKS 1 _ACEOF HAVE_REMOVE_LINKS=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_REMOVE_LINKS 0 _ACEOF HAVE_REMOVE_LINKS='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel for task.pids pid_link" >&5 $as_echo_n "checking kernel for task.pids pid_link... " >&6; } if test "${cr_cv_kconfig_HAVE_TASK_PIDS_PID_LINK+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { struct task_struct x; struct pid_link tc_1 = x.pids[0]; ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_TASK_PIDS_PID_LINK=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_TASK_PIDS_PID_LINK=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_TASK_PIDS_PID_LINK if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_TASK_PIDS_PID_LINK 1 _ACEOF HAVE_TASK_PIDS_PID_LINK=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_TASK_PIDS_PID_LINK 0 _ACEOF HAVE_TASK_PIDS_PID_LINK='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel for task.pids pid" >&5 $as_echo_n "checking kernel for task.pids pid... " >&6; } if test "${cr_cv_kconfig_HAVE_TASK_PIDS_PID+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { struct task_struct x; struct pid tc_1 = x.pids[0]; ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_TASK_PIDS_PID=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_TASK_PIDS_PID=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_TASK_PIDS_PID if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_TASK_PIDS_PID 1 _ACEOF HAVE_TASK_PIDS_PID=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_TASK_PIDS_PID 0 _ACEOF HAVE_TASK_PIDS_PID='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } # Allow zero or one match if test "${HAVE_TASK_PIDS_PID_LINK}${HAVE_TASK_PIDS_PID}" = "11"; then 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:$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= ;; #( *) $as_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 test "x$cache_file" != "x/dev/null" && { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache echo "======================================================================" echo "Please review the following configuration information:" echo " Kernel source directory = $LINUX_SRC" echo " Kernel build directory = $LINUX_OBJ" echo " Kernel symbol table = ${LINUX_SYSTEM_MAP}${LINUX_VMLINUX}" echo " Kernel version probed from kernel build = $LINUX_VER" echo " Kernel running currently = `uname -r`" echo "======================================================================" { { $as_echo "$as_me:$LINENO: error: Unable to use kernel $LINUX_VER - unable to determine type of task.pids array" >&5 $as_echo "$as_me: error: Unable to use kernel $LINUX_VER - unable to determine type of task.pids array" >&2;} { (exit 1); exit 1; }; } fi # put_task_struct() requires one of these: { $as_echo "$as_me:$LINENO: checking kernel symbol table for __put_task_struct" >&5 $as_echo_n "checking kernel symbol table for __put_task_struct... " >&6; } # Our cacheval is encoded with 'Y' or 'N' as the first char to indicate # if a declaration was found or not, and the address or 0 as the rest. if test "${cr_cv_ksymtab___put_task_struct+set}" = set; then $as_echo_n "(cached) " >&6 else cr_cv_ksymtab___put_task_struct=`eval $LINUX_SYMTAB_CMD | sed -n -e "/${CR_KSYM_PATTERN_CODE}__put_task_struct$/ {s/ .*//p;q;}"` if test -n "$cr_cv_ksymtab___put_task_struct"; then if eval $LINUX_SYMTAB_CMD | grep " __ksymtab___put_task_struct\$" >/dev/null ; then cr_cv_ksymtab___put_task_struct=0 else if test "CODE${HAVE_CONFIG_THUMB2_KERNEL}" = 'CODE1'; then cr_cv_ksymtab___put_task_struct=`$PERL -e "printf '%x', 1 | hex '$cr_cv_ksymtab___put_task_struct';"` fi fi SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #define IN_CONFIGURE 1 #include "${TOP_SRCDIR}/include/blcr_imports.h.in" int main () { int x = sizeof(&__put_task_struct); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab___put_task_struct="Y$cr_cv_ksymtab___put_task_struct" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab___put_task_struct="N$cr_cv_ksymtab___put_task_struct" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi fi cr_addr='' if test -z "$cr_cv_ksymtab___put_task_struct"; then cr_result='not found' else if expr "$cr_cv_ksymtab___put_task_struct" : N >/dev/null; then cat >>$CR_KSYM_IMPORT_DECLS <<_EOF extern void __put_task_struct(struct task_struct *); _EOF fi cr_result=`echo $cr_cv_ksymtab___put_task_struct | tr -d 'YN'` if test $cr_result = 0; then cr_result=exported cr_addr=0 else cr_addr="0x$cr_result" echo "_CR_IMPORT_KCODE(__put_task_struct, $cr_addr)" >>$CR_KSYM_IMPORT_CALLS fi cat >>confdefs.h <<_ACEOF #define CR_KCODE___put_task_struct $cr_addr _ACEOF fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel symbol table for __put_task_struct_cb" >&5 $as_echo_n "checking kernel symbol table for __put_task_struct_cb... " >&6; } # Our cacheval is encoded with 'Y' or 'N' as the first char to indicate # if a declaration was found or not, and the address or 0 as the rest. if test "${cr_cv_ksymtab___put_task_struct_cb+set}" = set; then $as_echo_n "(cached) " >&6 else cr_cv_ksymtab___put_task_struct_cb=`eval $LINUX_SYMTAB_CMD | sed -n -e "/${CR_KSYM_PATTERN_CODE}__put_task_struct_cb$/ {s/ .*//p;q;}"` if test -n "$cr_cv_ksymtab___put_task_struct_cb"; then if eval $LINUX_SYMTAB_CMD | grep " __ksymtab___put_task_struct_cb\$" >/dev/null ; then cr_cv_ksymtab___put_task_struct_cb=0 else if test "CODE${HAVE_CONFIG_THUMB2_KERNEL}" = 'CODE1'; then cr_cv_ksymtab___put_task_struct_cb=`$PERL -e "printf '%x', 1 | hex '$cr_cv_ksymtab___put_task_struct_cb';"` fi fi SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #define IN_CONFIGURE 1 #include "${TOP_SRCDIR}/include/blcr_imports.h.in" int main () { int x = sizeof(&__put_task_struct_cb); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab___put_task_struct_cb="Y$cr_cv_ksymtab___put_task_struct_cb" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab___put_task_struct_cb="N$cr_cv_ksymtab___put_task_struct_cb" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi fi cr_addr='' if test -z "$cr_cv_ksymtab___put_task_struct_cb"; then cr_result='not found' else if expr "$cr_cv_ksymtab___put_task_struct_cb" : N >/dev/null; then { { $as_echo "$as_me:$LINENO: error: Found symbol __put_task_struct_cb but no declaration -- please file a bug report." >&5 $as_echo "$as_me: error: Found symbol __put_task_struct_cb but no declaration -- please file a bug report." >&2;} { (exit 1); exit 1; }; } fi cr_result=`echo $cr_cv_ksymtab___put_task_struct_cb | tr -d 'YN'` if test $cr_result = 0; then cr_result=exported cr_addr=0 else cr_addr="0x$cr_result" echo "_CR_IMPORT_KCODE(__put_task_struct_cb, $cr_addr)" >>$CR_KSYM_IMPORT_CALLS fi cat >>confdefs.h <<_ACEOF #define CR_KCODE___put_task_struct_cb $cr_addr _ACEOF fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel for mm.task_size" >&5 $as_echo_n "checking kernel for mm.task_size... " >&6; } if test "${cr_cv_kconfig_HAVE_MM_TASK_SIZE+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { struct mm_struct x; unsigned long tc_1 = x.task_size; ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_MM_TASK_SIZE=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_MM_TASK_SIZE=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_MM_TASK_SIZE if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_MM_TASK_SIZE 1 _ACEOF HAVE_MM_TASK_SIZE=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_MM_TASK_SIZE 0 _ACEOF HAVE_MM_TASK_SIZE='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel for mm.exe_file" >&5 $as_echo_n "checking kernel for mm.exe_file... " >&6; } if test "${cr_cv_kconfig_HAVE_MM_EXE_FILE+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include #include int main () { struct mm_struct x; struct file tc_1 = *(x.exe_file); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_MM_EXE_FILE=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_MM_EXE_FILE=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_MM_EXE_FILE if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_MM_EXE_FILE 1 _ACEOF HAVE_MM_EXE_FILE=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_MM_EXE_FILE 0 _ACEOF HAVE_MM_EXE_FILE='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel for vma.vm_mm" >&5 $as_echo_n "checking kernel for vma.vm_mm... " >&6; } if test "${cr_cv_kconfig_HAVE_VMA_VM_MM+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { struct vm_area_struct x; struct mm_struct tc_1 = *(x.vm_mm); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_VMA_VM_MM=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_VMA_VM_MM=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_VMA_VM_MM if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_VMA_VM_MM 1 _ACEOF HAVE_VMA_VM_MM=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_VMA_VM_MM 0 _ACEOF HAVE_VMA_VM_MM='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel for PageAnon" >&5 $as_echo_n "checking kernel for PageAnon... " >&6; } if test "${cr_cv_kconfig_HAVE_PAGEANON+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { #ifdef PageAnon /* OK, it exists and is a macro */ #else /* Check for function case */ int x = sizeof(&PageAnon); #endif ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_PAGEANON=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_PAGEANON=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_PAGEANON if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_PAGEANON 1 _ACEOF HAVE_PAGEANON=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_PAGEANON 0 _ACEOF HAVE_PAGEANON='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } # Look for various VDSO-related bits (arch and version dependent) { $as_echo "$as_me:$LINENO: checking kernel for thread.vdso_base" >&5 $as_echo_n "checking kernel for thread.vdso_base... " >&6; } if test "${cr_cv_kconfig_HAVE_THREAD_VDSO_BASE+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { struct thread_struct x; unsigned long tc_1 = x.vdso_base; ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_THREAD_VDSO_BASE=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_THREAD_VDSO_BASE=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_THREAD_VDSO_BASE if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_THREAD_VDSO_BASE 1 _ACEOF HAVE_THREAD_VDSO_BASE=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_THREAD_VDSO_BASE 0 _ACEOF HAVE_THREAD_VDSO_BASE='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel for mm.context.vdso_base" >&5 $as_echo_n "checking kernel for mm.context.vdso_base... " >&6; } if test "${cr_cv_kconfig_HAVE_MM_CONTEXT_VDSO_BASE+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { mm_context_t x; unsigned long tc_1 = x.vdso_base; ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_MM_CONTEXT_VDSO_BASE=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_MM_CONTEXT_VDSO_BASE=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_MM_CONTEXT_VDSO_BASE if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_MM_CONTEXT_VDSO_BASE 1 _ACEOF HAVE_MM_CONTEXT_VDSO_BASE=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_MM_CONTEXT_VDSO_BASE 0 _ACEOF HAVE_MM_CONTEXT_VDSO_BASE='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel for mm.context.vdso" >&5 $as_echo_n "checking kernel for mm.context.vdso... " >&6; } if test "${cr_cv_kconfig_HAVE_MM_CONTEXT_VDSO+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { mm_context_t x; unsigned long tc_1 = x.vdso; ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_MM_CONTEXT_VDSO=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_MM_CONTEXT_VDSO=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_MM_CONTEXT_VDSO if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_MM_CONTEXT_VDSO 1 _ACEOF HAVE_MM_CONTEXT_VDSO=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_MM_CONTEXT_VDSO 0 _ACEOF HAVE_MM_CONTEXT_VDSO='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel for thread_info.sysenter_return" >&5 $as_echo_n "checking kernel for thread_info.sysenter_return... " >&6; } if test "${cr_cv_kconfig_HAVE_THREAD_INFO_SYSENTER_RETURN+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { struct thread_info x; void * tc_1 = x.sysenter_return; ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_THREAD_INFO_SYSENTER_RETURN=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_THREAD_INFO_SYSENTER_RETURN=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_THREAD_INFO_SYSENTER_RETURN if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_THREAD_INFO_SYSENTER_RETURN 1 _ACEOF HAVE_THREAD_INFO_SYSENTER_RETURN=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_THREAD_INFO_SYSENTER_RETURN 0 _ACEOF HAVE_THREAD_INFO_SYSENTER_RETURN='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } if test $CR_KARCH = arm; then { $as_echo "$as_me:$LINENO: checking kernel for thread_info.tp_value" >&5 $as_echo_n "checking kernel for thread_info.tp_value... " >&6; } if test "${cr_cv_kconfig_HAVE_THREAD_INFO_TP_VALUE+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { struct thread_info x; unsigned long tc_1 = x.tp_value; ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_THREAD_INFO_TP_VALUE=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_THREAD_INFO_TP_VALUE=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_THREAD_INFO_TP_VALUE if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_THREAD_INFO_TP_VALUE 1 _ACEOF HAVE_THREAD_INFO_TP_VALUE=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_THREAD_INFO_TP_VALUE 0 _ACEOF HAVE_THREAD_INFO_TP_VALUE='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel symbol table for __kuser_helper_start" >&5 $as_echo_n "checking kernel symbol table for __kuser_helper_start... " >&6; } # Our cacheval is encoded with 'Y' or 'N' as the first char to indicate # if a declaration was found or not, and the address or 0 as the rest. if test "${cr_cv_ksymtab___kuser_helper_start+set}" = set; then $as_echo_n "(cached) " >&6 else cr_cv_ksymtab___kuser_helper_start=`eval $LINUX_SYMTAB_CMD | sed -n -e "/${CR_KSYM_PATTERN_CODE}__kuser_helper_start$/ {s/ .*//p;q;}"` if test -n "$cr_cv_ksymtab___kuser_helper_start"; then if eval $LINUX_SYMTAB_CMD | grep " __ksymtab___kuser_helper_start\$" >/dev/null ; then cr_cv_ksymtab___kuser_helper_start=0 else if test "CODE${HAVE_CONFIG_THUMB2_KERNEL}" = 'CODE1'; then cr_cv_ksymtab___kuser_helper_start=`$PERL -e "printf '%x', 1 | hex '$cr_cv_ksymtab___kuser_helper_start';"` fi fi SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #define IN_CONFIGURE 1 #include "${TOP_SRCDIR}/include/blcr_imports.h.in" int main () { int x = sizeof(&__kuser_helper_start); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab___kuser_helper_start="Y$cr_cv_ksymtab___kuser_helper_start" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab___kuser_helper_start="N$cr_cv_ksymtab___kuser_helper_start" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi fi cr_addr='' if test -z "$cr_cv_ksymtab___kuser_helper_start"; then cr_result='not found' else if expr "$cr_cv_ksymtab___kuser_helper_start" : N >/dev/null; then cat >>$CR_KSYM_IMPORT_DECLS <<_EOF extern int __kuser_helper_start(void); _EOF fi cr_result=`echo $cr_cv_ksymtab___kuser_helper_start | tr -d 'YN'` if test $cr_result = 0; then cr_result=exported cr_addr=0 else cr_addr="0x$cr_result" echo "_CR_IMPORT_KCODE(__kuser_helper_start, $cr_addr)" >>$CR_KSYM_IMPORT_CALLS fi cat >>confdefs.h <<_ACEOF #define CR_KCODE___kuser_helper_start $cr_addr _ACEOF fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel symbol table for __kuser_cmpxchg" >&5 $as_echo_n "checking kernel symbol table for __kuser_cmpxchg... " >&6; } # Our cacheval is encoded with 'Y' or 'N' as the first char to indicate # if a declaration was found or not, and the address or 0 as the rest. if test "${cr_cv_ksymtab___kuser_cmpxchg+set}" = set; then $as_echo_n "(cached) " >&6 else cr_cv_ksymtab___kuser_cmpxchg=`eval $LINUX_SYMTAB_CMD | sed -n -e "/${CR_KSYM_PATTERN_CODE}__kuser_cmpxchg$/ {s/ .*//p;q;}"` if test -n "$cr_cv_ksymtab___kuser_cmpxchg"; then if eval $LINUX_SYMTAB_CMD | grep " __ksymtab___kuser_cmpxchg\$" >/dev/null ; then cr_cv_ksymtab___kuser_cmpxchg=0 else if test "CODE${HAVE_CONFIG_THUMB2_KERNEL}" = 'CODE1'; then cr_cv_ksymtab___kuser_cmpxchg=`$PERL -e "printf '%x', 1 | hex '$cr_cv_ksymtab___kuser_cmpxchg';"` fi fi SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #define IN_CONFIGURE 1 #include "${TOP_SRCDIR}/include/blcr_imports.h.in" int main () { int x = sizeof(&__kuser_cmpxchg); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab___kuser_cmpxchg="Y$cr_cv_ksymtab___kuser_cmpxchg" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab___kuser_cmpxchg="N$cr_cv_ksymtab___kuser_cmpxchg" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi fi cr_addr='' if test -z "$cr_cv_ksymtab___kuser_cmpxchg"; then cr_result='not found' else if expr "$cr_cv_ksymtab___kuser_cmpxchg" : N >/dev/null; then cat >>$CR_KSYM_IMPORT_DECLS <<_EOF extern int __kuser_cmpxchg(void); _EOF fi cr_result=`echo $cr_cv_ksymtab___kuser_cmpxchg | tr -d 'YN'` if test $cr_result = 0; then cr_result=exported cr_addr=0 else cr_addr="0x$cr_result" echo "_CR_IMPORT_KCODE(__kuser_cmpxchg, $cr_addr)" >>$CR_KSYM_IMPORT_CALLS fi cat >>confdefs.h <<_ACEOF #define CR_KCODE___kuser_cmpxchg $cr_addr _ACEOF fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } fi { $as_echo "$as_me:$LINENO: checking kernel for VSYSCALL_BASE" >&5 $as_echo_n "checking kernel for VSYSCALL_BASE... " >&6; } if test "${cr_cv_kconfig_HAVE_VSYSCALL_BASE+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { typeof(VSYSCALL_BASE) y; int x = sizeof(y); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_VSYSCALL_BASE=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_VSYSCALL_BASE=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_VSYSCALL_BASE if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_VSYSCALL_BASE 1 _ACEOF HAVE_VSYSCALL_BASE=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_VSYSCALL_BASE 0 _ACEOF HAVE_VSYSCALL_BASE='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel for 2-arg arch_setup_additional_pages" >&5 $as_echo_n "checking kernel for 2-arg arch_setup_additional_pages... " >&6; } if test "${cr_cv_kconfig_HAVE_2_ARG_ARCH_SETUP_ADDITIONAL_PAGES+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include #include int main () { #ifndef arch_setup_additional_pages /* Must be macro or have a decl */ int x = sizeof(&arch_setup_additional_pages); #endif arch_setup_additional_pages(NULL,0); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_2_ARG_ARCH_SETUP_ADDITIONAL_PAGES=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_2_ARG_ARCH_SETUP_ADDITIONAL_PAGES=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_2_ARG_ARCH_SETUP_ADDITIONAL_PAGES if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_2_ARG_ARCH_SETUP_ADDITIONAL_PAGES 1 _ACEOF HAVE_2_ARG_ARCH_SETUP_ADDITIONAL_PAGES=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_2_ARG_ARCH_SETUP_ADDITIONAL_PAGES 0 _ACEOF HAVE_2_ARG_ARCH_SETUP_ADDITIONAL_PAGES='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel for 4-arg arch_setup_additional_pages" >&5 $as_echo_n "checking kernel for 4-arg arch_setup_additional_pages... " >&6; } if test "${cr_cv_kconfig_HAVE_4_ARG_ARCH_SETUP_ADDITIONAL_PAGES+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include #include int main () { #ifndef arch_setup_additional_pages /* Must be macro or have a decl */ int x = sizeof(&arch_setup_additional_pages); #endif arch_setup_additional_pages(NULL,0,0,0); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_4_ARG_ARCH_SETUP_ADDITIONAL_PAGES=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_4_ARG_ARCH_SETUP_ADDITIONAL_PAGES=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_4_ARG_ARCH_SETUP_ADDITIONAL_PAGES if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_4_ARG_ARCH_SETUP_ADDITIONAL_PAGES 1 _ACEOF HAVE_4_ARG_ARCH_SETUP_ADDITIONAL_PAGES=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_4_ARG_ARCH_SETUP_ADDITIONAL_PAGES 0 _ACEOF HAVE_4_ARG_ARCH_SETUP_ADDITIONAL_PAGES='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } if test -n "${HAVE_2_ARG_ARCH_SETUP_ADDITIONAL_PAGES}${HAVE_4_ARG_ARCH_SETUP_ADDITIONAL_PAGES}"; then { $as_echo "$as_me:$LINENO: checking kernel symbol table for arch_setup_additional_pages" >&5 $as_echo_n "checking kernel symbol table for arch_setup_additional_pages... " >&6; } # Our cacheval is encoded with 'Y' or 'N' as the first char to indicate # if a declaration was found or not, and the address or 0 as the rest. if test "${cr_cv_ksymtab_arch_setup_additional_pages+set}" = set; then $as_echo_n "(cached) " >&6 else cr_cv_ksymtab_arch_setup_additional_pages=`eval $LINUX_SYMTAB_CMD | sed -n -e "/${CR_KSYM_PATTERN_CODE}arch_setup_additional_pages$/ {s/ .*//p;q;}"` if test -n "$cr_cv_ksymtab_arch_setup_additional_pages"; then if eval $LINUX_SYMTAB_CMD | grep " __ksymtab_arch_setup_additional_pages\$" >/dev/null ; then cr_cv_ksymtab_arch_setup_additional_pages=0 else if test "CODE${HAVE_CONFIG_THUMB2_KERNEL}" = 'CODE1'; then cr_cv_ksymtab_arch_setup_additional_pages=`$PERL -e "printf '%x', 1 | hex '$cr_cv_ksymtab_arch_setup_additional_pages';"` fi fi SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #define IN_CONFIGURE 1 #include "${TOP_SRCDIR}/include/blcr_imports.h.in" int main () { int x = sizeof(&arch_setup_additional_pages); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_arch_setup_additional_pages="Y$cr_cv_ksymtab_arch_setup_additional_pages" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_arch_setup_additional_pages="N$cr_cv_ksymtab_arch_setup_additional_pages" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi fi cr_addr='' if test -z "$cr_cv_ksymtab_arch_setup_additional_pages"; then cr_result='not found' else if expr "$cr_cv_ksymtab_arch_setup_additional_pages" : N >/dev/null; then { { $as_echo "$as_me:$LINENO: error: Found symbol arch_setup_additional_pages but no declaration -- please file a bug report." >&5 $as_echo "$as_me: error: Found symbol arch_setup_additional_pages but no declaration -- please file a bug report." >&2;} { (exit 1); exit 1; }; } fi cr_result=`echo $cr_cv_ksymtab_arch_setup_additional_pages | tr -d 'YN'` if test $cr_result = 0; then cr_result=exported cr_addr=0 else cr_addr="0x$cr_result" echo "_CR_IMPORT_KCODE(arch_setup_additional_pages, $cr_addr)" >>$CR_KSYM_IMPORT_CALLS fi cat >>confdefs.h <<_ACEOF #define CR_KCODE_arch_setup_additional_pages $cr_addr _ACEOF fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } fi { $as_echo "$as_me:$LINENO: checking kernel for map_vsyscall" >&5 $as_echo_n "checking kernel for map_vsyscall... " >&6; } if test "${cr_cv_kconfig_HAVE_MAP_VSYSCALL+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include #include #ifndef __HAVE_ARCH_VSYSCALL choke me #endif int main () { #ifdef map_vsyscall /* OK, it exists and is a macro */ #else /* Check for function case */ int x = sizeof(&map_vsyscall); #endif ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_MAP_VSYSCALL=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_MAP_VSYSCALL=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_MAP_VSYSCALL if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_MAP_VSYSCALL 1 _ACEOF HAVE_MAP_VSYSCALL=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_MAP_VSYSCALL 0 _ACEOF HAVE_MAP_VSYSCALL='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } if test -n "${HAVE_MAP_VSYSCALL}"; then { $as_echo "$as_me:$LINENO: checking kernel symbol table for map_vsyscall" >&5 $as_echo_n "checking kernel symbol table for map_vsyscall... " >&6; } # Our cacheval is encoded with 'Y' or 'N' as the first char to indicate # if a declaration was found or not, and the address or 0 as the rest. if test "${cr_cv_ksymtab_map_vsyscall+set}" = set; then $as_echo_n "(cached) " >&6 else cr_cv_ksymtab_map_vsyscall=`eval $LINUX_SYMTAB_CMD | sed -n -e "/${CR_KSYM_PATTERN_CODE}map_vsyscall$/ {s/ .*//p;q;}"` if test -n "$cr_cv_ksymtab_map_vsyscall"; then if eval $LINUX_SYMTAB_CMD | grep " __ksymtab_map_vsyscall\$" >/dev/null ; then cr_cv_ksymtab_map_vsyscall=0 else if test "CODE${HAVE_CONFIG_THUMB2_KERNEL}" = 'CODE1'; then cr_cv_ksymtab_map_vsyscall=`$PERL -e "printf '%x', 1 | hex '$cr_cv_ksymtab_map_vsyscall';"` fi fi SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #define IN_CONFIGURE 1 #include "${TOP_SRCDIR}/include/blcr_imports.h.in" int main () { int x = sizeof(&map_vsyscall); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_map_vsyscall="Y$cr_cv_ksymtab_map_vsyscall" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_map_vsyscall="N$cr_cv_ksymtab_map_vsyscall" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi fi cr_addr='' if test -z "$cr_cv_ksymtab_map_vsyscall"; then cr_result='not found' else if expr "$cr_cv_ksymtab_map_vsyscall" : N >/dev/null; then { { $as_echo "$as_me:$LINENO: error: Found symbol map_vsyscall but no declaration -- please file a bug report." >&5 $as_echo "$as_me: error: Found symbol map_vsyscall but no declaration -- please file a bug report." >&2;} { (exit 1); exit 1; }; } fi cr_result=`echo $cr_cv_ksymtab_map_vsyscall | tr -d 'YN'` if test $cr_result = 0; then cr_result=exported cr_addr=0 else cr_addr="0x$cr_result" echo "_CR_IMPORT_KCODE(map_vsyscall, $cr_addr)" >>$CR_KSYM_IMPORT_CALLS fi cat >>confdefs.h <<_ACEOF #define CR_KCODE_map_vsyscall $cr_addr _ACEOF fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } fi if test $CR_KARCH = x86_64; then { $as_echo "$as_me:$LINENO: checking kernel symbol table for syscall32_setup_pages" >&5 $as_echo_n "checking kernel symbol table for syscall32_setup_pages... " >&6; } # Our cacheval is encoded with 'Y' or 'N' as the first char to indicate # if a declaration was found or not, and the address or 0 as the rest. if test "${cr_cv_ksymtab_syscall32_setup_pages+set}" = set; then $as_echo_n "(cached) " >&6 else cr_cv_ksymtab_syscall32_setup_pages=`eval $LINUX_SYMTAB_CMD | sed -n -e "/${CR_KSYM_PATTERN_CODE}syscall32_setup_pages$/ {s/ .*//p;q;}"` if test -n "$cr_cv_ksymtab_syscall32_setup_pages"; then if eval $LINUX_SYMTAB_CMD | grep " __ksymtab_syscall32_setup_pages\$" >/dev/null ; then cr_cv_ksymtab_syscall32_setup_pages=0 else if test "CODE${HAVE_CONFIG_THUMB2_KERNEL}" = 'CODE1'; then cr_cv_ksymtab_syscall32_setup_pages=`$PERL -e "printf '%x', 1 | hex '$cr_cv_ksymtab_syscall32_setup_pages';"` fi fi SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #define IN_CONFIGURE 1 #include "${TOP_SRCDIR}/include/blcr_imports.h.in" int main () { int x = sizeof(&syscall32_setup_pages); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_syscall32_setup_pages="Y$cr_cv_ksymtab_syscall32_setup_pages" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_syscall32_setup_pages="N$cr_cv_ksymtab_syscall32_setup_pages" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi fi cr_addr='' if test -z "$cr_cv_ksymtab_syscall32_setup_pages"; then cr_result='not found' else if expr "$cr_cv_ksymtab_syscall32_setup_pages" : N >/dev/null; then cat >>$CR_KSYM_IMPORT_DECLS <<_EOF extern int syscall32_setup_pages(void *, int); _EOF fi cr_result=`echo $cr_cv_ksymtab_syscall32_setup_pages | tr -d 'YN'` if test $cr_result = 0; then cr_result=exported cr_addr=0 else cr_addr="0x$cr_result" echo "_CR_IMPORT_KCODE(syscall32_setup_pages, $cr_addr)" >>$CR_KSYM_IMPORT_CALLS fi cat >>confdefs.h <<_ACEOF #define CR_KCODE_syscall32_setup_pages $cr_addr _ACEOF fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } fi if test $CR_KARCH = arm; then { $as_echo "$as_me:$LINENO: checking kernel symbol table for vectors_user_mapping" >&5 $as_echo_n "checking kernel symbol table for vectors_user_mapping... " >&6; } # Our cacheval is encoded with 'Y' or 'N' as the first char to indicate # if a declaration was found or not, and the address or 0 as the rest. if test "${cr_cv_ksymtab_vectors_user_mapping+set}" = set; then $as_echo_n "(cached) " >&6 else cr_cv_ksymtab_vectors_user_mapping=`eval $LINUX_SYMTAB_CMD | sed -n -e "/${CR_KSYM_PATTERN_CODE}vectors_user_mapping$/ {s/ .*//p;q;}"` if test -n "$cr_cv_ksymtab_vectors_user_mapping"; then if eval $LINUX_SYMTAB_CMD | grep " __ksymtab_vectors_user_mapping\$" >/dev/null ; then cr_cv_ksymtab_vectors_user_mapping=0 else if test "CODE${HAVE_CONFIG_THUMB2_KERNEL}" = 'CODE1'; then cr_cv_ksymtab_vectors_user_mapping=`$PERL -e "printf '%x', 1 | hex '$cr_cv_ksymtab_vectors_user_mapping';"` fi fi SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #define IN_CONFIGURE 1 #include "${TOP_SRCDIR}/include/blcr_imports.h.in" int main () { int x = sizeof(&vectors_user_mapping); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_vectors_user_mapping="Y$cr_cv_ksymtab_vectors_user_mapping" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_vectors_user_mapping="N$cr_cv_ksymtab_vectors_user_mapping" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi fi cr_addr='' if test -z "$cr_cv_ksymtab_vectors_user_mapping"; then cr_result='not found' else if expr "$cr_cv_ksymtab_vectors_user_mapping" : N >/dev/null; then cat >>$CR_KSYM_IMPORT_DECLS <<_EOF extern int vectors_user_mapping(void); _EOF fi cr_result=`echo $cr_cv_ksymtab_vectors_user_mapping | tr -d 'YN'` if test $cr_result = 0; then cr_result=exported cr_addr=0 else cr_addr="0x$cr_result" echo "_CR_IMPORT_KCODE(vectors_user_mapping, $cr_addr)" >>$CR_KSYM_IMPORT_CALLS fi cat >>confdefs.h <<_ACEOF #define CR_KCODE_vectors_user_mapping $cr_addr _ACEOF fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } fi { $as_echo "$as_me:$LINENO: checking kernel symbol table for arch_pick_mmap_layout" >&5 $as_echo_n "checking kernel symbol table for arch_pick_mmap_layout... " >&6; } # Our cacheval is encoded with 'Y' or 'N' as the first char to indicate # if a declaration was found or not, and the address or 0 as the rest. if test "${cr_cv_ksymtab_arch_pick_mmap_layout+set}" = set; then $as_echo_n "(cached) " >&6 else cr_cv_ksymtab_arch_pick_mmap_layout=`eval $LINUX_SYMTAB_CMD | sed -n -e "/${CR_KSYM_PATTERN_CODE}arch_pick_mmap_layout$/ {s/ .*//p;q;}"` if test -n "$cr_cv_ksymtab_arch_pick_mmap_layout"; then if eval $LINUX_SYMTAB_CMD | grep " __ksymtab_arch_pick_mmap_layout\$" >/dev/null ; then cr_cv_ksymtab_arch_pick_mmap_layout=0 else if test "CODE${HAVE_CONFIG_THUMB2_KERNEL}" = 'CODE1'; then cr_cv_ksymtab_arch_pick_mmap_layout=`$PERL -e "printf '%x', 1 | hex '$cr_cv_ksymtab_arch_pick_mmap_layout';"` fi fi SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #define IN_CONFIGURE 1 #include "${TOP_SRCDIR}/include/blcr_imports.h.in" int main () { int x = sizeof(&arch_pick_mmap_layout); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_arch_pick_mmap_layout="Y$cr_cv_ksymtab_arch_pick_mmap_layout" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_arch_pick_mmap_layout="N$cr_cv_ksymtab_arch_pick_mmap_layout" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi fi cr_addr='' if test -z "$cr_cv_ksymtab_arch_pick_mmap_layout"; then cr_result='not found' else if expr "$cr_cv_ksymtab_arch_pick_mmap_layout" : N >/dev/null; then { { $as_echo "$as_me:$LINENO: error: Found symbol arch_pick_mmap_layout but no declaration -- please file a bug report." >&5 $as_echo "$as_me: error: Found symbol arch_pick_mmap_layout but no declaration -- please file a bug report." >&2;} { (exit 1); exit 1; }; } fi cr_result=`echo $cr_cv_ksymtab_arch_pick_mmap_layout | tr -d 'YN'` if test $cr_result = 0; then cr_result=exported cr_addr=0 else cr_addr="0x$cr_result" echo "_CR_IMPORT_KCODE(arch_pick_mmap_layout, $cr_addr)" >>$CR_KSYM_IMPORT_CALLS fi cat >>confdefs.h <<_ACEOF #define CR_KCODE_arch_pick_mmap_layout $cr_addr _ACEOF fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel symbol table for arch_get_unmaped_area" >&5 $as_echo_n "checking kernel symbol table for arch_get_unmaped_area... " >&6; } # Our cacheval is encoded with 'Y' or 'N' as the first char to indicate # if a declaration was found or not, and the address or 0 as the rest. if test "${cr_cv_ksymtab_arch_get_unmaped_area+set}" = set; then $as_echo_n "(cached) " >&6 else cr_cv_ksymtab_arch_get_unmaped_area=`eval $LINUX_SYMTAB_CMD | sed -n -e "/${CR_KSYM_PATTERN_CODE}arch_get_unmaped_area$/ {s/ .*//p;q;}"` if test -n "$cr_cv_ksymtab_arch_get_unmaped_area"; then if eval $LINUX_SYMTAB_CMD | grep " __ksymtab_arch_get_unmaped_area\$" >/dev/null ; then cr_cv_ksymtab_arch_get_unmaped_area=0 else if test "CODE${HAVE_CONFIG_THUMB2_KERNEL}" = 'CODE1'; then cr_cv_ksymtab_arch_get_unmaped_area=`$PERL -e "printf '%x', 1 | hex '$cr_cv_ksymtab_arch_get_unmaped_area';"` fi fi SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #define IN_CONFIGURE 1 #include "${TOP_SRCDIR}/include/blcr_imports.h.in" int main () { int x = sizeof(&arch_get_unmaped_area); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_arch_get_unmaped_area="Y$cr_cv_ksymtab_arch_get_unmaped_area" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_arch_get_unmaped_area="N$cr_cv_ksymtab_arch_get_unmaped_area" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi fi cr_addr='' if test -z "$cr_cv_ksymtab_arch_get_unmaped_area"; then cr_result='not found' else if expr "$cr_cv_ksymtab_arch_get_unmaped_area" : N >/dev/null; then { { $as_echo "$as_me:$LINENO: error: Found symbol arch_get_unmaped_area but no declaration -- please file a bug report." >&5 $as_echo "$as_me: error: Found symbol arch_get_unmaped_area but no declaration -- please file a bug report." >&2;} { (exit 1); exit 1; }; } fi cr_result=`echo $cr_cv_ksymtab_arch_get_unmaped_area | tr -d 'YN'` if test $cr_result = 0; then cr_result=exported cr_addr=0 else cr_addr="0x$cr_result" echo "_CR_IMPORT_KCODE(arch_get_unmaped_area, $cr_addr)" >>$CR_KSYM_IMPORT_CALLS fi cat >>confdefs.h <<_ACEOF #define CR_KCODE_arch_get_unmaped_area $cr_addr _ACEOF fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel symbol table for arch_unmap_area" >&5 $as_echo_n "checking kernel symbol table for arch_unmap_area... " >&6; } # Our cacheval is encoded with 'Y' or 'N' as the first char to indicate # if a declaration was found or not, and the address or 0 as the rest. if test "${cr_cv_ksymtab_arch_unmap_area+set}" = set; then $as_echo_n "(cached) " >&6 else cr_cv_ksymtab_arch_unmap_area=`eval $LINUX_SYMTAB_CMD | sed -n -e "/${CR_KSYM_PATTERN_CODE}arch_unmap_area$/ {s/ .*//p;q;}"` if test -n "$cr_cv_ksymtab_arch_unmap_area"; then if eval $LINUX_SYMTAB_CMD | grep " __ksymtab_arch_unmap_area\$" >/dev/null ; then cr_cv_ksymtab_arch_unmap_area=0 else if test "CODE${HAVE_CONFIG_THUMB2_KERNEL}" = 'CODE1'; then cr_cv_ksymtab_arch_unmap_area=`$PERL -e "printf '%x', 1 | hex '$cr_cv_ksymtab_arch_unmap_area';"` fi fi SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #define IN_CONFIGURE 1 #include "${TOP_SRCDIR}/include/blcr_imports.h.in" int main () { int x = sizeof(&arch_unmap_area); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_arch_unmap_area="Y$cr_cv_ksymtab_arch_unmap_area" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_arch_unmap_area="N$cr_cv_ksymtab_arch_unmap_area" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi fi cr_addr='' if test -z "$cr_cv_ksymtab_arch_unmap_area"; then cr_result='not found' else if expr "$cr_cv_ksymtab_arch_unmap_area" : N >/dev/null; then { { $as_echo "$as_me:$LINENO: error: Found symbol arch_unmap_area but no declaration -- please file a bug report." >&5 $as_echo "$as_me: error: Found symbol arch_unmap_area but no declaration -- please file a bug report." >&2;} { (exit 1); exit 1; }; } fi cr_result=`echo $cr_cv_ksymtab_arch_unmap_area | tr -d 'YN'` if test $cr_result = 0; then cr_result=exported cr_addr=0 else cr_addr="0x$cr_result" echo "_CR_IMPORT_KCODE(arch_unmap_area, $cr_addr)" >>$CR_KSYM_IMPORT_CALLS fi cat >>confdefs.h <<_ACEOF #define CR_KCODE_arch_unmap_area $cr_addr _ACEOF fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel for mm.mmap_base" >&5 $as_echo_n "checking kernel for mm.mmap_base... " >&6; } if test "${cr_cv_kconfig_HAVE_MM_MMAP_BASE+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { struct mm_struct x; unsigned long tc_1 = x.mmap_base; ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_MM_MMAP_BASE=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_MM_MMAP_BASE=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_MM_MMAP_BASE if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_MM_MMAP_BASE 1 _ACEOF HAVE_MM_MMAP_BASE=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_MM_MMAP_BASE 0 _ACEOF HAVE_MM_MMAP_BASE='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel for mm.cached_hole_size" >&5 $as_echo_n "checking kernel for mm.cached_hole_size... " >&6; } if test "${cr_cv_kconfig_HAVE_MM_CACHED_HOLE_SIZE+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { struct mm_struct x; unsigned long tc_1 = x.cached_hole_size; ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_MM_CACHED_HOLE_SIZE=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_MM_CACHED_HOLE_SIZE=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_MM_CACHED_HOLE_SIZE if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_MM_CACHED_HOLE_SIZE 1 _ACEOF HAVE_MM_CACHED_HOLE_SIZE=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_MM_CACHED_HOLE_SIZE 0 _ACEOF HAVE_MM_CACHED_HOLE_SIZE='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel symbol table for do_munmap" >&5 $as_echo_n "checking kernel symbol table for do_munmap... " >&6; } # Our cacheval is encoded with 'Y' or 'N' as the first char to indicate # if a declaration was found or not, and the address or 0 as the rest. if test "${cr_cv_ksymtab_do_munmap+set}" = set; then $as_echo_n "(cached) " >&6 else cr_cv_ksymtab_do_munmap=`eval $LINUX_SYMTAB_CMD | sed -n -e "/${CR_KSYM_PATTERN_CODE}do_munmap$/ {s/ .*//p;q;}"` if test -n "$cr_cv_ksymtab_do_munmap"; then if eval $LINUX_SYMTAB_CMD | grep " __ksymtab_do_munmap\$" >/dev/null ; then cr_cv_ksymtab_do_munmap=0 else if test "CODE${HAVE_CONFIG_THUMB2_KERNEL}" = 'CODE1'; then cr_cv_ksymtab_do_munmap=`$PERL -e "printf '%x', 1 | hex '$cr_cv_ksymtab_do_munmap';"` fi fi SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #define IN_CONFIGURE 1 #include "${TOP_SRCDIR}/include/blcr_imports.h.in" int main () { int x = sizeof(&do_munmap); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_do_munmap="Y$cr_cv_ksymtab_do_munmap" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_do_munmap="N$cr_cv_ksymtab_do_munmap" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi fi cr_addr='' if test -z "$cr_cv_ksymtab_do_munmap"; then cr_result='not found' else if expr "$cr_cv_ksymtab_do_munmap" : N >/dev/null; then { { $as_echo "$as_me:$LINENO: error: Found symbol do_munmap but no declaration -- please file a bug report." >&5 $as_echo "$as_me: error: Found symbol do_munmap but no declaration -- please file a bug report." >&2;} { (exit 1); exit 1; }; } fi cr_result=`echo $cr_cv_ksymtab_do_munmap | tr -d 'YN'` if test $cr_result = 0; then cr_result=exported cr_addr=0 else cr_addr="0x$cr_result" echo "_CR_IMPORT_KCODE(do_munmap, $cr_addr)" >>$CR_KSYM_IMPORT_CALLS fi cat >>confdefs.h <<_ACEOF #define CR_KCODE_do_munmap $cr_addr _ACEOF fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel for do_mmap" >&5 $as_echo_n "checking kernel for do_mmap... " >&6; } if test "${cr_cv_kconfig_HAVE_DO_MMAP+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { #ifdef do_mmap /* OK, it exists and is a macro */ #else /* Check for function case */ int x = sizeof(&do_mmap); #endif ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_DO_MMAP=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_DO_MMAP=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_DO_MMAP if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_DO_MMAP 1 _ACEOF HAVE_DO_MMAP=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_DO_MMAP 0 _ACEOF HAVE_DO_MMAP='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel for do_mmap_pgoff" >&5 $as_echo_n "checking kernel for do_mmap_pgoff... " >&6; } if test "${cr_cv_kconfig_HAVE_DO_MMAP_PGOFF+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { #ifdef do_mmap_pgoff /* OK, it exists and is a macro */ #else /* Check for function case */ int x = sizeof(&do_mmap_pgoff); #endif ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_DO_MMAP_PGOFF=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_DO_MMAP_PGOFF=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_DO_MMAP_PGOFF if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_DO_MMAP_PGOFF 1 _ACEOF HAVE_DO_MMAP_PGOFF=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_DO_MMAP_PGOFF 0 _ACEOF HAVE_DO_MMAP_PGOFF='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } if test -n "${HAVE_DO_MMAP_PGOFF}"; then { $as_echo "$as_me:$LINENO: checking kernel symbol table for do_mmap_pgoff" >&5 $as_echo_n "checking kernel symbol table for do_mmap_pgoff... " >&6; } # Our cacheval is encoded with 'Y' or 'N' as the first char to indicate # if a declaration was found or not, and the address or 0 as the rest. if test "${cr_cv_ksymtab_do_mmap_pgoff+set}" = set; then $as_echo_n "(cached) " >&6 else cr_cv_ksymtab_do_mmap_pgoff=`eval $LINUX_SYMTAB_CMD | sed -n -e "/${CR_KSYM_PATTERN_CODE}do_mmap_pgoff$/ {s/ .*//p;q;}"` if test -n "$cr_cv_ksymtab_do_mmap_pgoff"; then if eval $LINUX_SYMTAB_CMD | grep " __ksymtab_do_mmap_pgoff\$" >/dev/null ; then cr_cv_ksymtab_do_mmap_pgoff=0 else if test "CODE${HAVE_CONFIG_THUMB2_KERNEL}" = 'CODE1'; then cr_cv_ksymtab_do_mmap_pgoff=`$PERL -e "printf '%x', 1 | hex '$cr_cv_ksymtab_do_mmap_pgoff';"` fi fi SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #define IN_CONFIGURE 1 #include "${TOP_SRCDIR}/include/blcr_imports.h.in" int main () { int x = sizeof(&do_mmap_pgoff); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_do_mmap_pgoff="Y$cr_cv_ksymtab_do_mmap_pgoff" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_do_mmap_pgoff="N$cr_cv_ksymtab_do_mmap_pgoff" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi fi cr_addr='' if test -z "$cr_cv_ksymtab_do_mmap_pgoff"; then cr_result='not found' else if expr "$cr_cv_ksymtab_do_mmap_pgoff" : N >/dev/null; then { { $as_echo "$as_me:$LINENO: error: Found symbol do_mmap_pgoff but no declaration -- please file a bug report." >&5 $as_echo "$as_me: error: Found symbol do_mmap_pgoff but no declaration -- please file a bug report." >&2;} { (exit 1); exit 1; }; } fi cr_result=`echo $cr_cv_ksymtab_do_mmap_pgoff | tr -d 'YN'` if test $cr_result = 0; then cr_result=exported cr_addr=0 else cr_addr="0x$cr_result" echo "_CR_IMPORT_KCODE(do_mmap_pgoff, $cr_addr)" >>$CR_KSYM_IMPORT_CALLS fi cat >>confdefs.h <<_ACEOF #define CR_KCODE_do_mmap_pgoff $cr_addr _ACEOF fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } elif test -n "${HAVE_DO_MMAP}"; then { $as_echo "$as_me:$LINENO: checking kernel symbol table for do_mmap" >&5 $as_echo_n "checking kernel symbol table for do_mmap... " >&6; } # Our cacheval is encoded with 'Y' or 'N' as the first char to indicate # if a declaration was found or not, and the address or 0 as the rest. if test "${cr_cv_ksymtab_do_mmap+set}" = set; then $as_echo_n "(cached) " >&6 else cr_cv_ksymtab_do_mmap=`eval $LINUX_SYMTAB_CMD | sed -n -e "/${CR_KSYM_PATTERN_CODE}do_mmap$/ {s/ .*//p;q;}"` if test -n "$cr_cv_ksymtab_do_mmap"; then if eval $LINUX_SYMTAB_CMD | grep " __ksymtab_do_mmap\$" >/dev/null ; then cr_cv_ksymtab_do_mmap=0 else if test "CODE${HAVE_CONFIG_THUMB2_KERNEL}" = 'CODE1'; then cr_cv_ksymtab_do_mmap=`$PERL -e "printf '%x', 1 | hex '$cr_cv_ksymtab_do_mmap';"` fi fi SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #define IN_CONFIGURE 1 #include "${TOP_SRCDIR}/include/blcr_imports.h.in" int main () { int x = sizeof(&do_mmap); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_do_mmap="Y$cr_cv_ksymtab_do_mmap" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_do_mmap="N$cr_cv_ksymtab_do_mmap" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi fi cr_addr='' if test -z "$cr_cv_ksymtab_do_mmap"; then cr_result='not found' else if expr "$cr_cv_ksymtab_do_mmap" : N >/dev/null; then { { $as_echo "$as_me:$LINENO: error: Found symbol do_mmap but no declaration -- please file a bug report." >&5 $as_echo "$as_me: error: Found symbol do_mmap but no declaration -- please file a bug report." >&2;} { (exit 1); exit 1; }; } fi cr_result=`echo $cr_cv_ksymtab_do_mmap | tr -d 'YN'` if test $cr_result = 0; then cr_result=exported cr_addr=0 else cr_addr="0x$cr_result" echo "_CR_IMPORT_KCODE(do_mmap, $cr_addr)" >>$CR_KSYM_IMPORT_CALLS fi cat >>confdefs.h <<_ACEOF #define CR_KCODE_do_mmap $cr_addr _ACEOF fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } else 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:$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= ;; #( *) $as_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 test "x$cache_file" != "x/dev/null" && { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache echo "======================================================================" echo "Please review the following configuration information:" echo " Kernel source directory = $LINUX_SRC" echo " Kernel build directory = $LINUX_OBJ" echo " Kernel symbol table = ${LINUX_SYSTEM_MAP}${LINUX_VMLINUX}" echo " Kernel version probed from kernel build = $LINUX_VER" echo " Kernel running currently = `uname -r`" echo "======================================================================" { { $as_echo "$as_me:$LINENO: error: Unable to use kernel $LINUX_VER - could not locate either do_mmap() or do_mmap_pgoff()" >&5 $as_echo "$as_me: error: Unable to use kernel $LINUX_VER - could not locate either do_mmap() or do_mmap_pgoff()" >&2;} { (exit 1); exit 1; }; } fi { $as_echo "$as_me:$LINENO: checking kernel for CONFIG_HUGETLBFS" >&5 $as_echo_n "checking kernel for CONFIG_HUGETLBFS... " >&6; } if test "${cr_cv_kconfig_HAVE_CONFIG_HUGETLBFS+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include int main () { #ifndef CONFIG_HUGETLBFS choke me #endif ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_CONFIG_HUGETLBFS=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_CONFIG_HUGETLBFS=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_CONFIG_HUGETLBFS if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_CONFIG_HUGETLBFS 1 _ACEOF HAVE_CONFIG_HUGETLBFS=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_CONFIG_HUGETLBFS 0 _ACEOF HAVE_CONFIG_HUGETLBFS='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } if test -n "${HAVE_CONFIG_HUGETLBFS}"; then { $as_echo "$as_me:$LINENO: checking kernel symbol table for hugetlbfs_file_operations" >&5 $as_echo_n "checking kernel symbol table for hugetlbfs_file_operations... " >&6; } # Our cacheval is encoded with 'Y' or 'N' as the first char to indicate # if a declaration was found or not, and the address or 0 as the rest. if test "${cr_cv_ksymtab_hugetlbfs_file_operations+set}" = set; then $as_echo_n "(cached) " >&6 else cr_cv_ksymtab_hugetlbfs_file_operations=`eval $LINUX_SYMTAB_CMD | sed -n -e "/${CR_KSYM_PATTERN_DATA}hugetlbfs_file_operations$/ {s/ .*//p;q;}"` if test -n "$cr_cv_ksymtab_hugetlbfs_file_operations"; then if eval $LINUX_SYMTAB_CMD | grep " __ksymtab_hugetlbfs_file_operations\$" >/dev/null ; then cr_cv_ksymtab_hugetlbfs_file_operations=0 else if test "DATA${HAVE_CONFIG_THUMB2_KERNEL}" = 'CODE1'; then cr_cv_ksymtab_hugetlbfs_file_operations=`$PERL -e "printf '%x', 1 | hex '$cr_cv_ksymtab_hugetlbfs_file_operations';"` fi fi SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #define IN_CONFIGURE 1 #include "${TOP_SRCDIR}/include/blcr_imports.h.in" int main () { int x = sizeof(&hugetlbfs_file_operations); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_hugetlbfs_file_operations="Y$cr_cv_ksymtab_hugetlbfs_file_operations" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_hugetlbfs_file_operations="N$cr_cv_ksymtab_hugetlbfs_file_operations" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi fi cr_addr='' if test -z "$cr_cv_ksymtab_hugetlbfs_file_operations"; then cr_result='not found' else if expr "$cr_cv_ksymtab_hugetlbfs_file_operations" : N >/dev/null; then cat >>$CR_KSYM_IMPORT_DECLS <<_EOF extern const struct file_operations hugetlbfs_file_operations; _EOF fi cr_result=`echo $cr_cv_ksymtab_hugetlbfs_file_operations | tr -d 'YN'` if test $cr_result = 0; then cr_result=exported cr_addr=0 else cr_addr="0x$cr_result" echo "_CR_IMPORT_KDATA(hugetlbfs_file_operations, $cr_addr)" >>$CR_KSYM_IMPORT_CALLS fi cat >>confdefs.h <<_ACEOF #define CR_KDATA_hugetlbfs_file_operations $cr_addr _ACEOF fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel symbol table for is_file_shm_hugepages" >&5 $as_echo_n "checking kernel symbol table for is_file_shm_hugepages... " >&6; } # Our cacheval is encoded with 'Y' or 'N' as the first char to indicate # if a declaration was found or not, and the address or 0 as the rest. if test "${cr_cv_ksymtab_is_file_shm_hugepages+set}" = set; then $as_echo_n "(cached) " >&6 else cr_cv_ksymtab_is_file_shm_hugepages=`eval $LINUX_SYMTAB_CMD | sed -n -e "/${CR_KSYM_PATTERN_CODE}is_file_shm_hugepages$/ {s/ .*//p;q;}"` if test -n "$cr_cv_ksymtab_is_file_shm_hugepages"; then if eval $LINUX_SYMTAB_CMD | grep " __ksymtab_is_file_shm_hugepages\$" >/dev/null ; then cr_cv_ksymtab_is_file_shm_hugepages=0 else if test "CODE${HAVE_CONFIG_THUMB2_KERNEL}" = 'CODE1'; then cr_cv_ksymtab_is_file_shm_hugepages=`$PERL -e "printf '%x', 1 | hex '$cr_cv_ksymtab_is_file_shm_hugepages';"` fi fi SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #define IN_CONFIGURE 1 #include "${TOP_SRCDIR}/include/blcr_imports.h.in" int main () { int x = sizeof(&is_file_shm_hugepages); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_is_file_shm_hugepages="Y$cr_cv_ksymtab_is_file_shm_hugepages" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_is_file_shm_hugepages="N$cr_cv_ksymtab_is_file_shm_hugepages" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi fi cr_addr='' if test -z "$cr_cv_ksymtab_is_file_shm_hugepages"; then cr_result='not found' else if expr "$cr_cv_ksymtab_is_file_shm_hugepages" : N >/dev/null; then cat >>$CR_KSYM_IMPORT_DECLS <<_EOF extern int is_file_shm_hugepages(struct file *file); _EOF fi cr_result=`echo $cr_cv_ksymtab_is_file_shm_hugepages | tr -d 'YN'` if test $cr_result = 0; then cr_result=exported cr_addr=0 else cr_addr="0x$cr_result" echo "_CR_IMPORT_KCODE(is_file_shm_hugepages, $cr_addr)" >>$CR_KSYM_IMPORT_CALLS fi cat >>confdefs.h <<_ACEOF #define CR_KCODE_is_file_shm_hugepages $cr_addr _ACEOF fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel symbol table for hugepage_vma" >&5 $as_echo_n "checking kernel symbol table for hugepage_vma... " >&6; } # Our cacheval is encoded with 'Y' or 'N' as the first char to indicate # if a declaration was found or not, and the address or 0 as the rest. if test "${cr_cv_ksymtab_hugepage_vma+set}" = set; then $as_echo_n "(cached) " >&6 else cr_cv_ksymtab_hugepage_vma=`eval $LINUX_SYMTAB_CMD | sed -n -e "/${CR_KSYM_PATTERN_CODE}hugepage_vma$/ {s/ .*//p;q;}"` if test -n "$cr_cv_ksymtab_hugepage_vma"; then if eval $LINUX_SYMTAB_CMD | grep " __ksymtab_hugepage_vma\$" >/dev/null ; then cr_cv_ksymtab_hugepage_vma=0 else if test "CODE${HAVE_CONFIG_THUMB2_KERNEL}" = 'CODE1'; then cr_cv_ksymtab_hugepage_vma=`$PERL -e "printf '%x', 1 | hex '$cr_cv_ksymtab_hugepage_vma';"` fi fi SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #define IN_CONFIGURE 1 #include "${TOP_SRCDIR}/include/blcr_imports.h.in" int main () { int x = sizeof(&hugepage_vma); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_hugepage_vma="Y$cr_cv_ksymtab_hugepage_vma" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_hugepage_vma="N$cr_cv_ksymtab_hugepage_vma" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi fi cr_addr='' if test -z "$cr_cv_ksymtab_hugepage_vma"; then cr_result='not found' else if expr "$cr_cv_ksymtab_hugepage_vma" : N >/dev/null; then cat >>$CR_KSYM_IMPORT_DECLS <<_EOF extern struct vm_area_struct *hugepage_vma(struct mm_struct *, unsigned long); _EOF fi cr_result=`echo $cr_cv_ksymtab_hugepage_vma | tr -d 'YN'` if test $cr_result = 0; then cr_result=exported cr_addr=0 else cr_addr="0x$cr_result" echo "_CR_IMPORT_KCODE(hugepage_vma, $cr_addr)" >>$CR_KSYM_IMPORT_CALLS fi cat >>confdefs.h <<_ACEOF #define CR_KCODE_hugepage_vma $cr_addr _ACEOF fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel symbol table for pmd_huge" >&5 $as_echo_n "checking kernel symbol table for pmd_huge... " >&6; } # Our cacheval is encoded with 'Y' or 'N' as the first char to indicate # if a declaration was found or not, and the address or 0 as the rest. if test "${cr_cv_ksymtab_pmd_huge+set}" = set; then $as_echo_n "(cached) " >&6 else cr_cv_ksymtab_pmd_huge=`eval $LINUX_SYMTAB_CMD | sed -n -e "/${CR_KSYM_PATTERN_CODE}pmd_huge$/ {s/ .*//p;q;}"` if test -n "$cr_cv_ksymtab_pmd_huge"; then if eval $LINUX_SYMTAB_CMD | grep " __ksymtab_pmd_huge\$" >/dev/null ; then cr_cv_ksymtab_pmd_huge=0 else if test "CODE${HAVE_CONFIG_THUMB2_KERNEL}" = 'CODE1'; then cr_cv_ksymtab_pmd_huge=`$PERL -e "printf '%x', 1 | hex '$cr_cv_ksymtab_pmd_huge';"` fi fi SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #define IN_CONFIGURE 1 #include "${TOP_SRCDIR}/include/blcr_imports.h.in" int main () { int x = sizeof(&pmd_huge); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_pmd_huge="Y$cr_cv_ksymtab_pmd_huge" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_pmd_huge="N$cr_cv_ksymtab_pmd_huge" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi fi cr_addr='' if test -z "$cr_cv_ksymtab_pmd_huge"; then cr_result='not found' else if expr "$cr_cv_ksymtab_pmd_huge" : N >/dev/null; then cat >>$CR_KSYM_IMPORT_DECLS <<_EOF extern int pmd_huge(pmd_t pmd); _EOF fi cr_result=`echo $cr_cv_ksymtab_pmd_huge | tr -d 'YN'` if test $cr_result = 0; then cr_result=exported cr_addr=0 else cr_addr="0x$cr_result" echo "_CR_IMPORT_KCODE(pmd_huge, $cr_addr)" >>$CR_KSYM_IMPORT_CALLS fi cat >>confdefs.h <<_ACEOF #define CR_KCODE_pmd_huge $cr_addr _ACEOF fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel symbol table for follow_huge_pmd" >&5 $as_echo_n "checking kernel symbol table for follow_huge_pmd... " >&6; } # Our cacheval is encoded with 'Y' or 'N' as the first char to indicate # if a declaration was found or not, and the address or 0 as the rest. if test "${cr_cv_ksymtab_follow_huge_pmd+set}" = set; then $as_echo_n "(cached) " >&6 else cr_cv_ksymtab_follow_huge_pmd=`eval $LINUX_SYMTAB_CMD | sed -n -e "/${CR_KSYM_PATTERN_CODE}follow_huge_pmd$/ {s/ .*//p;q;}"` if test -n "$cr_cv_ksymtab_follow_huge_pmd"; then if eval $LINUX_SYMTAB_CMD | grep " __ksymtab_follow_huge_pmd\$" >/dev/null ; then cr_cv_ksymtab_follow_huge_pmd=0 else if test "CODE${HAVE_CONFIG_THUMB2_KERNEL}" = 'CODE1'; then cr_cv_ksymtab_follow_huge_pmd=`$PERL -e "printf '%x', 1 | hex '$cr_cv_ksymtab_follow_huge_pmd';"` fi fi SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #define IN_CONFIGURE 1 #include "${TOP_SRCDIR}/include/blcr_imports.h.in" int main () { int x = sizeof(&follow_huge_pmd); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_follow_huge_pmd="Y$cr_cv_ksymtab_follow_huge_pmd" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_follow_huge_pmd="N$cr_cv_ksymtab_follow_huge_pmd" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi fi cr_addr='' if test -z "$cr_cv_ksymtab_follow_huge_pmd"; then cr_result='not found' else if expr "$cr_cv_ksymtab_follow_huge_pmd" : N >/dev/null; then cat >>$CR_KSYM_IMPORT_DECLS <<_EOF extern struct page * follow_huge_pmd(struct mm_struct *, unsigned long pmd_t *, int); _EOF fi cr_result=`echo $cr_cv_ksymtab_follow_huge_pmd | tr -d 'YN'` if test $cr_result = 0; then cr_result=exported cr_addr=0 else cr_addr="0x$cr_result" echo "_CR_IMPORT_KCODE(follow_huge_pmd, $cr_addr)" >>$CR_KSYM_IMPORT_CALLS fi cat >>confdefs.h <<_ACEOF #define CR_KCODE_follow_huge_pmd $cr_addr _ACEOF fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel symbol table for follow_huge_addr" >&5 $as_echo_n "checking kernel symbol table for follow_huge_addr... " >&6; } # Our cacheval is encoded with 'Y' or 'N' as the first char to indicate # if a declaration was found or not, and the address or 0 as the rest. if test "${cr_cv_ksymtab_follow_huge_addr+set}" = set; then $as_echo_n "(cached) " >&6 else cr_cv_ksymtab_follow_huge_addr=`eval $LINUX_SYMTAB_CMD | sed -n -e "/${CR_KSYM_PATTERN_CODE}follow_huge_addr$/ {s/ .*//p;q;}"` if test -n "$cr_cv_ksymtab_follow_huge_addr"; then if eval $LINUX_SYMTAB_CMD | grep " __ksymtab_follow_huge_addr\$" >/dev/null ; then cr_cv_ksymtab_follow_huge_addr=0 else if test "CODE${HAVE_CONFIG_THUMB2_KERNEL}" = 'CODE1'; then cr_cv_ksymtab_follow_huge_addr=`$PERL -e "printf '%x', 1 | hex '$cr_cv_ksymtab_follow_huge_addr';"` fi fi SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #define IN_CONFIGURE 1 #include "${TOP_SRCDIR}/include/blcr_imports.h.in" int main () { int x = sizeof(&follow_huge_addr); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_follow_huge_addr="Y$cr_cv_ksymtab_follow_huge_addr" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_follow_huge_addr="N$cr_cv_ksymtab_follow_huge_addr" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi fi cr_addr='' if test -z "$cr_cv_ksymtab_follow_huge_addr"; then cr_result='not found' else if expr "$cr_cv_ksymtab_follow_huge_addr" : N >/dev/null; then { { $as_echo "$as_me:$LINENO: error: Found symbol follow_huge_addr but no declaration -- please file a bug report." >&5 $as_echo "$as_me: error: Found symbol follow_huge_addr but no declaration -- please file a bug report." >&2;} { (exit 1); exit 1; }; } fi cr_result=`echo $cr_cv_ksymtab_follow_huge_addr | tr -d 'YN'` if test $cr_result = 0; then cr_result=exported cr_addr=0 else cr_addr="0x$cr_result" echo "_CR_IMPORT_KCODE(follow_huge_addr, $cr_addr)" >>$CR_KSYM_IMPORT_CALLS fi cat >>confdefs.h <<_ACEOF #define CR_KCODE_follow_huge_addr $cr_addr _ACEOF fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } # Must have prototype, or NARGS probe will fail { $as_echo "$as_me:$LINENO: checking kernel for 3-arg follow_huge_addr" >&5 $as_echo_n "checking kernel for 3-arg follow_huge_addr... " >&6; } if test "${cr_cv_kconfig_HAVE_3_ARG_FOLLOW_HUGE_ADDR+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include #include int main () { #ifndef follow_huge_addr /* Must be macro or have a decl */ int x = sizeof(&follow_huge_addr); #endif follow_huge_addr(NULL,0,0); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_3_ARG_FOLLOW_HUGE_ADDR=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_3_ARG_FOLLOW_HUGE_ADDR=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_3_ARG_FOLLOW_HUGE_ADDR if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_3_ARG_FOLLOW_HUGE_ADDR 1 _ACEOF HAVE_3_ARG_FOLLOW_HUGE_ADDR=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_3_ARG_FOLLOW_HUGE_ADDR 0 _ACEOF HAVE_3_ARG_FOLLOW_HUGE_ADDR='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel for 4-arg follow_huge_addr" >&5 $as_echo_n "checking kernel for 4-arg follow_huge_addr... " >&6; } if test "${cr_cv_kconfig_HAVE_4_ARG_FOLLOW_HUGE_ADDR+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include #include int main () { #ifndef follow_huge_addr /* Must be macro or have a decl */ int x = sizeof(&follow_huge_addr); #endif follow_huge_addr(NULL,NULL,0,0); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_4_ARG_FOLLOW_HUGE_ADDR=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_4_ARG_FOLLOW_HUGE_ADDR=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_4_ARG_FOLLOW_HUGE_ADDR if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_4_ARG_FOLLOW_HUGE_ADDR 1 _ACEOF HAVE_4_ARG_FOLLOW_HUGE_ADDR=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_4_ARG_FOLLOW_HUGE_ADDR 0 _ACEOF HAVE_4_ARG_FOLLOW_HUGE_ADDR='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } if test "${HAVE_3_ARG_FOLLOW_HUGE_ADDR}${HAVE_4_ARG_FOLLOW_HUGE_ADDR}" != "1"; then 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:$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= ;; #( *) $as_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 test "x$cache_file" != "x/dev/null" && { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache echo "======================================================================" echo "Please review the following configuration information:" echo " Kernel source directory = $LINUX_SRC" echo " Kernel build directory = $LINUX_OBJ" echo " Kernel symbol table = ${LINUX_SYSTEM_MAP}${LINUX_VMLINUX}" echo " Kernel version probed from kernel build = $LINUX_VER" echo " Kernel running currently = `uname -r`" echo "======================================================================" { { $as_echo "$as_me:$LINENO: error: Unable to use kernel $LINUX_VER - CONFIG_HUGETLBFS set, but unable to determine how invoke follow_huge_addr()" >&5 $as_echo "$as_me: error: Unable to use kernel $LINUX_VER - CONFIG_HUGETLBFS set, but unable to determine how invoke follow_huge_addr()" >&2;} { (exit 1); exit 1; }; } fi else # Avoid gripes from gcc cat >>confdefs.h <<\_ACEOF #define HAVE_3_ARG_FOLLOW_HUGE_ADDR 0 _ACEOF cat >>confdefs.h <<\_ACEOF #define HAVE_4_ARG_FOLLOW_HUGE_ADDR 0 _ACEOF fi # Import the correct symbol for arch-specific ZERO_PAGE(), # which must have a prototype in asm/pgtable.h (arch-specific) # If we support ia64 or mips in the future we'll need to add more cases here. # NOTE: don't try to factor the CR_FIND_KSYM() call; it requires a literal. case $CR_KARCH in sparc*) { $as_echo "$as_me:$LINENO: checking kernel symbol table for mem_map_zero" >&5 $as_echo_n "checking kernel symbol table for mem_map_zero... " >&6; } # Our cacheval is encoded with 'Y' or 'N' as the first char to indicate # if a declaration was found or not, and the address or 0 as the rest. if test "${cr_cv_ksymtab_mem_map_zero+set}" = set; then $as_echo_n "(cached) " >&6 else cr_cv_ksymtab_mem_map_zero=`eval $LINUX_SYMTAB_CMD | sed -n -e "/${CR_KSYM_PATTERN_DATA}mem_map_zero$/ {s/ .*//p;q;}"` if test -n "$cr_cv_ksymtab_mem_map_zero"; then if eval $LINUX_SYMTAB_CMD | grep " __ksymtab_mem_map_zero\$" >/dev/null ; then cr_cv_ksymtab_mem_map_zero=0 else if test "DATA${HAVE_CONFIG_THUMB2_KERNEL}" = 'CODE1'; then cr_cv_ksymtab_mem_map_zero=`$PERL -e "printf '%x', 1 | hex '$cr_cv_ksymtab_mem_map_zero';"` fi fi SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #define IN_CONFIGURE 1 #include "${TOP_SRCDIR}/include/blcr_imports.h.in" int main () { int x = sizeof(&mem_map_zero); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_mem_map_zero="Y$cr_cv_ksymtab_mem_map_zero" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_mem_map_zero="N$cr_cv_ksymtab_mem_map_zero" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi fi cr_addr='' if test -z "$cr_cv_ksymtab_mem_map_zero"; then cr_result='not found' else if expr "$cr_cv_ksymtab_mem_map_zero" : N >/dev/null; then { { $as_echo "$as_me:$LINENO: error: Found symbol mem_map_zero but no declaration -- please file a bug report." >&5 $as_echo "$as_me: error: Found symbol mem_map_zero but no declaration -- please file a bug report." >&2;} { (exit 1); exit 1; }; } fi cr_result=`echo $cr_cv_ksymtab_mem_map_zero | tr -d 'YN'` if test $cr_result = 0; then cr_result=exported cr_addr=0 else cr_addr="0x$cr_result" echo "_CR_IMPORT_KDATA(mem_map_zero, $cr_addr)" >>$CR_KSYM_IMPORT_CALLS fi cat >>confdefs.h <<_ACEOF #define CR_KDATA_mem_map_zero $cr_addr _ACEOF fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } ZERO_PAGE_SYMBOL=mem_map_zero ;; *) { $as_echo "$as_me:$LINENO: checking kernel symbol table for empty_zero_page" >&5 $as_echo_n "checking kernel symbol table for empty_zero_page... " >&6; } # Our cacheval is encoded with 'Y' or 'N' as the first char to indicate # if a declaration was found or not, and the address or 0 as the rest. if test "${cr_cv_ksymtab_empty_zero_page+set}" = set; then $as_echo_n "(cached) " >&6 else cr_cv_ksymtab_empty_zero_page=`eval $LINUX_SYMTAB_CMD | sed -n -e "/${CR_KSYM_PATTERN_DATA}empty_zero_page$/ {s/ .*//p;q;}"` if test -n "$cr_cv_ksymtab_empty_zero_page"; then if eval $LINUX_SYMTAB_CMD | grep " __ksymtab_empty_zero_page\$" >/dev/null ; then cr_cv_ksymtab_empty_zero_page=0 else if test "DATA${HAVE_CONFIG_THUMB2_KERNEL}" = 'CODE1'; then cr_cv_ksymtab_empty_zero_page=`$PERL -e "printf '%x', 1 | hex '$cr_cv_ksymtab_empty_zero_page';"` fi fi SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #define IN_CONFIGURE 1 #include "${TOP_SRCDIR}/include/blcr_imports.h.in" int main () { int x = sizeof(&empty_zero_page); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_empty_zero_page="Y$cr_cv_ksymtab_empty_zero_page" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_empty_zero_page="N$cr_cv_ksymtab_empty_zero_page" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi fi cr_addr='' if test -z "$cr_cv_ksymtab_empty_zero_page"; then cr_result='not found' else if expr "$cr_cv_ksymtab_empty_zero_page" : N >/dev/null; then { { $as_echo "$as_me:$LINENO: error: Found symbol empty_zero_page but no declaration -- please file a bug report." >&5 $as_echo "$as_me: error: Found symbol empty_zero_page but no declaration -- please file a bug report." >&2;} { (exit 1); exit 1; }; } fi cr_result=`echo $cr_cv_ksymtab_empty_zero_page | tr -d 'YN'` if test $cr_result = 0; then cr_result=exported cr_addr=0 else cr_addr="0x$cr_result" echo "_CR_IMPORT_KDATA(empty_zero_page, $cr_addr)" >>$CR_KSYM_IMPORT_CALLS fi cat >>confdefs.h <<_ACEOF #define CR_KDATA_empty_zero_page $cr_addr _ACEOF fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } ZERO_PAGE_SYMBOL=empty_zero_page ;; esac if test -z "$cr_addr"; then { { $as_echo "$as_me:$LINENO: error: failed to find symbol $ZERO_PAGE_SYMBOL" >&5 $as_echo "$as_me: error: failed to find symbol $ZERO_PAGE_SYMBOL" >&2;} { (exit 1); exit 1; }; } fi # How to check for permission { $as_echo "$as_me:$LINENO: checking kernel for inode_permission" >&5 $as_echo_n "checking kernel for inode_permission... " >&6; } if test "${cr_cv_kconfig_HAVE_INODE_PERMISSION+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { #ifdef inode_permission /* OK, it exists and is a macro */ #else /* Check for function case */ int x = sizeof(&inode_permission); #endif ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_INODE_PERMISSION=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_INODE_PERMISSION=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_INODE_PERMISSION if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_INODE_PERMISSION 1 _ACEOF HAVE_INODE_PERMISSION=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_INODE_PERMISSION 0 _ACEOF HAVE_INODE_PERMISSION='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel for permission" >&5 $as_echo_n "checking kernel for permission... " >&6; } if test "${cr_cv_kconfig_HAVE_PERMISSION+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { #ifdef permission /* OK, it exists and is a macro */ #else /* Check for function case */ int x = sizeof(&permission); #endif ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_PERMISSION=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_PERMISSION=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_PERMISSION if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_PERMISSION 1 _ACEOF HAVE_PERMISSION=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_PERMISSION 0 _ACEOF HAVE_PERMISSION='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } if test -z "${HAVE_INODE_PERMISSION}${HAVE_PERMISSION}"; then 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:$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= ;; #( *) $as_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 test "x$cache_file" != "x/dev/null" && { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache echo "======================================================================" echo "Please review the following configuration information:" echo " Kernel source directory = $LINUX_SRC" echo " Kernel build directory = $LINUX_OBJ" echo " Kernel symbol table = ${LINUX_SYSTEM_MAP}${LINUX_VMLINUX}" echo " Kernel version probed from kernel build = $LINUX_VER" echo " Kernel running currently = `uname -r`" echo "======================================================================" { { $as_echo "$as_me:$LINENO: error: Unable to use kernel $LINUX_VER - unable to determine how to invoke permission() or inode_permission" >&5 $as_echo "$as_me: error: Unable to use kernel $LINUX_VER - unable to determine how to invoke permission() or inode_permission" >&2;} { (exit 1); exit 1; }; } fi # Bits for save/restore of pending signals { $as_echo "$as_me:$LINENO: checking kernel symbol table for copy_siginfo_to_user" >&5 $as_echo_n "checking kernel symbol table for copy_siginfo_to_user... " >&6; } # Our cacheval is encoded with 'Y' or 'N' as the first char to indicate # if a declaration was found or not, and the address or 0 as the rest. if test "${cr_cv_ksymtab_copy_siginfo_to_user+set}" = set; then $as_echo_n "(cached) " >&6 else cr_cv_ksymtab_copy_siginfo_to_user=`eval $LINUX_SYMTAB_CMD | sed -n -e "/${CR_KSYM_PATTERN_CODE}copy_siginfo_to_user$/ {s/ .*//p;q;}"` if test -n "$cr_cv_ksymtab_copy_siginfo_to_user"; then if eval $LINUX_SYMTAB_CMD | grep " __ksymtab_copy_siginfo_to_user\$" >/dev/null ; then cr_cv_ksymtab_copy_siginfo_to_user=0 else if test "CODE${HAVE_CONFIG_THUMB2_KERNEL}" = 'CODE1'; then cr_cv_ksymtab_copy_siginfo_to_user=`$PERL -e "printf '%x', 1 | hex '$cr_cv_ksymtab_copy_siginfo_to_user';"` fi fi SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #define IN_CONFIGURE 1 #include "${TOP_SRCDIR}/include/blcr_imports.h.in" int main () { int x = sizeof(©_siginfo_to_user); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_copy_siginfo_to_user="Y$cr_cv_ksymtab_copy_siginfo_to_user" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_copy_siginfo_to_user="N$cr_cv_ksymtab_copy_siginfo_to_user" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi fi cr_addr='' if test -z "$cr_cv_ksymtab_copy_siginfo_to_user"; then cr_result='not found' else if expr "$cr_cv_ksymtab_copy_siginfo_to_user" : N >/dev/null; then cat >>$CR_KSYM_IMPORT_DECLS <<_EOF extern int copy_siginfo_to_user(siginfo_t *to, siginfo_t *from); _EOF fi cr_result=`echo $cr_cv_ksymtab_copy_siginfo_to_user | tr -d 'YN'` if test $cr_result = 0; then cr_result=exported cr_addr=0 else cr_addr="0x$cr_result" echo "_CR_IMPORT_KCODE(copy_siginfo_to_user, $cr_addr)" >>$CR_KSYM_IMPORT_CALLS fi cat >>confdefs.h <<_ACEOF #define CR_KCODE_copy_siginfo_to_user $cr_addr _ACEOF fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel symbol table for group_send_sig_info" >&5 $as_echo_n "checking kernel symbol table for group_send_sig_info... " >&6; } # Our cacheval is encoded with 'Y' or 'N' as the first char to indicate # if a declaration was found or not, and the address or 0 as the rest. if test "${cr_cv_ksymtab_group_send_sig_info+set}" = set; then $as_echo_n "(cached) " >&6 else cr_cv_ksymtab_group_send_sig_info=`eval $LINUX_SYMTAB_CMD | sed -n -e "/${CR_KSYM_PATTERN_CODE}group_send_sig_info$/ {s/ .*//p;q;}"` if test -n "$cr_cv_ksymtab_group_send_sig_info"; then if eval $LINUX_SYMTAB_CMD | grep " __ksymtab_group_send_sig_info\$" >/dev/null ; then cr_cv_ksymtab_group_send_sig_info=0 else if test "CODE${HAVE_CONFIG_THUMB2_KERNEL}" = 'CODE1'; then cr_cv_ksymtab_group_send_sig_info=`$PERL -e "printf '%x', 1 | hex '$cr_cv_ksymtab_group_send_sig_info';"` fi fi SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #define IN_CONFIGURE 1 #include "${TOP_SRCDIR}/include/blcr_imports.h.in" int main () { int x = sizeof(&group_send_sig_info); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_group_send_sig_info="Y$cr_cv_ksymtab_group_send_sig_info" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_group_send_sig_info="N$cr_cv_ksymtab_group_send_sig_info" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi fi cr_addr='' if test -z "$cr_cv_ksymtab_group_send_sig_info"; then cr_result='not found' else if expr "$cr_cv_ksymtab_group_send_sig_info" : N >/dev/null; then cat >>$CR_KSYM_IMPORT_DECLS <<_EOF extern int group_send_sig_info(int, struct siginfo *, struct task_struct *); _EOF fi cr_result=`echo $cr_cv_ksymtab_group_send_sig_info | tr -d 'YN'` if test $cr_result = 0; then cr_result=exported cr_addr=0 else cr_addr="0x$cr_result" echo "_CR_IMPORT_KCODE(group_send_sig_info, $cr_addr)" >>$CR_KSYM_IMPORT_CALLS fi cat >>confdefs.h <<_ACEOF #define CR_KCODE_group_send_sig_info $cr_addr _ACEOF fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } # For save/restore of sigaltstack { $as_echo "$as_me:$LINENO: checking kernel symbol table for do_sigaltstack" >&5 $as_echo_n "checking kernel symbol table for do_sigaltstack... " >&6; } # Our cacheval is encoded with 'Y' or 'N' as the first char to indicate # if a declaration was found or not, and the address or 0 as the rest. if test "${cr_cv_ksymtab_do_sigaltstack+set}" = set; then $as_echo_n "(cached) " >&6 else cr_cv_ksymtab_do_sigaltstack=`eval $LINUX_SYMTAB_CMD | sed -n -e "/${CR_KSYM_PATTERN_CODE}do_sigaltstack$/ {s/ .*//p;q;}"` if test -n "$cr_cv_ksymtab_do_sigaltstack"; then if eval $LINUX_SYMTAB_CMD | grep " __ksymtab_do_sigaltstack\$" >/dev/null ; then cr_cv_ksymtab_do_sigaltstack=0 else if test "CODE${HAVE_CONFIG_THUMB2_KERNEL}" = 'CODE1'; then cr_cv_ksymtab_do_sigaltstack=`$PERL -e "printf '%x', 1 | hex '$cr_cv_ksymtab_do_sigaltstack';"` fi fi SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #define IN_CONFIGURE 1 #include "${TOP_SRCDIR}/include/blcr_imports.h.in" int main () { int x = sizeof(&do_sigaltstack); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_do_sigaltstack="Y$cr_cv_ksymtab_do_sigaltstack" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_do_sigaltstack="N$cr_cv_ksymtab_do_sigaltstack" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi fi cr_addr='' if test -z "$cr_cv_ksymtab_do_sigaltstack"; then cr_result='not found' else if expr "$cr_cv_ksymtab_do_sigaltstack" : N >/dev/null; then cat >>$CR_KSYM_IMPORT_DECLS <<_EOF extern int do_sigaltstack(const stack_t *, stack_t *, unsigned long); _EOF fi cr_result=`echo $cr_cv_ksymtab_do_sigaltstack | tr -d 'YN'` if test $cr_result = 0; then cr_result=exported cr_addr=0 else cr_addr="0x$cr_result" echo "_CR_IMPORT_KCODE(do_sigaltstack, $cr_addr)" >>$CR_KSYM_IMPORT_CALLS fi cat >>confdefs.h <<_ACEOF #define CR_KCODE_do_sigaltstack $cr_addr _ACEOF fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } if test $CR_KARCH = i386 -o $CR_KARCH = x86_64; then { $as_echo "$as_me:$LINENO: checking kernel for struct n_desc_struct" >&5 $as_echo_n "checking kernel for struct n_desc_struct... " >&6; } if test "${cr_cv_kconfig_HAVE_STRUCT_N_DESC_STRUCT+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include #include int main () { struct n_desc_struct y; int x = sizeof(y); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_STRUCT_N_DESC_STRUCT=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_STRUCT_N_DESC_STRUCT=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_STRUCT_N_DESC_STRUCT if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_STRUCT_N_DESC_STRUCT 1 _ACEOF HAVE_STRUCT_N_DESC_STRUCT=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_STRUCT_N_DESC_STRUCT 0 _ACEOF HAVE_STRUCT_N_DESC_STRUCT='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel for cpu_gdt_descr" >&5 $as_echo_n "checking kernel for cpu_gdt_descr... " >&6; } if test "${cr_cv_kconfig_HAVE_CPU_GDT_DESCR+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include #include int main () { int x = sizeof(&cpu_gdt_descr); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_CPU_GDT_DESCR=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_CPU_GDT_DESCR=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_CPU_GDT_DESCR if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_CPU_GDT_DESCR 1 _ACEOF HAVE_CPU_GDT_DESCR=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_CPU_GDT_DESCR 0 _ACEOF HAVE_CPU_GDT_DESCR='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } if test -n "${HAVE_CPU_GDT_DESCR}"; then { $as_echo "$as_me:$LINENO: checking kernel symbol table for cpu_gdt_descr" >&5 $as_echo_n "checking kernel symbol table for cpu_gdt_descr... " >&6; } # Our cacheval is encoded with 'Y' or 'N' as the first char to indicate # if a declaration was found or not, and the address or 0 as the rest. if test "${cr_cv_ksymtab_cpu_gdt_descr+set}" = set; then $as_echo_n "(cached) " >&6 else cr_cv_ksymtab_cpu_gdt_descr=`eval $LINUX_SYMTAB_CMD | sed -n -e "/${CR_KSYM_PATTERN_DATA}cpu_gdt_descr$/ {s/ .*//p;q;}"` if test -n "$cr_cv_ksymtab_cpu_gdt_descr"; then if eval $LINUX_SYMTAB_CMD | grep " __ksymtab_cpu_gdt_descr\$" >/dev/null ; then cr_cv_ksymtab_cpu_gdt_descr=0 else if test "DATA${HAVE_CONFIG_THUMB2_KERNEL}" = 'CODE1'; then cr_cv_ksymtab_cpu_gdt_descr=`$PERL -e "printf '%x', 1 | hex '$cr_cv_ksymtab_cpu_gdt_descr';"` fi fi SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #define IN_CONFIGURE 1 #include "${TOP_SRCDIR}/include/blcr_imports.h.in" int main () { int x = sizeof(&cpu_gdt_descr); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_cpu_gdt_descr="Y$cr_cv_ksymtab_cpu_gdt_descr" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_cpu_gdt_descr="N$cr_cv_ksymtab_cpu_gdt_descr" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi fi cr_addr='' if test -z "$cr_cv_ksymtab_cpu_gdt_descr"; then cr_result='not found' else if expr "$cr_cv_ksymtab_cpu_gdt_descr" : N >/dev/null; then { { $as_echo "$as_me:$LINENO: error: Found symbol cpu_gdt_descr but no declaration -- please file a bug report." >&5 $as_echo "$as_me: error: Found symbol cpu_gdt_descr but no declaration -- please file a bug report." >&2;} { (exit 1); exit 1; }; } fi cr_result=`echo $cr_cv_ksymtab_cpu_gdt_descr | tr -d 'YN'` if test $cr_result = 0; then cr_result=exported cr_addr=0 else cr_addr="0x$cr_result" echo "_CR_IMPORT_KDATA(cpu_gdt_descr, $cr_addr)" >>$CR_KSYM_IMPORT_CALLS fi cat >>confdefs.h <<_ACEOF #define CR_KDATA_cpu_gdt_descr $cr_addr _ACEOF fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } fi { $as_echo "$as_me:$LINENO: checking kernel symbol table for cpu_gdt_table" >&5 $as_echo_n "checking kernel symbol table for cpu_gdt_table... " >&6; } # Our cacheval is encoded with 'Y' or 'N' as the first char to indicate # if a declaration was found or not, and the address or 0 as the rest. if test "${cr_cv_ksymtab_cpu_gdt_table+set}" = set; then $as_echo_n "(cached) " >&6 else cr_cv_ksymtab_cpu_gdt_table=`eval $LINUX_SYMTAB_CMD | sed -n -e "/${CR_KSYM_PATTERN_DATA}cpu_gdt_table$/ {s/ .*//p;q;}"` if test -n "$cr_cv_ksymtab_cpu_gdt_table"; then if eval $LINUX_SYMTAB_CMD | grep " __ksymtab_cpu_gdt_table\$" >/dev/null ; then cr_cv_ksymtab_cpu_gdt_table=0 else if test "DATA${HAVE_CONFIG_THUMB2_KERNEL}" = 'CODE1'; then cr_cv_ksymtab_cpu_gdt_table=`$PERL -e "printf '%x', 1 | hex '$cr_cv_ksymtab_cpu_gdt_table';"` fi fi SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #define IN_CONFIGURE 1 #include "${TOP_SRCDIR}/include/blcr_imports.h.in" int main () { int x = sizeof(&cpu_gdt_table); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_cpu_gdt_table="Y$cr_cv_ksymtab_cpu_gdt_table" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_cpu_gdt_table="N$cr_cv_ksymtab_cpu_gdt_table" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi fi cr_addr='' if test -z "$cr_cv_ksymtab_cpu_gdt_table"; then cr_result='not found' else if expr "$cr_cv_ksymtab_cpu_gdt_table" : N >/dev/null; then { { $as_echo "$as_me:$LINENO: error: Found symbol cpu_gdt_table but no declaration -- please file a bug report." >&5 $as_echo "$as_me: error: Found symbol cpu_gdt_table but no declaration -- please file a bug report." >&2;} { (exit 1); exit 1; }; } fi cr_result=`echo $cr_cv_ksymtab_cpu_gdt_table | tr -d 'YN'` if test $cr_result = 0; then cr_result=exported cr_addr=0 else cr_addr="0x$cr_result" echo "_CR_IMPORT_KDATA(cpu_gdt_table, $cr_addr)" >>$CR_KSYM_IMPORT_CALLS fi cat >>confdefs.h <<_ACEOF #define CR_KDATA_cpu_gdt_table $cr_addr _ACEOF fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel symbol table for per_cpu__cpu_gdt_descr" >&5 $as_echo_n "checking kernel symbol table for per_cpu__cpu_gdt_descr... " >&6; } # Our cacheval is encoded with 'Y' or 'N' as the first char to indicate # if a declaration was found or not, and the address or 0 as the rest. if test "${cr_cv_ksymtab_per_cpu__cpu_gdt_descr+set}" = set; then $as_echo_n "(cached) " >&6 else cr_cv_ksymtab_per_cpu__cpu_gdt_descr=`eval $LINUX_SYMTAB_CMD | sed -n -e "/${CR_KSYM_PATTERN_DATA}per_cpu__cpu_gdt_descr$/ {s/ .*//p;q;}"` if test -n "$cr_cv_ksymtab_per_cpu__cpu_gdt_descr"; then if eval $LINUX_SYMTAB_CMD | grep " __ksymtab_per_cpu__cpu_gdt_descr\$" >/dev/null ; then cr_cv_ksymtab_per_cpu__cpu_gdt_descr=0 else if test "DATA${HAVE_CONFIG_THUMB2_KERNEL}" = 'CODE1'; then cr_cv_ksymtab_per_cpu__cpu_gdt_descr=`$PERL -e "printf '%x', 1 | hex '$cr_cv_ksymtab_per_cpu__cpu_gdt_descr';"` fi fi SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #define IN_CONFIGURE 1 #include "${TOP_SRCDIR}/include/blcr_imports.h.in" int main () { int x = sizeof(&per_cpu__cpu_gdt_descr); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_per_cpu__cpu_gdt_descr="Y$cr_cv_ksymtab_per_cpu__cpu_gdt_descr" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_per_cpu__cpu_gdt_descr="N$cr_cv_ksymtab_per_cpu__cpu_gdt_descr" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi fi cr_addr='' if test -z "$cr_cv_ksymtab_per_cpu__cpu_gdt_descr"; then cr_result='not found' else if expr "$cr_cv_ksymtab_per_cpu__cpu_gdt_descr" : N >/dev/null; then { { $as_echo "$as_me:$LINENO: error: Found symbol per_cpu__cpu_gdt_descr but no declaration -- please file a bug report." >&5 $as_echo "$as_me: error: Found symbol per_cpu__cpu_gdt_descr but no declaration -- please file a bug report." >&2;} { (exit 1); exit 1; }; } fi cr_result=`echo $cr_cv_ksymtab_per_cpu__cpu_gdt_descr | tr -d 'YN'` if test $cr_result = 0; then cr_result=exported cr_addr=0 else cr_addr="0x$cr_result" echo "_CR_IMPORT_KDATA(per_cpu__cpu_gdt_descr, $cr_addr)" >>$CR_KSYM_IMPORT_CALLS fi cat >>confdefs.h <<_ACEOF #define CR_KDATA_per_cpu__cpu_gdt_descr $cr_addr _ACEOF fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel for thread.sp0" >&5 $as_echo_n "checking kernel for thread.sp0... " >&6; } if test "${cr_cv_kconfig_HAVE_THREAD_SP0+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { struct thread_struct x; unsigned long tc_1 = x.sp0; ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_THREAD_SP0=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_THREAD_SP0=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_THREAD_SP0 if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_THREAD_SP0 1 _ACEOF HAVE_THREAD_SP0=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_THREAD_SP0 0 _ACEOF HAVE_THREAD_SP0='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel for thread.esp0" >&5 $as_echo_n "checking kernel for thread.esp0... " >&6; } if test "${cr_cv_kconfig_HAVE_THREAD_ESP0+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { struct thread_struct x; unsigned long tc_1 = x.esp0; ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_THREAD_ESP0=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_THREAD_ESP0=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_THREAD_ESP0 if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_THREAD_ESP0 1 _ACEOF HAVE_THREAD_ESP0=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_THREAD_ESP0 0 _ACEOF HAVE_THREAD_ESP0='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel for thread.rsp0" >&5 $as_echo_n "checking kernel for thread.rsp0... " >&6; } if test "${cr_cv_kconfig_HAVE_THREAD_RSP0+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { struct thread_struct x; unsigned long tc_1 = x.rsp0; ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_THREAD_RSP0=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_THREAD_RSP0=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_THREAD_RSP0 if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_THREAD_RSP0 1 _ACEOF HAVE_THREAD_RSP0=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_THREAD_RSP0 0 _ACEOF HAVE_THREAD_RSP0='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel for thread.usersp" >&5 $as_echo_n "checking kernel for thread.usersp... " >&6; } if test "${cr_cv_kconfig_HAVE_THREAD_USERSP+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { struct thread_struct x; unsigned long tc_1 = x.usersp; ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_THREAD_USERSP=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_THREAD_USERSP=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_THREAD_USERSP if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_THREAD_USERSP 1 _ACEOF HAVE_THREAD_USERSP=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_THREAD_USERSP 0 _ACEOF HAVE_THREAD_USERSP='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel for thread.userrsp" >&5 $as_echo_n "checking kernel for thread.userrsp... " >&6; } if test "${cr_cv_kconfig_HAVE_THREAD_USERRSP+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { struct thread_struct x; unsigned long tc_1 = x.userrsp; ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_THREAD_USERRSP=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_THREAD_USERRSP=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_THREAD_USERRSP if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_THREAD_USERRSP 1 _ACEOF HAVE_THREAD_USERRSP=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_THREAD_USERRSP 0 _ACEOF HAVE_THREAD_USERRSP='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel for thread.debugreg0" >&5 $as_echo_n "checking kernel for thread.debugreg0... " >&6; } if test "${cr_cv_kconfig_HAVE_THREAD_DEBUGREG0+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { struct thread_struct x; unsigned long tc_1 = x.debugreg0; ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_THREAD_DEBUGREG0=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_THREAD_DEBUGREG0=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_THREAD_DEBUGREG0 if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_THREAD_DEBUGREG0 1 _ACEOF HAVE_THREAD_DEBUGREG0=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_THREAD_DEBUGREG0 0 _ACEOF HAVE_THREAD_DEBUGREG0='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel for thread.debugregs" >&5 $as_echo_n "checking kernel for thread.debugregs... " >&6; } if test "${cr_cv_kconfig_HAVE_THREAD_DEBUGREGS+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { struct thread_struct x; unsigned long tc_1 = x.debugreg[1]; ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_THREAD_DEBUGREGS=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_THREAD_DEBUGREGS=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_THREAD_DEBUGREGS if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_THREAD_DEBUGREGS 1 _ACEOF HAVE_THREAD_DEBUGREGS=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_THREAD_DEBUGREGS 0 _ACEOF HAVE_THREAD_DEBUGREGS='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel for thread.ptrace_bps" >&5 $as_echo_n "checking kernel for thread.ptrace_bps... " >&6; } if test "${cr_cv_kconfig_HAVE_THREAD_PTRACE_BPS+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include #include int main () { struct thread_struct x; struct perf_event tc_1 = *(x.ptrace_bps[1]); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_THREAD_PTRACE_BPS=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_THREAD_PTRACE_BPS=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_THREAD_PTRACE_BPS if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_THREAD_PTRACE_BPS 1 _ACEOF HAVE_THREAD_PTRACE_BPS=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_THREAD_PTRACE_BPS 0 _ACEOF HAVE_THREAD_PTRACE_BPS='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel for thread.i387" >&5 $as_echo_n "checking kernel for thread.i387... " >&6; } if test "${cr_cv_kconfig_HAVE_THREAD_I387+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { struct thread_struct x; union i387_union tc_1 = x.i387; ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_THREAD_I387=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_THREAD_I387=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_THREAD_I387 if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_THREAD_I387 1 _ACEOF HAVE_THREAD_I387=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_THREAD_I387 0 _ACEOF HAVE_THREAD_I387='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel for thread.xstate" >&5 $as_echo_n "checking kernel for thread.xstate... " >&6; } if test "${cr_cv_kconfig_HAVE_THREAD_XSTATE+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { struct thread_struct x; union thread_xstate tc_1 = *(x.xstate); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_THREAD_XSTATE=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_THREAD_XSTATE=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_THREAD_XSTATE if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_THREAD_XSTATE 1 _ACEOF HAVE_THREAD_XSTATE=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_THREAD_XSTATE 0 _ACEOF HAVE_THREAD_XSTATE='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel for thread.fpu" >&5 $as_echo_n "checking kernel for thread.fpu... " >&6; } if test "${cr_cv_kconfig_HAVE_THREAD_FPU+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { struct thread_struct x; struct fpu tc_1 = x.fpu; ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_THREAD_FPU=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_THREAD_FPU=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_THREAD_FPU if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_THREAD_FPU 1 _ACEOF HAVE_THREAD_FPU=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_THREAD_FPU 0 _ACEOF HAVE_THREAD_FPU='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel for pt_regs.eflags" >&5 $as_echo_n "checking kernel for pt_regs.eflags... " >&6; } if test "${cr_cv_kconfig_HAVE_PT_REGS_EFLAGS+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { struct pt_regs x; unsigned long tc_1 = x.eflags; ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_PT_REGS_EFLAGS=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_PT_REGS_EFLAGS=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_PT_REGS_EFLAGS if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_PT_REGS_EFLAGS 1 _ACEOF HAVE_PT_REGS_EFLAGS=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_PT_REGS_EFLAGS 0 _ACEOF HAVE_PT_REGS_EFLAGS='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel for pt_regs.flags" >&5 $as_echo_n "checking kernel for pt_regs.flags... " >&6; } if test "${cr_cv_kconfig_HAVE_PT_REGS_FLAGS+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { struct pt_regs x; unsigned long tc_1 = x.flags; ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_PT_REGS_FLAGS=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_PT_REGS_FLAGS=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_PT_REGS_FLAGS if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_PT_REGS_FLAGS 1 _ACEOF HAVE_PT_REGS_FLAGS=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_PT_REGS_FLAGS 0 _ACEOF HAVE_PT_REGS_FLAGS='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel symbol table for init_fpu" >&5 $as_echo_n "checking kernel symbol table for init_fpu... " >&6; } # Our cacheval is encoded with 'Y' or 'N' as the first char to indicate # if a declaration was found or not, and the address or 0 as the rest. if test "${cr_cv_ksymtab_init_fpu+set}" = set; then $as_echo_n "(cached) " >&6 else cr_cv_ksymtab_init_fpu=`eval $LINUX_SYMTAB_CMD | sed -n -e "/${CR_KSYM_PATTERN_CODE}init_fpu$/ {s/ .*//p;q;}"` if test -n "$cr_cv_ksymtab_init_fpu"; then if eval $LINUX_SYMTAB_CMD | grep " __ksymtab_init_fpu\$" >/dev/null ; then cr_cv_ksymtab_init_fpu=0 else if test "CODE${HAVE_CONFIG_THUMB2_KERNEL}" = 'CODE1'; then cr_cv_ksymtab_init_fpu=`$PERL -e "printf '%x', 1 | hex '$cr_cv_ksymtab_init_fpu';"` fi fi SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #define IN_CONFIGURE 1 #include "${TOP_SRCDIR}/include/blcr_imports.h.in" int main () { int x = sizeof(&init_fpu); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_init_fpu="Y$cr_cv_ksymtab_init_fpu" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_init_fpu="N$cr_cv_ksymtab_init_fpu" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi fi cr_addr='' if test -z "$cr_cv_ksymtab_init_fpu"; then cr_result='not found' else if expr "$cr_cv_ksymtab_init_fpu" : N >/dev/null; then cat >>$CR_KSYM_IMPORT_DECLS <<_EOF extern void init_fpu(struct task_struct *); _EOF fi cr_result=`echo $cr_cv_ksymtab_init_fpu | tr -d 'YN'` if test $cr_result = 0; then cr_result=exported cr_addr=0 else cr_addr="0x$cr_result" echo "_CR_IMPORT_KCODE(init_fpu, $cr_addr)" >>$CR_KSYM_IMPORT_CALLS fi cat >>confdefs.h <<_ACEOF #define CR_KCODE_init_fpu $cr_addr _ACEOF fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel symbol table for xstate_size" >&5 $as_echo_n "checking kernel symbol table for xstate_size... " >&6; } # Our cacheval is encoded with 'Y' or 'N' as the first char to indicate # if a declaration was found or not, and the address or 0 as the rest. if test "${cr_cv_ksymtab_xstate_size+set}" = set; then $as_echo_n "(cached) " >&6 else cr_cv_ksymtab_xstate_size=`eval $LINUX_SYMTAB_CMD | sed -n -e "/${CR_KSYM_PATTERN_DATA}xstate_size$/ {s/ .*//p;q;}"` if test -n "$cr_cv_ksymtab_xstate_size"; then if eval $LINUX_SYMTAB_CMD | grep " __ksymtab_xstate_size\$" >/dev/null ; then cr_cv_ksymtab_xstate_size=0 else if test "DATA${HAVE_CONFIG_THUMB2_KERNEL}" = 'CODE1'; then cr_cv_ksymtab_xstate_size=`$PERL -e "printf '%x', 1 | hex '$cr_cv_ksymtab_xstate_size';"` fi fi SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #define IN_CONFIGURE 1 #include "${TOP_SRCDIR}/include/blcr_imports.h.in" int main () { int x = sizeof(&xstate_size); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_xstate_size="Y$cr_cv_ksymtab_xstate_size" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_xstate_size="N$cr_cv_ksymtab_xstate_size" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi fi cr_addr='' if test -z "$cr_cv_ksymtab_xstate_size"; then cr_result='not found' else if expr "$cr_cv_ksymtab_xstate_size" : N >/dev/null; then cat >>$CR_KSYM_IMPORT_DECLS <<_EOF extern unsigned int xstate_size; _EOF fi cr_result=`echo $cr_cv_ksymtab_xstate_size | tr -d 'YN'` if test $cr_result = 0; then cr_result=exported cr_addr=0 else cr_addr="0x$cr_result" echo "_CR_IMPORT_KDATA(xstate_size, $cr_addr)" >>$CR_KSYM_IMPORT_CALLS fi cat >>confdefs.h <<_ACEOF #define CR_KDATA_xstate_size $cr_addr _ACEOF fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel for restore_fpu_checking" >&5 $as_echo_n "checking kernel for restore_fpu_checking... " >&6; } if test "${cr_cv_kconfig_HAVE_RESTORE_FPU_CHECKING+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { #ifdef restore_fpu_checking /* OK, it exists and is a macro */ #else /* Check for function case */ int x = sizeof(&restore_fpu_checking); #endif ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_RESTORE_FPU_CHECKING=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_RESTORE_FPU_CHECKING=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_RESTORE_FPU_CHECKING if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_RESTORE_FPU_CHECKING 1 _ACEOF HAVE_RESTORE_FPU_CHECKING=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_RESTORE_FPU_CHECKING 0 _ACEOF HAVE_RESTORE_FPU_CHECKING='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } if test -n "${HAVE_RESTORE_FPU_CHECKING}"; then { $as_echo "$as_me:$LINENO: checking kernel for 2.6.0 restore_fpu_checking" >&5 $as_echo_n "checking kernel for 2.6.0 restore_fpu_checking... " >&6; } if test "${cr_cv_kconfig_HAVE_2_6_0_RESTORE_FPU_CHECKING+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int restore_fpu_checking(struct i387_fxsave_struct *); int main () { int x = sizeof(&restore_fpu_checking) ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_2_6_0_RESTORE_FPU_CHECKING=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_2_6_0_RESTORE_FPU_CHECKING=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_2_6_0_RESTORE_FPU_CHECKING if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_2_6_0_RESTORE_FPU_CHECKING 1 _ACEOF HAVE_2_6_0_RESTORE_FPU_CHECKING=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_2_6_0_RESTORE_FPU_CHECKING 0 _ACEOF HAVE_2_6_0_RESTORE_FPU_CHECKING='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel for 2.6.28 restore_fpu_checking" >&5 $as_echo_n "checking kernel for 2.6.28 restore_fpu_checking... " >&6; } if test "${cr_cv_kconfig_HAVE_2_6_28_RESTORE_FPU_CHECKING+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int restore_fpu_checking(struct task_struct *); int main () { int x = sizeof(&restore_fpu_checking) ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_2_6_28_RESTORE_FPU_CHECKING=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_2_6_28_RESTORE_FPU_CHECKING=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_2_6_28_RESTORE_FPU_CHECKING if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_2_6_28_RESTORE_FPU_CHECKING 1 _ACEOF HAVE_2_6_28_RESTORE_FPU_CHECKING=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_2_6_28_RESTORE_FPU_CHECKING 0 _ACEOF HAVE_2_6_28_RESTORE_FPU_CHECKING='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } if test "${HAVE_2_6_0_RESTORE_FPU_CHECKING}${HAVE_2_6_28_RESTORE_FPU_CHECKING}" != "1"; then 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:$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= ;; #( *) $as_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 test "x$cache_file" != "x/dev/null" && { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache echo "======================================================================" echo "Please review the following configuration information:" echo " Kernel source directory = $LINUX_SRC" echo " Kernel build directory = $LINUX_OBJ" echo " Kernel symbol table = ${LINUX_SYSTEM_MAP}${LINUX_VMLINUX}" echo " Kernel version probed from kernel build = $LINUX_VER" echo " Kernel running currently = `uname -r`" echo "======================================================================" { { $as_echo "$as_me:$LINENO: error: Unable to use kernel $LINUX_VER - unable to determine how to call restore_fpu_checking()" >&5 $as_echo "$as_me: error: Unable to use kernel $LINUX_VER - unable to determine how to call restore_fpu_checking()" >&2;} { (exit 1); exit 1; }; } fi fi fi if test $CR_KARCH = i386; then { $as_echo "$as_me:$LINENO: checking kernel for pt_regs.xcs" >&5 $as_echo_n "checking kernel for pt_regs.xcs... " >&6; } if test "${cr_cv_kconfig_HAVE_PT_REGS_XCS+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { struct pt_regs x; int tc_1 = x.xcs; ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_PT_REGS_XCS=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_PT_REGS_XCS=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_PT_REGS_XCS if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_PT_REGS_XCS 1 _ACEOF HAVE_PT_REGS_XCS=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_PT_REGS_XCS 0 _ACEOF HAVE_PT_REGS_XCS='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel for pt_regs.xfs" >&5 $as_echo_n "checking kernel for pt_regs.xfs... " >&6; } if test "${cr_cv_kconfig_HAVE_PT_REGS_XFS+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { struct pt_regs x; int tc_1 = x.xfs; ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_PT_REGS_XFS=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_PT_REGS_XFS=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_PT_REGS_XFS if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_PT_REGS_XFS 1 _ACEOF HAVE_PT_REGS_XFS=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_PT_REGS_XFS 0 _ACEOF HAVE_PT_REGS_XFS='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel for pt_regs.xgs" >&5 $as_echo_n "checking kernel for pt_regs.xgs... " >&6; } if test "${cr_cv_kconfig_HAVE_PT_REGS_XGS+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { struct pt_regs x; int tc_1 = x.xgs; ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_PT_REGS_XGS=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_PT_REGS_XGS=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_PT_REGS_XGS if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_PT_REGS_XGS 1 _ACEOF HAVE_PT_REGS_XGS=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_PT_REGS_XGS 0 _ACEOF HAVE_PT_REGS_XGS='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel for pt_regs.cs" >&5 $as_echo_n "checking kernel for pt_regs.cs... " >&6; } if test "${cr_cv_kconfig_HAVE_PT_REGS_CS+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { struct pt_regs x; int tc_1 = x.cs; ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_PT_REGS_CS=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_PT_REGS_CS=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_PT_REGS_CS if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_PT_REGS_CS 1 _ACEOF HAVE_PT_REGS_CS=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_PT_REGS_CS 0 _ACEOF HAVE_PT_REGS_CS='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel for pt_regs.fs" >&5 $as_echo_n "checking kernel for pt_regs.fs... " >&6; } if test "${cr_cv_kconfig_HAVE_PT_REGS_FS+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { struct pt_regs x; int tc_1 = x.fs; ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_PT_REGS_FS=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_PT_REGS_FS=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_PT_REGS_FS if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_PT_REGS_FS 1 _ACEOF HAVE_PT_REGS_FS=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_PT_REGS_FS 0 _ACEOF HAVE_PT_REGS_FS='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel for pt_regs.gs" >&5 $as_echo_n "checking kernel for pt_regs.gs... " >&6; } if test "${cr_cv_kconfig_HAVE_PT_REGS_GS+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { struct pt_regs x; int tc_1 = x.gs; ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_PT_REGS_GS=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_PT_REGS_GS=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_PT_REGS_GS if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_PT_REGS_GS 1 _ACEOF HAVE_PT_REGS_GS=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_PT_REGS_GS 0 _ACEOF HAVE_PT_REGS_GS='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } fi { $as_echo "$as_me:$LINENO: checking kernel for inode sem" >&5 $as_echo_n "checking kernel for inode sem... " >&6; } if test "${cr_cv_kconfig_HAVE_INODE_SEM+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include #include int main () { struct inode x; struct semaphore tc_1 = x.i_sem; ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_INODE_SEM=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_INODE_SEM=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_INODE_SEM if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_INODE_SEM 1 _ACEOF HAVE_INODE_SEM=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_INODE_SEM 0 _ACEOF HAVE_INODE_SEM='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel for inode mutex" >&5 $as_echo_n "checking kernel for inode mutex... " >&6; } if test "${cr_cv_kconfig_HAVE_INODE_MUTEX+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include #include #include int main () { struct inode x; struct mutex tc_1 = x.i_mutex; ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_INODE_MUTEX=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_INODE_MUTEX=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_INODE_MUTEX if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_INODE_MUTEX 1 _ACEOF HAVE_INODE_MUTEX=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_INODE_MUTEX 0 _ACEOF HAVE_INODE_MUTEX='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } # Allow exactly one match if test "${HAVE_INODE_SEM}${HAVE_INODE_MUTEX}" != "1"; then 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:$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= ;; #( *) $as_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 test "x$cache_file" != "x/dev/null" && { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache echo "======================================================================" echo "Please review the following configuration information:" echo " Kernel source directory = $LINUX_SRC" echo " Kernel build directory = $LINUX_OBJ" echo " Kernel symbol table = ${LINUX_SYSTEM_MAP}${LINUX_VMLINUX}" echo " Kernel version probed from kernel build = $LINUX_VER" echo " Kernel running currently = `uname -r`" echo "======================================================================" { { $as_echo "$as_me:$LINENO: error: Unable to use kernel $LINUX_VER - unrecognized lock type for struct inode" >&5 $as_echo "$as_me: error: Unable to use kernel $LINUX_VER - unrecognized lock type for struct inode" >&2;} { (exit 1); exit 1; }; } fi { $as_echo "$as_me:$LINENO: checking kernel for mm.dumpable" >&5 $as_echo_n "checking kernel for mm.dumpable... " >&6; } if test "${cr_cv_kconfig_HAVE_MM_DUMPABLE+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { struct mm_struct x; int tc_1 = x.dumpable; ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_MM_DUMPABLE=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_MM_DUMPABLE=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_MM_DUMPABLE if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_MM_DUMPABLE 1 _ACEOF HAVE_MM_DUMPABLE=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_MM_DUMPABLE 0 _ACEOF HAVE_MM_DUMPABLE='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel symbol table for get_dumpable" >&5 $as_echo_n "checking kernel symbol table for get_dumpable... " >&6; } # Our cacheval is encoded with 'Y' or 'N' as the first char to indicate # if a declaration was found or not, and the address or 0 as the rest. if test "${cr_cv_ksymtab_get_dumpable+set}" = set; then $as_echo_n "(cached) " >&6 else cr_cv_ksymtab_get_dumpable=`eval $LINUX_SYMTAB_CMD | sed -n -e "/${CR_KSYM_PATTERN_CODE}get_dumpable$/ {s/ .*//p;q;}"` if test -n "$cr_cv_ksymtab_get_dumpable"; then if eval $LINUX_SYMTAB_CMD | grep " __ksymtab_get_dumpable\$" >/dev/null ; then cr_cv_ksymtab_get_dumpable=0 else if test "CODE${HAVE_CONFIG_THUMB2_KERNEL}" = 'CODE1'; then cr_cv_ksymtab_get_dumpable=`$PERL -e "printf '%x', 1 | hex '$cr_cv_ksymtab_get_dumpable';"` fi fi SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #define IN_CONFIGURE 1 #include "${TOP_SRCDIR}/include/blcr_imports.h.in" int main () { int x = sizeof(&get_dumpable); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_get_dumpable="Y$cr_cv_ksymtab_get_dumpable" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_get_dumpable="N$cr_cv_ksymtab_get_dumpable" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi fi cr_addr='' if test -z "$cr_cv_ksymtab_get_dumpable"; then cr_result='not found' else if expr "$cr_cv_ksymtab_get_dumpable" : N >/dev/null; then cat >>$CR_KSYM_IMPORT_DECLS <<_EOF extern int get_dumpable(struct mm_struct *mm); _EOF fi cr_result=`echo $cr_cv_ksymtab_get_dumpable | tr -d 'YN'` if test $cr_result = 0; then cr_result=exported cr_addr=0 else cr_addr="0x$cr_result" echo "_CR_IMPORT_KCODE(get_dumpable, $cr_addr)" >>$CR_KSYM_IMPORT_CALLS fi cat >>confdefs.h <<_ACEOF #define CR_KCODE_get_dumpable $cr_addr _ACEOF fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } # Allow one or more match(es) if test -z "${HAVE_MM_DUMPABLE}${cr_addr}"; then 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:$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= ;; #( *) $as_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 test "x$cache_file" != "x/dev/null" && { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache echo "======================================================================" echo "Please review the following configuration information:" echo " Kernel source directory = $LINUX_SRC" echo " Kernel build directory = $LINUX_OBJ" echo " Kernel symbol table = ${LINUX_SYSTEM_MAP}${LINUX_VMLINUX}" echo " Kernel version probed from kernel build = $LINUX_VER" echo " Kernel running currently = `uname -r`" echo "======================================================================" { { $as_echo "$as_me:$LINENO: error: Unable to use kernel $LINUX_VER - unable to determine how to identify non-dumpable tasks" >&5 $as_echo "$as_me: error: Unable to use kernel $LINUX_VER - unable to determine how to identify non-dumpable tasks" >&2;} { (exit 1); exit 1; }; } fi { $as_echo "$as_me:$LINENO: checking kernel for task.rlim" >&5 $as_echo_n "checking kernel for task.rlim... " >&6; } if test "${cr_cv_kconfig_HAVE_TASK_RLIM+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { struct task_struct x; struct rlimit tc_1 = x.rlim[0]; ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_TASK_RLIM=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_TASK_RLIM=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_TASK_RLIM if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_TASK_RLIM 1 _ACEOF HAVE_TASK_RLIM=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_TASK_RLIM 0 _ACEOF HAVE_TASK_RLIM='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel for signal.rlim" >&5 $as_echo_n "checking kernel for signal.rlim... " >&6; } if test "${cr_cv_kconfig_HAVE_SIGNAL_RLIM+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { struct task_struct x; struct rlimit tc_1 = x.signal->rlim[0]; ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_SIGNAL_RLIM=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_SIGNAL_RLIM=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_SIGNAL_RLIM if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_SIGNAL_RLIM 1 _ACEOF HAVE_SIGNAL_RLIM=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_SIGNAL_RLIM 0 _ACEOF HAVE_SIGNAL_RLIM='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } # Allow exactly one match if test "${HAVE_TASK_RLIM}${HAVE_SIGNAL_RLIM}" != "1"; then 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:$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= ;; #( *) $as_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 test "x$cache_file" != "x/dev/null" && { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache echo "======================================================================" echo "Please review the following configuration information:" echo " Kernel source directory = $LINUX_SRC" echo " Kernel build directory = $LINUX_OBJ" echo " Kernel symbol table = ${LINUX_SYSTEM_MAP}${LINUX_VMLINUX}" echo " Kernel version probed from kernel build = $LINUX_VER" echo " Kernel running currently = `uname -r`" echo "======================================================================" { { $as_echo "$as_me:$LINENO: error: Unable to use kernel $LINUX_VER - unable to determine location of rlim structure" >&5 $as_echo "$as_me: error: Unable to use kernel $LINUX_VER - unable to determine location of rlim structure" >&2;} { (exit 1); exit 1; }; } fi { $as_echo "$as_me:$LINENO: checking kernel for task.cred" >&5 $as_echo_n "checking kernel for task.cred... " >&6; } if test "${cr_cv_kconfig_HAVE_TASK_CRED+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { struct task_struct x; const struct cred tc_1 = *(x.cred); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_TASK_CRED=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_TASK_CRED=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_TASK_CRED if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_TASK_CRED 1 _ACEOF HAVE_TASK_CRED=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_TASK_CRED 0 _ACEOF HAVE_TASK_CRED='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } if test -n "${HAVE_TASK_CRED}"; then { $as_echo "$as_me:$LINENO: checking kernel for 3-arg dentry_open" >&5 $as_echo_n "checking kernel for 3-arg dentry_open... " >&6; } if test "${cr_cv_kconfig_HAVE_3_ARG_DENTRY_OPEN+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { #ifndef dentry_open /* Must be macro or have a decl */ int x = sizeof(&dentry_open); #endif dentry_open(NULL,0,NULL); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_3_ARG_DENTRY_OPEN=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_3_ARG_DENTRY_OPEN=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_3_ARG_DENTRY_OPEN if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_3_ARG_DENTRY_OPEN 1 _ACEOF HAVE_3_ARG_DENTRY_OPEN=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_3_ARG_DENTRY_OPEN 0 _ACEOF HAVE_3_ARG_DENTRY_OPEN='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel for 4-arg dentry_open" >&5 $as_echo_n "checking kernel for 4-arg dentry_open... " >&6; } if test "${cr_cv_kconfig_HAVE_4_ARG_DENTRY_OPEN+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { #ifndef dentry_open /* Must be macro or have a decl */ int x = sizeof(&dentry_open); #endif dentry_open(NULL,NULL,0,NULL); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_4_ARG_DENTRY_OPEN=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_4_ARG_DENTRY_OPEN=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_4_ARG_DENTRY_OPEN if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_4_ARG_DENTRY_OPEN 1 _ACEOF HAVE_4_ARG_DENTRY_OPEN=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_4_ARG_DENTRY_OPEN 0 _ACEOF HAVE_4_ARG_DENTRY_OPEN='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } fi { $as_echo "$as_me:$LINENO: checking kernel for task.group_info" >&5 $as_echo_n "checking kernel for task.group_info... " >&6; } if test "${cr_cv_kconfig_HAVE_TASK_GROUP_INFO+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { struct task_struct x; struct group_info tc_1 = *(x.group_info); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_TASK_GROUP_INFO=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_TASK_GROUP_INFO=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_TASK_GROUP_INFO if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_TASK_GROUP_INFO 1 _ACEOF HAVE_TASK_GROUP_INFO=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_TASK_GROUP_INFO 0 _ACEOF HAVE_TASK_GROUP_INFO='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel for suid_dumpable" >&5 $as_echo_n "checking kernel for suid_dumpable... " >&6; } if test "${cr_cv_kconfig_HAVE_SUID_DUMPABLE+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { int x = sizeof(&suid_dumpable); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_SUID_DUMPABLE=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_SUID_DUMPABLE=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_SUID_DUMPABLE if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_SUID_DUMPABLE 1 _ACEOF HAVE_SUID_DUMPABLE=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_SUID_DUMPABLE 0 _ACEOF HAVE_SUID_DUMPABLE='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } if test -n "${HAVE_SUID_DUMPABLE}"; then { $as_echo "$as_me:$LINENO: checking kernel symbol table for suid_dumpable" >&5 $as_echo_n "checking kernel symbol table for suid_dumpable... " >&6; } # Our cacheval is encoded with 'Y' or 'N' as the first char to indicate # if a declaration was found or not, and the address or 0 as the rest. if test "${cr_cv_ksymtab_suid_dumpable+set}" = set; then $as_echo_n "(cached) " >&6 else cr_cv_ksymtab_suid_dumpable=`eval $LINUX_SYMTAB_CMD | sed -n -e "/${CR_KSYM_PATTERN_DATA}suid_dumpable$/ {s/ .*//p;q;}"` if test -n "$cr_cv_ksymtab_suid_dumpable"; then if eval $LINUX_SYMTAB_CMD | grep " __ksymtab_suid_dumpable\$" >/dev/null ; then cr_cv_ksymtab_suid_dumpable=0 else if test "DATA${HAVE_CONFIG_THUMB2_KERNEL}" = 'CODE1'; then cr_cv_ksymtab_suid_dumpable=`$PERL -e "printf '%x', 1 | hex '$cr_cv_ksymtab_suid_dumpable';"` fi fi SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #define IN_CONFIGURE 1 #include "${TOP_SRCDIR}/include/blcr_imports.h.in" int main () { int x = sizeof(&suid_dumpable); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_suid_dumpable="Y$cr_cv_ksymtab_suid_dumpable" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_suid_dumpable="N$cr_cv_ksymtab_suid_dumpable" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi fi cr_addr='' if test -z "$cr_cv_ksymtab_suid_dumpable"; then cr_result='not found' else if expr "$cr_cv_ksymtab_suid_dumpable" : N >/dev/null; then { { $as_echo "$as_me:$LINENO: error: Found symbol suid_dumpable but no declaration -- please file a bug report." >&5 $as_echo "$as_me: error: Found symbol suid_dumpable but no declaration -- please file a bug report." >&2;} { (exit 1); exit 1; }; } fi cr_result=`echo $cr_cv_ksymtab_suid_dumpable | tr -d 'YN'` if test $cr_result = 0; then cr_result=exported cr_addr=0 else cr_addr="0x$cr_result" echo "_CR_IMPORT_KDATA(suid_dumpable, $cr_addr)" >>$CR_KSYM_IMPORT_CALLS fi cat >>confdefs.h <<_ACEOF #define CR_KDATA_suid_dumpable $cr_addr _ACEOF fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } fi { $as_echo "$as_me:$LINENO: checking kernel for set_dumpable" >&5 $as_echo_n "checking kernel for set_dumpable... " >&6; } if test "${cr_cv_kconfig_HAVE_SET_DUMPABLE+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { #ifdef set_dumpable /* OK, it exists and is a macro */ #else /* Check for function case */ int x = sizeof(&set_dumpable); #endif ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_SET_DUMPABLE=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_SET_DUMPABLE=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_SET_DUMPABLE if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_SET_DUMPABLE 1 _ACEOF HAVE_SET_DUMPABLE=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_SET_DUMPABLE 0 _ACEOF HAVE_SET_DUMPABLE='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } if test -n "${HAVE_SET_DUMPABLE}"; then { $as_echo "$as_me:$LINENO: checking kernel symbol table for set_dumpable" >&5 $as_echo_n "checking kernel symbol table for set_dumpable... " >&6; } # Our cacheval is encoded with 'Y' or 'N' as the first char to indicate # if a declaration was found or not, and the address or 0 as the rest. if test "${cr_cv_ksymtab_set_dumpable+set}" = set; then $as_echo_n "(cached) " >&6 else cr_cv_ksymtab_set_dumpable=`eval $LINUX_SYMTAB_CMD | sed -n -e "/${CR_KSYM_PATTERN_CODE}set_dumpable$/ {s/ .*//p;q;}"` if test -n "$cr_cv_ksymtab_set_dumpable"; then if eval $LINUX_SYMTAB_CMD | grep " __ksymtab_set_dumpable\$" >/dev/null ; then cr_cv_ksymtab_set_dumpable=0 else if test "CODE${HAVE_CONFIG_THUMB2_KERNEL}" = 'CODE1'; then cr_cv_ksymtab_set_dumpable=`$PERL -e "printf '%x', 1 | hex '$cr_cv_ksymtab_set_dumpable';"` fi fi SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #define IN_CONFIGURE 1 #include "${TOP_SRCDIR}/include/blcr_imports.h.in" int main () { int x = sizeof(&set_dumpable); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_set_dumpable="Y$cr_cv_ksymtab_set_dumpable" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_set_dumpable="N$cr_cv_ksymtab_set_dumpable" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi fi cr_addr='' if test -z "$cr_cv_ksymtab_set_dumpable"; then cr_result='not found' else if expr "$cr_cv_ksymtab_set_dumpable" : N >/dev/null; then { { $as_echo "$as_me:$LINENO: error: Found symbol set_dumpable but no declaration -- please file a bug report." >&5 $as_echo "$as_me: error: Found symbol set_dumpable but no declaration -- please file a bug report." >&2;} { (exit 1); exit 1; }; } fi cr_result=`echo $cr_cv_ksymtab_set_dumpable | tr -d 'YN'` if test $cr_result = 0; then cr_result=exported cr_addr=0 else cr_addr="0x$cr_result" echo "_CR_IMPORT_KCODE(set_dumpable, $cr_addr)" >>$CR_KSYM_IMPORT_CALLS fi cat >>confdefs.h <<_ACEOF #define CR_KCODE_set_dumpable $cr_addr _ACEOF fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } fi { $as_echo "$as_me:$LINENO: checking kernel symbol table for groups_search" >&5 $as_echo_n "checking kernel symbol table for groups_search... " >&6; } # Our cacheval is encoded with 'Y' or 'N' as the first char to indicate # if a declaration was found or not, and the address or 0 as the rest. if test "${cr_cv_ksymtab_groups_search+set}" = set; then $as_echo_n "(cached) " >&6 else cr_cv_ksymtab_groups_search=`eval $LINUX_SYMTAB_CMD | sed -n -e "/${CR_KSYM_PATTERN_CODE}groups_search$/ {s/ .*//p;q;}"` if test -n "$cr_cv_ksymtab_groups_search"; then if eval $LINUX_SYMTAB_CMD | grep " __ksymtab_groups_search\$" >/dev/null ; then cr_cv_ksymtab_groups_search=0 else if test "CODE${HAVE_CONFIG_THUMB2_KERNEL}" = 'CODE1'; then cr_cv_ksymtab_groups_search=`$PERL -e "printf '%x', 1 | hex '$cr_cv_ksymtab_groups_search';"` fi fi SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #define IN_CONFIGURE 1 #include "${TOP_SRCDIR}/include/blcr_imports.h.in" int main () { int x = sizeof(&groups_search); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_groups_search="Y$cr_cv_ksymtab_groups_search" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_groups_search="N$cr_cv_ksymtab_groups_search" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi fi cr_addr='' if test -z "$cr_cv_ksymtab_groups_search"; then cr_result='not found' else if expr "$cr_cv_ksymtab_groups_search" : N >/dev/null; then cat >>$CR_KSYM_IMPORT_DECLS <<_EOF extern int groups_search(struct group_info *, gid_t); _EOF fi cr_result=`echo $cr_cv_ksymtab_groups_search | tr -d 'YN'` if test $cr_result = 0; then cr_result=exported cr_addr=0 else cr_addr="0x$cr_result" echo "_CR_IMPORT_KCODE(groups_search, $cr_addr)" >>$CR_KSYM_IMPORT_CALLS fi cat >>confdefs.h <<_ACEOF #define CR_KCODE_groups_search $cr_addr _ACEOF fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel symbol table for supplemental_group_member" >&5 $as_echo_n "checking kernel symbol table for supplemental_group_member... " >&6; } # Our cacheval is encoded with 'Y' or 'N' as the first char to indicate # if a declaration was found or not, and the address or 0 as the rest. if test "${cr_cv_ksymtab_supplemental_group_member+set}" = set; then $as_echo_n "(cached) " >&6 else cr_cv_ksymtab_supplemental_group_member=`eval $LINUX_SYMTAB_CMD | sed -n -e "/${CR_KSYM_PATTERN_CODE}supplemental_group_member$/ {s/ .*//p;q;}"` if test -n "$cr_cv_ksymtab_supplemental_group_member"; then if eval $LINUX_SYMTAB_CMD | grep " __ksymtab_supplemental_group_member\$" >/dev/null ; then cr_cv_ksymtab_supplemental_group_member=0 else if test "CODE${HAVE_CONFIG_THUMB2_KERNEL}" = 'CODE1'; then cr_cv_ksymtab_supplemental_group_member=`$PERL -e "printf '%x', 1 | hex '$cr_cv_ksymtab_supplemental_group_member';"` fi fi SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #define IN_CONFIGURE 1 #include "${TOP_SRCDIR}/include/blcr_imports.h.in" int main () { int x = sizeof(&supplemental_group_member); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_supplemental_group_member="Y$cr_cv_ksymtab_supplemental_group_member" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_supplemental_group_member="N$cr_cv_ksymtab_supplemental_group_member" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi fi cr_addr='' if test -z "$cr_cv_ksymtab_supplemental_group_member"; then cr_result='not found' else if expr "$cr_cv_ksymtab_supplemental_group_member" : N >/dev/null; then cat >>$CR_KSYM_IMPORT_DECLS <<_EOF extern int supplemental_group_member(gid_t); _EOF fi cr_result=`echo $cr_cv_ksymtab_supplemental_group_member | tr -d 'YN'` if test $cr_result = 0; then cr_result=exported cr_addr=0 else cr_addr="0x$cr_result" echo "_CR_IMPORT_KCODE(supplemental_group_member, $cr_addr)" >>$CR_KSYM_IMPORT_CALLS fi cat >>confdefs.h <<_ACEOF #define CR_KCODE_supplemental_group_member $cr_addr _ACEOF fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel for PIDTYPE_TGID" >&5 $as_echo_n "checking kernel for PIDTYPE_TGID... " >&6; } if test "${cr_cv_kconfig_HAVE_PIDTYPE_TGID+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { typeof(PIDTYPE_TGID) y; int x = sizeof(y); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_PIDTYPE_TGID=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_PIDTYPE_TGID=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_PIDTYPE_TGID if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_PIDTYPE_TGID 1 _ACEOF HAVE_PIDTYPE_TGID=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_PIDTYPE_TGID 0 _ACEOF HAVE_PIDTYPE_TGID='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel for task.thread_group" >&5 $as_echo_n "checking kernel for task.thread_group... " >&6; } if test "${cr_cv_kconfig_HAVE_TASK_THREAD_GROUP+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { struct task_struct x; struct list_head tc_1 = x.thread_group; ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_TASK_THREAD_GROUP=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_TASK_THREAD_GROUP=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_TASK_THREAD_GROUP if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_TASK_THREAD_GROUP 1 _ACEOF HAVE_TASK_THREAD_GROUP=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_TASK_THREAD_GROUP 0 _ACEOF HAVE_TASK_THREAD_GROUP='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } if test "${HAVE_PIDTYPE_TGID}${HAVE_TASK_THREAD_GROUP}" != "1"; then 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:$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= ;; #( *) $as_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 test "x$cache_file" != "x/dev/null" && { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache echo "======================================================================" echo "Please review the following configuration information:" echo " Kernel source directory = $LINUX_SRC" echo " Kernel build directory = $LINUX_OBJ" echo " Kernel symbol table = ${LINUX_SYSTEM_MAP}${LINUX_VMLINUX}" echo " Kernel version probed from kernel build = $LINUX_VER" echo " Kernel running currently = `uname -r`" echo "======================================================================" { { $as_echo "$as_me:$LINENO: error: Unable to use kernel $LINUX_VER - unable to determine thread group list" >&5 $as_echo "$as_me: error: Unable to use kernel $LINUX_VER - unable to determine thread group list" >&2;} { (exit 1); exit 1; }; } fi { $as_echo "$as_me:$LINENO: checking kernel symbol table for detach_pid" >&5 $as_echo_n "checking kernel symbol table for detach_pid... " >&6; } # Our cacheval is encoded with 'Y' or 'N' as the first char to indicate # if a declaration was found or not, and the address or 0 as the rest. if test "${cr_cv_ksymtab_detach_pid+set}" = set; then $as_echo_n "(cached) " >&6 else cr_cv_ksymtab_detach_pid=`eval $LINUX_SYMTAB_CMD | sed -n -e "/${CR_KSYM_PATTERN_CODE}detach_pid$/ {s/ .*//p;q;}"` if test -n "$cr_cv_ksymtab_detach_pid"; then if eval $LINUX_SYMTAB_CMD | grep " __ksymtab_detach_pid\$" >/dev/null ; then cr_cv_ksymtab_detach_pid=0 else if test "CODE${HAVE_CONFIG_THUMB2_KERNEL}" = 'CODE1'; then cr_cv_ksymtab_detach_pid=`$PERL -e "printf '%x', 1 | hex '$cr_cv_ksymtab_detach_pid';"` fi fi SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #define IN_CONFIGURE 1 #include "${TOP_SRCDIR}/include/blcr_imports.h.in" int main () { int x = sizeof(&detach_pid); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_detach_pid="Y$cr_cv_ksymtab_detach_pid" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_detach_pid="N$cr_cv_ksymtab_detach_pid" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi fi cr_addr='' if test -z "$cr_cv_ksymtab_detach_pid"; then cr_result='not found' else if expr "$cr_cv_ksymtab_detach_pid" : N >/dev/null; then { { $as_echo "$as_me:$LINENO: error: Found symbol detach_pid but no declaration -- please file a bug report." >&5 $as_echo "$as_me: error: Found symbol detach_pid but no declaration -- please file a bug report." >&2;} { (exit 1); exit 1; }; } fi cr_result=`echo $cr_cv_ksymtab_detach_pid | tr -d 'YN'` if test $cr_result = 0; then cr_result=exported cr_addr=0 else cr_addr="0x$cr_result" echo "_CR_IMPORT_KCODE(detach_pid, $cr_addr)" >>$CR_KSYM_IMPORT_CALLS fi cat >>confdefs.h <<_ACEOF #define CR_KCODE_detach_pid $cr_addr _ACEOF fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel symbol table for attach_pid" >&5 $as_echo_n "checking kernel symbol table for attach_pid... " >&6; } # Our cacheval is encoded with 'Y' or 'N' as the first char to indicate # if a declaration was found or not, and the address or 0 as the rest. if test "${cr_cv_ksymtab_attach_pid+set}" = set; then $as_echo_n "(cached) " >&6 else cr_cv_ksymtab_attach_pid=`eval $LINUX_SYMTAB_CMD | sed -n -e "/${CR_KSYM_PATTERN_CODE}attach_pid$/ {s/ .*//p;q;}"` if test -n "$cr_cv_ksymtab_attach_pid"; then if eval $LINUX_SYMTAB_CMD | grep " __ksymtab_attach_pid\$" >/dev/null ; then cr_cv_ksymtab_attach_pid=0 else if test "CODE${HAVE_CONFIG_THUMB2_KERNEL}" = 'CODE1'; then cr_cv_ksymtab_attach_pid=`$PERL -e "printf '%x', 1 | hex '$cr_cv_ksymtab_attach_pid';"` fi fi SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #define IN_CONFIGURE 1 #include "${TOP_SRCDIR}/include/blcr_imports.h.in" int main () { int x = sizeof(&attach_pid); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_attach_pid="Y$cr_cv_ksymtab_attach_pid" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_attach_pid="N$cr_cv_ksymtab_attach_pid" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi fi cr_addr='' if test -z "$cr_cv_ksymtab_attach_pid"; then cr_result='not found' else if expr "$cr_cv_ksymtab_attach_pid" : N >/dev/null; then { { $as_echo "$as_me:$LINENO: error: Found symbol attach_pid but no declaration -- please file a bug report." >&5 $as_echo "$as_me: error: Found symbol attach_pid but no declaration -- please file a bug report." >&2;} { (exit 1); exit 1; }; } fi cr_result=`echo $cr_cv_ksymtab_attach_pid | tr -d 'YN'` if test $cr_result = 0; then cr_result=exported cr_addr=0 else cr_addr="0x$cr_result" echo "_CR_IMPORT_KCODE(attach_pid, $cr_addr)" >>$CR_KSYM_IMPORT_CALLS fi cat >>confdefs.h <<_ACEOF #define CR_KCODE_attach_pid $cr_addr _ACEOF fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel symbol table for change_pid" >&5 $as_echo_n "checking kernel symbol table for change_pid... " >&6; } # Our cacheval is encoded with 'Y' or 'N' as the first char to indicate # if a declaration was found or not, and the address or 0 as the rest. if test "${cr_cv_ksymtab_change_pid+set}" = set; then $as_echo_n "(cached) " >&6 else cr_cv_ksymtab_change_pid=`eval $LINUX_SYMTAB_CMD | sed -n -e "/${CR_KSYM_PATTERN_CODE}change_pid$/ {s/ .*//p;q;}"` if test -n "$cr_cv_ksymtab_change_pid"; then if eval $LINUX_SYMTAB_CMD | grep " __ksymtab_change_pid\$" >/dev/null ; then cr_cv_ksymtab_change_pid=0 else if test "CODE${HAVE_CONFIG_THUMB2_KERNEL}" = 'CODE1'; then cr_cv_ksymtab_change_pid=`$PERL -e "printf '%x', 1 | hex '$cr_cv_ksymtab_change_pid';"` fi fi SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #define IN_CONFIGURE 1 #include "${TOP_SRCDIR}/include/blcr_imports.h.in" int main () { int x = sizeof(&change_pid); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_change_pid="Y$cr_cv_ksymtab_change_pid" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_change_pid="N$cr_cv_ksymtab_change_pid" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi fi cr_addr='' if test -z "$cr_cv_ksymtab_change_pid"; then cr_result='not found' else if expr "$cr_cv_ksymtab_change_pid" : N >/dev/null; then { { $as_echo "$as_me:$LINENO: error: Found symbol change_pid but no declaration -- please file a bug report." >&5 $as_echo "$as_me: error: Found symbol change_pid but no declaration -- please file a bug report." >&2;} { (exit 1); exit 1; }; } fi cr_result=`echo $cr_cv_ksymtab_change_pid | tr -d 'YN'` if test $cr_result = 0; then cr_result=exported cr_addr=0 else cr_addr="0x$cr_result" echo "_CR_IMPORT_KCODE(change_pid, $cr_addr)" >>$CR_KSYM_IMPORT_CALLS fi cat >>confdefs.h <<_ACEOF #define CR_KCODE_change_pid $cr_addr _ACEOF fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel symbol table for find_pid" >&5 $as_echo_n "checking kernel symbol table for find_pid... " >&6; } # Our cacheval is encoded with 'Y' or 'N' as the first char to indicate # if a declaration was found or not, and the address or 0 as the rest. if test "${cr_cv_ksymtab_find_pid+set}" = set; then $as_echo_n "(cached) " >&6 else cr_cv_ksymtab_find_pid=`eval $LINUX_SYMTAB_CMD | sed -n -e "/${CR_KSYM_PATTERN_CODE}find_pid$/ {s/ .*//p;q;}"` if test -n "$cr_cv_ksymtab_find_pid"; then if eval $LINUX_SYMTAB_CMD | grep " __ksymtab_find_pid\$" >/dev/null ; then cr_cv_ksymtab_find_pid=0 else if test "CODE${HAVE_CONFIG_THUMB2_KERNEL}" = 'CODE1'; then cr_cv_ksymtab_find_pid=`$PERL -e "printf '%x', 1 | hex '$cr_cv_ksymtab_find_pid';"` fi fi SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #define IN_CONFIGURE 1 #include "${TOP_SRCDIR}/include/blcr_imports.h.in" int main () { int x = sizeof(&find_pid); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_find_pid="Y$cr_cv_ksymtab_find_pid" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_find_pid="N$cr_cv_ksymtab_find_pid" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi fi cr_addr='' if test -z "$cr_cv_ksymtab_find_pid"; then cr_result='not found' else if expr "$cr_cv_ksymtab_find_pid" : N >/dev/null; then { { $as_echo "$as_me:$LINENO: error: Found symbol find_pid but no declaration -- please file a bug report." >&5 $as_echo "$as_me: error: Found symbol find_pid but no declaration -- please file a bug report." >&2;} { (exit 1); exit 1; }; } fi cr_result=`echo $cr_cv_ksymtab_find_pid | tr -d 'YN'` if test $cr_result = 0; then cr_result=exported cr_addr=0 else cr_addr="0x$cr_result" echo "_CR_IMPORT_KCODE(find_pid, $cr_addr)" >>$CR_KSYM_IMPORT_CALLS fi cat >>confdefs.h <<_ACEOF #define CR_KCODE_find_pid $cr_addr _ACEOF fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel symbol table for link_pid" >&5 $as_echo_n "checking kernel symbol table for link_pid... " >&6; } # Our cacheval is encoded with 'Y' or 'N' as the first char to indicate # if a declaration was found or not, and the address or 0 as the rest. if test "${cr_cv_ksymtab_link_pid+set}" = set; then $as_echo_n "(cached) " >&6 else cr_cv_ksymtab_link_pid=`eval $LINUX_SYMTAB_CMD | sed -n -e "/${CR_KSYM_PATTERN_CODE}link_pid$/ {s/ .*//p;q;}"` if test -n "$cr_cv_ksymtab_link_pid"; then if eval $LINUX_SYMTAB_CMD | grep " __ksymtab_link_pid\$" >/dev/null ; then cr_cv_ksymtab_link_pid=0 else if test "CODE${HAVE_CONFIG_THUMB2_KERNEL}" = 'CODE1'; then cr_cv_ksymtab_link_pid=`$PERL -e "printf '%x', 1 | hex '$cr_cv_ksymtab_link_pid';"` fi fi SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #define IN_CONFIGURE 1 #include "${TOP_SRCDIR}/include/blcr_imports.h.in" int main () { int x = sizeof(&link_pid); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_link_pid="Y$cr_cv_ksymtab_link_pid" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_link_pid="N$cr_cv_ksymtab_link_pid" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi fi cr_addr='' if test -z "$cr_cv_ksymtab_link_pid"; then cr_result='not found' else if expr "$cr_cv_ksymtab_link_pid" : N >/dev/null; then { { $as_echo "$as_me:$LINENO: error: Found symbol link_pid but no declaration -- please file a bug report." >&5 $as_echo "$as_me: error: Found symbol link_pid but no declaration -- please file a bug report." >&2;} { (exit 1); exit 1; }; } fi cr_result=`echo $cr_cv_ksymtab_link_pid | tr -d 'YN'` if test $cr_result = 0; then cr_result=exported cr_addr=0 else cr_addr="0x$cr_result" echo "_CR_IMPORT_KCODE(link_pid, $cr_addr)" >>$CR_KSYM_IMPORT_CALLS fi cat >>confdefs.h <<_ACEOF #define CR_KCODE_link_pid $cr_addr _ACEOF fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel for 1-arg find_pid" >&5 $as_echo_n "checking kernel for 1-arg find_pid... " >&6; } if test "${cr_cv_kconfig_HAVE_1_ARG_FIND_PID+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { #ifndef find_pid /* Must be macro or have a decl */ int x = sizeof(&find_pid); #endif find_pid(0); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_1_ARG_FIND_PID=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_1_ARG_FIND_PID=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_1_ARG_FIND_PID if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_1_ARG_FIND_PID 1 _ACEOF HAVE_1_ARG_FIND_PID=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_1_ARG_FIND_PID 0 _ACEOF HAVE_1_ARG_FIND_PID='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel for 2-arg find_pid" >&5 $as_echo_n "checking kernel for 2-arg find_pid... " >&6; } if test "${cr_cv_kconfig_HAVE_2_ARG_FIND_PID+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { #ifndef find_pid /* Must be macro or have a decl */ int x = sizeof(&find_pid); #endif find_pid(0,0); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_2_ARG_FIND_PID=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_2_ARG_FIND_PID=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_2_ARG_FIND_PID if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_2_ARG_FIND_PID 1 _ACEOF HAVE_2_ARG_FIND_PID=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_2_ARG_FIND_PID 0 _ACEOF HAVE_2_ARG_FIND_PID='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel for find_pid_ns" >&5 $as_echo_n "checking kernel for find_pid_ns... " >&6; } if test "${cr_cv_kconfig_HAVE_FIND_PID_NS+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { #ifdef find_pid_ns /* OK, it exists and is a macro */ #else /* Check for function case */ int x = sizeof(&find_pid_ns); #endif ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_FIND_PID_NS=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_FIND_PID_NS=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_FIND_PID_NS if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_FIND_PID_NS 1 _ACEOF HAVE_FIND_PID_NS=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_FIND_PID_NS 0 _ACEOF HAVE_FIND_PID_NS='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } if test -z "${HAVE_1_ARG_FIND_PID}${HAVE_2_ARG_FIND_PID}${HAVE_FIND_PID_NS}"; then 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:$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= ;; #( *) $as_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 test "x$cache_file" != "x/dev/null" && { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache echo "======================================================================" echo "Please review the following configuration information:" echo " Kernel source directory = $LINUX_SRC" echo " Kernel build directory = $LINUX_OBJ" echo " Kernel symbol table = ${LINUX_SYSTEM_MAP}${LINUX_VMLINUX}" echo " Kernel version probed from kernel build = $LINUX_VER" echo " Kernel running currently = `uname -r`" echo "======================================================================" { { $as_echo "$as_me:$LINENO: error: Unable to use kernel $LINUX_VER - unable to determine how to map pid_nr -> struct pid" >&5 $as_echo "$as_me: error: Unable to use kernel $LINUX_VER - unable to determine how to map pid_nr -> struct pid" >&2;} { (exit 1); exit 1; }; } fi { $as_echo "$as_me:$LINENO: checking kernel for find_task_by_pid" >&5 $as_echo_n "checking kernel for find_task_by_pid... " >&6; } if test "${cr_cv_kconfig_HAVE_FIND_TASK_BY_PID+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { #ifdef find_task_by_pid /* OK, it exists and is a macro */ #else /* Check for function case */ int x = sizeof(&find_task_by_pid); #endif ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_FIND_TASK_BY_PID=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_FIND_TASK_BY_PID=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_FIND_TASK_BY_PID if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_FIND_TASK_BY_PID 1 _ACEOF HAVE_FIND_TASK_BY_PID=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_FIND_TASK_BY_PID 0 _ACEOF HAVE_FIND_TASK_BY_PID='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel for find_task_by_pid_ns" >&5 $as_echo_n "checking kernel for find_task_by_pid_ns... " >&6; } if test "${cr_cv_kconfig_HAVE_FIND_TASK_BY_PID_NS+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { #ifdef find_task_by_pid_ns /* OK, it exists and is a macro */ #else /* Check for function case */ int x = sizeof(&find_task_by_pid_ns); #endif ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_FIND_TASK_BY_PID_NS=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_FIND_TASK_BY_PID_NS=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_FIND_TASK_BY_PID_NS if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_FIND_TASK_BY_PID_NS 1 _ACEOF HAVE_FIND_TASK_BY_PID_NS=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_FIND_TASK_BY_PID_NS 0 _ACEOF HAVE_FIND_TASK_BY_PID_NS='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } if test -z "${HAVE_FIND_TASK_BY_PID}${HAVE_FIND_TASK_BY_PID_NS}"; then 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:$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= ;; #( *) $as_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 test "x$cache_file" != "x/dev/null" && { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache echo "======================================================================" echo "Please review the following configuration information:" echo " Kernel source directory = $LINUX_SRC" echo " Kernel build directory = $LINUX_OBJ" echo " Kernel symbol table = ${LINUX_SYSTEM_MAP}${LINUX_VMLINUX}" echo " Kernel version probed from kernel build = $LINUX_VER" echo " Kernel running currently = `uname -r`" echo "======================================================================" { { $as_echo "$as_me:$LINENO: error: Unable to use kernel $LINUX_VER - unable to determine how to map pid_nr -> struct task" >&5 $as_echo "$as_me: error: Unable to use kernel $LINUX_VER - unable to determine how to map pid_nr -> struct task" >&2;} { (exit 1); exit 1; }; } fi { $as_echo "$as_me:$LINENO: checking kernel symbol table for find_task_by_pid_ns" >&5 $as_echo_n "checking kernel symbol table for find_task_by_pid_ns... " >&6; } # Our cacheval is encoded with 'Y' or 'N' as the first char to indicate # if a declaration was found or not, and the address or 0 as the rest. if test "${cr_cv_ksymtab_find_task_by_pid_ns+set}" = set; then $as_echo_n "(cached) " >&6 else cr_cv_ksymtab_find_task_by_pid_ns=`eval $LINUX_SYMTAB_CMD | sed -n -e "/${CR_KSYM_PATTERN_CODE}find_task_by_pid_ns$/ {s/ .*//p;q;}"` if test -n "$cr_cv_ksymtab_find_task_by_pid_ns"; then if eval $LINUX_SYMTAB_CMD | grep " __ksymtab_find_task_by_pid_ns\$" >/dev/null ; then cr_cv_ksymtab_find_task_by_pid_ns=0 else if test "CODE${HAVE_CONFIG_THUMB2_KERNEL}" = 'CODE1'; then cr_cv_ksymtab_find_task_by_pid_ns=`$PERL -e "printf '%x', 1 | hex '$cr_cv_ksymtab_find_task_by_pid_ns';"` fi fi SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #define IN_CONFIGURE 1 #include "${TOP_SRCDIR}/include/blcr_imports.h.in" int main () { int x = sizeof(&find_task_by_pid_ns); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_find_task_by_pid_ns="Y$cr_cv_ksymtab_find_task_by_pid_ns" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_find_task_by_pid_ns="N$cr_cv_ksymtab_find_task_by_pid_ns" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi fi cr_addr='' if test -z "$cr_cv_ksymtab_find_task_by_pid_ns"; then cr_result='not found' else if expr "$cr_cv_ksymtab_find_task_by_pid_ns" : N >/dev/null; then { { $as_echo "$as_me:$LINENO: error: Found symbol find_task_by_pid_ns but no declaration -- please file a bug report." >&5 $as_echo "$as_me: error: Found symbol find_task_by_pid_ns but no declaration -- please file a bug report." >&2;} { (exit 1); exit 1; }; } fi cr_result=`echo $cr_cv_ksymtab_find_task_by_pid_ns | tr -d 'YN'` if test $cr_result = 0; then cr_result=exported cr_addr=0 else cr_addr="0x$cr_result" echo "_CR_IMPORT_KCODE(find_task_by_pid_ns, $cr_addr)" >>$CR_KSYM_IMPORT_CALLS fi cat >>confdefs.h <<_ACEOF #define CR_KCODE_find_task_by_pid_ns $cr_addr _ACEOF fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel for find_task_by_pid_type" >&5 $as_echo_n "checking kernel for find_task_by_pid_type... " >&6; } if test "${cr_cv_kconfig_HAVE_FIND_TASK_BY_PID_TYPE+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { #ifdef find_task_by_pid_type /* OK, it exists and is a macro */ #else /* Check for function case */ int x = sizeof(&find_task_by_pid_type); #endif ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_FIND_TASK_BY_PID_TYPE=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_FIND_TASK_BY_PID_TYPE=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_FIND_TASK_BY_PID_TYPE if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_FIND_TASK_BY_PID_TYPE 1 _ACEOF HAVE_FIND_TASK_BY_PID_TYPE=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_FIND_TASK_BY_PID_TYPE 0 _ACEOF HAVE_FIND_TASK_BY_PID_TYPE='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel for find_task_by_pid_type_ns" >&5 $as_echo_n "checking kernel for find_task_by_pid_type_ns... " >&6; } if test "${cr_cv_kconfig_HAVE_FIND_TASK_BY_PID_TYPE_NS+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { #ifdef find_task_by_pid_type_ns /* OK, it exists and is a macro */ #else /* Check for function case */ int x = sizeof(&find_task_by_pid_type_ns); #endif ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_FIND_TASK_BY_PID_TYPE_NS=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_FIND_TASK_BY_PID_TYPE_NS=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_FIND_TASK_BY_PID_TYPE_NS if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_FIND_TASK_BY_PID_TYPE_NS 1 _ACEOF HAVE_FIND_TASK_BY_PID_TYPE_NS=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_FIND_TASK_BY_PID_TYPE_NS 0 _ACEOF HAVE_FIND_TASK_BY_PID_TYPE_NS='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } if test -z "${HAVE_2_ARG_FIND_PID}${HAVE_FIND_TASK_BY_PID}${HAVE_FIND_TASK_BY_PID_NS}"; then 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:$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= ;; #( *) $as_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 test "x$cache_file" != "x/dev/null" && { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache echo "======================================================================" echo "Please review the following configuration information:" echo " Kernel source directory = $LINUX_SRC" echo " Kernel build directory = $LINUX_OBJ" echo " Kernel symbol table = ${LINUX_SYSTEM_MAP}${LINUX_VMLINUX}" echo " Kernel version probed from kernel build = $LINUX_VER" echo " Kernel running currently = `uname -r`" echo "======================================================================" { { $as_echo "$as_me:$LINENO: error: Unable to use kernel $LINUX_VER - unable to determine how to map (type, pid_nr) -> struct task" >&5 $as_echo "$as_me: error: Unable to use kernel $LINUX_VER - unable to determine how to map (type, pid_nr) -> struct task" >&2;} { (exit 1); exit 1; }; } fi { $as_echo "$as_me:$LINENO: checking kernel for alloc_pid" >&5 $as_echo_n "checking kernel for alloc_pid... " >&6; } if test "${cr_cv_kconfig_HAVE_ALLOC_PID+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { #ifdef alloc_pid /* OK, it exists and is a macro */ #else /* Check for function case */ int x = sizeof(&alloc_pid); #endif ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_ALLOC_PID=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_ALLOC_PID=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_ALLOC_PID if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_ALLOC_PID 1 _ACEOF HAVE_ALLOC_PID=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_ALLOC_PID 0 _ACEOF HAVE_ALLOC_PID='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } if test -n "${HAVE_ALLOC_PID}"; then { $as_echo "$as_me:$LINENO: checking kernel for 0-arg alloc_pid" >&5 $as_echo_n "checking kernel for 0-arg alloc_pid... " >&6; } if test "${cr_cv_kconfig_HAVE_0_ARG_ALLOC_PID+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { #ifndef alloc_pid /* Must be macro or have a decl */ int x = sizeof(&alloc_pid); #endif alloc_pid(); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_0_ARG_ALLOC_PID=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_0_ARG_ALLOC_PID=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_0_ARG_ALLOC_PID if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_0_ARG_ALLOC_PID 1 _ACEOF HAVE_0_ARG_ALLOC_PID=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_0_ARG_ALLOC_PID 0 _ACEOF HAVE_0_ARG_ALLOC_PID='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel for 1-arg alloc_pid" >&5 $as_echo_n "checking kernel for 1-arg alloc_pid... " >&6; } if test "${cr_cv_kconfig_HAVE_1_ARG_ALLOC_PID+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { #ifndef alloc_pid /* Must be macro or have a decl */ int x = sizeof(&alloc_pid); #endif alloc_pid(NULL); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_1_ARG_ALLOC_PID=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_1_ARG_ALLOC_PID=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_1_ARG_ALLOC_PID if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_1_ARG_ALLOC_PID 1 _ACEOF HAVE_1_ARG_ALLOC_PID=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_1_ARG_ALLOC_PID 0 _ACEOF HAVE_1_ARG_ALLOC_PID='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } if test "${HAVE_0_ARG_ALLOC_PID}${HAVE_1_ARG_ALLOC_PID}" != "1"; then 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:$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= ;; #( *) $as_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 test "x$cache_file" != "x/dev/null" && { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache echo "======================================================================" echo "Please review the following configuration information:" echo " Kernel source directory = $LINUX_SRC" echo " Kernel build directory = $LINUX_OBJ" echo " Kernel symbol table = ${LINUX_SYSTEM_MAP}${LINUX_VMLINUX}" echo " Kernel version probed from kernel build = $LINUX_VER" echo " Kernel running currently = `uname -r`" echo "======================================================================" { { $as_echo "$as_me:$LINENO: error: Unable to use kernel $LINUX_VER - unable to determine how to call alloc_pid()" >&5 $as_echo "$as_me: error: Unable to use kernel $LINUX_VER - unable to determine how to call alloc_pid()" >&2;} { (exit 1); exit 1; }; } fi { $as_echo "$as_me:$LINENO: checking kernel symbol table for free_pid" >&5 $as_echo_n "checking kernel symbol table for free_pid... " >&6; } # Our cacheval is encoded with 'Y' or 'N' as the first char to indicate # if a declaration was found or not, and the address or 0 as the rest. if test "${cr_cv_ksymtab_free_pid+set}" = set; then $as_echo_n "(cached) " >&6 else cr_cv_ksymtab_free_pid=`eval $LINUX_SYMTAB_CMD | sed -n -e "/${CR_KSYM_PATTERN_CODE}free_pid$/ {s/ .*//p;q;}"` if test -n "$cr_cv_ksymtab_free_pid"; then if eval $LINUX_SYMTAB_CMD | grep " __ksymtab_free_pid\$" >/dev/null ; then cr_cv_ksymtab_free_pid=0 else if test "CODE${HAVE_CONFIG_THUMB2_KERNEL}" = 'CODE1'; then cr_cv_ksymtab_free_pid=`$PERL -e "printf '%x', 1 | hex '$cr_cv_ksymtab_free_pid';"` fi fi SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #define IN_CONFIGURE 1 #include "${TOP_SRCDIR}/include/blcr_imports.h.in" int main () { int x = sizeof(&free_pid); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_free_pid="Y$cr_cv_ksymtab_free_pid" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_free_pid="N$cr_cv_ksymtab_free_pid" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi fi cr_addr='' if test -z "$cr_cv_ksymtab_free_pid"; then cr_result='not found' else if expr "$cr_cv_ksymtab_free_pid" : N >/dev/null; then { { $as_echo "$as_me:$LINENO: error: Found symbol free_pid but no declaration -- please file a bug report." >&5 $as_echo "$as_me: error: Found symbol free_pid but no declaration -- please file a bug report." >&2;} { (exit 1); exit 1; }; } fi cr_result=`echo $cr_cv_ksymtab_free_pid | tr -d 'YN'` if test $cr_result = 0; then cr_result=exported cr_addr=0 else cr_addr="0x$cr_result" echo "_CR_IMPORT_KCODE(free_pid, $cr_addr)" >>$CR_KSYM_IMPORT_CALLS fi cat >>confdefs.h <<_ACEOF #define CR_KCODE_free_pid $cr_addr _ACEOF fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel symbol table for pid_hash" >&5 $as_echo_n "checking kernel symbol table for pid_hash... " >&6; } # Our cacheval is encoded with 'Y' or 'N' as the first char to indicate # if a declaration was found or not, and the address or 0 as the rest. if test "${cr_cv_ksymtab_pid_hash+set}" = set; then $as_echo_n "(cached) " >&6 else cr_cv_ksymtab_pid_hash=`eval $LINUX_SYMTAB_CMD | sed -n -e "/${CR_KSYM_PATTERN_DATA}pid_hash$/ {s/ .*//p;q;}"` if test -n "$cr_cv_ksymtab_pid_hash"; then if eval $LINUX_SYMTAB_CMD | grep " __ksymtab_pid_hash\$" >/dev/null ; then cr_cv_ksymtab_pid_hash=0 else if test "DATA${HAVE_CONFIG_THUMB2_KERNEL}" = 'CODE1'; then cr_cv_ksymtab_pid_hash=`$PERL -e "printf '%x', 1 | hex '$cr_cv_ksymtab_pid_hash';"` fi fi SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #define IN_CONFIGURE 1 #include "${TOP_SRCDIR}/include/blcr_imports.h.in" int main () { int x = sizeof(&pid_hash); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_pid_hash="Y$cr_cv_ksymtab_pid_hash" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_pid_hash="N$cr_cv_ksymtab_pid_hash" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi fi cr_addr='' if test -z "$cr_cv_ksymtab_pid_hash"; then cr_result='not found' else if expr "$cr_cv_ksymtab_pid_hash" : N >/dev/null; then cat >>$CR_KSYM_IMPORT_DECLS <<_EOF extern struct hlist_head *pid_hash; _EOF fi cr_result=`echo $cr_cv_ksymtab_pid_hash | tr -d 'YN'` if test $cr_result = 0; then cr_result=exported cr_addr=0 else cr_addr="0x$cr_result" echo "_CR_IMPORT_KDATA(pid_hash, $cr_addr)" >>$CR_KSYM_IMPORT_CALLS fi cat >>confdefs.h <<_ACEOF #define CR_KDATA_pid_hash $cr_addr _ACEOF fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel symbol table for pidhash_shift" >&5 $as_echo_n "checking kernel symbol table for pidhash_shift... " >&6; } # Our cacheval is encoded with 'Y' or 'N' as the first char to indicate # if a declaration was found or not, and the address or 0 as the rest. if test "${cr_cv_ksymtab_pidhash_shift+set}" = set; then $as_echo_n "(cached) " >&6 else cr_cv_ksymtab_pidhash_shift=`eval $LINUX_SYMTAB_CMD | sed -n -e "/${CR_KSYM_PATTERN_DATA}pidhash_shift$/ {s/ .*//p;q;}"` if test -n "$cr_cv_ksymtab_pidhash_shift"; then if eval $LINUX_SYMTAB_CMD | grep " __ksymtab_pidhash_shift\$" >/dev/null ; then cr_cv_ksymtab_pidhash_shift=0 else if test "DATA${HAVE_CONFIG_THUMB2_KERNEL}" = 'CODE1'; then cr_cv_ksymtab_pidhash_shift=`$PERL -e "printf '%x', 1 | hex '$cr_cv_ksymtab_pidhash_shift';"` fi fi SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #define IN_CONFIGURE 1 #include "${TOP_SRCDIR}/include/blcr_imports.h.in" int main () { int x = sizeof(&pidhash_shift); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_pidhash_shift="Y$cr_cv_ksymtab_pidhash_shift" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_pidhash_shift="N$cr_cv_ksymtab_pidhash_shift" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi fi cr_addr='' if test -z "$cr_cv_ksymtab_pidhash_shift"; then cr_result='not found' else if expr "$cr_cv_ksymtab_pidhash_shift" : N >/dev/null; then cat >>$CR_KSYM_IMPORT_DECLS <<_EOF extern int pidhash_shift; _EOF fi cr_result=`echo $cr_cv_ksymtab_pidhash_shift | tr -d 'YN'` if test $cr_result = 0; then cr_result=exported cr_addr=0 else cr_addr="0x$cr_result" echo "_CR_IMPORT_KDATA(pidhash_shift, $cr_addr)" >>$CR_KSYM_IMPORT_CALLS fi cat >>confdefs.h <<_ACEOF #define CR_KDATA_pidhash_shift $cr_addr _ACEOF fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } # Can't use true type because 'struct kmem_cache' is opaque by design { $as_echo "$as_me:$LINENO: checking kernel for pid_namespace.pid_cachep" >&5 $as_echo_n "checking kernel for pid_namespace.pid_cachep... " >&6; } if test "${cr_cv_kconfig_HAVE_PID_NAMESPACE_PID_CACHEP+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include #include int main () { struct pid_namespace x; void * tc_1 = x.pid_cachep; ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_PID_NAMESPACE_PID_CACHEP=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_PID_NAMESPACE_PID_CACHEP=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_PID_NAMESPACE_PID_CACHEP if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_PID_NAMESPACE_PID_CACHEP 1 _ACEOF HAVE_PID_NAMESPACE_PID_CACHEP=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_PID_NAMESPACE_PID_CACHEP 0 _ACEOF HAVE_PID_NAMESPACE_PID_CACHEP='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel symbol table for pid_cachep" >&5 $as_echo_n "checking kernel symbol table for pid_cachep... " >&6; } # Our cacheval is encoded with 'Y' or 'N' as the first char to indicate # if a declaration was found or not, and the address or 0 as the rest. if test "${cr_cv_ksymtab_pid_cachep+set}" = set; then $as_echo_n "(cached) " >&6 else cr_cv_ksymtab_pid_cachep=`eval $LINUX_SYMTAB_CMD | sed -n -e "/${CR_KSYM_PATTERN_DATA}pid_cachep$/ {s/ .*//p;q;}"` if test -n "$cr_cv_ksymtab_pid_cachep"; then if eval $LINUX_SYMTAB_CMD | grep " __ksymtab_pid_cachep\$" >/dev/null ; then cr_cv_ksymtab_pid_cachep=0 else if test "DATA${HAVE_CONFIG_THUMB2_KERNEL}" = 'CODE1'; then cr_cv_ksymtab_pid_cachep=`$PERL -e "printf '%x', 1 | hex '$cr_cv_ksymtab_pid_cachep';"` fi fi SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #define IN_CONFIGURE 1 #include "${TOP_SRCDIR}/include/blcr_imports.h.in" int main () { int x = sizeof(&pid_cachep); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_pid_cachep="Y$cr_cv_ksymtab_pid_cachep" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_pid_cachep="N$cr_cv_ksymtab_pid_cachep" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi fi cr_addr='' if test -z "$cr_cv_ksymtab_pid_cachep"; then cr_result='not found' else if expr "$cr_cv_ksymtab_pid_cachep" : N >/dev/null; then cat >>$CR_KSYM_IMPORT_DECLS <<_EOF #if HAVE_KMEM_CACHE_T extern kmem_cache_t *pid_cachep; #else extern struct kmem_cache *pid_cachep; #endif _EOF fi cr_result=`echo $cr_cv_ksymtab_pid_cachep | tr -d 'YN'` if test $cr_result = 0; then cr_result=exported cr_addr=0 else cr_addr="0x$cr_result" echo "_CR_IMPORT_KDATA(pid_cachep, $cr_addr)" >>$CR_KSYM_IMPORT_CALLS fi cat >>confdefs.h <<_ACEOF #define CR_KDATA_pid_cachep $cr_addr _ACEOF fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } if test -z "${cr_addr}${HAVE_PID_NAMESPACE_PID_CACHEP}"; then 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:$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= ;; #( *) $as_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 test "x$cache_file" != "x/dev/null" && { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache echo "======================================================================" echo "Please review the following configuration information:" echo " Kernel source directory = $LINUX_SRC" echo " Kernel build directory = $LINUX_OBJ" echo " Kernel symbol table = ${LINUX_SYSTEM_MAP}${LINUX_VMLINUX}" echo " Kernel version probed from kernel build = $LINUX_VER" echo " Kernel running currently = `uname -r`" echo "======================================================================" { { $as_echo "$as_me:$LINENO: error: Unable to use kernel $LINUX_VER - unable to determine where to find pid_cachep" >&5 $as_echo "$as_me: error: Unable to use kernel $LINUX_VER - unable to determine where to find pid_cachep" >&2;} { (exit 1); exit 1; }; } fi if test -n "${HAVE_LINUX_PSPACE_H}"; then { $as_echo "$as_me:$LINENO: checking kernel symbol table for init_pspace" >&5 $as_echo_n "checking kernel symbol table for init_pspace... " >&6; } # Our cacheval is encoded with 'Y' or 'N' as the first char to indicate # if a declaration was found or not, and the address or 0 as the rest. if test "${cr_cv_ksymtab_init_pspace+set}" = set; then $as_echo_n "(cached) " >&6 else cr_cv_ksymtab_init_pspace=`eval $LINUX_SYMTAB_CMD | sed -n -e "/${CR_KSYM_PATTERN_DATA}init_pspace$/ {s/ .*//p;q;}"` if test -n "$cr_cv_ksymtab_init_pspace"; then if eval $LINUX_SYMTAB_CMD | grep " __ksymtab_init_pspace\$" >/dev/null ; then cr_cv_ksymtab_init_pspace=0 else if test "DATA${HAVE_CONFIG_THUMB2_KERNEL}" = 'CODE1'; then cr_cv_ksymtab_init_pspace=`$PERL -e "printf '%x', 1 | hex '$cr_cv_ksymtab_init_pspace';"` fi fi SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #define IN_CONFIGURE 1 #include "${TOP_SRCDIR}/include/blcr_imports.h.in" int main () { int x = sizeof(&init_pspace); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_init_pspace="Y$cr_cv_ksymtab_init_pspace" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_init_pspace="N$cr_cv_ksymtab_init_pspace" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi fi cr_addr='' if test -z "$cr_cv_ksymtab_init_pspace"; then cr_result='not found' else if expr "$cr_cv_ksymtab_init_pspace" : N >/dev/null; then { { $as_echo "$as_me:$LINENO: error: Found symbol init_pspace but no declaration -- please file a bug report." >&5 $as_echo "$as_me: error: Found symbol init_pspace but no declaration -- please file a bug report." >&2;} { (exit 1); exit 1; }; } fi cr_result=`echo $cr_cv_ksymtab_init_pspace | tr -d 'YN'` if test $cr_result = 0; then cr_result=exported cr_addr=0 else cr_addr="0x$cr_result" echo "_CR_IMPORT_KDATA(init_pspace, $cr_addr)" >>$CR_KSYM_IMPORT_CALLS fi cat >>confdefs.h <<_ACEOF #define CR_KDATA_init_pspace $cr_addr _ACEOF fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } elif test -n "${HAVE_LINUX_PID_NAMESPACE_H}"; then { $as_echo "$as_me:$LINENO: checking kernel symbol table for init_pid_ns" >&5 $as_echo_n "checking kernel symbol table for init_pid_ns... " >&6; } # Our cacheval is encoded with 'Y' or 'N' as the first char to indicate # if a declaration was found or not, and the address or 0 as the rest. if test "${cr_cv_ksymtab_init_pid_ns+set}" = set; then $as_echo_n "(cached) " >&6 else cr_cv_ksymtab_init_pid_ns=`eval $LINUX_SYMTAB_CMD | sed -n -e "/${CR_KSYM_PATTERN_DATA}init_pid_ns$/ {s/ .*//p;q;}"` if test -n "$cr_cv_ksymtab_init_pid_ns"; then if eval $LINUX_SYMTAB_CMD | grep " __ksymtab_init_pid_ns\$" >/dev/null ; then cr_cv_ksymtab_init_pid_ns=0 else if test "DATA${HAVE_CONFIG_THUMB2_KERNEL}" = 'CODE1'; then cr_cv_ksymtab_init_pid_ns=`$PERL -e "printf '%x', 1 | hex '$cr_cv_ksymtab_init_pid_ns';"` fi fi SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #define IN_CONFIGURE 1 #include "${TOP_SRCDIR}/include/blcr_imports.h.in" int main () { int x = sizeof(&init_pid_ns); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_init_pid_ns="Y$cr_cv_ksymtab_init_pid_ns" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_init_pid_ns="N$cr_cv_ksymtab_init_pid_ns" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi fi cr_addr='' if test -z "$cr_cv_ksymtab_init_pid_ns"; then cr_result='not found' else if expr "$cr_cv_ksymtab_init_pid_ns" : N >/dev/null; then { { $as_echo "$as_me:$LINENO: error: Found symbol init_pid_ns but no declaration -- please file a bug report." >&5 $as_echo "$as_me: error: Found symbol init_pid_ns but no declaration -- please file a bug report." >&2;} { (exit 1); exit 1; }; } fi cr_result=`echo $cr_cv_ksymtab_init_pid_ns | tr -d 'YN'` if test $cr_result = 0; then cr_result=exported cr_addr=0 else cr_addr="0x$cr_result" echo "_CR_IMPORT_KDATA(init_pid_ns, $cr_addr)" >>$CR_KSYM_IMPORT_CALLS fi cat >>confdefs.h <<_ACEOF #define CR_KDATA_init_pid_ns $cr_addr _ACEOF fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } fi fi { $as_echo "$as_me:$LINENO: checking kernel for 2.6.0 attach_pid" >&5 $as_echo_n "checking kernel for 2.6.0 attach_pid... " >&6; } if test "${cr_cv_kconfig_HAVE_2_6_0_ATTACH_PID+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include #include extern int FASTCALL(attach_pid(struct task_struct *task, enum pid_type type, int nr)); int main () { int x = sizeof(&attach_pid) ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_2_6_0_ATTACH_PID=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_2_6_0_ATTACH_PID=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_2_6_0_ATTACH_PID if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_2_6_0_ATTACH_PID 1 _ACEOF HAVE_2_6_0_ATTACH_PID=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_2_6_0_ATTACH_PID 0 _ACEOF HAVE_2_6_0_ATTACH_PID='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel for 2.6.22 attach_pid" >&5 $as_echo_n "checking kernel for 2.6.22 attach_pid... " >&6; } if test "${cr_cv_kconfig_HAVE_2_6_22_ATTACH_PID+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include #include extern int FASTCALL(attach_pid(struct task_struct *task, enum pid_type type, struct pid *pid)); int main () { int x = sizeof(&attach_pid) ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_2_6_22_ATTACH_PID=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_2_6_22_ATTACH_PID=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_2_6_22_ATTACH_PID if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_2_6_22_ATTACH_PID 1 _ACEOF HAVE_2_6_22_ATTACH_PID=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_2_6_22_ATTACH_PID 0 _ACEOF HAVE_2_6_22_ATTACH_PID='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel for 2.6.26 attach_pid" >&5 $as_echo_n "checking kernel for 2.6.26 attach_pid... " >&6; } if test "${cr_cv_kconfig_HAVE_2_6_26_ATTACH_PID+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include #include extern void attach_pid(struct task_struct *task, enum pid_type type, struct pid *pid); int main () { int x = sizeof(&attach_pid) ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_2_6_26_ATTACH_PID=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_2_6_26_ATTACH_PID=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_2_6_26_ATTACH_PID if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_2_6_26_ATTACH_PID 1 _ACEOF HAVE_2_6_26_ATTACH_PID=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_2_6_26_ATTACH_PID 0 _ACEOF HAVE_2_6_26_ATTACH_PID='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } # Require exactly one match if test "${HAVE_2_6_0_ATTACH_PID}${HAVE_2_6_22_ATTACH_PID}${HAVE_2_6_26_ATTACH_PID}" != "1"; then 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:$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= ;; #( *) $as_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 test "x$cache_file" != "x/dev/null" && { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache echo "======================================================================" echo "Please review the following configuration information:" echo " Kernel source directory = $LINUX_SRC" echo " Kernel build directory = $LINUX_OBJ" echo " Kernel symbol table = ${LINUX_SYSTEM_MAP}${LINUX_VMLINUX}" echo " Kernel version probed from kernel build = $LINUX_VER" echo " Kernel running currently = `uname -r`" echo "======================================================================" { { $as_echo "$as_me:$LINENO: error: Unable to use kernel $LINUX_VER - unable to determine how to call attach_pid()" >&5 $as_echo "$as_me: error: Unable to use kernel $LINUX_VER - unable to determine how to call attach_pid()" >&2;} { (exit 1); exit 1; }; } fi { $as_echo "$as_me:$LINENO: checking kernel for change_pid" >&5 $as_echo_n "checking kernel for change_pid... " >&6; } if test "${cr_cv_kconfig_HAVE_CHANGE_PID+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include #include int main () { #ifdef change_pid /* OK, it exists and is a macro */ #else /* Check for function case */ int x = sizeof(&change_pid); #endif ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_CHANGE_PID=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_CHANGE_PID=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_CHANGE_PID if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_CHANGE_PID 1 _ACEOF HAVE_CHANGE_PID=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_CHANGE_PID 0 _ACEOF HAVE_CHANGE_PID='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } # OK if missing { $as_echo "$as_me:$LINENO: checking kernel for struct pidmap" >&5 $as_echo_n "checking kernel for struct pidmap... " >&6; } if test "${cr_cv_kconfig_HAVE_STRUCT_PIDMAP+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #if HAVE_LINUX_PSPACE_H #include #endif #if HAVE_LINUX_PID_NAMESPACE_H #include #endif int main () { struct pidmap y; int x = sizeof(y); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_STRUCT_PIDMAP=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_STRUCT_PIDMAP=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_STRUCT_PIDMAP if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_STRUCT_PIDMAP 1 _ACEOF HAVE_STRUCT_PIDMAP=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_STRUCT_PIDMAP 0 _ACEOF HAVE_STRUCT_PIDMAP='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel symbol table for pidmap_array" >&5 $as_echo_n "checking kernel symbol table for pidmap_array... " >&6; } # Our cacheval is encoded with 'Y' or 'N' as the first char to indicate # if a declaration was found or not, and the address or 0 as the rest. if test "${cr_cv_ksymtab_pidmap_array+set}" = set; then $as_echo_n "(cached) " >&6 else cr_cv_ksymtab_pidmap_array=`eval $LINUX_SYMTAB_CMD | sed -n -e "/${CR_KSYM_PATTERN_DATA}pidmap_array$/ {s/ .*//p;q;}"` if test -n "$cr_cv_ksymtab_pidmap_array"; then if eval $LINUX_SYMTAB_CMD | grep " __ksymtab_pidmap_array\$" >/dev/null ; then cr_cv_ksymtab_pidmap_array=0 else if test "DATA${HAVE_CONFIG_THUMB2_KERNEL}" = 'CODE1'; then cr_cv_ksymtab_pidmap_array=`$PERL -e "printf '%x', 1 | hex '$cr_cv_ksymtab_pidmap_array';"` fi fi SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #define IN_CONFIGURE 1 #include "${TOP_SRCDIR}/include/blcr_imports.h.in" int main () { int x = sizeof(&pidmap_array); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_pidmap_array="Y$cr_cv_ksymtab_pidmap_array" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_pidmap_array="N$cr_cv_ksymtab_pidmap_array" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi fi cr_addr='' if test -z "$cr_cv_ksymtab_pidmap_array"; then cr_result='not found' else if expr "$cr_cv_ksymtab_pidmap_array" : N >/dev/null; then cat >>$CR_KSYM_IMPORT_DECLS <<_EOF #if !HAVE_STRUCT_PIDMAP struct pidmap { atomic_t nr_free; void *page; }; #endif extern struct pidmap pidmap_array[]; _EOF fi cr_result=`echo $cr_cv_ksymtab_pidmap_array | tr -d 'YN'` if test $cr_result = 0; then cr_result=exported cr_addr=0 else cr_addr="0x$cr_result" echo "_CR_IMPORT_KDATA(pidmap_array, $cr_addr)" >>$CR_KSYM_IMPORT_CALLS fi cat >>confdefs.h <<_ACEOF #define CR_KDATA_pidmap_array $cr_addr _ACEOF fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } if test x"$cr_kernel_smp" = xyes; then { $as_echo "$as_me:$LINENO: checking kernel symbol table for pidmap_lock" >&5 $as_echo_n "checking kernel symbol table for pidmap_lock... " >&6; } # Our cacheval is encoded with 'Y' or 'N' as the first char to indicate # if a declaration was found or not, and the address or 0 as the rest. if test "${cr_cv_ksymtab_pidmap_lock+set}" = set; then $as_echo_n "(cached) " >&6 else cr_cv_ksymtab_pidmap_lock=`eval $LINUX_SYMTAB_CMD | sed -n -e "/${CR_KSYM_PATTERN_DATA}pidmap_lock$/ {s/ .*//p;q;}"` if test -n "$cr_cv_ksymtab_pidmap_lock"; then if eval $LINUX_SYMTAB_CMD | grep " __ksymtab_pidmap_lock\$" >/dev/null ; then cr_cv_ksymtab_pidmap_lock=0 else if test "DATA${HAVE_CONFIG_THUMB2_KERNEL}" = 'CODE1'; then cr_cv_ksymtab_pidmap_lock=`$PERL -e "printf '%x', 1 | hex '$cr_cv_ksymtab_pidmap_lock';"` fi fi SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #define IN_CONFIGURE 1 #include "${TOP_SRCDIR}/include/blcr_imports.h.in" int main () { int x = sizeof(&pidmap_lock); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_pidmap_lock="Y$cr_cv_ksymtab_pidmap_lock" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_pidmap_lock="N$cr_cv_ksymtab_pidmap_lock" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi fi cr_addr='' if test -z "$cr_cv_ksymtab_pidmap_lock"; then cr_result='not found' else if expr "$cr_cv_ksymtab_pidmap_lock" : N >/dev/null; then cat >>$CR_KSYM_IMPORT_DECLS <<_EOF extern spinlock_t pidmap_lock; _EOF fi cr_result=`echo $cr_cv_ksymtab_pidmap_lock | tr -d 'YN'` if test $cr_result = 0; then cr_result=exported cr_addr=0 else cr_addr="0x$cr_result" echo "_CR_IMPORT_KDATA(pidmap_lock, $cr_addr)" >>$CR_KSYM_IMPORT_CALLS fi cat >>confdefs.h <<_ACEOF #define CR_KDATA_pidmap_lock $cr_addr _ACEOF fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } if test -z "$cr_addr"; then { { $as_echo "$as_me:$LINENO: error: failed to find symbol pidmap_lock" >&5 $as_echo "$as_me: error: failed to find symbol pidmap_lock" >&2;} { (exit 1); exit 1; }; } fi fi { $as_echo "$as_me:$LINENO: checking kernel for kill_pid" >&5 $as_echo_n "checking kernel for kill_pid... " >&6; } if test "${cr_cv_kconfig_HAVE_KILL_PID+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { #ifdef kill_pid /* OK, it exists and is a macro */ #else /* Check for function case */ int x = sizeof(&kill_pid); #endif ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_KILL_PID=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_KILL_PID=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_KILL_PID if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_KILL_PID 1 _ACEOF HAVE_KILL_PID=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_KILL_PID 0 _ACEOF HAVE_KILL_PID='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel for kill_proc" >&5 $as_echo_n "checking kernel for kill_proc... " >&6; } if test "${cr_cv_kconfig_HAVE_KILL_PROC+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { #ifdef kill_proc /* OK, it exists and is a macro */ #else /* Check for function case */ int x = sizeof(&kill_proc); #endif ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_KILL_PROC=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_KILL_PROC=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_KILL_PROC if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_KILL_PROC 1 _ACEOF HAVE_KILL_PROC=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_KILL_PROC 0 _ACEOF HAVE_KILL_PROC='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } # Require at least one if test -z "${HAVE_KILL_PID}${HAVE_KILL_PROC}"; then 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:$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= ;; #( *) $as_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 test "x$cache_file" != "x/dev/null" && { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache echo "======================================================================" echo "Please review the following configuration information:" echo " Kernel source directory = $LINUX_SRC" echo " Kernel build directory = $LINUX_OBJ" echo " Kernel symbol table = ${LINUX_SYSTEM_MAP}${LINUX_VMLINUX}" echo " Kernel version probed from kernel build = $LINUX_VER" echo " Kernel running currently = `uname -r`" echo "======================================================================" { { $as_echo "$as_me:$LINENO: error: Unable to use kernel $LINUX_VER - unable to find kill_pid() or kill_proc()" >&5 $as_echo "$as_me: error: Unable to use kernel $LINUX_VER - unable to find kill_pid() or kill_proc()" >&2;} { (exit 1); exit 1; }; } fi { $as_echo "$as_me:$LINENO: checking kernel for child_reaper" >&5 $as_echo_n "checking kernel for child_reaper... " >&6; } if test "${cr_cv_kconfig_HAVE_CHILD_REAPER+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { #ifdef child_reaper /* OK, it exists and is a macro */ #else /* Check for function case */ int x = sizeof(&child_reaper); #endif ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_CHILD_REAPER=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_CHILD_REAPER=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_CHILD_REAPER if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_CHILD_REAPER 1 _ACEOF HAVE_CHILD_REAPER=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_CHILD_REAPER 0 _ACEOF HAVE_CHILD_REAPER='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel for task_child_reaper" >&5 $as_echo_n "checking kernel for task_child_reaper... " >&6; } if test "${cr_cv_kconfig_HAVE_TASK_CHILD_REAPER+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { #ifdef task_child_reaper /* OK, it exists and is a macro */ #else /* Check for function case */ int x = sizeof(&task_child_reaper); #endif ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_TASK_CHILD_REAPER=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_TASK_CHILD_REAPER=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_TASK_CHILD_REAPER if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_TASK_CHILD_REAPER 1 _ACEOF HAVE_TASK_CHILD_REAPER=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_TASK_CHILD_REAPER 0 _ACEOF HAVE_TASK_CHILD_REAPER='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } if test -z "${HAVE_CHILD_REAPER}${HAVE_TASK_CHILD_REAPER}"; then { $as_echo "$as_me:$LINENO: checking kernel symbol table for child_reaper" >&5 $as_echo_n "checking kernel symbol table for child_reaper... " >&6; } # Our cacheval is encoded with 'Y' or 'N' as the first char to indicate # if a declaration was found or not, and the address or 0 as the rest. if test "${cr_cv_ksymtab_child_reaper+set}" = set; then $as_echo_n "(cached) " >&6 else cr_cv_ksymtab_child_reaper=`eval $LINUX_SYMTAB_CMD | sed -n -e "/${CR_KSYM_PATTERN_DATA}child_reaper$/ {s/ .*//p;q;}"` if test -n "$cr_cv_ksymtab_child_reaper"; then if eval $LINUX_SYMTAB_CMD | grep " __ksymtab_child_reaper\$" >/dev/null ; then cr_cv_ksymtab_child_reaper=0 else if test "DATA${HAVE_CONFIG_THUMB2_KERNEL}" = 'CODE1'; then cr_cv_ksymtab_child_reaper=`$PERL -e "printf '%x', 1 | hex '$cr_cv_ksymtab_child_reaper';"` fi fi SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #define IN_CONFIGURE 1 #include "${TOP_SRCDIR}/include/blcr_imports.h.in" int main () { int x = sizeof(&child_reaper); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_child_reaper="Y$cr_cv_ksymtab_child_reaper" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_child_reaper="N$cr_cv_ksymtab_child_reaper" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi fi cr_addr='' if test -z "$cr_cv_ksymtab_child_reaper"; then cr_result='not found' else if expr "$cr_cv_ksymtab_child_reaper" : N >/dev/null; then cat >>$CR_KSYM_IMPORT_DECLS <<_EOF extern struct task_struct *child_reaper; _EOF fi cr_result=`echo $cr_cv_ksymtab_child_reaper | tr -d 'YN'` if test $cr_result = 0; then cr_result=exported cr_addr=0 else cr_addr="0x$cr_result" echo "_CR_IMPORT_KDATA(child_reaper, $cr_addr)" >>$CR_KSYM_IMPORT_CALLS fi cat >>confdefs.h <<_ACEOF #define CR_KDATA_child_reaper $cr_addr _ACEOF fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } fi { $as_echo "$as_me:$LINENO: checking kernel for task.parent" >&5 $as_echo_n "checking kernel for task.parent... " >&6; } if test "${cr_cv_kconfig_HAVE_TASK_PARENT+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { struct task_struct x; struct task_struct tc_1 = *(x.parent); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_TASK_PARENT=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_TASK_PARENT=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_TASK_PARENT if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_TASK_PARENT 1 _ACEOF HAVE_TASK_PARENT=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_TASK_PARENT 0 _ACEOF HAVE_TASK_PARENT='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel for task.real_parent" >&5 $as_echo_n "checking kernel for task.real_parent... " >&6; } if test "${cr_cv_kconfig_HAVE_TASK_REAL_PARENT+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { struct task_struct x; struct task_struct tc_1 = *(x.real_parent); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_TASK_REAL_PARENT=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_TASK_REAL_PARENT=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_TASK_REAL_PARENT if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_TASK_REAL_PARENT 1 _ACEOF HAVE_TASK_REAL_PARENT=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_TASK_REAL_PARENT 0 _ACEOF HAVE_TASK_REAL_PARENT='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } # Look for non-deprecated "typedef struct SOMETHING kmem_cache_t". # This is slightly complicated by the fact that this is an opaque type (with # the struct itself forward-declared but not defined in the public headers). { $as_echo "$as_me:$LINENO: checking kernel for kmem_cache_t" >&5 $as_echo_n "checking kernel for kmem_cache_t... " >&6; } if test "${cr_cv_kconfig_HAVE_KMEM_CACHE_T+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { kmem_cache_t *x = NULL; ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS SAVE_CPP=$CPP SAVE_CPPFLAGS=$CPPFLAGS CPP="$KCC -E" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "typedef.+[[:space:]]kmem_cache_t[[:space:]].+deprecated" >/dev/null 2>&1; then CPP=$SAVE_CPP CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_KMEM_CACHE_T=no else CPP=$SAVE_CPP CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_KMEM_CACHE_T=yes fi rm -f conftest* # Want *not* found else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_KMEM_CACHE_T=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $cr_cv_kconfig_HAVE_KMEM_CACHE_T" >&5 $as_echo "$cr_cv_kconfig_HAVE_KMEM_CACHE_T" >&6; } if test x$cr_cv_kconfig_HAVE_KMEM_CACHE_T = xyes; then cat >>confdefs.h <<\_ACEOF #define HAVE_KMEM_CACHE_T 1 _ACEOF else cat >>confdefs.h <<\_ACEOF #define HAVE_KMEM_CACHE_T 0 _ACEOF fi # type of (struct fs_struct).lock { $as_echo "$as_me:$LINENO: checking kernel for fs_struct rwlock" >&5 $as_echo_n "checking kernel for fs_struct rwlock... " >&6; } if test "${cr_cv_kconfig_HAVE_FS_STRUCT_RWLOCK+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include #include int main () { struct fs_struct x; rwlock_t tc_1 = x.lock; ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_FS_STRUCT_RWLOCK=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_FS_STRUCT_RWLOCK=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_FS_STRUCT_RWLOCK if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_FS_STRUCT_RWLOCK 1 _ACEOF HAVE_FS_STRUCT_RWLOCK=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_FS_STRUCT_RWLOCK 0 _ACEOF HAVE_FS_STRUCT_RWLOCK='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel for fs_struct spinlock" >&5 $as_echo_n "checking kernel for fs_struct spinlock... " >&6; } if test "${cr_cv_kconfig_HAVE_FS_STRUCT_SPINLOCK+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include #include int main () { struct fs_struct x; spinlock_t tc_1 = x.lock; ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_FS_STRUCT_SPINLOCK=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_FS_STRUCT_SPINLOCK=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_FS_STRUCT_SPINLOCK if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_FS_STRUCT_SPINLOCK 1 _ACEOF HAVE_FS_STRUCT_SPINLOCK=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_FS_STRUCT_SPINLOCK 0 _ACEOF HAVE_FS_STRUCT_SPINLOCK='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } if test "$HAVE_FS_STRUCT_RWLOCK$HAVE_FS_STRUCT_SPINLOCK" = "11" \ -o "$HAVE_FS_STRUCT_RWLOCK$HAVE_FS_STRUCT_SPINLOCK" = "00" ; then 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:$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= ;; #( *) $as_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 test "x$cache_file" != "x/dev/null" && { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache echo "======================================================================" echo "Please review the following configuration information:" echo " Kernel source directory = $LINUX_SRC" echo " Kernel build directory = $LINUX_OBJ" echo " Kernel symbol table = ${LINUX_SYSTEM_MAP}${LINUX_VMLINUX}" echo " Kernel version probed from kernel build = $LINUX_VER" echo " Kernel running currently = `uname -r`" echo "======================================================================" { { $as_echo "$as_me:$LINENO: error: Unable to use kernel $LINUX_VER - unrecognized type for fs_struct.lock" >&5 $as_echo "$as_me: error: Unable to use kernel $LINUX_VER - unrecognized type for fs_struct.lock" >&2;} { (exit 1); exit 1; }; } fi { $as_echo "$as_me:$LINENO: checking kernel for gfp_t" >&5 $as_echo_n "checking kernel for gfp_t... " >&6; } if test "${cr_cv_kconfig_HAVE_GFP_T+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { gfp_t y; int x = sizeof(y); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_GFP_T=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_GFP_T=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_GFP_T if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_GFP_T 1 _ACEOF HAVE_GFP_T=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_GFP_T 0 _ACEOF HAVE_GFP_T='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } # OK if missing { $as_echo "$as_me:$LINENO: checking kernel for kzalloc" >&5 $as_echo_n "checking kernel for kzalloc... " >&6; } if test "${cr_cv_kconfig_HAVE_KZALLOC+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { #ifdef kzalloc /* OK, it exists and is a macro */ #else /* Check for function case */ int x = sizeof(&kzalloc); #endif ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_KZALLOC=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_KZALLOC=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_KZALLOC if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_KZALLOC 1 _ACEOF HAVE_KZALLOC=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_KZALLOC 0 _ACEOF HAVE_KZALLOC='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } # OK if missing { $as_echo "$as_me:$LINENO: checking kernel for kmem_cache_zalloc" >&5 $as_echo_n "checking kernel for kmem_cache_zalloc... " >&6; } if test "${cr_cv_kconfig_HAVE_KMEM_CACHE_ZALLOC+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { #ifdef kmem_cache_zalloc /* OK, it exists and is a macro */ #else /* Check for function case */ int x = sizeof(&kmem_cache_zalloc); #endif ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_KMEM_CACHE_ZALLOC=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_KMEM_CACHE_ZALLOC=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_KMEM_CACHE_ZALLOC if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_KMEM_CACHE_ZALLOC 1 _ACEOF HAVE_KMEM_CACHE_ZALLOC=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_KMEM_CACHE_ZALLOC 0 _ACEOF HAVE_KMEM_CACHE_ZALLOC='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } # OK if missing { $as_echo "$as_me:$LINENO: checking kernel for kmemdup" >&5 $as_echo_n "checking kernel for kmemdup... " >&6; } if test "${cr_cv_kconfig_HAVE_KMEMDUP+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { #ifdef kmemdup /* OK, it exists and is a macro */ #else /* Check for function case */ int x = sizeof(&kmemdup); #endif ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_KMEMDUP=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_KMEMDUP=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_KMEMDUP if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_KMEMDUP 1 _ACEOF HAVE_KMEMDUP=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_KMEMDUP 0 _ACEOF HAVE_KMEMDUP='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } # OK if missing { $as_echo "$as_me:$LINENO: checking kernel for pipe_inode_info.base" >&5 $as_echo_n "checking kernel for pipe_inode_info.base... " >&6; } if test "${cr_cv_kconfig_HAVE_PIPE_INODE_INFO_BASE+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include #include int main () { struct pipe_inode_info x; char tc_1 = *(x.base); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_PIPE_INODE_INFO_BASE=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_PIPE_INODE_INFO_BASE=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_PIPE_INODE_INFO_BASE if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_PIPE_INODE_INFO_BASE 1 _ACEOF HAVE_PIPE_INODE_INFO_BASE=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_PIPE_INODE_INFO_BASE 0 _ACEOF HAVE_PIPE_INODE_INFO_BASE='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } # OK if missing. { $as_echo "$as_me:$LINENO: checking kernel for pipe_inode_info.buffers" >&5 $as_echo_n "checking kernel for pipe_inode_info.buffers... " >&6; } if test "${cr_cv_kconfig_HAVE_PIPE_INODE_INFO_BUFFERS+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include #include int main () { struct pipe_inode_info x; unsigned int tc_1 = x.buffers; ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_PIPE_INODE_INFO_BUFFERS=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_PIPE_INODE_INFO_BUFFERS=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_PIPE_INODE_INFO_BUFFERS if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_PIPE_INODE_INFO_BUFFERS 1 _ACEOF HAVE_PIPE_INODE_INFO_BUFFERS=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_PIPE_INODE_INFO_BUFFERS 0 _ACEOF HAVE_PIPE_INODE_INFO_BUFFERS='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } # OK if missing. { $as_echo "$as_me:$LINENO: checking kernel for pipe_buf_operations.pin" >&5 $as_echo_n "checking kernel for pipe_buf_operations.pin... " >&6; } if test "${cr_cv_kconfig_HAVE_PIPE_BUF_OPERATIONS_PIN+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include #include int main () { struct pipe_buf_operations x; x.pin; ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_PIPE_BUF_OPERATIONS_PIN=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_PIPE_BUF_OPERATIONS_PIN=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_PIPE_BUF_OPERATIONS_PIN if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_PIPE_BUF_OPERATIONS_PIN 1 _ACEOF HAVE_PIPE_BUF_OPERATIONS_PIN=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_PIPE_BUF_OPERATIONS_PIN 0 _ACEOF HAVE_PIPE_BUF_OPERATIONS_PIN='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } if test -z "${HAVE_PIPE_BUF_OPERATIONS_PIN}"; then { $as_echo "$as_me:$LINENO: checking kernel for 2-arg pipe_ops.unmap" >&5 $as_echo_n "checking kernel for 2-arg pipe_ops.unmap... " >&6; } if test "${cr_cv_kconfig_HAVE_2_ARG_PIPE_OPS_UNMAP+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include #include int main () { struct pipe_buf_operations p; (void)p.unmap(NULL,NULL); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_2_ARG_PIPE_OPS_UNMAP=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_2_ARG_PIPE_OPS_UNMAP=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_2_ARG_PIPE_OPS_UNMAP if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_2_ARG_PIPE_OPS_UNMAP 1 _ACEOF HAVE_2_ARG_PIPE_OPS_UNMAP=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_2_ARG_PIPE_OPS_UNMAP 0 _ACEOF HAVE_2_ARG_PIPE_OPS_UNMAP='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel for 3-arg pipe_ops.unmap" >&5 $as_echo_n "checking kernel for 3-arg pipe_ops.unmap... " >&6; } if test "${cr_cv_kconfig_HAVE_3_ARG_PIPE_OPS_UNMAP+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include #include int main () { struct pipe_buf_operations p; (void)p.unmap(NULL,NULL,NULL); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_3_ARG_PIPE_OPS_UNMAP=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_3_ARG_PIPE_OPS_UNMAP=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_3_ARG_PIPE_OPS_UNMAP if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_3_ARG_PIPE_OPS_UNMAP 1 _ACEOF HAVE_3_ARG_PIPE_OPS_UNMAP=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_3_ARG_PIPE_OPS_UNMAP 0 _ACEOF HAVE_3_ARG_PIPE_OPS_UNMAP='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } fi # Require exactly one match if test "${HAVE_PIPE_INODE_INFO_BASE}${HAVE_PIPE_BUF_OPERATIONS_PIN}${HAVE_2_ARG_PIPE_OPS_UNMAP}${HAVE_3_ARG_PIPE_OPS_UNMAP}" != "1"; then 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:$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= ;; #( *) $as_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 test "x$cache_file" != "x/dev/null" && { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache echo "======================================================================" echo "Please review the following configuration information:" echo " Kernel source directory = $LINUX_SRC" echo " Kernel build directory = $LINUX_OBJ" echo " Kernel symbol table = ${LINUX_SYSTEM_MAP}${LINUX_VMLINUX}" echo " Kernel version probed from kernel build = $LINUX_VER" echo " Kernel running currently = `uname -r`" echo "======================================================================" { { $as_echo "$as_me:$LINENO: error: Unable to use kernel $LINUX_VER - unrecognized pipe buf operations" >&5 $as_echo "$as_me: error: Unable to use kernel $LINUX_VER - unrecognized pipe buf operations" >&2;} { (exit 1); exit 1; }; } fi { $as_echo "$as_me:$LINENO: checking kernel symbol table for anon_pipe_buf_ops" >&5 $as_echo_n "checking kernel symbol table for anon_pipe_buf_ops... " >&6; } # Our cacheval is encoded with 'Y' or 'N' as the first char to indicate # if a declaration was found or not, and the address or 0 as the rest. if test "${cr_cv_ksymtab_anon_pipe_buf_ops+set}" = set; then $as_echo_n "(cached) " >&6 else cr_cv_ksymtab_anon_pipe_buf_ops=`eval $LINUX_SYMTAB_CMD | sed -n -e "/${CR_KSYM_PATTERN_DATA}anon_pipe_buf_ops$/ {s/ .*//p;q;}"` if test -n "$cr_cv_ksymtab_anon_pipe_buf_ops"; then if eval $LINUX_SYMTAB_CMD | grep " __ksymtab_anon_pipe_buf_ops\$" >/dev/null ; then cr_cv_ksymtab_anon_pipe_buf_ops=0 else if test "DATA${HAVE_CONFIG_THUMB2_KERNEL}" = 'CODE1'; then cr_cv_ksymtab_anon_pipe_buf_ops=`$PERL -e "printf '%x', 1 | hex '$cr_cv_ksymtab_anon_pipe_buf_ops';"` fi fi SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #define IN_CONFIGURE 1 #include "${TOP_SRCDIR}/include/blcr_imports.h.in" int main () { int x = sizeof(&anon_pipe_buf_ops); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_anon_pipe_buf_ops="Y$cr_cv_ksymtab_anon_pipe_buf_ops" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_anon_pipe_buf_ops="N$cr_cv_ksymtab_anon_pipe_buf_ops" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi fi cr_addr='' if test -z "$cr_cv_ksymtab_anon_pipe_buf_ops"; then cr_result='not found' else if expr "$cr_cv_ksymtab_anon_pipe_buf_ops" : N >/dev/null; then cat >>$CR_KSYM_IMPORT_DECLS <<_EOF extern struct pipe_buf_operations anon_pipe_buf_ops; _EOF fi cr_result=`echo $cr_cv_ksymtab_anon_pipe_buf_ops | tr -d 'YN'` if test $cr_result = 0; then cr_result=exported cr_addr=0 else cr_addr="0x$cr_result" echo "_CR_IMPORT_KDATA(anon_pipe_buf_ops, $cr_addr)" >>$CR_KSYM_IMPORT_CALLS fi cat >>confdefs.h <<_ACEOF #define CR_KDATA_anon_pipe_buf_ops $cr_addr _ACEOF fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel for pipe_fcntl" >&5 $as_echo_n "checking kernel for pipe_fcntl... " >&6; } if test "${cr_cv_kconfig_HAVE_PIPE_FCNTL+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include #include int main () { #ifdef pipe_fcntl /* OK, it exists and is a macro */ #else /* Check for function case */ int x = sizeof(&pipe_fcntl); #endif ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_PIPE_FCNTL=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_PIPE_FCNTL=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_PIPE_FCNTL if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_PIPE_FCNTL 1 _ACEOF HAVE_PIPE_FCNTL=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_PIPE_FCNTL 0 _ACEOF HAVE_PIPE_FCNTL='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } if test "${HAVE_PIPE_FCNTL}" = "1"; then { $as_echo "$as_me:$LINENO: checking kernel symbol table for pipe_fcntl" >&5 $as_echo_n "checking kernel symbol table for pipe_fcntl... " >&6; } # Our cacheval is encoded with 'Y' or 'N' as the first char to indicate # if a declaration was found or not, and the address or 0 as the rest. if test "${cr_cv_ksymtab_pipe_fcntl+set}" = set; then $as_echo_n "(cached) " >&6 else cr_cv_ksymtab_pipe_fcntl=`eval $LINUX_SYMTAB_CMD | sed -n -e "/${CR_KSYM_PATTERN_CODE}pipe_fcntl$/ {s/ .*//p;q;}"` if test -n "$cr_cv_ksymtab_pipe_fcntl"; then if eval $LINUX_SYMTAB_CMD | grep " __ksymtab_pipe_fcntl\$" >/dev/null ; then cr_cv_ksymtab_pipe_fcntl=0 else if test "CODE${HAVE_CONFIG_THUMB2_KERNEL}" = 'CODE1'; then cr_cv_ksymtab_pipe_fcntl=`$PERL -e "printf '%x', 1 | hex '$cr_cv_ksymtab_pipe_fcntl';"` fi fi SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #define IN_CONFIGURE 1 #include "${TOP_SRCDIR}/include/blcr_imports.h.in" int main () { int x = sizeof(&pipe_fcntl); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_pipe_fcntl="Y$cr_cv_ksymtab_pipe_fcntl" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_pipe_fcntl="N$cr_cv_ksymtab_pipe_fcntl" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi fi cr_addr='' if test -z "$cr_cv_ksymtab_pipe_fcntl"; then cr_result='not found' else if expr "$cr_cv_ksymtab_pipe_fcntl" : N >/dev/null; then cat >>$CR_KSYM_IMPORT_DECLS <<_EOF long pipe_fcntl(struct file *file, unsigned int cmd, unsigned long arg); _EOF fi cr_result=`echo $cr_cv_ksymtab_pipe_fcntl | tr -d 'YN'` if test $cr_result = 0; then cr_result=exported cr_addr=0 else cr_addr="0x$cr_result" echo "_CR_IMPORT_KCODE(pipe_fcntl, $cr_addr)" >>$CR_KSYM_IMPORT_CALLS fi cat >>confdefs.h <<_ACEOF #define CR_KCODE_pipe_fcntl $cr_addr _ACEOF fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } fi # Now try to define CR_F_SETPIPE_SZ and CR_F_GETPIPE_SZ, for the pipe test. # # We try the user space headers first. If we don't find a definition, then we # poke around the kernel headers for the definition. # # If we still don't have a definition at this point, the crut test also # uses an #ifdef F_SETPIPE_SZ before using CR_F_SETPIPE_SZ, so we have # one more chance. { $as_echo "$as_me:$LINENO: checking kernel for F_SETPIPE_SZ" >&5 $as_echo_n "checking kernel for F_SETPIPE_SZ... " >&6; } if test "${cr_cv_kconfig_HAVE_F_SETPIPE_SZ+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { #ifndef F_SETPIPE_SZ choke me #endif ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_F_SETPIPE_SZ=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_F_SETPIPE_SZ=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_F_SETPIPE_SZ if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_F_SETPIPE_SZ 1 _ACEOF HAVE_F_SETPIPE_SZ=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_F_SETPIPE_SZ 0 _ACEOF HAVE_F_SETPIPE_SZ='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel for F_GETPIPE_SZ" >&5 $as_echo_n "checking kernel for F_GETPIPE_SZ... " >&6; } if test "${cr_cv_kconfig_HAVE_F_GETPIPE_SZ+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { #ifndef F_GETPIPE_SZ choke me #endif ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_F_GETPIPE_SZ=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_F_GETPIPE_SZ=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_F_GETPIPE_SZ if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_F_GETPIPE_SZ 1 _ACEOF HAVE_F_GETPIPE_SZ=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_F_GETPIPE_SZ 0 _ACEOF HAVE_F_GETPIPE_SZ='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } if test "${HAVE_F_SETPIPE_SZ}${HAVE_F_GETPIPE_SZ}" = "11"; then CR_F_SETPIPE_SZ="" { $as_echo "$as_me:$LINENO: checking for value for CR_F_SETPIPE_SZ" >&5 $as_echo_n "checking for value for CR_F_SETPIPE_SZ... " >&6; } if test "${cr_cv_compute_int_CR_F_SETPIPE_SZ+set}" = set; then $as_echo_n "(cached) " >&6 else cr_cv_compute_int_CR_F_SETPIPE_SZ="not found" if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { static int test_array [1 - 2 * !((F_SETPIPE_SZ) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { static int test_array [1 - 2 * !((F_SETPIPE_SZ) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { static int test_array [1 - 2 * !((F_SETPIPE_SZ) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { static int test_array [1 - 2 * !((F_SETPIPE_SZ) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { static int test_array [1 - 2 * !((F_SETPIPE_SZ) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) cr_cv_compute_int_CR_F_SETPIPE_SZ=$ac_lo;; '') ;; esac else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include static long int longval () { return F_SETPIPE_SZ; } static unsigned long int ulongval () { return F_SETPIPE_SZ; } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if ((F_SETPIPE_SZ) < 0) { long int i = longval (); if (i != (F_SETPIPE_SZ)) return 1; fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); if (i != (F_SETPIPE_SZ)) return 1; fprintf (f, "%lu", i); } /* Do not output a trailing newline, as this causes \r\n confusion on some platforms. */ return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF rm -f 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cr_cv_compute_int_CR_F_SETPIPE_SZ=`cat conftest.val` 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 fi rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi { $as_echo "$as_me:$LINENO: result: $cr_cv_compute_int_CR_F_SETPIPE_SZ" >&5 $as_echo "$cr_cv_compute_int_CR_F_SETPIPE_SZ" >&6; } if test "$cr_cv_compute_int_CR_F_SETPIPE_SZ" != "not found"; then CR_F_SETPIPE_SZ="$cr_cv_compute_int_CR_F_SETPIPE_SZ" fi if test -n "$CR_F_SETPIPE_SZ"; then cat >>confdefs.h <<_ACEOF #define CR_F_SETPIPE_SZ $CR_F_SETPIPE_SZ _ACEOF fi if test -z "${CR_F_SETPIPE_SZ}"; then CR_F_SETPIPE_SZ="" SAVE_CPP=$CPP SAVE_CPPFLAGS=$CPPFLAGS SAVE_cross_compiling="$cross_compiling" CPP="$KCC -E" CPPFLAGS="$KCFLAGS" cross_compiling="yes" { $as_echo "$as_me:$LINENO: checking kernel for value for CR_F_SETPIPE_SZ" >&5 $as_echo_n "checking kernel for value for CR_F_SETPIPE_SZ... " >&6; } if test "${cr_cv_compute_kernel_int_CR_F_SETPIPE_SZ+set}" = set; then $as_echo_n "(cached) " >&6 else cr_cv_compute_kernel_int_CR_F_SETPIPE_SZ="not found" if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { static int test_array [1 - 2 * !((F_SETPIPE_SZ) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { static int test_array [1 - 2 * !((F_SETPIPE_SZ) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { static int test_array [1 - 2 * !((F_SETPIPE_SZ) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { static int test_array [1 - 2 * !((F_SETPIPE_SZ) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { static int test_array [1 - 2 * !((F_SETPIPE_SZ) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) cr_cv_compute_kernel_int_CR_F_SETPIPE_SZ=$ac_lo;; '') ;; esac else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include static long int longval () { return F_SETPIPE_SZ; } static unsigned long int ulongval () { return F_SETPIPE_SZ; } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if ((F_SETPIPE_SZ) < 0) { long int i = longval (); if (i != (F_SETPIPE_SZ)) return 1; fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); if (i != (F_SETPIPE_SZ)) return 1; fprintf (f, "%lu", i); } /* Do not output a trailing newline, as this causes \r\n confusion on some platforms. */ return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF rm -f 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cr_cv_compute_kernel_int_CR_F_SETPIPE_SZ=`cat conftest.val` 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 fi rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi { $as_echo "$as_me:$LINENO: result: $cr_cv_compute_kernel_int_CR_F_SETPIPE_SZ" >&5 $as_echo "$cr_cv_compute_kernel_int_CR_F_SETPIPE_SZ" >&6; } CPP=$SAVE_CPP CPPFLAGS=$SAVE_CPPFLAGS cross_compiling="$SAVE_cross_compiling" if test "$cr_cv_compute_kernel_int_CR_F_SETPIPE_SZ" != "not found"; then CR_F_SETPIPE_SZ="$cr_cv_compute_kernel_int_CR_F_SETPIPE_SZ" fi if test -n "$CR_F_SETPIPE_SZ"; then cat >>confdefs.h <<_ACEOF #define CR_F_SETPIPE_SZ $CR_F_SETPIPE_SZ _ACEOF fi fi CR_F_GETPIPE_SZ="" { $as_echo "$as_me:$LINENO: checking for value for CR_F_GETPIPE_SZ" >&5 $as_echo_n "checking for value for CR_F_GETPIPE_SZ... " >&6; } if test "${cr_cv_compute_int_CR_F_GETPIPE_SZ+set}" = set; then $as_echo_n "(cached) " >&6 else cr_cv_compute_int_CR_F_GETPIPE_SZ="not found" if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { static int test_array [1 - 2 * !((F_GETPIPE_SZ) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { static int test_array [1 - 2 * !((F_GETPIPE_SZ) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { static int test_array [1 - 2 * !((F_GETPIPE_SZ) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { static int test_array [1 - 2 * !((F_GETPIPE_SZ) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { static int test_array [1 - 2 * !((F_GETPIPE_SZ) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) cr_cv_compute_int_CR_F_GETPIPE_SZ=$ac_lo;; '') ;; esac else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include static long int longval () { return F_GETPIPE_SZ; } static unsigned long int ulongval () { return F_GETPIPE_SZ; } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if ((F_GETPIPE_SZ) < 0) { long int i = longval (); if (i != (F_GETPIPE_SZ)) return 1; fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); if (i != (F_GETPIPE_SZ)) return 1; fprintf (f, "%lu", i); } /* Do not output a trailing newline, as this causes \r\n confusion on some platforms. */ return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF rm -f 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cr_cv_compute_int_CR_F_GETPIPE_SZ=`cat conftest.val` 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 fi rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi { $as_echo "$as_me:$LINENO: result: $cr_cv_compute_int_CR_F_GETPIPE_SZ" >&5 $as_echo "$cr_cv_compute_int_CR_F_GETPIPE_SZ" >&6; } if test "$cr_cv_compute_int_CR_F_GETPIPE_SZ" != "not found"; then CR_F_GETPIPE_SZ="$cr_cv_compute_int_CR_F_GETPIPE_SZ" fi if test -n "$CR_F_GETPIPE_SZ"; then cat >>confdefs.h <<_ACEOF #define CR_F_GETPIPE_SZ $CR_F_GETPIPE_SZ _ACEOF fi if test -z "${CR_F_GETPIPE_SZ}"; then CR_F_GETPIPE_SZ="" SAVE_CPP=$CPP SAVE_CPPFLAGS=$CPPFLAGS SAVE_cross_compiling="$cross_compiling" CPP="$KCC -E" CPPFLAGS="$KCFLAGS" cross_compiling="yes" { $as_echo "$as_me:$LINENO: checking kernel for value for CR_F_GETPIPE_SZ" >&5 $as_echo_n "checking kernel for value for CR_F_GETPIPE_SZ... " >&6; } if test "${cr_cv_compute_kernel_int_CR_F_GETPIPE_SZ+set}" = set; then $as_echo_n "(cached) " >&6 else cr_cv_compute_kernel_int_CR_F_GETPIPE_SZ="not found" if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { static int test_array [1 - 2 * !((F_GETPIPE_SZ) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { static int test_array [1 - 2 * !((F_GETPIPE_SZ) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { static int test_array [1 - 2 * !((F_GETPIPE_SZ) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { static int test_array [1 - 2 * !((F_GETPIPE_SZ) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { static int test_array [1 - 2 * !((F_GETPIPE_SZ) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) cr_cv_compute_kernel_int_CR_F_GETPIPE_SZ=$ac_lo;; '') ;; esac else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include static long int longval () { return F_GETPIPE_SZ; } static unsigned long int ulongval () { return F_GETPIPE_SZ; } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if ((F_GETPIPE_SZ) < 0) { long int i = longval (); if (i != (F_GETPIPE_SZ)) return 1; fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); if (i != (F_GETPIPE_SZ)) return 1; fprintf (f, "%lu", i); } /* Do not output a trailing newline, as this causes \r\n confusion on some platforms. */ return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF rm -f 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cr_cv_compute_kernel_int_CR_F_GETPIPE_SZ=`cat conftest.val` 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 fi rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi { $as_echo "$as_me:$LINENO: result: $cr_cv_compute_kernel_int_CR_F_GETPIPE_SZ" >&5 $as_echo "$cr_cv_compute_kernel_int_CR_F_GETPIPE_SZ" >&6; } CPP=$SAVE_CPP CPPFLAGS=$SAVE_CPPFLAGS cross_compiling="$SAVE_cross_compiling" if test "$cr_cv_compute_kernel_int_CR_F_GETPIPE_SZ" != "not found"; then CR_F_GETPIPE_SZ="$cr_cv_compute_kernel_int_CR_F_GETPIPE_SZ" fi if test -n "$CR_F_GETPIPE_SZ"; then cat >>confdefs.h <<_ACEOF #define CR_F_GETPIPE_SZ $CR_F_GETPIPE_SZ _ACEOF fi fi fi # The user space headers may not define F_SETPIPE_SZ or F_GETPIPE_SZ, # and we need these values to run the unit test, # so we define CR_F_SETPIPE_SZ and CR_F_GETPIPE_SZ to hold the values # that we find in the kernel. # For O_DIRECT support { $as_echo "$as_me:$LINENO: checking kernel for file_operations.check_flags" >&5 $as_echo_n "checking kernel for file_operations.check_flags... " >&6; } if test "${cr_cv_kconfig_HAVE_FILE_OPERATIONS_CHECK_FLAGS+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { struct file_operations x; x.check_flags; ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_FILE_OPERATIONS_CHECK_FLAGS=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_FILE_OPERATIONS_CHECK_FLAGS=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_FILE_OPERATIONS_CHECK_FLAGS if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_FILE_OPERATIONS_CHECK_FLAGS 1 _ACEOF HAVE_FILE_OPERATIONS_CHECK_FLAGS=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_FILE_OPERATIONS_CHECK_FLAGS 0 _ACEOF HAVE_FILE_OPERATIONS_CHECK_FLAGS='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel for file.f_lock" >&5 $as_echo_n "checking kernel for file.f_lock... " >&6; } if test "${cr_cv_kconfig_HAVE_FILE_F_LOCK+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { struct file x; spinlock_t tc_1 = x.f_lock; ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_FILE_F_LOCK=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_FILE_F_LOCK=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_FILE_F_LOCK if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_FILE_F_LOCK 1 _ACEOF HAVE_FILE_F_LOCK=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_FILE_F_LOCK 0 _ACEOF HAVE_FILE_F_LOCK='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel for inode.i_mapping" >&5 $as_echo_n "checking kernel for inode.i_mapping... " >&6; } if test "${cr_cv_kconfig_HAVE_INODE_I_MAPPING+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { struct inode x; struct address_space tc_1 = *(x.i_mapping); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_INODE_I_MAPPING=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_INODE_I_MAPPING=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_INODE_I_MAPPING if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_INODE_I_MAPPING 1 _ACEOF HAVE_INODE_I_MAPPING=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_INODE_I_MAPPING 0 _ACEOF HAVE_INODE_I_MAPPING='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel for file.f_mapping" >&5 $as_echo_n "checking kernel for file.f_mapping... " >&6; } if test "${cr_cv_kconfig_HAVE_FILE_F_MAPPING+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { struct file x; struct address_space tc_1 = *(x.f_mapping); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_FILE_F_MAPPING=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_FILE_F_MAPPING=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_FILE_F_MAPPING if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_FILE_F_MAPPING 1 _ACEOF HAVE_FILE_F_MAPPING=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_FILE_F_MAPPING 0 _ACEOF HAVE_FILE_F_MAPPING='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } # Require one or more match on mapping if test -z "${HAVE_INODE_I_MAPPING}${HAVE_FILE_F_MAPPING}"; then 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:$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= ;; #( *) $as_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 test "x$cache_file" != "x/dev/null" && { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache echo "======================================================================" echo "Please review the following configuration information:" echo " Kernel source directory = $LINUX_SRC" echo " Kernel build directory = $LINUX_OBJ" echo " Kernel symbol table = ${LINUX_SYSTEM_MAP}${LINUX_VMLINUX}" echo " Kernel version probed from kernel build = $LINUX_VER" echo " Kernel running currently = `uname -r`" echo "======================================================================" { { $as_echo "$as_me:$LINENO: error: Unable to use kernel $LINUX_VER - could not locate address_space in inode or file structs" >&5 $as_echo "$as_me: error: Unable to use kernel $LINUX_VER - could not locate address_space in inode or file structs" >&2;} { (exit 1); exit 1; }; } fi { $as_echo "$as_me:$LINENO: checking kernel for file_operations.unlocked_ioctl" >&5 $as_echo_n "checking kernel for file_operations.unlocked_ioctl... " >&6; } if test "${cr_cv_kconfig_HAVE_FILE_OPERATIONS_UNLOCKED_IOCTL+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { struct file_operations x; x.unlocked_ioctl; ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_FILE_OPERATIONS_UNLOCKED_IOCTL=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_FILE_OPERATIONS_UNLOCKED_IOCTL=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_FILE_OPERATIONS_UNLOCKED_IOCTL if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_FILE_OPERATIONS_UNLOCKED_IOCTL 1 _ACEOF HAVE_FILE_OPERATIONS_UNLOCKED_IOCTL=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_FILE_OPERATIONS_UNLOCKED_IOCTL 0 _ACEOF HAVE_FILE_OPERATIONS_UNLOCKED_IOCTL='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel for 4-arg do_generic_file_read" >&5 $as_echo_n "checking kernel for 4-arg do_generic_file_read... " >&6; } if test "${cr_cv_kconfig_HAVE_4_ARG_DO_GENERIC_FILE_READ+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { #ifndef do_generic_file_read /* Must be macro or have a decl */ int x = sizeof(&do_generic_file_read); #endif do_generic_file_read(NULL,NULL,NULL,NULL); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_4_ARG_DO_GENERIC_FILE_READ=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_4_ARG_DO_GENERIC_FILE_READ=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_4_ARG_DO_GENERIC_FILE_READ if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_4_ARG_DO_GENERIC_FILE_READ 1 _ACEOF HAVE_4_ARG_DO_GENERIC_FILE_READ=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_4_ARG_DO_GENERIC_FILE_READ 0 _ACEOF HAVE_4_ARG_DO_GENERIC_FILE_READ='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel for 5-arg do_generic_file_read" >&5 $as_echo_n "checking kernel for 5-arg do_generic_file_read... " >&6; } if test "${cr_cv_kconfig_HAVE_5_ARG_DO_GENERIC_FILE_READ+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { #ifndef do_generic_file_read /* Must be macro or have a decl */ int x = sizeof(&do_generic_file_read); #endif do_generic_file_read(NULL,NULL,NULL,NULL,0); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_5_ARG_DO_GENERIC_FILE_READ=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_5_ARG_DO_GENERIC_FILE_READ=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_5_ARG_DO_GENERIC_FILE_READ if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_5_ARG_DO_GENERIC_FILE_READ 1 _ACEOF HAVE_5_ARG_DO_GENERIC_FILE_READ=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_5_ARG_DO_GENERIC_FILE_READ 0 _ACEOF HAVE_5_ARG_DO_GENERIC_FILE_READ='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel for read_descriptor_t.arg.data" >&5 $as_echo_n "checking kernel for read_descriptor_t.arg.data... " >&6; } if test "${cr_cv_kconfig_HAVE_READ_DESCRIPTOR_T_ARG_DATA+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { read_descriptor_t x; void * tc_1 = x.arg.data; ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_READ_DESCRIPTOR_T_ARG_DATA=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_READ_DESCRIPTOR_T_ARG_DATA=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_READ_DESCRIPTOR_T_ARG_DATA if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_READ_DESCRIPTOR_T_ARG_DATA 1 _ACEOF HAVE_READ_DESCRIPTOR_T_ARG_DATA=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_READ_DESCRIPTOR_T_ARG_DATA 0 _ACEOF HAVE_READ_DESCRIPTOR_T_ARG_DATA='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel for read_descriptor_t.buf" >&5 $as_echo_n "checking kernel for read_descriptor_t.buf... " >&6; } if test "${cr_cv_kconfig_HAVE_READ_DESCRIPTOR_T_BUF+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { read_descriptor_t x; char tc_1 = *(x.buf); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_READ_DESCRIPTOR_T_BUF=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_READ_DESCRIPTOR_T_BUF=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_READ_DESCRIPTOR_T_BUF if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_READ_DESCRIPTOR_T_BUF 1 _ACEOF HAVE_READ_DESCRIPTOR_T_BUF=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_READ_DESCRIPTOR_T_BUF 0 _ACEOF HAVE_READ_DESCRIPTOR_T_BUF='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } if test "${HAVE_READ_DESCRIPTOR_T_ARG_DATA}${HAVE_READ_DESCRIPTOR_T_BUF}" != "1"; then 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:$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= ;; #( *) $as_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 test "x$cache_file" != "x/dev/null" && { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache echo "======================================================================" echo "Please review the following configuration information:" echo " Kernel source directory = $LINUX_SRC" echo " Kernel build directory = $LINUX_OBJ" echo " Kernel symbol table = ${LINUX_SYSTEM_MAP}${LINUX_VMLINUX}" echo " Kernel version probed from kernel build = $LINUX_VER" echo " Kernel running currently = `uname -r`" echo "======================================================================" { { $as_echo "$as_me:$LINENO: error: Unable to use kernel $LINUX_VER - unable to determine how to use do_generic_file_read()" >&5 $as_echo "$as_me: error: Unable to use kernel $LINUX_VER - unable to determine how to use do_generic_file_read()" >&2;} { (exit 1); exit 1; }; } fi { $as_echo "$as_me:$LINENO: checking kernel for splice_direct_to_actor" >&5 $as_echo_n "checking kernel for splice_direct_to_actor... " >&6; } if test "${cr_cv_kconfig_HAVE_SPLICE_DIRECT_TO_ACTOR+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include #include int main () { #ifdef splice_direct_to_actor /* OK, it exists and is a macro */ #else /* Check for function case */ int x = sizeof(&splice_direct_to_actor); #endif ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_SPLICE_DIRECT_TO_ACTOR=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_SPLICE_DIRECT_TO_ACTOR=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_SPLICE_DIRECT_TO_ACTOR if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_SPLICE_DIRECT_TO_ACTOR 1 _ACEOF HAVE_SPLICE_DIRECT_TO_ACTOR=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_SPLICE_DIRECT_TO_ACTOR 0 _ACEOF HAVE_SPLICE_DIRECT_TO_ACTOR='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel for task.ptrace" >&5 $as_echo_n "checking kernel for task.ptrace... " >&6; } if test "${cr_cv_kconfig_HAVE_TASK_PTRACE+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { struct task_struct x; unsigned long tc_1 = x.ptrace; ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_TASK_PTRACE=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_TASK_PTRACE=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_TASK_PTRACE if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_TASK_PTRACE 1 _ACEOF HAVE_TASK_PTRACE=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_TASK_PTRACE 0 _ACEOF HAVE_TASK_PTRACE='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel for task.ptracees" >&5 $as_echo_n "checking kernel for task.ptracees... " >&6; } if test "${cr_cv_kconfig_HAVE_TASK_PTRACEES+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { struct task_struct x; struct list_head tc_1 = x.ptracees; ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_TASK_PTRACEES=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_TASK_PTRACEES=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_TASK_PTRACEES if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_TASK_PTRACEES 1 _ACEOF HAVE_TASK_PTRACEES=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_TASK_PTRACEES 0 _ACEOF HAVE_TASK_PTRACEES='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel for task.ptraced" >&5 $as_echo_n "checking kernel for task.ptraced... " >&6; } if test "${cr_cv_kconfig_HAVE_TASK_PTRACED+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { struct task_struct x; struct list_head tc_1 = x.ptraced; ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_TASK_PTRACED=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_TASK_PTRACED=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_TASK_PTRACED if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_TASK_PTRACED 1 _ACEOF HAVE_TASK_PTRACED=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_TASK_PTRACED 0 _ACEOF HAVE_TASK_PTRACED='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } if test -n "${HAVE_TASK_PTRACEES}"; then { $as_echo "$as_me:$LINENO: checking kernel symbol table for ptrace_utrace_ops" >&5 $as_echo_n "checking kernel symbol table for ptrace_utrace_ops... " >&6; } # Our cacheval is encoded with 'Y' or 'N' as the first char to indicate # if a declaration was found or not, and the address or 0 as the rest. if test "${cr_cv_ksymtab_ptrace_utrace_ops+set}" = set; then $as_echo_n "(cached) " >&6 else cr_cv_ksymtab_ptrace_utrace_ops=`eval $LINUX_SYMTAB_CMD | sed -n -e "/${CR_KSYM_PATTERN_DATA}ptrace_utrace_ops$/ {s/ .*//p;q;}"` if test -n "$cr_cv_ksymtab_ptrace_utrace_ops"; then if eval $LINUX_SYMTAB_CMD | grep " __ksymtab_ptrace_utrace_ops\$" >/dev/null ; then cr_cv_ksymtab_ptrace_utrace_ops=0 else if test "DATA${HAVE_CONFIG_THUMB2_KERNEL}" = 'CODE1'; then cr_cv_ksymtab_ptrace_utrace_ops=`$PERL -e "printf '%x', 1 | hex '$cr_cv_ksymtab_ptrace_utrace_ops';"` fi fi SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #define IN_CONFIGURE 1 #include "${TOP_SRCDIR}/include/blcr_imports.h.in" int main () { int x = sizeof(&ptrace_utrace_ops); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_ptrace_utrace_ops="Y$cr_cv_ksymtab_ptrace_utrace_ops" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_ptrace_utrace_ops="N$cr_cv_ksymtab_ptrace_utrace_ops" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi fi cr_addr='' if test -z "$cr_cv_ksymtab_ptrace_utrace_ops"; then cr_result='not found' else if expr "$cr_cv_ksymtab_ptrace_utrace_ops" : N >/dev/null; then cat >>$CR_KSYM_IMPORT_DECLS <<_EOF extern struct utrace_engine_ops ptrace_utrace_ops; _EOF fi cr_result=`echo $cr_cv_ksymtab_ptrace_utrace_ops | tr -d 'YN'` if test $cr_result = 0; then cr_result=exported cr_addr=0 else cr_addr="0x$cr_result" echo "_CR_IMPORT_KDATA(ptrace_utrace_ops, $cr_addr)" >>$CR_KSYM_IMPORT_CALLS fi cat >>confdefs.h <<_ACEOF #define CR_KDATA_ptrace_utrace_ops $cr_addr _ACEOF fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } if test -z "$cr_addr"; then { { $as_echo "$as_me:$LINENO: error: failed to find symbol ptrace_utrace_ops" >&5 $as_echo "$as_me: error: failed to find symbol ptrace_utrace_ops" >&2;} { (exit 1); exit 1; }; } fi fi if test "${HAVE_TASK_PTRACE}${HAVE_TASK_PTRACEES}" != "1"; then 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:$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= ;; #( *) $as_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 test "x$cache_file" != "x/dev/null" && { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache echo "======================================================================" echo "Please review the following configuration information:" echo " Kernel source directory = $LINUX_SRC" echo " Kernel build directory = $LINUX_OBJ" echo " Kernel symbol table = ${LINUX_SYSTEM_MAP}${LINUX_VMLINUX}" echo " Kernel version probed from kernel build = $LINUX_VER" echo " Kernel running currently = `uname -r`" echo "======================================================================" { { $as_echo "$as_me:$LINENO: error: Unable to use kernel $LINUX_VER - unable to determine how to identify ptrace()ed/ing processes" >&5 $as_echo "$as_me: error: Unable to use kernel $LINUX_VER - unable to determine how to identify ptrace()ed/ing processes" >&2;} { (exit 1); exit 1; }; } fi { $as_echo "$as_me:$LINENO: checking kernel for proc_root" >&5 $as_echo_n "checking kernel for proc_root... " >&6; } if test "${cr_cv_kconfig_HAVE_PROC_ROOT+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { int x = sizeof(&proc_root); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_PROC_ROOT=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_PROC_ROOT=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_PROC_ROOT if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_PROC_ROOT 1 _ACEOF HAVE_PROC_ROOT=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_PROC_ROOT 0 _ACEOF HAVE_PROC_ROOT='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } # check kmalloc max size { $as_echo "$as_me:$LINENO: checking kernel for maximum kmalloc() allocation" >&5 $as_echo_n "checking kernel for maximum kmalloc() allocation... " >&6; } if test "${cr_cv_kconfig_kmalloc_max+set}" = set; then $as_echo_n "(cached) " >&6 else cr_kmalloc_default="131072 (default)" cr_header="${LINUX_OBJ}/include/generated/autoconf.h" test -e "$cr_header" || cr_header="${LINUX_OBJ}/include/linux/autoconf.h" cr_cv_kconfig_kmalloc_max=`eval "$CPP $CPPFLAGS -I${LINUX_OBJ}/include \ -include ${cr_header} \ ${LINUX_OBJ}/include/linux/kmalloc_sizes.h" 2>/dev/null | \ $PERL -n -e 'BEGIN {$max=0;}' \ -e 'if (/CACHE\s*\(\s*([0-9]+)\s*\)/ && ($1 > $max)) { $max = $1; }' \ -e 'END {print "$max\n";}'` if test $? = 0 -a "$cr_cv_kconfig_kmalloc_max" != 0; then : # OK - keep it else cr_cv_kconfig_kmalloc_max="$cr_kmalloc_default" fi fi { $as_echo "$as_me:$LINENO: result: $cr_cv_kconfig_kmalloc_max" >&5 $as_echo "$cr_cv_kconfig_kmalloc_max" >&6; } cr_kmalloc_max=`echo $cr_cv_kconfig_kmalloc_max | cut -d' ' -f1` cat >>confdefs.h <<_ACEOF #define CR_KMALLOC_MAX $cr_kmalloc_max _ACEOF ## Now we check for some additional (potentially) non-exported kernel symbols... # DATA { $as_echo "$as_me:$LINENO: checking kernel symbol table for tasklist_lock" >&5 $as_echo_n "checking kernel symbol table for tasklist_lock... " >&6; } # Our cacheval is encoded with 'Y' or 'N' as the first char to indicate # if a declaration was found or not, and the address or 0 as the rest. if test "${cr_cv_ksymtab_tasklist_lock+set}" = set; then $as_echo_n "(cached) " >&6 else cr_cv_ksymtab_tasklist_lock=`eval $LINUX_SYMTAB_CMD | sed -n -e "/${CR_KSYM_PATTERN_DATA}tasklist_lock$/ {s/ .*//p;q;}"` if test -n "$cr_cv_ksymtab_tasklist_lock"; then if eval $LINUX_SYMTAB_CMD | grep " __ksymtab_tasklist_lock\$" >/dev/null ; then cr_cv_ksymtab_tasklist_lock=0 else if test "DATA${HAVE_CONFIG_THUMB2_KERNEL}" = 'CODE1'; then cr_cv_ksymtab_tasklist_lock=`$PERL -e "printf '%x', 1 | hex '$cr_cv_ksymtab_tasklist_lock';"` fi fi SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #define IN_CONFIGURE 1 #include "${TOP_SRCDIR}/include/blcr_imports.h.in" int main () { int x = sizeof(&tasklist_lock); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_tasklist_lock="Y$cr_cv_ksymtab_tasklist_lock" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_tasklist_lock="N$cr_cv_ksymtab_tasklist_lock" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi fi cr_addr='' if test -z "$cr_cv_ksymtab_tasklist_lock"; then cr_result='not found' else if expr "$cr_cv_ksymtab_tasklist_lock" : N >/dev/null; then { { $as_echo "$as_me:$LINENO: error: Found symbol tasklist_lock but no declaration -- please file a bug report." >&5 $as_echo "$as_me: error: Found symbol tasklist_lock but no declaration -- please file a bug report." >&2;} { (exit 1); exit 1; }; } fi cr_result=`echo $cr_cv_ksymtab_tasklist_lock | tr -d 'YN'` if test $cr_result = 0; then cr_result=exported cr_addr=0 else cr_addr="0x$cr_result" echo "_CR_IMPORT_KDATA(tasklist_lock, $cr_addr)" >>$CR_KSYM_IMPORT_CALLS fi cat >>confdefs.h <<_ACEOF #define CR_KDATA_tasklist_lock $cr_addr _ACEOF fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel symbol table for shmem_file_operations" >&5 $as_echo_n "checking kernel symbol table for shmem_file_operations... " >&6; } # Our cacheval is encoded with 'Y' or 'N' as the first char to indicate # if a declaration was found or not, and the address or 0 as the rest. if test "${cr_cv_ksymtab_shmem_file_operations+set}" = set; then $as_echo_n "(cached) " >&6 else cr_cv_ksymtab_shmem_file_operations=`eval $LINUX_SYMTAB_CMD | sed -n -e "/${CR_KSYM_PATTERN_DATA}shmem_file_operations$/ {s/ .*//p;q;}"` if test -n "$cr_cv_ksymtab_shmem_file_operations"; then if eval $LINUX_SYMTAB_CMD | grep " __ksymtab_shmem_file_operations\$" >/dev/null ; then cr_cv_ksymtab_shmem_file_operations=0 else if test "DATA${HAVE_CONFIG_THUMB2_KERNEL}" = 'CODE1'; then cr_cv_ksymtab_shmem_file_operations=`$PERL -e "printf '%x', 1 | hex '$cr_cv_ksymtab_shmem_file_operations';"` fi fi SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #define IN_CONFIGURE 1 #include "${TOP_SRCDIR}/include/blcr_imports.h.in" int main () { int x = sizeof(&shmem_file_operations); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_shmem_file_operations="Y$cr_cv_ksymtab_shmem_file_operations" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_shmem_file_operations="N$cr_cv_ksymtab_shmem_file_operations" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi fi cr_addr='' if test -z "$cr_cv_ksymtab_shmem_file_operations"; then cr_result='not found' else if expr "$cr_cv_ksymtab_shmem_file_operations" : N >/dev/null; then cat >>$CR_KSYM_IMPORT_DECLS <<_EOF extern const struct file_operations shmem_file_operations; _EOF fi cr_result=`echo $cr_cv_ksymtab_shmem_file_operations | tr -d 'YN'` if test $cr_result = 0; then cr_result=exported cr_addr=0 else cr_addr="0x$cr_result" echo "_CR_IMPORT_KDATA(shmem_file_operations, $cr_addr)" >>$CR_KSYM_IMPORT_CALLS fi cat >>confdefs.h <<_ACEOF #define CR_KDATA_shmem_file_operations $cr_addr _ACEOF fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel symbol table for ramfs_file_operations" >&5 $as_echo_n "checking kernel symbol table for ramfs_file_operations... " >&6; } # Our cacheval is encoded with 'Y' or 'N' as the first char to indicate # if a declaration was found or not, and the address or 0 as the rest. if test "${cr_cv_ksymtab_ramfs_file_operations+set}" = set; then $as_echo_n "(cached) " >&6 else cr_cv_ksymtab_ramfs_file_operations=`eval $LINUX_SYMTAB_CMD | sed -n -e "/${CR_KSYM_PATTERN_DATA}ramfs_file_operations$/ {s/ .*//p;q;}"` if test -n "$cr_cv_ksymtab_ramfs_file_operations"; then if eval $LINUX_SYMTAB_CMD | grep " __ksymtab_ramfs_file_operations\$" >/dev/null ; then cr_cv_ksymtab_ramfs_file_operations=0 else if test "DATA${HAVE_CONFIG_THUMB2_KERNEL}" = 'CODE1'; then cr_cv_ksymtab_ramfs_file_operations=`$PERL -e "printf '%x', 1 | hex '$cr_cv_ksymtab_ramfs_file_operations';"` fi fi SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #define IN_CONFIGURE 1 #include "${TOP_SRCDIR}/include/blcr_imports.h.in" int main () { int x = sizeof(&ramfs_file_operations); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_ramfs_file_operations="Y$cr_cv_ksymtab_ramfs_file_operations" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_ramfs_file_operations="N$cr_cv_ksymtab_ramfs_file_operations" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi fi cr_addr='' if test -z "$cr_cv_ksymtab_ramfs_file_operations"; then cr_result='not found' else if expr "$cr_cv_ksymtab_ramfs_file_operations" : N >/dev/null; then cat >>$CR_KSYM_IMPORT_DECLS <<_EOF extern const struct file_operations ramfs_file_operations; _EOF fi cr_result=`echo $cr_cv_ksymtab_ramfs_file_operations | tr -d 'YN'` if test $cr_result = 0; then cr_result=exported cr_addr=0 else cr_addr="0x$cr_result" echo "_CR_IMPORT_KDATA(ramfs_file_operations, $cr_addr)" >>$CR_KSYM_IMPORT_CALLS fi cat >>confdefs.h <<_ACEOF #define CR_KDATA_ramfs_file_operations $cr_addr _ACEOF fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel symbol table for HPAGE_SHIFT" >&5 $as_echo_n "checking kernel symbol table for HPAGE_SHIFT... " >&6; } # Our cacheval is encoded with 'Y' or 'N' as the first char to indicate # if a declaration was found or not, and the address or 0 as the rest. if test "${cr_cv_ksymtab_HPAGE_SHIFT+set}" = set; then $as_echo_n "(cached) " >&6 else cr_cv_ksymtab_HPAGE_SHIFT=`eval $LINUX_SYMTAB_CMD | sed -n -e "/${CR_KSYM_PATTERN_DATA}HPAGE_SHIFT$/ {s/ .*//p;q;}"` if test -n "$cr_cv_ksymtab_HPAGE_SHIFT"; then if eval $LINUX_SYMTAB_CMD | grep " __ksymtab_HPAGE_SHIFT\$" >/dev/null ; then cr_cv_ksymtab_HPAGE_SHIFT=0 else if test "DATA${HAVE_CONFIG_THUMB2_KERNEL}" = 'CODE1'; then cr_cv_ksymtab_HPAGE_SHIFT=`$PERL -e "printf '%x', 1 | hex '$cr_cv_ksymtab_HPAGE_SHIFT';"` fi fi SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #define IN_CONFIGURE 1 #include "${TOP_SRCDIR}/include/blcr_imports.h.in" int main () { int x = sizeof(&HPAGE_SHIFT); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_HPAGE_SHIFT="Y$cr_cv_ksymtab_HPAGE_SHIFT" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_HPAGE_SHIFT="N$cr_cv_ksymtab_HPAGE_SHIFT" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi fi cr_addr='' if test -z "$cr_cv_ksymtab_HPAGE_SHIFT"; then cr_result='not found' else if expr "$cr_cv_ksymtab_HPAGE_SHIFT" : N >/dev/null; then cat >>$CR_KSYM_IMPORT_DECLS <<_EOF extern unsigned int HPAGE_SHIFT; _EOF fi cr_result=`echo $cr_cv_ksymtab_HPAGE_SHIFT | tr -d 'YN'` if test $cr_result = 0; then cr_result=exported cr_addr=0 else cr_addr="0x$cr_result" echo "_CR_IMPORT_KDATA(HPAGE_SHIFT, $cr_addr)" >>$CR_KSYM_IMPORT_CALLS fi cat >>confdefs.h <<_ACEOF #define CR_KDATA_HPAGE_SHIFT $cr_addr _ACEOF fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel symbol table for phys_base" >&5 $as_echo_n "checking kernel symbol table for phys_base... " >&6; } # Our cacheval is encoded with 'Y' or 'N' as the first char to indicate # if a declaration was found or not, and the address or 0 as the rest. if test "${cr_cv_ksymtab_phys_base+set}" = set; then $as_echo_n "(cached) " >&6 else cr_cv_ksymtab_phys_base=`eval $LINUX_SYMTAB_CMD | sed -n -e "/${CR_KSYM_PATTERN_DATA}phys_base$/ {s/ .*//p;q;}"` if test -n "$cr_cv_ksymtab_phys_base"; then if eval $LINUX_SYMTAB_CMD | grep " __ksymtab_phys_base\$" >/dev/null ; then cr_cv_ksymtab_phys_base=0 else if test "DATA${HAVE_CONFIG_THUMB2_KERNEL}" = 'CODE1'; then cr_cv_ksymtab_phys_base=`$PERL -e "printf '%x', 1 | hex '$cr_cv_ksymtab_phys_base';"` fi fi SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #define IN_CONFIGURE 1 #include "${TOP_SRCDIR}/include/blcr_imports.h.in" int main () { int x = sizeof(&phys_base); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_phys_base="Y$cr_cv_ksymtab_phys_base" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_phys_base="N$cr_cv_ksymtab_phys_base" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi fi cr_addr='' if test -z "$cr_cv_ksymtab_phys_base"; then cr_result='not found' else if expr "$cr_cv_ksymtab_phys_base" : N >/dev/null; then cat >>$CR_KSYM_IMPORT_DECLS <<_EOF extern unsigned long phys_base; _EOF fi cr_result=`echo $cr_cv_ksymtab_phys_base | tr -d 'YN'` if test $cr_result = 0; then cr_result=exported cr_addr=0 else cr_addr="0x$cr_result" echo "_CR_IMPORT_KDATA(phys_base, $cr_addr)" >>$CR_KSYM_IMPORT_CALLS fi cat >>confdefs.h <<_ACEOF #define CR_KDATA_phys_base $cr_addr _ACEOF fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } # CODE { $as_echo "$as_me:$LINENO: checking kernel symbol table for do_pipe" >&5 $as_echo_n "checking kernel symbol table for do_pipe... " >&6; } # Our cacheval is encoded with 'Y' or 'N' as the first char to indicate # if a declaration was found or not, and the address or 0 as the rest. if test "${cr_cv_ksymtab_do_pipe+set}" = set; then $as_echo_n "(cached) " >&6 else cr_cv_ksymtab_do_pipe=`eval $LINUX_SYMTAB_CMD | sed -n -e "/${CR_KSYM_PATTERN_CODE}do_pipe$/ {s/ .*//p;q;}"` if test -n "$cr_cv_ksymtab_do_pipe"; then if eval $LINUX_SYMTAB_CMD | grep " __ksymtab_do_pipe\$" >/dev/null ; then cr_cv_ksymtab_do_pipe=0 else if test "CODE${HAVE_CONFIG_THUMB2_KERNEL}" = 'CODE1'; then cr_cv_ksymtab_do_pipe=`$PERL -e "printf '%x', 1 | hex '$cr_cv_ksymtab_do_pipe';"` fi fi SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #define IN_CONFIGURE 1 #include "${TOP_SRCDIR}/include/blcr_imports.h.in" int main () { int x = sizeof(&do_pipe); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_do_pipe="Y$cr_cv_ksymtab_do_pipe" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_do_pipe="N$cr_cv_ksymtab_do_pipe" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi fi cr_addr='' if test -z "$cr_cv_ksymtab_do_pipe"; then cr_result='not found' else if expr "$cr_cv_ksymtab_do_pipe" : N >/dev/null; then { { $as_echo "$as_me:$LINENO: error: Found symbol do_pipe but no declaration -- please file a bug report." >&5 $as_echo "$as_me: error: Found symbol do_pipe but no declaration -- please file a bug report." >&2;} { (exit 1); exit 1; }; } fi cr_result=`echo $cr_cv_ksymtab_do_pipe | tr -d 'YN'` if test $cr_result = 0; then cr_result=exported cr_addr=0 else cr_addr="0x$cr_result" echo "_CR_IMPORT_KCODE(do_pipe, $cr_addr)" >>$CR_KSYM_IMPORT_CALLS fi cat >>confdefs.h <<_ACEOF #define CR_KCODE_do_pipe $cr_addr _ACEOF fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel symbol table for do_pipe_flags" >&5 $as_echo_n "checking kernel symbol table for do_pipe_flags... " >&6; } # Our cacheval is encoded with 'Y' or 'N' as the first char to indicate # if a declaration was found or not, and the address or 0 as the rest. if test "${cr_cv_ksymtab_do_pipe_flags+set}" = set; then $as_echo_n "(cached) " >&6 else cr_cv_ksymtab_do_pipe_flags=`eval $LINUX_SYMTAB_CMD | sed -n -e "/${CR_KSYM_PATTERN_CODE}do_pipe_flags$/ {s/ .*//p;q;}"` if test -n "$cr_cv_ksymtab_do_pipe_flags"; then if eval $LINUX_SYMTAB_CMD | grep " __ksymtab_do_pipe_flags\$" >/dev/null ; then cr_cv_ksymtab_do_pipe_flags=0 else if test "CODE${HAVE_CONFIG_THUMB2_KERNEL}" = 'CODE1'; then cr_cv_ksymtab_do_pipe_flags=`$PERL -e "printf '%x', 1 | hex '$cr_cv_ksymtab_do_pipe_flags';"` fi fi SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #define IN_CONFIGURE 1 #include "${TOP_SRCDIR}/include/blcr_imports.h.in" int main () { int x = sizeof(&do_pipe_flags); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_do_pipe_flags="Y$cr_cv_ksymtab_do_pipe_flags" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_do_pipe_flags="N$cr_cv_ksymtab_do_pipe_flags" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi fi cr_addr='' if test -z "$cr_cv_ksymtab_do_pipe_flags"; then cr_result='not found' else if expr "$cr_cv_ksymtab_do_pipe_flags" : N >/dev/null; then { { $as_echo "$as_me:$LINENO: error: Found symbol do_pipe_flags but no declaration -- please file a bug report." >&5 $as_echo "$as_me: error: Found symbol do_pipe_flags but no declaration -- please file a bug report." >&2;} { (exit 1); exit 1; }; } fi cr_result=`echo $cr_cv_ksymtab_do_pipe_flags | tr -d 'YN'` if test $cr_result = 0; then cr_result=exported cr_addr=0 else cr_addr="0x$cr_result" echo "_CR_IMPORT_KCODE(do_pipe_flags, $cr_addr)" >>$CR_KSYM_IMPORT_CALLS fi cat >>confdefs.h <<_ACEOF #define CR_KCODE_do_pipe_flags $cr_addr _ACEOF fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel symbol table for sys_munmap" >&5 $as_echo_n "checking kernel symbol table for sys_munmap... " >&6; } # Our cacheval is encoded with 'Y' or 'N' as the first char to indicate # if a declaration was found or not, and the address or 0 as the rest. if test "${cr_cv_ksymtab_sys_munmap+set}" = set; then $as_echo_n "(cached) " >&6 else cr_cv_ksymtab_sys_munmap=`eval $LINUX_SYMTAB_CMD | sed -n -e "/${CR_KSYM_PATTERN_CODE}sys_munmap$/ {s/ .*//p;q;}"` if test -n "$cr_cv_ksymtab_sys_munmap"; then if eval $LINUX_SYMTAB_CMD | grep " __ksymtab_sys_munmap\$" >/dev/null ; then cr_cv_ksymtab_sys_munmap=0 else if test "CODE${HAVE_CONFIG_THUMB2_KERNEL}" = 'CODE1'; then cr_cv_ksymtab_sys_munmap=`$PERL -e "printf '%x', 1 | hex '$cr_cv_ksymtab_sys_munmap';"` fi fi SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #define IN_CONFIGURE 1 #include "${TOP_SRCDIR}/include/blcr_imports.h.in" int main () { int x = sizeof(&sys_munmap); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_sys_munmap="Y$cr_cv_ksymtab_sys_munmap" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_sys_munmap="N$cr_cv_ksymtab_sys_munmap" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi fi cr_addr='' if test -z "$cr_cv_ksymtab_sys_munmap"; then cr_result='not found' else if expr "$cr_cv_ksymtab_sys_munmap" : N >/dev/null; then cat >>$CR_KSYM_IMPORT_DECLS <<_EOF extern asmlinkage long sys_munmap(unsigned long addr, size_t len); _EOF fi cr_result=`echo $cr_cv_ksymtab_sys_munmap | tr -d 'YN'` if test $cr_result = 0; then cr_result=exported cr_addr=0 else cr_addr="0x$cr_result" echo "_CR_IMPORT_KCODE(sys_munmap, $cr_addr)" >>$CR_KSYM_IMPORT_CALLS fi cat >>confdefs.h <<_ACEOF #define CR_KCODE_sys_munmap $cr_addr _ACEOF fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel symbol table for sys_dup2" >&5 $as_echo_n "checking kernel symbol table for sys_dup2... " >&6; } # Our cacheval is encoded with 'Y' or 'N' as the first char to indicate # if a declaration was found or not, and the address or 0 as the rest. if test "${cr_cv_ksymtab_sys_dup2+set}" = set; then $as_echo_n "(cached) " >&6 else cr_cv_ksymtab_sys_dup2=`eval $LINUX_SYMTAB_CMD | sed -n -e "/${CR_KSYM_PATTERN_CODE}sys_dup2$/ {s/ .*//p;q;}"` if test -n "$cr_cv_ksymtab_sys_dup2"; then if eval $LINUX_SYMTAB_CMD | grep " __ksymtab_sys_dup2\$" >/dev/null ; then cr_cv_ksymtab_sys_dup2=0 else if test "CODE${HAVE_CONFIG_THUMB2_KERNEL}" = 'CODE1'; then cr_cv_ksymtab_sys_dup2=`$PERL -e "printf '%x', 1 | hex '$cr_cv_ksymtab_sys_dup2';"` fi fi SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #define IN_CONFIGURE 1 #include "${TOP_SRCDIR}/include/blcr_imports.h.in" int main () { int x = sizeof(&sys_dup2); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_sys_dup2="Y$cr_cv_ksymtab_sys_dup2" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_sys_dup2="N$cr_cv_ksymtab_sys_dup2" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi fi cr_addr='' if test -z "$cr_cv_ksymtab_sys_dup2"; then cr_result='not found' else if expr "$cr_cv_ksymtab_sys_dup2" : N >/dev/null; then cat >>$CR_KSYM_IMPORT_DECLS <<_EOF extern asmlinkage long sys_dup2(unsigned int oldfd, unsigned int newfd); _EOF fi cr_result=`echo $cr_cv_ksymtab_sys_dup2 | tr -d 'YN'` if test $cr_result = 0; then cr_result=exported cr_addr=0 else cr_addr="0x$cr_result" echo "_CR_IMPORT_KCODE(sys_dup2, $cr_addr)" >>$CR_KSYM_IMPORT_CALLS fi cat >>confdefs.h <<_ACEOF #define CR_KCODE_sys_dup2 $cr_addr _ACEOF fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel symbol table for sys_lseek" >&5 $as_echo_n "checking kernel symbol table for sys_lseek... " >&6; } # Our cacheval is encoded with 'Y' or 'N' as the first char to indicate # if a declaration was found or not, and the address or 0 as the rest. if test "${cr_cv_ksymtab_sys_lseek+set}" = set; then $as_echo_n "(cached) " >&6 else cr_cv_ksymtab_sys_lseek=`eval $LINUX_SYMTAB_CMD | sed -n -e "/${CR_KSYM_PATTERN_CODE}sys_lseek$/ {s/ .*//p;q;}"` if test -n "$cr_cv_ksymtab_sys_lseek"; then if eval $LINUX_SYMTAB_CMD | grep " __ksymtab_sys_lseek\$" >/dev/null ; then cr_cv_ksymtab_sys_lseek=0 else if test "CODE${HAVE_CONFIG_THUMB2_KERNEL}" = 'CODE1'; then cr_cv_ksymtab_sys_lseek=`$PERL -e "printf '%x', 1 | hex '$cr_cv_ksymtab_sys_lseek';"` fi fi SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #define IN_CONFIGURE 1 #include "${TOP_SRCDIR}/include/blcr_imports.h.in" int main () { int x = sizeof(&sys_lseek); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_sys_lseek="Y$cr_cv_ksymtab_sys_lseek" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_sys_lseek="N$cr_cv_ksymtab_sys_lseek" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi fi cr_addr='' if test -z "$cr_cv_ksymtab_sys_lseek"; then cr_result='not found' else if expr "$cr_cv_ksymtab_sys_lseek" : N >/dev/null; then cat >>$CR_KSYM_IMPORT_DECLS <<_EOF extern asmlinkage off_t sys_lseek(unsigned int fd, off_t offset, unsigned int origin); _EOF fi cr_result=`echo $cr_cv_ksymtab_sys_lseek | tr -d 'YN'` if test $cr_result = 0; then cr_result=exported cr_addr=0 else cr_addr="0x$cr_result" echo "_CR_IMPORT_KCODE(sys_lseek, $cr_addr)" >>$CR_KSYM_IMPORT_CALLS fi cat >>confdefs.h <<_ACEOF #define CR_KCODE_sys_lseek $cr_addr _ACEOF fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel symbol table for sys_ftruncate" >&5 $as_echo_n "checking kernel symbol table for sys_ftruncate... " >&6; } # Our cacheval is encoded with 'Y' or 'N' as the first char to indicate # if a declaration was found or not, and the address or 0 as the rest. if test "${cr_cv_ksymtab_sys_ftruncate+set}" = set; then $as_echo_n "(cached) " >&6 else cr_cv_ksymtab_sys_ftruncate=`eval $LINUX_SYMTAB_CMD | sed -n -e "/${CR_KSYM_PATTERN_CODE}sys_ftruncate$/ {s/ .*//p;q;}"` if test -n "$cr_cv_ksymtab_sys_ftruncate"; then if eval $LINUX_SYMTAB_CMD | grep " __ksymtab_sys_ftruncate\$" >/dev/null ; then cr_cv_ksymtab_sys_ftruncate=0 else if test "CODE${HAVE_CONFIG_THUMB2_KERNEL}" = 'CODE1'; then cr_cv_ksymtab_sys_ftruncate=`$PERL -e "printf '%x', 1 | hex '$cr_cv_ksymtab_sys_ftruncate';"` fi fi SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #define IN_CONFIGURE 1 #include "${TOP_SRCDIR}/include/blcr_imports.h.in" int main () { int x = sizeof(&sys_ftruncate); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_sys_ftruncate="Y$cr_cv_ksymtab_sys_ftruncate" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_sys_ftruncate="N$cr_cv_ksymtab_sys_ftruncate" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi fi cr_addr='' if test -z "$cr_cv_ksymtab_sys_ftruncate"; then cr_result='not found' else if expr "$cr_cv_ksymtab_sys_ftruncate" : N >/dev/null; then cat >>$CR_KSYM_IMPORT_DECLS <<_EOF extern asmlinkage long sys_ftruncate(unsigned int fd, unsigned long length); _EOF fi cr_result=`echo $cr_cv_ksymtab_sys_ftruncate | tr -d 'YN'` if test $cr_result = 0; then cr_result=exported cr_addr=0 else cr_addr="0x$cr_result" echo "_CR_IMPORT_KCODE(sys_ftruncate, $cr_addr)" >>$CR_KSYM_IMPORT_CALLS fi cat >>confdefs.h <<_ACEOF #define CR_KCODE_sys_ftruncate $cr_addr _ACEOF fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel symbol table for sys_mprotect" >&5 $as_echo_n "checking kernel symbol table for sys_mprotect... " >&6; } # Our cacheval is encoded with 'Y' or 'N' as the first char to indicate # if a declaration was found or not, and the address or 0 as the rest. if test "${cr_cv_ksymtab_sys_mprotect+set}" = set; then $as_echo_n "(cached) " >&6 else cr_cv_ksymtab_sys_mprotect=`eval $LINUX_SYMTAB_CMD | sed -n -e "/${CR_KSYM_PATTERN_CODE}sys_mprotect$/ {s/ .*//p;q;}"` if test -n "$cr_cv_ksymtab_sys_mprotect"; then if eval $LINUX_SYMTAB_CMD | grep " __ksymtab_sys_mprotect\$" >/dev/null ; then cr_cv_ksymtab_sys_mprotect=0 else if test "CODE${HAVE_CONFIG_THUMB2_KERNEL}" = 'CODE1'; then cr_cv_ksymtab_sys_mprotect=`$PERL -e "printf '%x', 1 | hex '$cr_cv_ksymtab_sys_mprotect';"` fi fi SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #define IN_CONFIGURE 1 #include "${TOP_SRCDIR}/include/blcr_imports.h.in" int main () { int x = sizeof(&sys_mprotect); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_sys_mprotect="Y$cr_cv_ksymtab_sys_mprotect" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_sys_mprotect="N$cr_cv_ksymtab_sys_mprotect" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi fi cr_addr='' if test -z "$cr_cv_ksymtab_sys_mprotect"; then cr_result='not found' else if expr "$cr_cv_ksymtab_sys_mprotect" : N >/dev/null; then cat >>$CR_KSYM_IMPORT_DECLS <<_EOF extern asmlinkage long sys_mprotect(unsigned long start, size_t len, unsigned long prot); _EOF fi cr_result=`echo $cr_cv_ksymtab_sys_mprotect | tr -d 'YN'` if test $cr_result = 0; then cr_result=exported cr_addr=0 else cr_addr="0x$cr_result" echo "_CR_IMPORT_KCODE(sys_mprotect, $cr_addr)" >>$CR_KSYM_IMPORT_CALLS fi cat >>confdefs.h <<_ACEOF #define CR_KCODE_sys_mprotect $cr_addr _ACEOF fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel symbol table for sys_setitimer" >&5 $as_echo_n "checking kernel symbol table for sys_setitimer... " >&6; } # Our cacheval is encoded with 'Y' or 'N' as the first char to indicate # if a declaration was found or not, and the address or 0 as the rest. if test "${cr_cv_ksymtab_sys_setitimer+set}" = set; then $as_echo_n "(cached) " >&6 else cr_cv_ksymtab_sys_setitimer=`eval $LINUX_SYMTAB_CMD | sed -n -e "/${CR_KSYM_PATTERN_CODE}sys_setitimer$/ {s/ .*//p;q;}"` if test -n "$cr_cv_ksymtab_sys_setitimer"; then if eval $LINUX_SYMTAB_CMD | grep " __ksymtab_sys_setitimer\$" >/dev/null ; then cr_cv_ksymtab_sys_setitimer=0 else if test "CODE${HAVE_CONFIG_THUMB2_KERNEL}" = 'CODE1'; then cr_cv_ksymtab_sys_setitimer=`$PERL -e "printf '%x', 1 | hex '$cr_cv_ksymtab_sys_setitimer';"` fi fi SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #define IN_CONFIGURE 1 #include "${TOP_SRCDIR}/include/blcr_imports.h.in" int main () { int x = sizeof(&sys_setitimer); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_sys_setitimer="Y$cr_cv_ksymtab_sys_setitimer" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_sys_setitimer="N$cr_cv_ksymtab_sys_setitimer" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi fi cr_addr='' if test -z "$cr_cv_ksymtab_sys_setitimer"; then cr_result='not found' else if expr "$cr_cv_ksymtab_sys_setitimer" : N >/dev/null; then cat >>$CR_KSYM_IMPORT_DECLS <<_EOF extern asmlinkage long sys_setitimer(int which, struct itimerval *value, struct itimerval *ovalue); _EOF fi cr_result=`echo $cr_cv_ksymtab_sys_setitimer | tr -d 'YN'` if test $cr_result = 0; then cr_result=exported cr_addr=0 else cr_addr="0x$cr_result" echo "_CR_IMPORT_KCODE(sys_setitimer, $cr_addr)" >>$CR_KSYM_IMPORT_CALLS fi cat >>confdefs.h <<_ACEOF #define CR_KCODE_sys_setitimer $cr_addr _ACEOF fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel symbol table for sys_prctl" >&5 $as_echo_n "checking kernel symbol table for sys_prctl... " >&6; } # Our cacheval is encoded with 'Y' or 'N' as the first char to indicate # if a declaration was found or not, and the address or 0 as the rest. if test "${cr_cv_ksymtab_sys_prctl+set}" = set; then $as_echo_n "(cached) " >&6 else cr_cv_ksymtab_sys_prctl=`eval $LINUX_SYMTAB_CMD | sed -n -e "/${CR_KSYM_PATTERN_CODE}sys_prctl$/ {s/ .*//p;q;}"` if test -n "$cr_cv_ksymtab_sys_prctl"; then if eval $LINUX_SYMTAB_CMD | grep " __ksymtab_sys_prctl\$" >/dev/null ; then cr_cv_ksymtab_sys_prctl=0 else if test "CODE${HAVE_CONFIG_THUMB2_KERNEL}" = 'CODE1'; then cr_cv_ksymtab_sys_prctl=`$PERL -e "printf '%x', 1 | hex '$cr_cv_ksymtab_sys_prctl';"` fi fi SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #define IN_CONFIGURE 1 #include "${TOP_SRCDIR}/include/blcr_imports.h.in" int main () { int x = sizeof(&sys_prctl); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_sys_prctl="Y$cr_cv_ksymtab_sys_prctl" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_sys_prctl="N$cr_cv_ksymtab_sys_prctl" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi fi cr_addr='' if test -z "$cr_cv_ksymtab_sys_prctl"; then cr_result='not found' else if expr "$cr_cv_ksymtab_sys_prctl" : N >/dev/null; then cat >>$CR_KSYM_IMPORT_DECLS <<_EOF extern asmlinkage long sys_prctl(int option, unsigned long arg2, unsigned long arg3, unsigned long arg4, unsigned long arg5); _EOF fi cr_result=`echo $cr_cv_ksymtab_sys_prctl | tr -d 'YN'` if test $cr_result = 0; then cr_result=exported cr_addr=0 else cr_addr="0x$cr_result" echo "_CR_IMPORT_KCODE(sys_prctl, $cr_addr)" >>$CR_KSYM_IMPORT_CALLS fi cat >>confdefs.h <<_ACEOF #define CR_KCODE_sys_prctl $cr_addr _ACEOF fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel symbol table for copy_fs_struct" >&5 $as_echo_n "checking kernel symbol table for copy_fs_struct... " >&6; } # Our cacheval is encoded with 'Y' or 'N' as the first char to indicate # if a declaration was found or not, and the address or 0 as the rest. if test "${cr_cv_ksymtab_copy_fs_struct+set}" = set; then $as_echo_n "(cached) " >&6 else cr_cv_ksymtab_copy_fs_struct=`eval $LINUX_SYMTAB_CMD | sed -n -e "/${CR_KSYM_PATTERN_CODE}copy_fs_struct$/ {s/ .*//p;q;}"` if test -n "$cr_cv_ksymtab_copy_fs_struct"; then if eval $LINUX_SYMTAB_CMD | grep " __ksymtab_copy_fs_struct\$" >/dev/null ; then cr_cv_ksymtab_copy_fs_struct=0 else if test "CODE${HAVE_CONFIG_THUMB2_KERNEL}" = 'CODE1'; then cr_cv_ksymtab_copy_fs_struct=`$PERL -e "printf '%x', 1 | hex '$cr_cv_ksymtab_copy_fs_struct';"` fi fi SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #define IN_CONFIGURE 1 #include "${TOP_SRCDIR}/include/blcr_imports.h.in" int main () { int x = sizeof(©_fs_struct); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_copy_fs_struct="Y$cr_cv_ksymtab_copy_fs_struct" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_copy_fs_struct="N$cr_cv_ksymtab_copy_fs_struct" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi fi cr_addr='' if test -z "$cr_cv_ksymtab_copy_fs_struct"; then cr_result='not found' else if expr "$cr_cv_ksymtab_copy_fs_struct" : N >/dev/null; then { { $as_echo "$as_me:$LINENO: error: Found symbol copy_fs_struct but no declaration -- please file a bug report." >&5 $as_echo "$as_me: error: Found symbol copy_fs_struct but no declaration -- please file a bug report." >&2;} { (exit 1); exit 1; }; } fi cr_result=`echo $cr_cv_ksymtab_copy_fs_struct | tr -d 'YN'` if test $cr_result = 0; then cr_result=exported cr_addr=0 else cr_addr="0x$cr_result" echo "_CR_IMPORT_KCODE(copy_fs_struct, $cr_addr)" >>$CR_KSYM_IMPORT_CALLS fi cat >>confdefs.h <<_ACEOF #define CR_KCODE_copy_fs_struct $cr_addr _ACEOF fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel symbol table for put_fs_struct" >&5 $as_echo_n "checking kernel symbol table for put_fs_struct... " >&6; } # Our cacheval is encoded with 'Y' or 'N' as the first char to indicate # if a declaration was found or not, and the address or 0 as the rest. if test "${cr_cv_ksymtab_put_fs_struct+set}" = set; then $as_echo_n "(cached) " >&6 else cr_cv_ksymtab_put_fs_struct=`eval $LINUX_SYMTAB_CMD | sed -n -e "/${CR_KSYM_PATTERN_CODE}put_fs_struct$/ {s/ .*//p;q;}"` if test -n "$cr_cv_ksymtab_put_fs_struct"; then if eval $LINUX_SYMTAB_CMD | grep " __ksymtab_put_fs_struct\$" >/dev/null ; then cr_cv_ksymtab_put_fs_struct=0 else if test "CODE${HAVE_CONFIG_THUMB2_KERNEL}" = 'CODE1'; then cr_cv_ksymtab_put_fs_struct=`$PERL -e "printf '%x', 1 | hex '$cr_cv_ksymtab_put_fs_struct';"` fi fi SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #define IN_CONFIGURE 1 #include "${TOP_SRCDIR}/include/blcr_imports.h.in" int main () { int x = sizeof(&put_fs_struct); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_put_fs_struct="Y$cr_cv_ksymtab_put_fs_struct" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_put_fs_struct="N$cr_cv_ksymtab_put_fs_struct" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi fi cr_addr='' if test -z "$cr_cv_ksymtab_put_fs_struct"; then cr_result='not found' else if expr "$cr_cv_ksymtab_put_fs_struct" : N >/dev/null; then { { $as_echo "$as_me:$LINENO: error: Found symbol put_fs_struct but no declaration -- please file a bug report." >&5 $as_echo "$as_me: error: Found symbol put_fs_struct but no declaration -- please file a bug report." >&2;} { (exit 1); exit 1; }; } fi cr_result=`echo $cr_cv_ksymtab_put_fs_struct | tr -d 'YN'` if test $cr_result = 0; then cr_result=exported cr_addr=0 else cr_addr="0x$cr_result" echo "_CR_IMPORT_KCODE(put_fs_struct, $cr_addr)" >>$CR_KSYM_IMPORT_CALLS fi cat >>confdefs.h <<_ACEOF #define CR_KCODE_put_fs_struct $cr_addr _ACEOF fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } if test -z "$cr_addr"; then { $as_echo "$as_me:$LINENO: checking kernel symbol table for free_fs_struct" >&5 $as_echo_n "checking kernel symbol table for free_fs_struct... " >&6; } # Our cacheval is encoded with 'Y' or 'N' as the first char to indicate # if a declaration was found or not, and the address or 0 as the rest. if test "${cr_cv_ksymtab_free_fs_struct+set}" = set; then $as_echo_n "(cached) " >&6 else cr_cv_ksymtab_free_fs_struct=`eval $LINUX_SYMTAB_CMD | sed -n -e "/${CR_KSYM_PATTERN_CODE}free_fs_struct$/ {s/ .*//p;q;}"` if test -n "$cr_cv_ksymtab_free_fs_struct"; then if eval $LINUX_SYMTAB_CMD | grep " __ksymtab_free_fs_struct\$" >/dev/null ; then cr_cv_ksymtab_free_fs_struct=0 else if test "CODE${HAVE_CONFIG_THUMB2_KERNEL}" = 'CODE1'; then cr_cv_ksymtab_free_fs_struct=`$PERL -e "printf '%x', 1 | hex '$cr_cv_ksymtab_free_fs_struct';"` fi fi SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #define IN_CONFIGURE 1 #include "${TOP_SRCDIR}/include/blcr_imports.h.in" int main () { int x = sizeof(&free_fs_struct); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_free_fs_struct="Y$cr_cv_ksymtab_free_fs_struct" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_free_fs_struct="N$cr_cv_ksymtab_free_fs_struct" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi fi cr_addr='' if test -z "$cr_cv_ksymtab_free_fs_struct"; then cr_result='not found' else if expr "$cr_cv_ksymtab_free_fs_struct" : N >/dev/null; then { { $as_echo "$as_me:$LINENO: error: Found symbol free_fs_struct but no declaration -- please file a bug report." >&5 $as_echo "$as_me: error: Found symbol free_fs_struct but no declaration -- please file a bug report." >&2;} { (exit 1); exit 1; }; } fi cr_result=`echo $cr_cv_ksymtab_free_fs_struct | tr -d 'YN'` if test $cr_result = 0; then cr_result=exported cr_addr=0 else cr_addr="0x$cr_result" echo "_CR_IMPORT_KCODE(free_fs_struct, $cr_addr)" >>$CR_KSYM_IMPORT_CALLS fi cat >>confdefs.h <<_ACEOF #define CR_KCODE_free_fs_struct $cr_addr _ACEOF fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } if test -z "$cr_addr"; then { { $as_echo "$as_me:$LINENO: error: failed to find either symbol put_fs_struct or free_fs_struct" >&5 $as_echo "$as_me: error: failed to find either symbol put_fs_struct or free_fs_struct" >&2;} { (exit 1); exit 1; }; } fi fi # Check for auditing support { $as_echo "$as_me:$LINENO: checking kernel for CONFIG_AUDITSYSCALL" >&5 $as_echo_n "checking kernel for CONFIG_AUDITSYSCALL... " >&6; } if test "${cr_cv_kconfig_HAVE_CONFIG_AUDITSYSCALL+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include int main () { #ifndef CONFIG_AUDITSYSCALL choke me #endif ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_CONFIG_AUDITSYSCALL=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_CONFIG_AUDITSYSCALL=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_CONFIG_AUDITSYSCALL if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_CONFIG_AUDITSYSCALL 1 _ACEOF HAVE_CONFIG_AUDITSYSCALL=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_CONFIG_AUDITSYSCALL 0 _ACEOF HAVE_CONFIG_AUDITSYSCALL='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } if test -n "${HAVE_CONFIG_AUDITSYSCALL}"; then { $as_echo "$as_me:$LINENO: checking kernel for audit_dummy_context" >&5 $as_echo_n "checking kernel for audit_dummy_context... " >&6; } if test "${cr_cv_kconfig_HAVE_AUDIT_DUMMY_CONTEXT+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { #ifdef audit_dummy_context /* OK, it exists and is a macro */ #else /* Check for function case */ int x = sizeof(&audit_dummy_context); #endif ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_AUDIT_DUMMY_CONTEXT=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_AUDIT_DUMMY_CONTEXT=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_AUDIT_DUMMY_CONTEXT if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_AUDIT_DUMMY_CONTEXT 1 _ACEOF HAVE_AUDIT_DUMMY_CONTEXT=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_AUDIT_DUMMY_CONTEXT 0 _ACEOF HAVE_AUDIT_DUMMY_CONTEXT='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel for 2.6.6 audit_syscall_exit" >&5 $as_echo_n "checking kernel for 2.6.6 audit_syscall_exit... " >&6; } if test "${cr_cv_kconfig_HAVE_2_6_6_AUDIT_SYSCALL_EXIT+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include #ifdef AUDITSC_RESULT choke me #endif int main () { #ifndef audit_syscall_exit /* Must be macro or have a decl */ int x = sizeof(&audit_syscall_exit); #endif audit_syscall_exit(NULL,0); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_2_6_6_AUDIT_SYSCALL_EXIT=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_2_6_6_AUDIT_SYSCALL_EXIT=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_2_6_6_AUDIT_SYSCALL_EXIT if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_2_6_6_AUDIT_SYSCALL_EXIT 1 _ACEOF HAVE_2_6_6_AUDIT_SYSCALL_EXIT=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_2_6_6_AUDIT_SYSCALL_EXIT 0 _ACEOF HAVE_2_6_6_AUDIT_SYSCALL_EXIT='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel for 2.6.12 audit_syscall_exit" >&5 $as_echo_n "checking kernel for 2.6.12 audit_syscall_exit... " >&6; } if test "${cr_cv_kconfig_HAVE_2_6_12_AUDIT_SYSCALL_EXIT+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include #ifndef AUDITSC_RESULT choke me #endif int main () { #ifndef audit_syscall_exit /* Must be macro or have a decl */ int x = sizeof(&audit_syscall_exit); #endif audit_syscall_exit(NULL,AUDITSC_RESULT(0),0); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_2_6_12_AUDIT_SYSCALL_EXIT=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_2_6_12_AUDIT_SYSCALL_EXIT=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_2_6_12_AUDIT_SYSCALL_EXIT if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_2_6_12_AUDIT_SYSCALL_EXIT 1 _ACEOF HAVE_2_6_12_AUDIT_SYSCALL_EXIT=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_2_6_12_AUDIT_SYSCALL_EXIT 0 _ACEOF HAVE_2_6_12_AUDIT_SYSCALL_EXIT='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel for 2.6.17 audit_syscall_exit" >&5 $as_echo_n "checking kernel for 2.6.17 audit_syscall_exit... " >&6; } if test "${cr_cv_kconfig_HAVE_2_6_17_AUDIT_SYSCALL_EXIT+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include #ifndef AUDITSC_RESULT choke me #endif int main () { #ifndef audit_syscall_exit /* Must be macro or have a decl */ int x = sizeof(&audit_syscall_exit); #endif audit_syscall_exit(AUDITSC_RESULT(0),0); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_2_6_17_AUDIT_SYSCALL_EXIT=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_2_6_17_AUDIT_SYSCALL_EXIT=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_2_6_17_AUDIT_SYSCALL_EXIT if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_2_6_17_AUDIT_SYSCALL_EXIT 1 _ACEOF HAVE_2_6_17_AUDIT_SYSCALL_EXIT=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_2_6_17_AUDIT_SYSCALL_EXIT 0 _ACEOF HAVE_2_6_17_AUDIT_SYSCALL_EXIT='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel for __audit_syscall_exit" >&5 $as_echo_n "checking kernel for __audit_syscall_exit... " >&6; } if test "${cr_cv_kconfig_HAVE___AUDIT_SYSCALL_EXIT+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { #ifdef __audit_syscall_exit /* OK, it exists and is a macro */ #else /* Check for function case */ int x = sizeof(&__audit_syscall_exit); #endif ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE___AUDIT_SYSCALL_EXIT=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE___AUDIT_SYSCALL_EXIT=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE___AUDIT_SYSCALL_EXIT if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE___AUDIT_SYSCALL_EXIT 1 _ACEOF HAVE___AUDIT_SYSCALL_EXIT=1 else cat >>confdefs.h <<\_ACEOF #define HAVE___AUDIT_SYSCALL_EXIT 0 _ACEOF HAVE___AUDIT_SYSCALL_EXIT='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } if test x"${HAVE_2_6_6_AUDIT_SYSCALL_EXIT}${HAVE_2_6_12_AUDIT_SYSCALL_EXIT}${HAVE_2_6_17_AUDIT_SYSCALL_EXIT}${HAVE___AUDIT_SYSCALL_EXIT}" != x"1"; then { { $as_echo "$as_me:$LINENO: error: failed to determine arguments to audit_syscall_exit()" >&5 $as_echo "$as_me: error: failed to determine arguments to audit_syscall_exit()" >&2;} { (exit 1); exit 1; }; } fi if test x"${HAVE_2_6_17_AUDIT_SYSCALL_EXIT}" = x"1"; then { $as_echo "$as_me:$LINENO: checking kernel symbol table for audit_syscall_exit" >&5 $as_echo_n "checking kernel symbol table for audit_syscall_exit... " >&6; } # Our cacheval is encoded with 'Y' or 'N' as the first char to indicate # if a declaration was found or not, and the address or 0 as the rest. if test "${cr_cv_ksymtab_audit_syscall_exit+set}" = set; then $as_echo_n "(cached) " >&6 else cr_cv_ksymtab_audit_syscall_exit=`eval $LINUX_SYMTAB_CMD | sed -n -e "/${CR_KSYM_PATTERN_CODE}audit_syscall_exit$/ {s/ .*//p;q;}"` if test -n "$cr_cv_ksymtab_audit_syscall_exit"; then if eval $LINUX_SYMTAB_CMD | grep " __ksymtab_audit_syscall_exit\$" >/dev/null ; then cr_cv_ksymtab_audit_syscall_exit=0 else if test "CODE${HAVE_CONFIG_THUMB2_KERNEL}" = 'CODE1'; then cr_cv_ksymtab_audit_syscall_exit=`$PERL -e "printf '%x', 1 | hex '$cr_cv_ksymtab_audit_syscall_exit';"` fi fi SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #define IN_CONFIGURE 1 #include "${TOP_SRCDIR}/include/blcr_imports.h.in" int main () { int x = sizeof(&audit_syscall_exit); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_audit_syscall_exit="Y$cr_cv_ksymtab_audit_syscall_exit" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_audit_syscall_exit="N$cr_cv_ksymtab_audit_syscall_exit" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi fi cr_addr='' if test -z "$cr_cv_ksymtab_audit_syscall_exit"; then cr_result='not found' else if expr "$cr_cv_ksymtab_audit_syscall_exit" : N >/dev/null; then cat >>$CR_KSYM_IMPORT_DECLS <<_EOF extern void audit_syscall_exit(int failed, long return_code); _EOF fi cr_result=`echo $cr_cv_ksymtab_audit_syscall_exit | tr -d 'YN'` if test $cr_result = 0; then cr_result=exported cr_addr=0 else cr_addr="0x$cr_result" echo "_CR_IMPORT_KCODE(audit_syscall_exit, $cr_addr)" >>$CR_KSYM_IMPORT_CALLS fi cat >>confdefs.h <<_ACEOF #define CR_KCODE_audit_syscall_exit $cr_addr _ACEOF fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } elif test x"${HAVE_2_6_12_AUDIT_SYSCALL_EXIT}" = x"1"; then { $as_echo "$as_me:$LINENO: checking kernel symbol table for audit_syscall_exit" >&5 $as_echo_n "checking kernel symbol table for audit_syscall_exit... " >&6; } # Our cacheval is encoded with 'Y' or 'N' as the first char to indicate # if a declaration was found or not, and the address or 0 as the rest. if test "${cr_cv_ksymtab_audit_syscall_exit+set}" = set; then $as_echo_n "(cached) " >&6 else cr_cv_ksymtab_audit_syscall_exit=`eval $LINUX_SYMTAB_CMD | sed -n -e "/${CR_KSYM_PATTERN_CODE}audit_syscall_exit$/ {s/ .*//p;q;}"` if test -n "$cr_cv_ksymtab_audit_syscall_exit"; then if eval $LINUX_SYMTAB_CMD | grep " __ksymtab_audit_syscall_exit\$" >/dev/null ; then cr_cv_ksymtab_audit_syscall_exit=0 else if test "CODE${HAVE_CONFIG_THUMB2_KERNEL}" = 'CODE1'; then cr_cv_ksymtab_audit_syscall_exit=`$PERL -e "printf '%x', 1 | hex '$cr_cv_ksymtab_audit_syscall_exit';"` fi fi SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #define IN_CONFIGURE 1 #include "${TOP_SRCDIR}/include/blcr_imports.h.in" int main () { int x = sizeof(&audit_syscall_exit); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_audit_syscall_exit="Y$cr_cv_ksymtab_audit_syscall_exit" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_audit_syscall_exit="N$cr_cv_ksymtab_audit_syscall_exit" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi fi cr_addr='' if test -z "$cr_cv_ksymtab_audit_syscall_exit"; then cr_result='not found' else if expr "$cr_cv_ksymtab_audit_syscall_exit" : N >/dev/null; then cat >>$CR_KSYM_IMPORT_DECLS <<_EOF extern void audit_syscall_exit(struct task_struct *task, int failed, long return_code); _EOF fi cr_result=`echo $cr_cv_ksymtab_audit_syscall_exit | tr -d 'YN'` if test $cr_result = 0; then cr_result=exported cr_addr=0 else cr_addr="0x$cr_result" echo "_CR_IMPORT_KCODE(audit_syscall_exit, $cr_addr)" >>$CR_KSYM_IMPORT_CALLS fi cat >>confdefs.h <<_ACEOF #define CR_KCODE_audit_syscall_exit $cr_addr _ACEOF fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } elif test x"${HAVE_2_6_6_AUDIT_SYSCALL_EXIT}" = x"1"; then { $as_echo "$as_me:$LINENO: checking kernel symbol table for audit_syscall_exit" >&5 $as_echo_n "checking kernel symbol table for audit_syscall_exit... " >&6; } # Our cacheval is encoded with 'Y' or 'N' as the first char to indicate # if a declaration was found or not, and the address or 0 as the rest. if test "${cr_cv_ksymtab_audit_syscall_exit+set}" = set; then $as_echo_n "(cached) " >&6 else cr_cv_ksymtab_audit_syscall_exit=`eval $LINUX_SYMTAB_CMD | sed -n -e "/${CR_KSYM_PATTERN_CODE}audit_syscall_exit$/ {s/ .*//p;q;}"` if test -n "$cr_cv_ksymtab_audit_syscall_exit"; then if eval $LINUX_SYMTAB_CMD | grep " __ksymtab_audit_syscall_exit\$" >/dev/null ; then cr_cv_ksymtab_audit_syscall_exit=0 else if test "CODE${HAVE_CONFIG_THUMB2_KERNEL}" = 'CODE1'; then cr_cv_ksymtab_audit_syscall_exit=`$PERL -e "printf '%x', 1 | hex '$cr_cv_ksymtab_audit_syscall_exit';"` fi fi SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #define IN_CONFIGURE 1 #include "${TOP_SRCDIR}/include/blcr_imports.h.in" int main () { int x = sizeof(&audit_syscall_exit); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_audit_syscall_exit="Y$cr_cv_ksymtab_audit_syscall_exit" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_audit_syscall_exit="N$cr_cv_ksymtab_audit_syscall_exit" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi fi cr_addr='' if test -z "$cr_cv_ksymtab_audit_syscall_exit"; then cr_result='not found' else if expr "$cr_cv_ksymtab_audit_syscall_exit" : N >/dev/null; then cat >>$CR_KSYM_IMPORT_DECLS <<_EOF extern void audit_syscall_exit(struct task_struct *task, int return_code); _EOF fi cr_result=`echo $cr_cv_ksymtab_audit_syscall_exit | tr -d 'YN'` if test $cr_result = 0; then cr_result=exported cr_addr=0 else cr_addr="0x$cr_result" echo "_CR_IMPORT_KCODE(audit_syscall_exit, $cr_addr)" >>$CR_KSYM_IMPORT_CALLS fi cat >>confdefs.h <<_ACEOF #define CR_KCODE_audit_syscall_exit $cr_addr _ACEOF fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } elif test x"${HAVE___AUDIT_SYSCALL_EXIT}" = x"1"; then { $as_echo "$as_me:$LINENO: checking kernel symbol table for __audit_syscall_exit" >&5 $as_echo_n "checking kernel symbol table for __audit_syscall_exit... " >&6; } # Our cacheval is encoded with 'Y' or 'N' as the first char to indicate # if a declaration was found or not, and the address or 0 as the rest. if test "${cr_cv_ksymtab___audit_syscall_exit+set}" = set; then $as_echo_n "(cached) " >&6 else cr_cv_ksymtab___audit_syscall_exit=`eval $LINUX_SYMTAB_CMD | sed -n -e "/${CR_KSYM_PATTERN_CODE}__audit_syscall_exit$/ {s/ .*//p;q;}"` if test -n "$cr_cv_ksymtab___audit_syscall_exit"; then if eval $LINUX_SYMTAB_CMD | grep " __ksymtab___audit_syscall_exit\$" >/dev/null ; then cr_cv_ksymtab___audit_syscall_exit=0 else if test "CODE${HAVE_CONFIG_THUMB2_KERNEL}" = 'CODE1'; then cr_cv_ksymtab___audit_syscall_exit=`$PERL -e "printf '%x', 1 | hex '$cr_cv_ksymtab___audit_syscall_exit';"` fi fi SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #define IN_CONFIGURE 1 #include "${TOP_SRCDIR}/include/blcr_imports.h.in" int main () { int x = sizeof(&__audit_syscall_exit); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab___audit_syscall_exit="Y$cr_cv_ksymtab___audit_syscall_exit" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab___audit_syscall_exit="N$cr_cv_ksymtab___audit_syscall_exit" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi fi cr_addr='' if test -z "$cr_cv_ksymtab___audit_syscall_exit"; then cr_result='not found' else if expr "$cr_cv_ksymtab___audit_syscall_exit" : N >/dev/null; then cat >>$CR_KSYM_IMPORT_DECLS <<_EOF extern void __audit_syscall_exit(int ret_success, long ret_value); _EOF fi cr_result=`echo $cr_cv_ksymtab___audit_syscall_exit | tr -d 'YN'` if test $cr_result = 0; then cr_result=exported cr_addr=0 else cr_addr="0x$cr_result" echo "_CR_IMPORT_KCODE(__audit_syscall_exit, $cr_addr)" >>$CR_KSYM_IMPORT_CALLS fi cat >>confdefs.h <<_ACEOF #define CR_KCODE___audit_syscall_exit $cr_addr _ACEOF fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } else : # Unreachable? { { $as_echo "$as_me:$LINENO: error: failed to determine arguments to audit_syscall_exit()" >&5 $as_echo "$as_me: error: failed to determine arguments to audit_syscall_exit()" >&2;} { (exit 1); exit 1; }; } fi if test -z "$cr_addr"; then { { $as_echo "$as_me:$LINENO: error: failed to find symbol audit_syscall_exit()" >&5 $as_echo "$as_me: error: failed to find symbol audit_syscall_exit()" >&2;} { (exit 1); exit 1; }; } fi fi # For blcr { $as_echo "$as_me:$LINENO: checking kernel symbol table for set_fs_pwd" >&5 $as_echo_n "checking kernel symbol table for set_fs_pwd... " >&6; } # Our cacheval is encoded with 'Y' or 'N' as the first char to indicate # if a declaration was found or not, and the address or 0 as the rest. if test "${cr_cv_ksymtab_set_fs_pwd+set}" = set; then $as_echo_n "(cached) " >&6 else cr_cv_ksymtab_set_fs_pwd=`eval $LINUX_SYMTAB_CMD | sed -n -e "/${CR_KSYM_PATTERN_CODE}set_fs_pwd$/ {s/ .*//p;q;}"` if test -n "$cr_cv_ksymtab_set_fs_pwd"; then if eval $LINUX_SYMTAB_CMD | grep " __ksymtab_set_fs_pwd\$" >/dev/null ; then cr_cv_ksymtab_set_fs_pwd=0 else if test "CODE${HAVE_CONFIG_THUMB2_KERNEL}" = 'CODE1'; then cr_cv_ksymtab_set_fs_pwd=`$PERL -e "printf '%x', 1 | hex '$cr_cv_ksymtab_set_fs_pwd';"` fi fi SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #define IN_CONFIGURE 1 #include "${TOP_SRCDIR}/include/blcr_imports.h.in" int main () { int x = sizeof(&set_fs_pwd); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_set_fs_pwd="Y$cr_cv_ksymtab_set_fs_pwd" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_set_fs_pwd="N$cr_cv_ksymtab_set_fs_pwd" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi fi cr_addr='' if test -z "$cr_cv_ksymtab_set_fs_pwd"; then cr_result='not found' else if expr "$cr_cv_ksymtab_set_fs_pwd" : N >/dev/null; then { { $as_echo "$as_me:$LINENO: error: Found symbol set_fs_pwd but no declaration -- please file a bug report." >&5 $as_echo "$as_me: error: Found symbol set_fs_pwd but no declaration -- please file a bug report." >&2;} { (exit 1); exit 1; }; } fi cr_result=`echo $cr_cv_ksymtab_set_fs_pwd | tr -d 'YN'` if test $cr_result = 0; then cr_result=exported cr_addr=0 else cr_addr="0x$cr_result" echo "_CR_IMPORT_KCODE(set_fs_pwd, $cr_addr)" >>$CR_KSYM_IMPORT_CALLS fi cat >>confdefs.h <<_ACEOF #define CR_KCODE_set_fs_pwd $cr_addr _ACEOF fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } # For vmadump4 { $as_echo "$as_me:$LINENO: checking kernel symbol table for sys_mremap" >&5 $as_echo_n "checking kernel symbol table for sys_mremap... " >&6; } # Our cacheval is encoded with 'Y' or 'N' as the first char to indicate # if a declaration was found or not, and the address or 0 as the rest. if test "${cr_cv_ksymtab_sys_mremap+set}" = set; then $as_echo_n "(cached) " >&6 else cr_cv_ksymtab_sys_mremap=`eval $LINUX_SYMTAB_CMD | sed -n -e "/${CR_KSYM_PATTERN_CODE}sys_mremap$/ {s/ .*//p;q;}"` if test -n "$cr_cv_ksymtab_sys_mremap"; then if eval $LINUX_SYMTAB_CMD | grep " __ksymtab_sys_mremap\$" >/dev/null ; then cr_cv_ksymtab_sys_mremap=0 else if test "CODE${HAVE_CONFIG_THUMB2_KERNEL}" = 'CODE1'; then cr_cv_ksymtab_sys_mremap=`$PERL -e "printf '%x', 1 | hex '$cr_cv_ksymtab_sys_mremap';"` fi fi SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #define IN_CONFIGURE 1 #include "${TOP_SRCDIR}/include/blcr_imports.h.in" int main () { int x = sizeof(&sys_mremap); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_sys_mremap="Y$cr_cv_ksymtab_sys_mremap" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_sys_mremap="N$cr_cv_ksymtab_sys_mremap" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi fi cr_addr='' if test -z "$cr_cv_ksymtab_sys_mremap"; then cr_result='not found' else if expr "$cr_cv_ksymtab_sys_mremap" : N >/dev/null; then cat >>$CR_KSYM_IMPORT_DECLS <<_EOF extern asmlinkage unsigned long sys_mremap(unsigned long addr, unsigned long old_len, unsigned long new_len, unsigned long flags, unsigned long new_addr); _EOF fi cr_result=`echo $cr_cv_ksymtab_sys_mremap | tr -d 'YN'` if test $cr_result = 0; then cr_result=exported cr_addr=0 else cr_addr="0x$cr_result" echo "_CR_IMPORT_KCODE(sys_mremap, $cr_addr)" >>$CR_KSYM_IMPORT_CALLS fi cat >>confdefs.h <<_ACEOF #define CR_KCODE_sys_mremap $cr_addr _ACEOF fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel symbol table for do_sigaction" >&5 $as_echo_n "checking kernel symbol table for do_sigaction... " >&6; } # Our cacheval is encoded with 'Y' or 'N' as the first char to indicate # if a declaration was found or not, and the address or 0 as the rest. if test "${cr_cv_ksymtab_do_sigaction+set}" = set; then $as_echo_n "(cached) " >&6 else cr_cv_ksymtab_do_sigaction=`eval $LINUX_SYMTAB_CMD | sed -n -e "/${CR_KSYM_PATTERN_CODE}do_sigaction$/ {s/ .*//p;q;}"` if test -n "$cr_cv_ksymtab_do_sigaction"; then if eval $LINUX_SYMTAB_CMD | grep " __ksymtab_do_sigaction\$" >/dev/null ; then cr_cv_ksymtab_do_sigaction=0 else if test "CODE${HAVE_CONFIG_THUMB2_KERNEL}" = 'CODE1'; then cr_cv_ksymtab_do_sigaction=`$PERL -e "printf '%x', 1 | hex '$cr_cv_ksymtab_do_sigaction';"` fi fi SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #define IN_CONFIGURE 1 #include "${TOP_SRCDIR}/include/blcr_imports.h.in" int main () { int x = sizeof(&do_sigaction); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_do_sigaction="Y$cr_cv_ksymtab_do_sigaction" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_do_sigaction="N$cr_cv_ksymtab_do_sigaction" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi fi cr_addr='' if test -z "$cr_cv_ksymtab_do_sigaction"; then cr_result='not found' else if expr "$cr_cv_ksymtab_do_sigaction" : N >/dev/null; then { { $as_echo "$as_me:$LINENO: error: Found symbol do_sigaction but no declaration -- please file a bug report." >&5 $as_echo "$as_me: error: Found symbol do_sigaction but no declaration -- please file a bug report." >&2;} { (exit 1); exit 1; }; } fi cr_result=`echo $cr_cv_ksymtab_do_sigaction | tr -d 'YN'` if test $cr_result = 0; then cr_result=exported cr_addr=0 else cr_addr="0x$cr_result" echo "_CR_IMPORT_KCODE(do_sigaction, $cr_addr)" >>$CR_KSYM_IMPORT_CALLS fi cat >>confdefs.h <<_ACEOF #define CR_KCODE_do_sigaction $cr_addr _ACEOF fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } if test $CR_KARCH = x86_64; then { $as_echo "$as_me:$LINENO: checking kernel symbol table for load_gs_index" >&5 $as_echo_n "checking kernel symbol table for load_gs_index... " >&6; } # Our cacheval is encoded with 'Y' or 'N' as the first char to indicate # if a declaration was found or not, and the address or 0 as the rest. if test "${cr_cv_ksymtab_load_gs_index+set}" = set; then $as_echo_n "(cached) " >&6 else cr_cv_ksymtab_load_gs_index=`eval $LINUX_SYMTAB_CMD | sed -n -e "/${CR_KSYM_PATTERN_CODE}load_gs_index$/ {s/ .*//p;q;}"` if test -n "$cr_cv_ksymtab_load_gs_index"; then if eval $LINUX_SYMTAB_CMD | grep " __ksymtab_load_gs_index\$" >/dev/null ; then cr_cv_ksymtab_load_gs_index=0 else if test "CODE${HAVE_CONFIG_THUMB2_KERNEL}" = 'CODE1'; then cr_cv_ksymtab_load_gs_index=`$PERL -e "printf '%x', 1 | hex '$cr_cv_ksymtab_load_gs_index';"` fi fi SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #define IN_CONFIGURE 1 #include "${TOP_SRCDIR}/include/blcr_imports.h.in" int main () { int x = sizeof(&load_gs_index); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_load_gs_index="Y$cr_cv_ksymtab_load_gs_index" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_load_gs_index="N$cr_cv_ksymtab_load_gs_index" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi fi cr_addr='' if test -z "$cr_cv_ksymtab_load_gs_index"; then cr_result='not found' else if expr "$cr_cv_ksymtab_load_gs_index" : N >/dev/null; then { { $as_echo "$as_me:$LINENO: error: Found symbol load_gs_index but no declaration -- please file a bug report." >&5 $as_echo "$as_me: error: Found symbol load_gs_index but no declaration -- please file a bug report." >&2;} { (exit 1); exit 1; }; } fi cr_result=`echo $cr_cv_ksymtab_load_gs_index | tr -d 'YN'` if test $cr_result = 0; then cr_result=exported cr_addr=0 else cr_addr="0x$cr_result" echo "_CR_IMPORT_KCODE(load_gs_index, $cr_addr)" >>$CR_KSYM_IMPORT_CALLS fi cat >>confdefs.h <<_ACEOF #define CR_KCODE_load_gs_index $cr_addr _ACEOF fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel for read_pda" >&5 $as_echo_n "checking kernel for read_pda... " >&6; } if test "${cr_cv_kconfig_HAVE_READ_PDA+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { #ifdef read_pda /* OK, it exists and is a macro */ #else /* Check for function case */ int x = sizeof(&read_pda); #endif ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_READ_PDA=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_READ_PDA=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_READ_PDA if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_READ_PDA 1 _ACEOF HAVE_READ_PDA=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_READ_PDA 0 _ACEOF HAVE_READ_PDA='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel for write_pda" >&5 $as_echo_n "checking kernel for write_pda... " >&6; } if test "${cr_cv_kconfig_HAVE_WRITE_PDA+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { #ifdef write_pda /* OK, it exists and is a macro */ #else /* Check for function case */ int x = sizeof(&write_pda); #endif ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_WRITE_PDA=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_WRITE_PDA=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_WRITE_PDA if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_WRITE_PDA 1 _ACEOF HAVE_WRITE_PDA=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_WRITE_PDA 0 _ACEOF HAVE_WRITE_PDA='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } if test "$HAVE_READ_PDA$HAVE_WRITE_PDA" != "11"; then { $as_echo "$as_me:$LINENO: checking kernel for percpu_read" >&5 $as_echo_n "checking kernel for percpu_read... " >&6; } if test "${cr_cv_kconfig_HAVE_PERCPU_READ+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { #ifdef percpu_read /* OK, it exists and is a macro */ #else /* Check for function case */ int x = sizeof(&percpu_read); #endif ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_PERCPU_READ=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_PERCPU_READ=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_PERCPU_READ if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_PERCPU_READ 1 _ACEOF HAVE_PERCPU_READ=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_PERCPU_READ 0 _ACEOF HAVE_PERCPU_READ='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel for percpu_write" >&5 $as_echo_n "checking kernel for percpu_write... " >&6; } if test "${cr_cv_kconfig_HAVE_PERCPU_WRITE+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { #ifdef percpu_write /* OK, it exists and is a macro */ #else /* Check for function case */ int x = sizeof(&percpu_write); #endif ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_PERCPU_WRITE=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_PERCPU_WRITE=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_PERCPU_WRITE if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_PERCPU_WRITE 1 _ACEOF HAVE_PERCPU_WRITE=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_PERCPU_WRITE 0 _ACEOF HAVE_PERCPU_WRITE='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel for this_cpu_read" >&5 $as_echo_n "checking kernel for this_cpu_read... " >&6; } if test "${cr_cv_kconfig_HAVE_THIS_CPU_READ+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { #ifdef this_cpu_read /* OK, it exists and is a macro */ #else /* Check for function case */ int x = sizeof(&this_cpu_read); #endif ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_THIS_CPU_READ=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_THIS_CPU_READ=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_THIS_CPU_READ if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_THIS_CPU_READ 1 _ACEOF HAVE_THIS_CPU_READ=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_THIS_CPU_READ 0 _ACEOF HAVE_THIS_CPU_READ='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel for this_cpu_write" >&5 $as_echo_n "checking kernel for this_cpu_write... " >&6; } if test "${cr_cv_kconfig_HAVE_THIS_CPU_WRITE+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { #ifdef this_cpu_write /* OK, it exists and is a macro */ #else /* Check for function case */ int x = sizeof(&this_cpu_write); #endif ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_THIS_CPU_WRITE=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_THIS_CPU_WRITE=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_THIS_CPU_WRITE if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_THIS_CPU_WRITE 1 _ACEOF HAVE_THIS_CPU_WRITE=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_THIS_CPU_WRITE 0 _ACEOF HAVE_THIS_CPU_WRITE='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } if test "$HAVE_PERCPU_READ$HAVE_PERCPU_WRITE" != "11" -a \ "$HAVE_THIS_CPU_READ$HAVE_THIS_CPU_WRITE" != "11" ; then 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:$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= ;; #( *) $as_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 test "x$cache_file" != "x/dev/null" && { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache echo "======================================================================" echo "Please review the following configuration information:" echo " Kernel source directory = $LINUX_SRC" echo " Kernel build directory = $LINUX_OBJ" echo " Kernel symbol table = ${LINUX_SYSTEM_MAP}${LINUX_VMLINUX}" echo " Kernel version probed from kernel build = $LINUX_VER" echo " Kernel running currently = `uname -r`" echo "======================================================================" { { $as_echo "$as_me:$LINENO: error: Unable to use kernel $LINUX_VER - found neither {read,write}_pda() nor percpu_{read,write}() nor this_cpu_{read,write}()" >&5 $as_echo "$as_me: error: Unable to use kernel $LINUX_VER - found neither {read,write}_pda() nor percpu_{read,write}() nor this_cpu_{read,write}()" >&2;} { (exit 1); exit 1; }; } else { $as_echo "$as_me:$LINENO: checking kernel symbol table for per_cpu__old_rsp" >&5 $as_echo_n "checking kernel symbol table for per_cpu__old_rsp... " >&6; } # Our cacheval is encoded with 'Y' or 'N' as the first char to indicate # if a declaration was found or not, and the address or 0 as the rest. if test "${cr_cv_ksymtab_per_cpu__old_rsp+set}" = set; then $as_echo_n "(cached) " >&6 else cr_cv_ksymtab_per_cpu__old_rsp=`eval $LINUX_SYMTAB_CMD | sed -n -e "/${CR_KSYM_PATTERN_DATA}per_cpu__old_rsp$/ {s/ .*//p;q;}"` if test -n "$cr_cv_ksymtab_per_cpu__old_rsp"; then if eval $LINUX_SYMTAB_CMD | grep " __ksymtab_per_cpu__old_rsp\$" >/dev/null ; then cr_cv_ksymtab_per_cpu__old_rsp=0 else if test "DATA${HAVE_CONFIG_THUMB2_KERNEL}" = 'CODE1'; then cr_cv_ksymtab_per_cpu__old_rsp=`$PERL -e "printf '%x', 1 | hex '$cr_cv_ksymtab_per_cpu__old_rsp';"` fi fi SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #define IN_CONFIGURE 1 #include "${TOP_SRCDIR}/include/blcr_imports.h.in" int main () { int x = sizeof(&per_cpu__old_rsp); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_per_cpu__old_rsp="Y$cr_cv_ksymtab_per_cpu__old_rsp" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_per_cpu__old_rsp="N$cr_cv_ksymtab_per_cpu__old_rsp" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi fi cr_addr='' if test -z "$cr_cv_ksymtab_per_cpu__old_rsp"; then cr_result='not found' else if expr "$cr_cv_ksymtab_per_cpu__old_rsp" : N >/dev/null; then cat >>$CR_KSYM_IMPORT_DECLS <<_EOF DECLARE_PER_CPU(unsigned long, old_rsp); _EOF fi cr_result=`echo $cr_cv_ksymtab_per_cpu__old_rsp | tr -d 'YN'` if test $cr_result = 0; then cr_result=exported cr_addr=0 else cr_addr="0x$cr_result" echo "_CR_IMPORT_KDATA(per_cpu__old_rsp, $cr_addr)" >>$CR_KSYM_IMPORT_CALLS fi cat >>confdefs.h <<_ACEOF #define CR_KDATA_per_cpu__old_rsp $cr_addr _ACEOF fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } if test -z "$cr_addr"; then { $as_echo "$as_me:$LINENO: checking kernel symbol table for old_rsp" >&5 $as_echo_n "checking kernel symbol table for old_rsp... " >&6; } # Our cacheval is encoded with 'Y' or 'N' as the first char to indicate # if a declaration was found or not, and the address or 0 as the rest. if test "${cr_cv_ksymtab_old_rsp+set}" = set; then $as_echo_n "(cached) " >&6 else cr_cv_ksymtab_old_rsp=`eval $LINUX_SYMTAB_CMD | sed -n -e "/${CR_KSYM_PATTERN_DATA}old_rsp$/ {s/ .*//p;q;}"` if test -n "$cr_cv_ksymtab_old_rsp"; then if eval $LINUX_SYMTAB_CMD | grep " __ksymtab_old_rsp\$" >/dev/null ; then cr_cv_ksymtab_old_rsp=0 else if test "DATA${HAVE_CONFIG_THUMB2_KERNEL}" = 'CODE1'; then cr_cv_ksymtab_old_rsp=`$PERL -e "printf '%x', 1 | hex '$cr_cv_ksymtab_old_rsp';"` fi fi SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #define IN_CONFIGURE 1 #include "${TOP_SRCDIR}/include/blcr_imports.h.in" int main () { int x = sizeof(&old_rsp); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_old_rsp="Y$cr_cv_ksymtab_old_rsp" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_old_rsp="N$cr_cv_ksymtab_old_rsp" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi fi cr_addr='' if test -z "$cr_cv_ksymtab_old_rsp"; then cr_result='not found' else if expr "$cr_cv_ksymtab_old_rsp" : N >/dev/null; then cat >>$CR_KSYM_IMPORT_DECLS <<_EOF DECLARE_PER_CPU(unsigned long, old_rsp); _EOF fi cr_result=`echo $cr_cv_ksymtab_old_rsp | tr -d 'YN'` if test $cr_result = 0; then cr_result=exported cr_addr=0 else cr_addr="0x$cr_result" echo "_CR_IMPORT_KDATA(old_rsp, $cr_addr)" >>$CR_KSYM_IMPORT_CALLS fi cat >>confdefs.h <<_ACEOF #define CR_KDATA_old_rsp $cr_addr _ACEOF fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } if test -z "$cr_addr"; then { { $as_echo "$as_me:$LINENO: error: failed to locate either symbol per_cpu__old_rsp or old_rsp" >&5 $as_echo "$as_me: error: failed to locate either symbol per_cpu__old_rsp or old_rsp" >&2;} { (exit 1); exit 1; }; } fi fi fi fi fi if test x$enable_restore_ids = xyes; then { $as_echo "$as_me:$LINENO: checking kernel symbol table for sys_setgroups" >&5 $as_echo_n "checking kernel symbol table for sys_setgroups... " >&6; } # Our cacheval is encoded with 'Y' or 'N' as the first char to indicate # if a declaration was found or not, and the address or 0 as the rest. if test "${cr_cv_ksymtab_sys_setgroups+set}" = set; then $as_echo_n "(cached) " >&6 else cr_cv_ksymtab_sys_setgroups=`eval $LINUX_SYMTAB_CMD | sed -n -e "/${CR_KSYM_PATTERN_CODE}sys_setgroups$/ {s/ .*//p;q;}"` if test -n "$cr_cv_ksymtab_sys_setgroups"; then if eval $LINUX_SYMTAB_CMD | grep " __ksymtab_sys_setgroups\$" >/dev/null ; then cr_cv_ksymtab_sys_setgroups=0 else if test "CODE${HAVE_CONFIG_THUMB2_KERNEL}" = 'CODE1'; then cr_cv_ksymtab_sys_setgroups=`$PERL -e "printf '%x', 1 | hex '$cr_cv_ksymtab_sys_setgroups';"` fi fi SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #define IN_CONFIGURE 1 #include "${TOP_SRCDIR}/include/blcr_imports.h.in" int main () { int x = sizeof(&sys_setgroups); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_sys_setgroups="Y$cr_cv_ksymtab_sys_setgroups" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_sys_setgroups="N$cr_cv_ksymtab_sys_setgroups" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi fi cr_addr='' if test -z "$cr_cv_ksymtab_sys_setgroups"; then cr_result='not found' else if expr "$cr_cv_ksymtab_sys_setgroups" : N >/dev/null; then cat >>$CR_KSYM_IMPORT_DECLS <<_EOF extern asmlinkage long sys_setgroups(int, gid_t *); _EOF fi cr_result=`echo $cr_cv_ksymtab_sys_setgroups | tr -d 'YN'` if test $cr_result = 0; then cr_result=exported cr_addr=0 else cr_addr="0x$cr_result" echo "_CR_IMPORT_KCODE(sys_setgroups, $cr_addr)" >>$CR_KSYM_IMPORT_CALLS fi cat >>confdefs.h <<_ACEOF #define CR_KCODE_sys_setgroups $cr_addr _ACEOF fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel symbol table for sys_setresuid" >&5 $as_echo_n "checking kernel symbol table for sys_setresuid... " >&6; } # Our cacheval is encoded with 'Y' or 'N' as the first char to indicate # if a declaration was found or not, and the address or 0 as the rest. if test "${cr_cv_ksymtab_sys_setresuid+set}" = set; then $as_echo_n "(cached) " >&6 else cr_cv_ksymtab_sys_setresuid=`eval $LINUX_SYMTAB_CMD | sed -n -e "/${CR_KSYM_PATTERN_CODE}sys_setresuid$/ {s/ .*//p;q;}"` if test -n "$cr_cv_ksymtab_sys_setresuid"; then if eval $LINUX_SYMTAB_CMD | grep " __ksymtab_sys_setresuid\$" >/dev/null ; then cr_cv_ksymtab_sys_setresuid=0 else if test "CODE${HAVE_CONFIG_THUMB2_KERNEL}" = 'CODE1'; then cr_cv_ksymtab_sys_setresuid=`$PERL -e "printf '%x', 1 | hex '$cr_cv_ksymtab_sys_setresuid';"` fi fi SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #define IN_CONFIGURE 1 #include "${TOP_SRCDIR}/include/blcr_imports.h.in" int main () { int x = sizeof(&sys_setresuid); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_sys_setresuid="Y$cr_cv_ksymtab_sys_setresuid" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_sys_setresuid="N$cr_cv_ksymtab_sys_setresuid" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi fi cr_addr='' if test -z "$cr_cv_ksymtab_sys_setresuid"; then cr_result='not found' else if expr "$cr_cv_ksymtab_sys_setresuid" : N >/dev/null; then cat >>$CR_KSYM_IMPORT_DECLS <<_EOF extern asmlinkage long sys_setresuid(uid_t, uid_t, uid_t); _EOF fi cr_result=`echo $cr_cv_ksymtab_sys_setresuid | tr -d 'YN'` if test $cr_result = 0; then cr_result=exported cr_addr=0 else cr_addr="0x$cr_result" echo "_CR_IMPORT_KCODE(sys_setresuid, $cr_addr)" >>$CR_KSYM_IMPORT_CALLS fi cat >>confdefs.h <<_ACEOF #define CR_KCODE_sys_setresuid $cr_addr _ACEOF fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel symbol table for sys_setresgid" >&5 $as_echo_n "checking kernel symbol table for sys_setresgid... " >&6; } # Our cacheval is encoded with 'Y' or 'N' as the first char to indicate # if a declaration was found or not, and the address or 0 as the rest. if test "${cr_cv_ksymtab_sys_setresgid+set}" = set; then $as_echo_n "(cached) " >&6 else cr_cv_ksymtab_sys_setresgid=`eval $LINUX_SYMTAB_CMD | sed -n -e "/${CR_KSYM_PATTERN_CODE}sys_setresgid$/ {s/ .*//p;q;}"` if test -n "$cr_cv_ksymtab_sys_setresgid"; then if eval $LINUX_SYMTAB_CMD | grep " __ksymtab_sys_setresgid\$" >/dev/null ; then cr_cv_ksymtab_sys_setresgid=0 else if test "CODE${HAVE_CONFIG_THUMB2_KERNEL}" = 'CODE1'; then cr_cv_ksymtab_sys_setresgid=`$PERL -e "printf '%x', 1 | hex '$cr_cv_ksymtab_sys_setresgid';"` fi fi SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #define IN_CONFIGURE 1 #include "${TOP_SRCDIR}/include/blcr_imports.h.in" int main () { int x = sizeof(&sys_setresgid); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_sys_setresgid="Y$cr_cv_ksymtab_sys_setresgid" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_sys_setresgid="N$cr_cv_ksymtab_sys_setresgid" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi fi cr_addr='' if test -z "$cr_cv_ksymtab_sys_setresgid"; then cr_result='not found' else if expr "$cr_cv_ksymtab_sys_setresgid" : N >/dev/null; then cat >>$CR_KSYM_IMPORT_DECLS <<_EOF extern asmlinkage long sys_setresgid(gid_t, gid_t, gid_t); _EOF fi cr_result=`echo $cr_cv_ksymtab_sys_setresgid | tr -d 'YN'` if test $cr_result = 0; then cr_result=exported cr_addr=0 else cr_addr="0x$cr_result" echo "_CR_IMPORT_KCODE(sys_setresgid, $cr_addr)" >>$CR_KSYM_IMPORT_CALLS fi cat >>confdefs.h <<_ACEOF #define CR_KCODE_sys_setresgid $cr_addr _ACEOF fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } fi { $as_echo "$as_me:$LINENO: checking kernel symbol table for expand_files" >&5 $as_echo_n "checking kernel symbol table for expand_files... " >&6; } # Our cacheval is encoded with 'Y' or 'N' as the first char to indicate # if a declaration was found or not, and the address or 0 as the rest. if test "${cr_cv_ksymtab_expand_files+set}" = set; then $as_echo_n "(cached) " >&6 else cr_cv_ksymtab_expand_files=`eval $LINUX_SYMTAB_CMD | sed -n -e "/${CR_KSYM_PATTERN_CODE}expand_files$/ {s/ .*//p;q;}"` if test -n "$cr_cv_ksymtab_expand_files"; then if eval $LINUX_SYMTAB_CMD | grep " __ksymtab_expand_files\$" >/dev/null ; then cr_cv_ksymtab_expand_files=0 else if test "CODE${HAVE_CONFIG_THUMB2_KERNEL}" = 'CODE1'; then cr_cv_ksymtab_expand_files=`$PERL -e "printf '%x', 1 | hex '$cr_cv_ksymtab_expand_files';"` fi fi SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #define IN_CONFIGURE 1 #include "${TOP_SRCDIR}/include/blcr_imports.h.in" int main () { int x = sizeof(&expand_files); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_expand_files="Y$cr_cv_ksymtab_expand_files" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_expand_files="N$cr_cv_ksymtab_expand_files" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi fi cr_addr='' if test -z "$cr_cv_ksymtab_expand_files"; then cr_result='not found' else if expr "$cr_cv_ksymtab_expand_files" : N >/dev/null; then cat >>$CR_KSYM_IMPORT_DECLS <<_EOF extern int expand_files(struct files_struct *, int); _EOF fi cr_result=`echo $cr_cv_ksymtab_expand_files | tr -d 'YN'` if test $cr_result = 0; then cr_result=exported cr_addr=0 else cr_addr="0x$cr_result" echo "_CR_IMPORT_KCODE(expand_files, $cr_addr)" >>$CR_KSYM_IMPORT_CALLS fi cat >>confdefs.h <<_ACEOF #define CR_KCODE_expand_files $cr_addr _ACEOF fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel symbol table for __flush_icache_range" >&5 $as_echo_n "checking kernel symbol table for __flush_icache_range... " >&6; } # Our cacheval is encoded with 'Y' or 'N' as the first char to indicate # if a declaration was found or not, and the address or 0 as the rest. if test "${cr_cv_ksymtab___flush_icache_range+set}" = set; then $as_echo_n "(cached) " >&6 else cr_cv_ksymtab___flush_icache_range=`eval $LINUX_SYMTAB_CMD | sed -n -e "/${CR_KSYM_PATTERN_CODE}__flush_icache_range$/ {s/ .*//p;q;}"` if test -n "$cr_cv_ksymtab___flush_icache_range"; then if eval $LINUX_SYMTAB_CMD | grep " __ksymtab___flush_icache_range\$" >/dev/null ; then cr_cv_ksymtab___flush_icache_range=0 else if test "CODE${HAVE_CONFIG_THUMB2_KERNEL}" = 'CODE1'; then cr_cv_ksymtab___flush_icache_range=`$PERL -e "printf '%x', 1 | hex '$cr_cv_ksymtab___flush_icache_range';"` fi fi SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #define IN_CONFIGURE 1 #include "${TOP_SRCDIR}/include/blcr_imports.h.in" int main () { int x = sizeof(&__flush_icache_range); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab___flush_icache_range="Y$cr_cv_ksymtab___flush_icache_range" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab___flush_icache_range="N$cr_cv_ksymtab___flush_icache_range" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi fi cr_addr='' if test -z "$cr_cv_ksymtab___flush_icache_range"; then cr_result='not found' else if expr "$cr_cv_ksymtab___flush_icache_range" : N >/dev/null; then { { $as_echo "$as_me:$LINENO: error: Found symbol __flush_icache_range but no declaration -- please file a bug report." >&5 $as_echo "$as_me: error: Found symbol __flush_icache_range but no declaration -- please file a bug report." >&2;} { (exit 1); exit 1; }; } fi cr_result=`echo $cr_cv_ksymtab___flush_icache_range | tr -d 'YN'` if test $cr_result = 0; then cr_result=exported cr_addr=0 else cr_addr="0x$cr_result" echo "_CR_IMPORT_KCODE(__flush_icache_range, $cr_addr)" >>$CR_KSYM_IMPORT_CALLS fi cat >>confdefs.h <<_ACEOF #define CR_KCODE___flush_icache_range $cr_addr _ACEOF fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel symbol table for sys_fchmod" >&5 $as_echo_n "checking kernel symbol table for sys_fchmod... " >&6; } # Our cacheval is encoded with 'Y' or 'N' as the first char to indicate # if a declaration was found or not, and the address or 0 as the rest. if test "${cr_cv_ksymtab_sys_fchmod+set}" = set; then $as_echo_n "(cached) " >&6 else cr_cv_ksymtab_sys_fchmod=`eval $LINUX_SYMTAB_CMD | sed -n -e "/${CR_KSYM_PATTERN_CODE}sys_fchmod$/ {s/ .*//p;q;}"` if test -n "$cr_cv_ksymtab_sys_fchmod"; then if eval $LINUX_SYMTAB_CMD | grep " __ksymtab_sys_fchmod\$" >/dev/null ; then cr_cv_ksymtab_sys_fchmod=0 else if test "CODE${HAVE_CONFIG_THUMB2_KERNEL}" = 'CODE1'; then cr_cv_ksymtab_sys_fchmod=`$PERL -e "printf '%x', 1 | hex '$cr_cv_ksymtab_sys_fchmod';"` fi fi SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #define IN_CONFIGURE 1 #include "${TOP_SRCDIR}/include/blcr_imports.h.in" int main () { int x = sizeof(&sys_fchmod); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_sys_fchmod="Y$cr_cv_ksymtab_sys_fchmod" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_sys_fchmod="N$cr_cv_ksymtab_sys_fchmod" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi fi cr_addr='' if test -z "$cr_cv_ksymtab_sys_fchmod"; then cr_result='not found' else if expr "$cr_cv_ksymtab_sys_fchmod" : N >/dev/null; then cat >>$CR_KSYM_IMPORT_DECLS <<_EOF extern asmlinkage long sys_fchmod(int fd, mode_t mode); _EOF fi cr_result=`echo $cr_cv_ksymtab_sys_fchmod | tr -d 'YN'` if test $cr_result = 0; then cr_result=exported cr_addr=0 else cr_addr="0x$cr_result" echo "_CR_IMPORT_KCODE(sys_fchmod, $cr_addr)" >>$CR_KSYM_IMPORT_CALLS fi cat >>confdefs.h <<_ACEOF #define CR_KCODE_sys_fchmod $cr_addr _ACEOF fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel symbol table for sys_link" >&5 $as_echo_n "checking kernel symbol table for sys_link... " >&6; } # Our cacheval is encoded with 'Y' or 'N' as the first char to indicate # if a declaration was found or not, and the address or 0 as the rest. if test "${cr_cv_ksymtab_sys_link+set}" = set; then $as_echo_n "(cached) " >&6 else cr_cv_ksymtab_sys_link=`eval $LINUX_SYMTAB_CMD | sed -n -e "/${CR_KSYM_PATTERN_CODE}sys_link$/ {s/ .*//p;q;}"` if test -n "$cr_cv_ksymtab_sys_link"; then if eval $LINUX_SYMTAB_CMD | grep " __ksymtab_sys_link\$" >/dev/null ; then cr_cv_ksymtab_sys_link=0 else if test "CODE${HAVE_CONFIG_THUMB2_KERNEL}" = 'CODE1'; then cr_cv_ksymtab_sys_link=`$PERL -e "printf '%x', 1 | hex '$cr_cv_ksymtab_sys_link';"` fi fi SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #define IN_CONFIGURE 1 #include "${TOP_SRCDIR}/include/blcr_imports.h.in" int main () { int x = sizeof(&sys_link); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_sys_link="Y$cr_cv_ksymtab_sys_link" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_sys_link="N$cr_cv_ksymtab_sys_link" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi fi cr_addr='' if test -z "$cr_cv_ksymtab_sys_link"; then cr_result='not found' else if expr "$cr_cv_ksymtab_sys_link" : N >/dev/null; then cat >>$CR_KSYM_IMPORT_DECLS <<_EOF extern asmlinkage long sys_link(const char *oldname, const char *newname); _EOF fi cr_result=`echo $cr_cv_ksymtab_sys_link | tr -d 'YN'` if test $cr_result = 0; then cr_result=exported cr_addr=0 else cr_addr="0x$cr_result" echo "_CR_IMPORT_KCODE(sys_link, $cr_addr)" >>$CR_KSYM_IMPORT_CALLS fi cat >>confdefs.h <<_ACEOF #define CR_KCODE_sys_link $cr_addr _ACEOF fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel symbol table for sys_unlink" >&5 $as_echo_n "checking kernel symbol table for sys_unlink... " >&6; } # Our cacheval is encoded with 'Y' or 'N' as the first char to indicate # if a declaration was found or not, and the address or 0 as the rest. if test "${cr_cv_ksymtab_sys_unlink+set}" = set; then $as_echo_n "(cached) " >&6 else cr_cv_ksymtab_sys_unlink=`eval $LINUX_SYMTAB_CMD | sed -n -e "/${CR_KSYM_PATTERN_CODE}sys_unlink$/ {s/ .*//p;q;}"` if test -n "$cr_cv_ksymtab_sys_unlink"; then if eval $LINUX_SYMTAB_CMD | grep " __ksymtab_sys_unlink\$" >/dev/null ; then cr_cv_ksymtab_sys_unlink=0 else if test "CODE${HAVE_CONFIG_THUMB2_KERNEL}" = 'CODE1'; then cr_cv_ksymtab_sys_unlink=`$PERL -e "printf '%x', 1 | hex '$cr_cv_ksymtab_sys_unlink';"` fi fi SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #define IN_CONFIGURE 1 #include "${TOP_SRCDIR}/include/blcr_imports.h.in" int main () { int x = sizeof(&sys_unlink); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_sys_unlink="Y$cr_cv_ksymtab_sys_unlink" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_sys_unlink="N$cr_cv_ksymtab_sys_unlink" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi fi cr_addr='' if test -z "$cr_cv_ksymtab_sys_unlink"; then cr_result='not found' else if expr "$cr_cv_ksymtab_sys_unlink" : N >/dev/null; then cat >>$CR_KSYM_IMPORT_DECLS <<_EOF extern asmlinkage long sys_unlink(const char *pathname); _EOF fi cr_result=`echo $cr_cv_ksymtab_sys_unlink | tr -d 'YN'` if test $cr_result = 0; then cr_result=exported cr_addr=0 else cr_addr="0x$cr_result" echo "_CR_IMPORT_KCODE(sys_unlink, $cr_addr)" >>$CR_KSYM_IMPORT_CALLS fi cat >>confdefs.h <<_ACEOF #define CR_KCODE_sys_unlink $cr_addr _ACEOF fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel symbol table for sys_mknod" >&5 $as_echo_n "checking kernel symbol table for sys_mknod... " >&6; } # Our cacheval is encoded with 'Y' or 'N' as the first char to indicate # if a declaration was found or not, and the address or 0 as the rest. if test "${cr_cv_ksymtab_sys_mknod+set}" = set; then $as_echo_n "(cached) " >&6 else cr_cv_ksymtab_sys_mknod=`eval $LINUX_SYMTAB_CMD | sed -n -e "/${CR_KSYM_PATTERN_CODE}sys_mknod$/ {s/ .*//p;q;}"` if test -n "$cr_cv_ksymtab_sys_mknod"; then if eval $LINUX_SYMTAB_CMD | grep " __ksymtab_sys_mknod\$" >/dev/null ; then cr_cv_ksymtab_sys_mknod=0 else if test "CODE${HAVE_CONFIG_THUMB2_KERNEL}" = 'CODE1'; then cr_cv_ksymtab_sys_mknod=`$PERL -e "printf '%x', 1 | hex '$cr_cv_ksymtab_sys_mknod';"` fi fi SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #define IN_CONFIGURE 1 #include "${TOP_SRCDIR}/include/blcr_imports.h.in" int main () { int x = sizeof(&sys_mknod); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_sys_mknod="Y$cr_cv_ksymtab_sys_mknod" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_ksymtab_sys_mknod="N$cr_cv_ksymtab_sys_mknod" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi fi cr_addr='' if test -z "$cr_cv_ksymtab_sys_mknod"; then cr_result='not found' else if expr "$cr_cv_ksymtab_sys_mknod" : N >/dev/null; then cat >>$CR_KSYM_IMPORT_DECLS <<_EOF extern asmlinkage long sys_mknod(const char *filename, int mode, unsigned int dev); _EOF fi cr_result=`echo $cr_cv_ksymtab_sys_mknod | tr -d 'YN'` if test $cr_result = 0; then cr_result=exported cr_addr=0 else cr_addr="0x$cr_result" echo "_CR_IMPORT_KCODE(sys_mknod, $cr_addr)" >>$CR_KSYM_IMPORT_CALLS fi cat >>confdefs.h <<_ACEOF #define CR_KCODE_sys_mknod $cr_addr _ACEOF fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } # CODE & DATA used for sanity checks # # Unless you are adding additional sanity checks, there is # no good reason to add more calls to CR_FIND_EXPORTED_KSYM. # # register_{chr,blk}dev are used at module load to validate # the System.map used to locate symbols and configure time. { $as_echo "$as_me:$LINENO: checking kernel symbol table for exported register_chrdev" >&5 $as_echo_n "checking kernel symbol table for exported register_chrdev... " >&6; } if test "${cr_cv_ksymtab_exp_register_chrdev+set}" = set; then $as_echo_n "(cached) " >&6 else cr_cv_ksymtab_exp_register_chrdev=`eval $LINUX_SYMTAB_CMD | sed -n -e "/${CR_KSYM_PATTERN_CODE}register_chrdev$/ {s/ .*//p;q;}"` if test -n "$cr_cv_ksymtab_exp_register_chrdev" && eval $LINUX_SYMTAB_CMD | grep " __ksymtab_register_chrdev\$" >/dev/null; then : # keep it else cr_cv_ksymtab_exp_register_chrdev='' fi fi if test -n "$cr_cv_ksymtab_exp_register_chrdev"; then if test "CODE${HAVE_CONFIG_THUMB2_KERNEL}" = 'CODE1'; then cr_cv_ksymtab_exp_register_chrdev=`$PERL -e "printf '%x', 1 | hex '$cr_cv_ksymtab_exp_register_chrdev';"` fi cr_result="$cr_cv_ksymtab_exp_register_chrdev" cr_addr="0x$cr_cv_ksymtab_exp_register_chrdev" cat >>confdefs.h <<_ACEOF #define CR_EXPORTED_KCODE_register_chrdev $cr_addr _ACEOF else cr_result='not found' cr_addr=0 fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } if test "$cr_addr" = "0"; then { $as_echo "$as_me:$LINENO: checking kernel symbol table for exported __register_chrdev" >&5 $as_echo_n "checking kernel symbol table for exported __register_chrdev... " >&6; } if test "${cr_cv_ksymtab_exp___register_chrdev+set}" = set; then $as_echo_n "(cached) " >&6 else cr_cv_ksymtab_exp___register_chrdev=`eval $LINUX_SYMTAB_CMD | sed -n -e "/${CR_KSYM_PATTERN_CODE}__register_chrdev$/ {s/ .*//p;q;}"` if test -n "$cr_cv_ksymtab_exp___register_chrdev" && eval $LINUX_SYMTAB_CMD | grep " __ksymtab___register_chrdev\$" >/dev/null; then : # keep it else cr_cv_ksymtab_exp___register_chrdev='' fi fi if test -n "$cr_cv_ksymtab_exp___register_chrdev"; then if test "CODE${HAVE_CONFIG_THUMB2_KERNEL}" = 'CODE1'; then cr_cv_ksymtab_exp___register_chrdev=`$PERL -e "printf '%x', 1 | hex '$cr_cv_ksymtab_exp___register_chrdev';"` fi cr_result="$cr_cv_ksymtab_exp___register_chrdev" cr_addr="0x$cr_cv_ksymtab_exp___register_chrdev" cat >>confdefs.h <<_ACEOF #define CR_EXPORTED_KCODE___register_chrdev $cr_addr _ACEOF else cr_result='not found' cr_addr=0 fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } if test "$cr_addr" = "0"; then 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:$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= ;; #( *) $as_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 test "x$cache_file" != "x/dev/null" && { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache echo "======================================================================" echo "Please review the following configuration information:" echo " Kernel source directory = $LINUX_SRC" echo " Kernel build directory = $LINUX_OBJ" echo " Kernel symbol table = ${LINUX_SYSTEM_MAP}${LINUX_VMLINUX}" echo " Kernel version probed from kernel build = $LINUX_VER" echo " Kernel running currently = `uname -r`" echo "======================================================================" { { $as_echo "$as_me:$LINENO: error: Unable to use kernel $LINUX_VER - kernel does not export register_chrdev or __register_chrdev" >&5 $as_echo "$as_me: error: Unable to use kernel $LINUX_VER - kernel does not export register_chrdev or __register_chrdev" >&2;} { (exit 1); exit 1; }; } fi fi { $as_echo "$as_me:$LINENO: checking kernel symbol table for exported register_blkdev" >&5 $as_echo_n "checking kernel symbol table for exported register_blkdev... " >&6; } if test "${cr_cv_ksymtab_exp_register_blkdev+set}" = set; then $as_echo_n "(cached) " >&6 else cr_cv_ksymtab_exp_register_blkdev=`eval $LINUX_SYMTAB_CMD | sed -n -e "/${CR_KSYM_PATTERN_CODE}register_blkdev$/ {s/ .*//p;q;}"` if test -n "$cr_cv_ksymtab_exp_register_blkdev" && eval $LINUX_SYMTAB_CMD | grep " __ksymtab_register_blkdev\$" >/dev/null; then : # keep it else cr_cv_ksymtab_exp_register_blkdev='' fi fi if test -n "$cr_cv_ksymtab_exp_register_blkdev"; then if test "CODE${HAVE_CONFIG_THUMB2_KERNEL}" = 'CODE1'; then cr_cv_ksymtab_exp_register_blkdev=`$PERL -e "printf '%x', 1 | hex '$cr_cv_ksymtab_exp_register_blkdev';"` fi cr_result="$cr_cv_ksymtab_exp_register_blkdev" cr_addr="0x$cr_cv_ksymtab_exp_register_blkdev" cat >>confdefs.h <<_ACEOF #define CR_EXPORTED_KCODE_register_blkdev $cr_addr _ACEOF else cr_result='not found' cr_addr=0 fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } if test "$cr_addr" = "0"; then 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:$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= ;; #( *) $as_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 test "x$cache_file" != "x/dev/null" && { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache echo "======================================================================" echo "Please review the following configuration information:" echo " Kernel source directory = $LINUX_SRC" echo " Kernel build directory = $LINUX_OBJ" echo " Kernel symbol table = ${LINUX_SYSTEM_MAP}${LINUX_VMLINUX}" echo " Kernel version probed from kernel build = $LINUX_VER" echo " Kernel running currently = `uname -r`" echo "======================================================================" { { $as_echo "$as_me:$LINENO: error: Unable to use kernel $LINUX_VER - kernel does not export register_blkdev" >&5 $as_echo "$as_me: error: Unable to use kernel $LINUX_VER - kernel does not export register_blkdev" >&2;} { (exit 1); exit 1; }; } fi # One of {init,system}_utsname is used to validate UTS_RELEASE { $as_echo "$as_me:$LINENO: checking kernel for init_utsname" >&5 $as_echo_n "checking kernel for init_utsname... " >&6; } if test "${cr_cv_kconfig_HAVE_INIT_UTSNAME+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { #ifdef init_utsname /* OK, it exists and is a macro */ #else /* Check for function case */ int x = sizeof(&init_utsname); #endif ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_INIT_UTSNAME=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_INIT_UTSNAME=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_INIT_UTSNAME if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_INIT_UTSNAME 1 _ACEOF HAVE_INIT_UTSNAME=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_INIT_UTSNAME 0 _ACEOF HAVE_INIT_UTSNAME='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } { $as_echo "$as_me:$LINENO: checking kernel for system_utsname" >&5 $as_echo_n "checking kernel for system_utsname... " >&6; } if test "${cr_cv_kconfig_HAVE_SYSTEM_UTSNAME+set}" = set; then $as_echo_n "(cached) " >&6 else SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include #include int main () { int x = sizeof(&system_utsname); ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_SYSTEM_UTSNAME=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS cr_cv_kconfig_HAVE_SYSTEM_UTSNAME=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi cr_result=$cr_cv_kconfig_HAVE_SYSTEM_UTSNAME if test $cr_result = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_SYSTEM_UTSNAME 1 _ACEOF HAVE_SYSTEM_UTSNAME=1 else cat >>confdefs.h <<\_ACEOF #define HAVE_SYSTEM_UTSNAME 0 _ACEOF HAVE_SYSTEM_UTSNAME='' fi { $as_echo "$as_me:$LINENO: result: $cr_result" >&5 $as_echo "$cr_result" >&6; } if test -z "${HAVE_INIT_UTSNAME}${HAVE_SYSTEM_UTSNAME}"; then 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:$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= ;; #( *) $as_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 test "x$cache_file" != "x/dev/null" && { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache echo "======================================================================" echo "Please review the following configuration information:" echo " Kernel source directory = $LINUX_SRC" echo " Kernel build directory = $LINUX_OBJ" echo " Kernel symbol table = ${LINUX_SYSTEM_MAP}${LINUX_VMLINUX}" echo " Kernel version probed from kernel build = $LINUX_VER" echo " Kernel running currently = `uname -r`" echo "======================================================================" { { $as_echo "$as_me:$LINENO: error: Unable to use kernel $LINUX_VER - unable to determine how to query UTSNAME" >&5 $as_echo "$as_me: error: Unable to use kernel $LINUX_VER - unable to determine how to query UTSNAME" >&2;} { (exit 1); exit 1; }; } fi cat >>confdefs.h <<_ACEOF #define BLCR_CONFIG_TIMESTAMP "`date`" _ACEOF fi # cr_build_modules if test x"$cr_build_libcr" = xyes && expr $CR_ARCH : ppc >/dev/null; then { $as_echo "$as_me:$LINENO: checking for work around for bug 2524" >&5 $as_echo_n "checking for work around for bug 2524... " >&6; } if test "$cr_build_modules,$force_bug2524" = "yes,"; then if test `echo $LINUX_VER | sed -e 's/^2\.6\.\([0-9]*\).*/\1/;' -e 's/^3\..*/999/;'` -le 15; then { { $as_echo "$as_me:$LINENO: error: Because you are building for a PowerPC kernel 2.6.15 or older, you must specify either --with-bug2524 or --without-bug2524. If in doubt --with-bug2524 is the safe option (with a small performance penalty)." >&5 $as_echo "$as_me: error: Because you are building for a PowerPC kernel 2.6.15 or older, you must specify either --with-bug2524 or --without-bug2524. If in doubt --with-bug2524 is the safe option (with a small performance penalty)." >&2;} { (exit 1); exit 1; }; } fi fi case "$force_bug2524" in yes|no) ;; # nothing to do '') force_bug2524=no ;; # empty is no *) { { $as_echo "$as_me:$LINENO: error: Argument to --with-bug2524 must be 'yes', 'no' or empty" >&5 $as_echo "$as_me: error: Argument to --with-bug2524 must be 'yes', 'no' or empty" >&2;} { (exit 1); exit 1; }; } ;; esac { $as_echo "$as_me:$LINENO: result: $force_bug2524" >&5 $as_echo "$force_bug2524" >&6; } if test x$force_bug2524 = xyes; then cat >>confdefs.h <<\_ACEOF #define CR_HAVE_BUG2524 1 _ACEOF else cat >>confdefs.h <<\_ACEOF #define CR_HAVE_BUG2524 0 _ACEOF fi fi ################################################################################ # AM_CONDITIONAL may not be called contitionally, so these go here ################################################################################ if echo $LINUX_SYMTAB_CMD | grep ^cat >/dev/null 2>&1; then CR_HAVE_SYSTEM_MAP_TRUE= CR_HAVE_SYSTEM_MAP_FALSE='#' else CR_HAVE_SYSTEM_MAP_TRUE='#' CR_HAVE_SYSTEM_MAP_FALSE= fi if test x$cr_build_util$cross_compiling = xyesno; then CR_BUILD_MAN_TRUE= CR_BUILD_MAN_FALSE='#' else CR_BUILD_MAN_TRUE='#' CR_BUILD_MAN_FALSE= fi if test x$cr_have_ftb = xyes; then CR_HAVE_FTB_TRUE= CR_HAVE_FTB_FALSE='#' else CR_HAVE_FTB_TRUE='#' CR_HAVE_FTB_FALSE= fi if test "x$CXX" != xno; then CR_HAVE_CXX_TRUE= CR_HAVE_CXX_FALSE='#' else CR_HAVE_CXX_TRUE='#' CR_HAVE_CXX_FALSE= fi ################################################################################ # Automake sillyness ################################################################################ GMAKE_IFEQ=ifeq GMAKE_IFNEQ=ifneq GMAKE_ELSE=else GMAKE_ENDIF=endif ################################################################################ # Kbuild glue ################################################################################ KBUILD_MAK="${TOP_BUILDDIR}/config/kbuild.mak" ################################################################################ # Enable/disable building various pieces of the code ################################################################################ if test x$enable_cr_info = xyes; then BUILD_CR_INFO_TRUE= BUILD_CR_INFO_FALSE='#' else BUILD_CR_INFO_TRUE='#' BUILD_CR_INFO_FALSE= fi if false; then BUILD_VMADLIB_TRUE= BUILD_VMADLIB_FALSE='#' else BUILD_VMADLIB_TRUE='#' BUILD_VMADLIB_FALSE= fi if test x$cr_build_modules = xyes; then CR_BUILD_MODULES_TRUE= CR_BUILD_MODULES_FALSE='#' else CR_BUILD_MODULES_TRUE='#' CR_BUILD_MODULES_FALSE= fi if test x$cr_build_util = xyes; then CR_BUILD_UTIL_TRUE= CR_BUILD_UTIL_FALSE='#' else CR_BUILD_UTIL_TRUE='#' CR_BUILD_UTIL_FALSE= fi if test x$cr_build_libcr = xyes; then CR_BUILD_LIBCR_TRUE= CR_BUILD_LIBCR_FALSE='#' else CR_BUILD_LIBCR_TRUE='#' CR_BUILD_LIBCR_FALSE= fi if test x$cr_build_include = xyes; then CR_BUILD_INCLUDE_TRUE= CR_BUILD_INCLUDE_FALSE='#' else CR_BUILD_INCLUDE_TRUE='#' CR_BUILD_INCLUDE_FALSE= fi if test x$cr_build_tests = xyes; then CR_BUILD_TESTS_TRUE= CR_BUILD_TESTS_FALSE='#' else CR_BUILD_TESTS_TRUE='#' CR_BUILD_TESTS_FALSE= fi if test x$cr_build_examples = xyes; then CR_BUILD_EXAMPLES_TRUE= CR_BUILD_EXAMPLES_FALSE='#' else CR_BUILD_EXAMPLES_TRUE='#' CR_BUILD_EXAMPLES_FALSE= fi if test x$cr_build_contrib = xyes; then CR_BUILD_CONTRIB_TRUE= CR_BUILD_CONTRIB_FALSE='#' else CR_BUILD_CONTRIB_TRUE='#' CR_BUILD_CONTRIB_FALSE= fi ################################################################################ # Finally generate the files and a report (unless supressed) ################################################################################ if test x"$cr_build_modules" = xyes; then ac_config_files="$ac_config_files cr_module/Makefile cr_module/kbuild/Makefile vmadump4/Makefile include/blcr_imports.h blcr_imports/imports.c blcr_imports/Makefile blcr_imports/kbuild/Makefile config/kbuild.mak" fi if test x"$cr_build_util" = xyes; then ac_config_files="$ac_config_files util/Makefile util/cr_checkpoint/Makefile util/cr_restart/Makefile util/cr_run/Makefile util/cr_info/Makefile man/Makefile" fi if test x"$cr_build_libcr" = xyes; then ac_config_files="$ac_config_files libcr/Makefile" fi if test x"$cr_build_tests" = xyes; then ac_config_files="$ac_config_files tests/Makefile" ac_config_files="$ac_config_files tests/shellinit" fi if test x"$cr_build_examples" = xyes; then ac_config_files="$ac_config_files examples/Makefile examples/counting/Makefile examples/pthread_counting/Makefile examples/pthread_misc/Makefile examples/file_counting/Makefile examples/io_bench/Makefile examples/pipe_counting/Makefile" fi if test x"$cr_build_contrib" = xyes; then ac_config_files="$ac_config_files contrib/Makefile" ac_config_files="$ac_config_files contrib/cr_insmod" ac_config_files="$ac_config_files contrib/gen_cscope" ac_config_files="$ac_config_files contrib/batch_build" fi ac_config_headers="$ac_config_headers blcr_config.h" ac_config_files="$ac_config_files Makefile etc/Makefile rpm/Makefile rpm/specfile include/Makefile include/blcr_common.h doc/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:$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= ;; #( *) $as_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 test "x$cache_file" != "x/dev/null" && { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= 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. ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi if test -z "${CRI_DEBUG_TRUE}" && test -z "${CRI_DEBUG_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"CRI_DEBUG\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"CRI_DEBUG\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${LIBCR_TRACING_TRUE}" && test -z "${LIBCR_TRACING_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"LIBCR_TRACING\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"LIBCR_TRACING\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${CR_KERNEL_TRACING_TRUE}" && test -z "${CR_KERNEL_TRACING_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"CR_KERNEL_TRACING\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"CR_KERNEL_TRACING\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${CR_BUILD_ETC_TRUE}" && test -z "${CR_BUILD_ETC_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"CR_BUILD_ETC\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"CR_BUILD_ETC\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${CR_INSTALLED_LIBCR_TRUE}" && test -z "${CR_INSTALLED_LIBCR_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"CR_INSTALLED_LIBCR\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"CR_INSTALLED_LIBCR\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${CR_INSTALLED_UTIL_TRUE}" && test -z "${CR_INSTALLED_UTIL_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"CR_INSTALLED_UTIL\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"CR_INSTALLED_UTIL\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${CR_BUILD_TESTSUITE_TRUE}" && test -z "${CR_BUILD_TESTSUITE_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"CR_BUILD_TESTSUITE\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"CR_BUILD_TESTSUITE\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${CR_ENABLE_STATIC_TRUE}" && test -z "${CR_ENABLE_STATIC_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"CR_ENABLE_STATIC\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"CR_ENABLE_STATIC\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${CR_ENABLE_SHARED_TRUE}" && test -z "${CR_ENABLE_SHARED_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"CR_ENABLE_SHARED\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"CR_ENABLE_SHARED\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${HAVE_RPMBUILD_TRUE}" && test -z "${HAVE_RPMBUILD_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"HAVE_RPMBUILD\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"HAVE_RPMBUILD\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${CR_BUILD_LIBCR32_TRUE}" && test -z "${CR_BUILD_LIBCR32_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"CR_BUILD_LIBCR32\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"CR_BUILD_LIBCR32\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${CR_HAVE_SYSTEM_MAP_TRUE}" && test -z "${CR_HAVE_SYSTEM_MAP_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"CR_HAVE_SYSTEM_MAP\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"CR_HAVE_SYSTEM_MAP\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${CR_BUILD_MAN_TRUE}" && test -z "${CR_BUILD_MAN_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"CR_BUILD_MAN\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"CR_BUILD_MAN\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${CR_HAVE_FTB_TRUE}" && test -z "${CR_HAVE_FTB_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"CR_HAVE_FTB\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"CR_HAVE_FTB\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${CR_HAVE_CXX_TRUE}" && test -z "${CR_HAVE_CXX_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"CR_HAVE_CXX\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"CR_HAVE_CXX\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${BUILD_CR_INFO_TRUE}" && test -z "${BUILD_CR_INFO_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"BUILD_CR_INFO\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"BUILD_CR_INFO\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${BUILD_VMADLIB_TRUE}" && test -z "${BUILD_VMADLIB_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"BUILD_VMADLIB\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"BUILD_VMADLIB\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${CR_BUILD_MODULES_TRUE}" && test -z "${CR_BUILD_MODULES_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"CR_BUILD_MODULES\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"CR_BUILD_MODULES\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${CR_BUILD_UTIL_TRUE}" && test -z "${CR_BUILD_UTIL_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"CR_BUILD_UTIL\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"CR_BUILD_UTIL\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${CR_BUILD_LIBCR_TRUE}" && test -z "${CR_BUILD_LIBCR_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"CR_BUILD_LIBCR\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"CR_BUILD_LIBCR\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${CR_BUILD_INCLUDE_TRUE}" && test -z "${CR_BUILD_INCLUDE_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"CR_BUILD_INCLUDE\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"CR_BUILD_INCLUDE\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${CR_BUILD_TESTS_TRUE}" && test -z "${CR_BUILD_TESTS_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"CR_BUILD_TESTS\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"CR_BUILD_TESTS\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${CR_BUILD_EXAMPLES_TRUE}" && test -z "${CR_BUILD_EXAMPLES_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"CR_BUILD_EXAMPLES\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"CR_BUILD_EXAMPLES\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${CR_BUILD_CONTRIB_TRUE}" && test -z "${CR_BUILD_CONTRIB_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"CR_BUILD_CONTRIB\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"CR_BUILD_CONTRIB\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } 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:$LINENO: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF || ac_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} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_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 # PATH needs CR # 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_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 if (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 # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false 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. 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); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # Required to use basename. 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 # Name of the executable. 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'` # CDPATH. $as_unset CDPATH as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. 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 { (exit 1); exit 1; }; } # 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 } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi 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 -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi else as_ln_s='cp -p' 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=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # 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 # 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 blcr $as_me 0.8.5, which was generated by GNU Autoconf 2.63. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTION]... [FILE]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_version="\\ blcr config.status 0.8.5 configured by $0, generated by GNU Autoconf 2.63, with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2008 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=$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 ;; --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"` ;; esac CONFIG_FILES="$CONFIG_FILES '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac CONFIG_HEADERS="$CONFIG_HEADERS '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header { $as_echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; };; --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_echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *) ac_config_targets="$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' enable_static='`$ECHO "X$enable_static" | $Xsed -e "$delay_single_quote_subst"`' macro_version='`$ECHO "X$macro_version" | $Xsed -e "$delay_single_quote_subst"`' macro_revision='`$ECHO "X$macro_revision" | $Xsed -e "$delay_single_quote_subst"`' enable_shared='`$ECHO "X$enable_shared" | $Xsed -e "$delay_single_quote_subst"`' pic_mode='`$ECHO "X$pic_mode" | $Xsed -e "$delay_single_quote_subst"`' enable_fast_install='`$ECHO "X$enable_fast_install" | $Xsed -e "$delay_single_quote_subst"`' host_alias='`$ECHO "X$host_alias" | $Xsed -e "$delay_single_quote_subst"`' host='`$ECHO "X$host" | $Xsed -e "$delay_single_quote_subst"`' host_os='`$ECHO "X$host_os" | $Xsed -e "$delay_single_quote_subst"`' build_alias='`$ECHO "X$build_alias" | $Xsed -e "$delay_single_quote_subst"`' build='`$ECHO "X$build" | $Xsed -e "$delay_single_quote_subst"`' build_os='`$ECHO "X$build_os" | $Xsed -e "$delay_single_quote_subst"`' SED='`$ECHO "X$SED" | $Xsed -e "$delay_single_quote_subst"`' Xsed='`$ECHO "X$Xsed" | $Xsed -e "$delay_single_quote_subst"`' GREP='`$ECHO "X$GREP" | $Xsed -e "$delay_single_quote_subst"`' EGREP='`$ECHO "X$EGREP" | $Xsed -e "$delay_single_quote_subst"`' FGREP='`$ECHO "X$FGREP" | $Xsed -e "$delay_single_quote_subst"`' LD='`$ECHO "X$LD" | $Xsed -e "$delay_single_quote_subst"`' NM='`$ECHO "X$NM" | $Xsed -e "$delay_single_quote_subst"`' LN_S='`$ECHO "X$LN_S" | $Xsed -e "$delay_single_quote_subst"`' max_cmd_len='`$ECHO "X$max_cmd_len" | $Xsed -e "$delay_single_quote_subst"`' ac_objext='`$ECHO "X$ac_objext" | $Xsed -e "$delay_single_quote_subst"`' exeext='`$ECHO "X$exeext" | $Xsed -e "$delay_single_quote_subst"`' lt_unset='`$ECHO "X$lt_unset" | $Xsed -e "$delay_single_quote_subst"`' lt_SP2NL='`$ECHO "X$lt_SP2NL" | $Xsed -e "$delay_single_quote_subst"`' lt_NL2SP='`$ECHO "X$lt_NL2SP" | $Xsed -e "$delay_single_quote_subst"`' reload_flag='`$ECHO "X$reload_flag" | $Xsed -e "$delay_single_quote_subst"`' reload_cmds='`$ECHO "X$reload_cmds" | $Xsed -e "$delay_single_quote_subst"`' OBJDUMP='`$ECHO "X$OBJDUMP" | $Xsed -e "$delay_single_quote_subst"`' deplibs_check_method='`$ECHO "X$deplibs_check_method" | $Xsed -e "$delay_single_quote_subst"`' file_magic_cmd='`$ECHO "X$file_magic_cmd" | $Xsed -e "$delay_single_quote_subst"`' AR='`$ECHO "X$AR" | $Xsed -e "$delay_single_quote_subst"`' AR_FLAGS='`$ECHO "X$AR_FLAGS" | $Xsed -e "$delay_single_quote_subst"`' STRIP='`$ECHO "X$STRIP" | $Xsed -e "$delay_single_quote_subst"`' RANLIB='`$ECHO "X$RANLIB" | $Xsed -e "$delay_single_quote_subst"`' old_postinstall_cmds='`$ECHO "X$old_postinstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' old_postuninstall_cmds='`$ECHO "X$old_postuninstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' old_archive_cmds='`$ECHO "X$old_archive_cmds" | $Xsed -e "$delay_single_quote_subst"`' CC='`$ECHO "X$CC" | $Xsed -e "$delay_single_quote_subst"`' CFLAGS='`$ECHO "X$CFLAGS" | $Xsed -e "$delay_single_quote_subst"`' compiler='`$ECHO "X$compiler" | $Xsed -e "$delay_single_quote_subst"`' GCC='`$ECHO "X$GCC" | $Xsed -e "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_pipe='`$ECHO "X$lt_cv_sys_global_symbol_pipe" | $Xsed -e "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_cdecl='`$ECHO "X$lt_cv_sys_global_symbol_to_cdecl" | $Xsed -e "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "X$lt_cv_sys_global_symbol_to_c_name_address" | $Xsed -e "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "X$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $Xsed -e "$delay_single_quote_subst"`' objdir='`$ECHO "X$objdir" | $Xsed -e "$delay_single_quote_subst"`' SHELL='`$ECHO "X$SHELL" | $Xsed -e "$delay_single_quote_subst"`' ECHO='`$ECHO "X$ECHO" | $Xsed -e "$delay_single_quote_subst"`' MAGIC_CMD='`$ECHO "X$MAGIC_CMD" | $Xsed -e "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag='`$ECHO "X$lt_prog_compiler_no_builtin_flag" | $Xsed -e "$delay_single_quote_subst"`' lt_prog_compiler_wl='`$ECHO "X$lt_prog_compiler_wl" | $Xsed -e "$delay_single_quote_subst"`' lt_prog_compiler_pic='`$ECHO "X$lt_prog_compiler_pic" | $Xsed -e "$delay_single_quote_subst"`' lt_prog_compiler_static='`$ECHO "X$lt_prog_compiler_static" | $Xsed -e "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o='`$ECHO "X$lt_cv_prog_compiler_c_o" | $Xsed -e "$delay_single_quote_subst"`' need_locks='`$ECHO "X$need_locks" | $Xsed -e "$delay_single_quote_subst"`' DSYMUTIL='`$ECHO "X$DSYMUTIL" | $Xsed -e "$delay_single_quote_subst"`' NMEDIT='`$ECHO "X$NMEDIT" | $Xsed -e "$delay_single_quote_subst"`' LIPO='`$ECHO "X$LIPO" | $Xsed -e "$delay_single_quote_subst"`' OTOOL='`$ECHO "X$OTOOL" | $Xsed -e "$delay_single_quote_subst"`' OTOOL64='`$ECHO "X$OTOOL64" | $Xsed -e "$delay_single_quote_subst"`' libext='`$ECHO "X$libext" | $Xsed -e "$delay_single_quote_subst"`' shrext_cmds='`$ECHO "X$shrext_cmds" | $Xsed -e "$delay_single_quote_subst"`' extract_expsyms_cmds='`$ECHO "X$extract_expsyms_cmds" | $Xsed -e "$delay_single_quote_subst"`' archive_cmds_need_lc='`$ECHO "X$archive_cmds_need_lc" | $Xsed -e "$delay_single_quote_subst"`' enable_shared_with_static_runtimes='`$ECHO "X$enable_shared_with_static_runtimes" | $Xsed -e "$delay_single_quote_subst"`' export_dynamic_flag_spec='`$ECHO "X$export_dynamic_flag_spec" | $Xsed -e "$delay_single_quote_subst"`' whole_archive_flag_spec='`$ECHO "X$whole_archive_flag_spec" | $Xsed -e "$delay_single_quote_subst"`' compiler_needs_object='`$ECHO "X$compiler_needs_object" | $Xsed -e "$delay_single_quote_subst"`' old_archive_from_new_cmds='`$ECHO "X$old_archive_from_new_cmds" | $Xsed -e "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds='`$ECHO "X$old_archive_from_expsyms_cmds" | $Xsed -e "$delay_single_quote_subst"`' archive_cmds='`$ECHO "X$archive_cmds" | $Xsed -e "$delay_single_quote_subst"`' archive_expsym_cmds='`$ECHO "X$archive_expsym_cmds" | $Xsed -e "$delay_single_quote_subst"`' module_cmds='`$ECHO "X$module_cmds" | $Xsed -e "$delay_single_quote_subst"`' module_expsym_cmds='`$ECHO "X$module_expsym_cmds" | $Xsed -e "$delay_single_quote_subst"`' with_gnu_ld='`$ECHO "X$with_gnu_ld" | $Xsed -e "$delay_single_quote_subst"`' allow_undefined_flag='`$ECHO "X$allow_undefined_flag" | $Xsed -e "$delay_single_quote_subst"`' no_undefined_flag='`$ECHO "X$no_undefined_flag" | $Xsed -e "$delay_single_quote_subst"`' hardcode_libdir_flag_spec='`$ECHO "X$hardcode_libdir_flag_spec" | $Xsed -e "$delay_single_quote_subst"`' hardcode_libdir_flag_spec_ld='`$ECHO "X$hardcode_libdir_flag_spec_ld" | $Xsed -e "$delay_single_quote_subst"`' hardcode_libdir_separator='`$ECHO "X$hardcode_libdir_separator" | $Xsed -e "$delay_single_quote_subst"`' hardcode_direct='`$ECHO "X$hardcode_direct" | $Xsed -e "$delay_single_quote_subst"`' hardcode_direct_absolute='`$ECHO "X$hardcode_direct_absolute" | $Xsed -e "$delay_single_quote_subst"`' hardcode_minus_L='`$ECHO "X$hardcode_minus_L" | $Xsed -e "$delay_single_quote_subst"`' hardcode_shlibpath_var='`$ECHO "X$hardcode_shlibpath_var" | $Xsed -e "$delay_single_quote_subst"`' hardcode_automatic='`$ECHO "X$hardcode_automatic" | $Xsed -e "$delay_single_quote_subst"`' inherit_rpath='`$ECHO "X$inherit_rpath" | $Xsed -e "$delay_single_quote_subst"`' link_all_deplibs='`$ECHO "X$link_all_deplibs" | $Xsed -e "$delay_single_quote_subst"`' fix_srcfile_path='`$ECHO "X$fix_srcfile_path" | $Xsed -e "$delay_single_quote_subst"`' always_export_symbols='`$ECHO "X$always_export_symbols" | $Xsed -e "$delay_single_quote_subst"`' export_symbols_cmds='`$ECHO "X$export_symbols_cmds" | $Xsed -e "$delay_single_quote_subst"`' exclude_expsyms='`$ECHO "X$exclude_expsyms" | $Xsed -e "$delay_single_quote_subst"`' include_expsyms='`$ECHO "X$include_expsyms" | $Xsed -e "$delay_single_quote_subst"`' prelink_cmds='`$ECHO "X$prelink_cmds" | $Xsed -e "$delay_single_quote_subst"`' file_list_spec='`$ECHO "X$file_list_spec" | $Xsed -e "$delay_single_quote_subst"`' variables_saved_for_relink='`$ECHO "X$variables_saved_for_relink" | $Xsed -e "$delay_single_quote_subst"`' need_lib_prefix='`$ECHO "X$need_lib_prefix" | $Xsed -e "$delay_single_quote_subst"`' need_version='`$ECHO "X$need_version" | $Xsed -e "$delay_single_quote_subst"`' version_type='`$ECHO "X$version_type" | $Xsed -e "$delay_single_quote_subst"`' runpath_var='`$ECHO "X$runpath_var" | $Xsed -e "$delay_single_quote_subst"`' shlibpath_var='`$ECHO "X$shlibpath_var" | $Xsed -e "$delay_single_quote_subst"`' shlibpath_overrides_runpath='`$ECHO "X$shlibpath_overrides_runpath" | $Xsed -e "$delay_single_quote_subst"`' libname_spec='`$ECHO "X$libname_spec" | $Xsed -e "$delay_single_quote_subst"`' library_names_spec='`$ECHO "X$library_names_spec" | $Xsed -e "$delay_single_quote_subst"`' soname_spec='`$ECHO "X$soname_spec" | $Xsed -e "$delay_single_quote_subst"`' postinstall_cmds='`$ECHO "X$postinstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' postuninstall_cmds='`$ECHO "X$postuninstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' finish_cmds='`$ECHO "X$finish_cmds" | $Xsed -e "$delay_single_quote_subst"`' finish_eval='`$ECHO "X$finish_eval" | $Xsed -e "$delay_single_quote_subst"`' hardcode_into_libs='`$ECHO "X$hardcode_into_libs" | $Xsed -e "$delay_single_quote_subst"`' sys_lib_search_path_spec='`$ECHO "X$sys_lib_search_path_spec" | $Xsed -e "$delay_single_quote_subst"`' sys_lib_dlsearch_path_spec='`$ECHO "X$sys_lib_dlsearch_path_spec" | $Xsed -e "$delay_single_quote_subst"`' hardcode_action='`$ECHO "X$hardcode_action" | $Xsed -e "$delay_single_quote_subst"`' enable_dlopen='`$ECHO "X$enable_dlopen" | $Xsed -e "$delay_single_quote_subst"`' enable_dlopen_self='`$ECHO "X$enable_dlopen_self" | $Xsed -e "$delay_single_quote_subst"`' enable_dlopen_self_static='`$ECHO "X$enable_dlopen_self_static" | $Xsed -e "$delay_single_quote_subst"`' old_striplib='`$ECHO "X$old_striplib" | $Xsed -e "$delay_single_quote_subst"`' striplib='`$ECHO "X$striplib" | $Xsed -e "$delay_single_quote_subst"`' compiler_lib_search_dirs='`$ECHO "X$compiler_lib_search_dirs" | $Xsed -e "$delay_single_quote_subst"`' predep_objects='`$ECHO "X$predep_objects" | $Xsed -e "$delay_single_quote_subst"`' postdep_objects='`$ECHO "X$postdep_objects" | $Xsed -e "$delay_single_quote_subst"`' predeps='`$ECHO "X$predeps" | $Xsed -e "$delay_single_quote_subst"`' postdeps='`$ECHO "X$postdeps" | $Xsed -e "$delay_single_quote_subst"`' compiler_lib_search_path='`$ECHO "X$compiler_lib_search_path" | $Xsed -e "$delay_single_quote_subst"`' LD_CXX='`$ECHO "X$LD_CXX" | $Xsed -e "$delay_single_quote_subst"`' old_archive_cmds_CXX='`$ECHO "X$old_archive_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' compiler_CXX='`$ECHO "X$compiler_CXX" | $Xsed -e "$delay_single_quote_subst"`' GCC_CXX='`$ECHO "X$GCC_CXX" | $Xsed -e "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag_CXX='`$ECHO "X$lt_prog_compiler_no_builtin_flag_CXX" | $Xsed -e "$delay_single_quote_subst"`' lt_prog_compiler_wl_CXX='`$ECHO "X$lt_prog_compiler_wl_CXX" | $Xsed -e "$delay_single_quote_subst"`' lt_prog_compiler_pic_CXX='`$ECHO "X$lt_prog_compiler_pic_CXX" | $Xsed -e "$delay_single_quote_subst"`' lt_prog_compiler_static_CXX='`$ECHO "X$lt_prog_compiler_static_CXX" | $Xsed -e "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o_CXX='`$ECHO "X$lt_cv_prog_compiler_c_o_CXX" | $Xsed -e "$delay_single_quote_subst"`' archive_cmds_need_lc_CXX='`$ECHO "X$archive_cmds_need_lc_CXX" | $Xsed -e "$delay_single_quote_subst"`' enable_shared_with_static_runtimes_CXX='`$ECHO "X$enable_shared_with_static_runtimes_CXX" | $Xsed -e "$delay_single_quote_subst"`' export_dynamic_flag_spec_CXX='`$ECHO "X$export_dynamic_flag_spec_CXX" | $Xsed -e "$delay_single_quote_subst"`' whole_archive_flag_spec_CXX='`$ECHO "X$whole_archive_flag_spec_CXX" | $Xsed -e "$delay_single_quote_subst"`' compiler_needs_object_CXX='`$ECHO "X$compiler_needs_object_CXX" | $Xsed -e "$delay_single_quote_subst"`' old_archive_from_new_cmds_CXX='`$ECHO "X$old_archive_from_new_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds_CXX='`$ECHO "X$old_archive_from_expsyms_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' archive_cmds_CXX='`$ECHO "X$archive_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' archive_expsym_cmds_CXX='`$ECHO "X$archive_expsym_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' module_cmds_CXX='`$ECHO "X$module_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' module_expsym_cmds_CXX='`$ECHO "X$module_expsym_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' with_gnu_ld_CXX='`$ECHO "X$with_gnu_ld_CXX" | $Xsed -e "$delay_single_quote_subst"`' allow_undefined_flag_CXX='`$ECHO "X$allow_undefined_flag_CXX" | $Xsed -e "$delay_single_quote_subst"`' no_undefined_flag_CXX='`$ECHO "X$no_undefined_flag_CXX" | $Xsed -e "$delay_single_quote_subst"`' hardcode_libdir_flag_spec_CXX='`$ECHO "X$hardcode_libdir_flag_spec_CXX" | $Xsed -e "$delay_single_quote_subst"`' hardcode_libdir_flag_spec_ld_CXX='`$ECHO "X$hardcode_libdir_flag_spec_ld_CXX" | $Xsed -e "$delay_single_quote_subst"`' hardcode_libdir_separator_CXX='`$ECHO "X$hardcode_libdir_separator_CXX" | $Xsed -e "$delay_single_quote_subst"`' hardcode_direct_CXX='`$ECHO "X$hardcode_direct_CXX" | $Xsed -e "$delay_single_quote_subst"`' hardcode_direct_absolute_CXX='`$ECHO "X$hardcode_direct_absolute_CXX" | $Xsed -e "$delay_single_quote_subst"`' hardcode_minus_L_CXX='`$ECHO "X$hardcode_minus_L_CXX" | $Xsed -e "$delay_single_quote_subst"`' hardcode_shlibpath_var_CXX='`$ECHO "X$hardcode_shlibpath_var_CXX" | $Xsed -e "$delay_single_quote_subst"`' hardcode_automatic_CXX='`$ECHO "X$hardcode_automatic_CXX" | $Xsed -e "$delay_single_quote_subst"`' inherit_rpath_CXX='`$ECHO "X$inherit_rpath_CXX" | $Xsed -e "$delay_single_quote_subst"`' link_all_deplibs_CXX='`$ECHO "X$link_all_deplibs_CXX" | $Xsed -e "$delay_single_quote_subst"`' fix_srcfile_path_CXX='`$ECHO "X$fix_srcfile_path_CXX" | $Xsed -e "$delay_single_quote_subst"`' always_export_symbols_CXX='`$ECHO "X$always_export_symbols_CXX" | $Xsed -e "$delay_single_quote_subst"`' export_symbols_cmds_CXX='`$ECHO "X$export_symbols_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' exclude_expsyms_CXX='`$ECHO "X$exclude_expsyms_CXX" | $Xsed -e "$delay_single_quote_subst"`' include_expsyms_CXX='`$ECHO "X$include_expsyms_CXX" | $Xsed -e "$delay_single_quote_subst"`' prelink_cmds_CXX='`$ECHO "X$prelink_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' file_list_spec_CXX='`$ECHO "X$file_list_spec_CXX" | $Xsed -e "$delay_single_quote_subst"`' hardcode_action_CXX='`$ECHO "X$hardcode_action_CXX" | $Xsed -e "$delay_single_quote_subst"`' compiler_lib_search_dirs_CXX='`$ECHO "X$compiler_lib_search_dirs_CXX" | $Xsed -e "$delay_single_quote_subst"`' predep_objects_CXX='`$ECHO "X$predep_objects_CXX" | $Xsed -e "$delay_single_quote_subst"`' postdep_objects_CXX='`$ECHO "X$postdep_objects_CXX" | $Xsed -e "$delay_single_quote_subst"`' predeps_CXX='`$ECHO "X$predeps_CXX" | $Xsed -e "$delay_single_quote_subst"`' postdeps_CXX='`$ECHO "X$postdeps_CXX" | $Xsed -e "$delay_single_quote_subst"`' compiler_lib_search_path_CXX='`$ECHO "X$compiler_lib_search_path_CXX" | $Xsed -e "$delay_single_quote_subst"`' LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # Quote evaled strings. for var in SED \ GREP \ EGREP \ FGREP \ LD \ NM \ LN_S \ lt_SP2NL \ lt_NL2SP \ reload_flag \ OBJDUMP \ deplibs_check_method \ file_magic_cmd \ AR \ AR_FLAGS \ 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 \ SHELL \ ECHO \ lt_prog_compiler_no_builtin_flag \ lt_prog_compiler_wl \ lt_prog_compiler_pic \ lt_prog_compiler_static \ lt_cv_prog_compiler_c_o \ need_locks \ 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_flag_spec_ld \ hardcode_libdir_separator \ fix_srcfile_path \ exclude_expsyms \ include_expsyms \ file_list_spec \ variables_saved_for_relink \ libname_spec \ library_names_spec \ soname_spec \ finish_eval \ old_striplib \ striplib \ compiler_lib_search_dirs \ predep_objects \ postdep_objects \ predeps \ postdeps \ compiler_lib_search_path \ LD_CXX \ compiler_CXX \ lt_prog_compiler_no_builtin_flag_CXX \ lt_prog_compiler_wl_CXX \ lt_prog_compiler_pic_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_flag_spec_ld_CXX \ hardcode_libdir_separator_CXX \ fix_srcfile_path_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 "X\\\\\$\$var"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in 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 \ postinstall_cmds \ postuninstall_cmds \ finish_cmds \ sys_lib_search_path_spec \ sys_lib_dlsearch_path_spec \ 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; do case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Fix-up fallback echo if it was mangled by the above quoting rules. case \$lt_ECHO in *'\\\$0 --fallback-echo"') lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\$0 --fallback-echo"\$/\$0 --fallback-echo"/'\` ;; esac 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" ;; "cr_module/Makefile") CONFIG_FILES="$CONFIG_FILES cr_module/Makefile" ;; "cr_module/kbuild/Makefile") CONFIG_FILES="$CONFIG_FILES cr_module/kbuild/Makefile" ;; "vmadump4/Makefile") CONFIG_FILES="$CONFIG_FILES vmadump4/Makefile" ;; "include/blcr_imports.h") CONFIG_FILES="$CONFIG_FILES include/blcr_imports.h" ;; "blcr_imports/imports.c") CONFIG_FILES="$CONFIG_FILES blcr_imports/imports.c" ;; "blcr_imports/Makefile") CONFIG_FILES="$CONFIG_FILES blcr_imports/Makefile" ;; "blcr_imports/kbuild/Makefile") CONFIG_FILES="$CONFIG_FILES blcr_imports/kbuild/Makefile" ;; "config/kbuild.mak") CONFIG_FILES="$CONFIG_FILES config/kbuild.mak" ;; "util/Makefile") CONFIG_FILES="$CONFIG_FILES util/Makefile" ;; "util/cr_checkpoint/Makefile") CONFIG_FILES="$CONFIG_FILES util/cr_checkpoint/Makefile" ;; "util/cr_restart/Makefile") CONFIG_FILES="$CONFIG_FILES util/cr_restart/Makefile" ;; "util/cr_run/Makefile") CONFIG_FILES="$CONFIG_FILES util/cr_run/Makefile" ;; "util/cr_info/Makefile") CONFIG_FILES="$CONFIG_FILES util/cr_info/Makefile" ;; "man/Makefile") CONFIG_FILES="$CONFIG_FILES man/Makefile" ;; "libcr/Makefile") CONFIG_FILES="$CONFIG_FILES libcr/Makefile" ;; "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;; "tests/shellinit") CONFIG_FILES="$CONFIG_FILES tests/shellinit" ;; "examples/Makefile") CONFIG_FILES="$CONFIG_FILES examples/Makefile" ;; "examples/counting/Makefile") CONFIG_FILES="$CONFIG_FILES examples/counting/Makefile" ;; "examples/pthread_counting/Makefile") CONFIG_FILES="$CONFIG_FILES examples/pthread_counting/Makefile" ;; "examples/pthread_misc/Makefile") CONFIG_FILES="$CONFIG_FILES examples/pthread_misc/Makefile" ;; "examples/file_counting/Makefile") CONFIG_FILES="$CONFIG_FILES examples/file_counting/Makefile" ;; "examples/io_bench/Makefile") CONFIG_FILES="$CONFIG_FILES examples/io_bench/Makefile" ;; "examples/pipe_counting/Makefile") CONFIG_FILES="$CONFIG_FILES examples/pipe_counting/Makefile" ;; "contrib/Makefile") CONFIG_FILES="$CONFIG_FILES contrib/Makefile" ;; "contrib/cr_insmod") CONFIG_FILES="$CONFIG_FILES contrib/cr_insmod" ;; "contrib/gen_cscope") CONFIG_FILES="$CONFIG_FILES contrib/gen_cscope" ;; "contrib/batch_build") CONFIG_FILES="$CONFIG_FILES contrib/batch_build" ;; "blcr_config.h") CONFIG_HEADERS="$CONFIG_HEADERS blcr_config.h" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "etc/Makefile") CONFIG_FILES="$CONFIG_FILES etc/Makefile" ;; "rpm/Makefile") CONFIG_FILES="$CONFIG_FILES rpm/Makefile" ;; "rpm/specfile") CONFIG_FILES="$CONFIG_FILES rpm/specfile" ;; "include/Makefile") CONFIG_FILES="$CONFIG_FILES include/Makefile" ;; "include/blcr_common.h") CONFIG_FILES="$CONFIG_FILES include/blcr_common.h" ;; "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; *) { { $as_echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 $as_echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= trap 'exit_status=$? { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status ' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || { $as_echo "$as_me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } # 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 if $AWK 'BEGIN { getline <"/dev/null" }' /dev/null; then ac_cs_awk_getline=: ac_cs_awk_pipe_init= ac_cs_awk_read_file=' while ((getline aline < (F[key])) > 0) print(aline) close(F[key])' ac_cs_awk_pipe_fini= else ac_cs_awk_getline=false ac_cs_awk_pipe_init="print \"cat <<'|#_!!_#|' &&\"" ac_cs_awk_read_file=' print "|#_!!_#|" print "cat " F[key] " &&" '$ac_cs_awk_pipe_init # The final `:' finishes the AND list. ac_cs_awk_pipe_fini='END { print "|#_!!_#|"; print ":" }' fi ac_cr=' ' 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 {' >"$tmp/subs1.awk" && _ACEOF # Create commands to substitute file output variables. { echo "cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1" && echo 'cat >>"\$tmp/subs1.awk" <<\\_ACAWK &&' && echo "$ac_subst_files" | sed 's/.*/F["&"]="$&"/' && echo "_ACAWK" && echo "_ACEOF" } >conf$$files.sh && . ./conf$$files.sh || { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 $as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } rm -f conf$$files.sh { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 $as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } 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_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 $as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } 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_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 $as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } 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 >>"\$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 >>"\$tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" \$ac_cs_awk_pipe_init } { 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 } if (nfields == 3 && !substed) { key = field[2] if (F[key] != "" && line ~ /^[ ]*@.*@[ ]*$/) { \$ac_cs_awk_read_file next } } print line } \$ac_cs_awk_pipe_fini _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 < "$tmp/subs1.awk" > "$tmp/subs.awk" \ || { { $as_echo "$as_me:$LINENO: error: could not setup config files machinery" >&5 $as_echo "$as_me: error: could not setup config files machinery" >&2;} { (exit 1); exit 1; }; } _ACEOF # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ 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[ ]*=/{ s/:*\$(srcdir):*/:/ s/:*\${srcdir}:*/:/ s/:*@srcdir@:*/:/ s/^\([^=]*=[ ]*\):*/\1/ s/:*$// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_t=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_t"; then break elif $ac_last_try; then { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_HEADERS" >&5 $as_echo "$as_me: error: could not make $CONFIG_HEADERS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 { { $as_echo "$as_me:$LINENO: error: could not setup config headers machinery" >&5 $as_echo "$as_me: error: could not setup config headers machinery" >&2;} { (exit 1); exit 1; }; } fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) { { $as_echo "$as_me:$LINENO: error: invalid tag $ac_tag" >&5 $as_echo "$as_me: error: invalid tag $ac_tag" >&2;} { (exit 1); exit 1; }; };; :[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="$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_echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 $as_echo "$as_me: error: cannot find input file: $ac_f" >&2;} { (exit 1); exit 1; }; };; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac ac_file_inputs="$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:$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 >"$tmp/stdin" \ || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 $as_echo "$as_me: error: could not create $ac_file" >&2;} { (exit 1); exit 1; }; } ;; 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" case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { 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_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 $as_echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } 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:$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" | if $ac_cs_awk_getline; then $AWK -f "$tmp/subs.awk" else $AWK -f "$tmp/subs.awk" | $SHELL fi >$tmp/out \ || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 $as_echo "$as_me: error: could not create $ac_file" >&2;} { (exit 1); exit 1; }; } test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:$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 "$tmp/stdin" case $ac_file in -) cat "$tmp/out" && rm -f "$tmp/out";; *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; esac \ || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 $as_echo "$as_me: error: could not create $ac_file" >&2;} { (exit 1); exit 1; }; } ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" } >"$tmp/config.h" \ || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 $as_echo "$as_me: error: could not create $ac_file" >&2;} { (exit 1); exit 1; }; } if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:$LINENO: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$tmp/config.h" "$ac_file" \ || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 $as_echo "$as_me: error: could not create $ac_file" >&2;} { (exit 1); exit 1; }; } fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \ || { { $as_echo "$as_me:$LINENO: error: could not create -" >&5 $as_echo "$as_me: error: could not create -" >&2;} { (exit 1); exit 1; }; } fi # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :C) { $as_echo "$as_me:$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"" || { # Autoconf 2.62 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"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //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' -e 's/\$U/'"$U"'/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 case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { 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_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 $as_echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } # 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 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 # Whether or not to build static libraries. build_old_libs=$enable_static # 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 # What type of objects to build. pic_mode=$pic_mode # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # 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 # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # 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 # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # 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 # 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 # The name of the directory that contains temporary libtool files. objdir=$objdir # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # An echo program that does not interpret backslashes. ECHO=$lt_ECHO # 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 # 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 # 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 # 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 # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic # 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 # If ld is used when linking, flag to hardcode \$libdir into a binary # during linking. This must work even if \$libdir does not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld # 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 # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path=$lt_fix_srcfile_path # 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 # 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 '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) case $xsi_shell in yes) cat << \_LT_EOF >> "$cfgfile" # func_dirname file append nondir_replacement # Compute the dirname of FILE. If nonempty, add APPEND to the result, # otherwise set result to NONDIR_REPLACEMENT. func_dirname () { case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac } # func_basename file func_basename () { func_basename_result="${1##*/}" } # func_dirname_and_basename file append nondir_replacement # perform func_basename and func_dirname in a single function # call: # dirname: Compute the dirname of FILE. If nonempty, # add APPEND to the result, otherwise set result # to NONDIR_REPLACEMENT. # value returned in "$func_dirname_result" # basename: Compute filename of FILE. # value retuned in "$func_basename_result" # Implementation must be kept synchronized with func_dirname # and func_basename. For efficiency, we do not delegate to # those functions but instead duplicate the functionality here. func_dirname_and_basename () { case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac func_basename_result="${1##*/}" } # func_stripname prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). func_stripname () { # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are # positional parameters, so assign one to ordinary parameter first. func_stripname_result=${3} func_stripname_result=${func_stripname_result#"${1}"} func_stripname_result=${func_stripname_result%"${2}"} } # func_opt_split func_opt_split () { func_opt_split_opt=${1%%=*} func_opt_split_arg=${1#*=} } # func_lo2o object func_lo2o () { case ${1} in *.lo) func_lo2o_result=${1%.lo}.${objext} ;; *) func_lo2o_result=${1} ;; esac } # func_xform libobj-or-source func_xform () { func_xform_result=${1%.*}.lo } # func_arith arithmetic-term... func_arith () { func_arith_result=$(( $* )) } # func_len string # STRING may not start with a hyphen. func_len () { func_len_result=${#1} } _LT_EOF ;; *) # Bourne compatible functions. cat << \_LT_EOF >> "$cfgfile" # func_dirname file append nondir_replacement # Compute the dirname of FILE. If nonempty, add APPEND to the result, # otherwise set result to NONDIR_REPLACEMENT. func_dirname () { # Extract subdirectory from the argument. func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"` if test "X$func_dirname_result" = "X${1}"; then func_dirname_result="${3}" else func_dirname_result="$func_dirname_result${2}" fi } # func_basename file func_basename () { func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"` } # func_stripname prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). # func_strip_suffix prefix name func_stripname () { case ${2} in .*) func_stripname_result=`$ECHO "X${3}" \ | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;; *) func_stripname_result=`$ECHO "X${3}" \ | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;; esac } # sed scripts: my_sed_long_opt='1s/^\(-[^=]*\)=.*/\1/;q' my_sed_long_arg='1s/^-[^=]*=//' # func_opt_split func_opt_split () { func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"` func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"` } # func_lo2o object func_lo2o () { func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"` } # func_xform libobj-or-source func_xform () { func_xform_result=`$ECHO "X${1}" | $Xsed -e 's/\.[^.]*$/.lo/'` } # func_arith arithmetic-term... func_arith () { func_arith_result=`expr "$@"` } # func_len string # STRING may not start with a hyphen. func_len () { func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len` } _LT_EOF esac case $lt_shell_append in yes) cat << \_LT_EOF >> "$cfgfile" # func_append var value # Append VALUE to the end of shell variable VAR. func_append () { eval "$1+=\$2" } _LT_EOF ;; *) cat << \_LT_EOF >> "$cfgfile" # func_append var value # Append VALUE to the end of shell variable VAR. func_append () { eval "$1=\$$1\$2" } _LT_EOF ;; esac sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" cat <<_LT_EOF >> "$ofile" # ### BEGIN LIBTOOL TAG CONFIG: CXX # The linker used to build libraries. LD=$lt_LD_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 # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_CXX # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_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 # If ld is used when linking, flag to hardcode \$libdir into a binary # during linking. This must work even if \$libdir does not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_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 # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path=$lt_fix_srcfile_path_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 # 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 ;; "tests/shellinit":F) chmod +x tests/shellinit ;; "contrib/cr_insmod":F) chmod +x contrib/cr_insmod ;; "contrib/gen_cscope":F) chmod +x contrib/gen_cscope ;; "contrib/batch_build":F) chmod +x contrib/batch_build ;; esac done # for ac_tag { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || { { $as_echo "$as_me:$LINENO: error: write failure creating $CONFIG_STATUS" >&5 $as_echo "$as_me: error: write failure creating $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } # 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 || { (exit 1); exit 1; } fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:$LINENO: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi if test x"$enable_config_report$cr_build_modules" = xyesyes; then echo '' current_kernel=`uname -r` if test "`uname -r`" != "$LINUX_VER" -a $cross_compiling = no; then echo '*******************************************************************' echo '***** WARNING WARNING WARNING WARNING WARNING WARNING WARNING *****' echo '*******************************************************************' echo '* The kernel source does not match currently the running kernel. *' echo '* Compilation will produce modules unsuitable for the currently *' echo '* running kernel, which may not be what you intended. *' echo '*******************************************************************' echo '***** WARNING WARNING WARNING WARNING WARNING WARNING WARNING *****' echo '*******************************************************************' fi if test x"$cr_static_link_warning" = xyes; then tmp=`echo "'$ldsuggest' " | cut -c-44` echo '*******************************************************************' echo '***** WARNING WARNING WARNING WARNING WARNING WARNING WARNING *****' echo '*******************************************************************' echo '* Static linking with -lpthread appears to yield LinuxThreads, *' echo '* but BLCR supports only the NPTL implementation of pthreads. *' echo "* Please use LDFLAGS=$tmp *" echo "* (or similar) when linking static executables with BLCR's libs *" echo '* to ensure you get the supported NPTL pthreads implementation. *' echo '*******************************************************************' echo '***** WARNING WARNING WARNING WARNING WARNING WARNING WARNING *****' echo '*******************************************************************' fi echo "======================================================================" echo "Please review the following configuration information:" echo " Kernel source directory = $LINUX_SRC" echo " Kernel build directory = $LINUX_OBJ" echo " Kernel symbol table = ${LINUX_SYSTEM_MAP}${LINUX_VMLINUX}" echo " Kernel version probed from kernel build = $LINUX_VER" echo " Kernel running currently = `uname -r`" echo "======================================================================" if test x"$cr_arch_experimental" = xyes; then echo echo 'WARNING: BLCR support for architecture "'$host_cpu'" is EXPERIMENTAL at this time.' echo fi if test x"$cr_arch_incomplete" = xyes; then echo echo 'WARNING: BLCR support for architecture "'$host_cpu'" is INCOMPLETE at this time.' echo 'WARNING: You probably won'\''t be able to do anything useful with this build.' echo fi fi blcr-0.8.5/util/0000755000000000000000000000000012102072123010360 500000000000000blcr-0.8.5/util/cr_checkpoint/0000755000000000000000000000000012102072123013173 500000000000000blcr-0.8.5/util/cr_checkpoint/cr_checkpoint.c0000664000000000000000000007107511055346724016127 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2008, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * 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 * * $Id: cr_checkpoint.c,v 1.90 2008/08/27 21:57:40 phargrov Exp $ */ #define _LARGEFILE64_SOURCE 1 /* For O_LARGEFILE */ #define _GNU_SOURCE 1 /* For strsignal() */ #define _BSD_SOURCE 1 /* For dirfd() */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #ifndef O_LARGEFILE #define O_LARGEFILE 0 #endif #include "libcr.h" /* can't use argv[0] to get name, since libtool screws it up */ #define MY_NAME "cr_checkpoint" static int verbose = 0; static enum { kmsg_none = 0, kmsg_err, kmsg_warn, } kmsg_level = kmsg_err; static char *to_remove; static void die(int code, const char *format, ...) __attribute__ ((noreturn, format (printf, 2, 3))); static void print_err(const char *format, ...) __attribute__ ((format (printf, 1, 2))); static void usage(FILE *stream, int exitcode) __attribute__ ((noreturn)); static void usage(FILE *stream, int exitcode) { if ((verbose < 0) && (stream == stderr)) { exit(exitcode); } fprintf(stream, "Usage: " MY_NAME " [options] ID\n" "\n" "Options:\n" "General options:\n" " -v, --verbose print progress messages to stderr.\n" " -q, --quiet suppress error/warning messages to stderr.\n" " -?, --help print this message and exit.\n" " --version print version information and exit.\n" "\n" "Options for scope of the checkpoint:\n" " -T, --tree ID identifies a process id. It and all\n" " of its descendants are to be checkpointed.\n" " This is the default.\n" " -p, --pid, --process ID identifies a single process id.\n" " -g, --pgid, --group ID identifies a process group id.\n" " -s, --sid, --session ID identifies a session id.\n" "\n" "Options for destination location of the checkpoint:\n" " -c, --cwd checkpoint saved as a single 'context.ID' file in\n" " cr_checkpoint's working directory (default).\n" " -d, --dir DIR checkpoint saved in new directory DIR, with one\n" " 'context.ID' file per process (unimplemented).\n" " -f, --file FILE checkpoint saved as FILE.\n" " -F, --fd FD checkpoint written to an open file descriptor.\n" "\n" "Options for creation/replacement policy for checkpoint files:\n" " --atomic checkpoint created/replaced atomically (default).\n" " --backup[=NAME] checkpoint created atomically, and any existing \n" " checkpoint backed up to NAME or *.~1~, *.~2~, etc.\n" " --clobber checkpoint written incrementally to target, \n" " overwriting any pre-existing checkpoint.\n" " --noclobber checkpoint will fail if the target file exists.\n" " These options are ignored if the destination is a file descriptor.\n" "\n" "Options for signal sent to process(es) after checkpoint:\n" " --run no signal sent: continue execution (default).\n" " -S, --signal NUM signal NUM sent to all processess.\n" " --stop SIGSTOP sent to all processes.\n" " --term SIGTERM sent to all processes.\n" " --abort SIGABRT sent to all processes.\n" " --kill SIGKILL sent to all processes.\n" " --cont SIGCONT sent to all processes.\n" //" --early-stop freeze processes for a debugger.\n" //" --early-abrt abort processes (dumps core if allowed).\n" " Options in this group are mutually exclusive.\n" " If more than one is given then only the last will be honored.\n" "\n" "Options for file system synchronization (default is --sync):\n" " --sync fsync checkpoint file(s) to disk (default).\n" " --nosync do not fsync checkpoint file(s) to disk.\n" "\n" "Options to save optional portions of memory:\n" " --save-exe save the executable file.\n" " --save-private save private mapped files.\n" " (executables and libraries are mapped this way)\n" " --save-shared save shared mapped files.\n" " (System V IPC is mapped this way).\n" " --save-all save all of the above.\n" " --save-none save none of the above (the default).\n" "\n" "Options for ptraced processes (default is --ptraced-error):\n" " --ptraced-error return an error if a checkpoint is requested\n" " of a process being ptraced.\n" " --ptraced-skip ptraced processes are silently excluded from the\n" " checkpoint request. If the checkpoint scope is\n" " --tree, then this will also exclude any children\n" " of such processes. No error is produced unless\n" " this results in zero processes checkpointed.\n" " --ptraced-allow checkpoint ptraced processes normally.\n" " WARNING: This may require the tracer to \"continue\"\n" " the target process(es), possibly more than once.\n" "\n" "Options for processes ptracing others (default is --ptracer-error):\n" " --ptracer-error return an error if a checkpoint is requested\n" " of a process which is ptracing others.\n" " --ptracer-skip processes ptracing others are silently excluded\n" " from the checkpoint request. If the checkpoint\n" " scope is --tree, then this will also exclude any\n" " children of such processes. No error is produced\n" " unless this results in zero processes checkpointed.\n" "\n" "Options for kernel log messages (default is --kmsg-error):\n" " --kmsg-none don't report any kernel messages.\n" " --kmsg-error on checkpoint failure, report on stderr any kernel\n" " messages associated with the checkpoint request.\n" " --kmsg-warning report on stderr any kernel messages associated\n" " with the checkpoint request, regardless of success\n" " or failure. Messages generated in the absence of\n" " failure are considered to be warnings.\n" " Options in this group are mutually exclusive.\n" " If more than one is given then only the last will be honored.\n" " Note that --quiet suppresses all stderr output, including these messages.\n" "\n" "Misc Options:\n" " -t, --time SEC allow only SEC seconds for target to complete\n" " checkpoint (default: wait indefinitely).\n" ); exit(exitcode); } static void print_version() { printf(MY_NAME " version %s\n", CR_RELEASE_VERSION); } static char *kmsgs = NULL; /* ... share any error/warning messages from the kernel */ static void show_kmsgs(void) { if (kmsgs) { /* prints each line with "- " as a prefix */ char *p = kmsgs; while (*p) { char *n = strchr(p, '\n'); if (!n) break; *n = '\0'; fputs("- ", stderr); fputs(p, stderr); fputc('\n', stderr); p = n+1; } } free(kmsgs); kmsgs = NULL; } /* * die(code, format, args...) * * Sends an error message to stderr and exits program with indicated exit code. */ static void die(int code, const char *format, ...) { va_list args; struct stat s; va_start(args, format); if (verbose >= 0) { show_kmsgs(); vfprintf(stderr, format, args); } va_end(args); if (to_remove != NULL) if (!stat(to_remove, &s)) unlink(to_remove); exit(code); } /* * print_err(format, args...) * * Works like fprintf(stderr, format, args...), but preserves errno. * No return value, since used only on error paths. */ static void print_err(const char *format, ...) { int saved_errno = errno; va_list args; va_start(args, format); if (verbose >= 0) { vfprintf(stderr, format, args); } va_end(args); errno = saved_errno; } static int readint(const char *arg, const char *argv0) { int val; char *endptr; val = strtol(arg, &endptr, 10); if ((*arg == '\0') || (*endptr != '\0')) { usage(stderr, -1); } return val; } static inline int ftype_ok(mode_t mode) { return S_ISREG(mode) || S_ISFIFO(mode) || S_ISSOCK(mode) || S_ISDIR(mode); } static int openfile(const char *filename, int do_excl) { int fd; struct stat st; int flags = O_WRONLY|O_CREAT|O_NOCTTY|O_NONBLOCK|O_LARGEFILE|O_TRUNC; if (do_excl) { flags |= O_EXCL; } if ((fd = open(filename, flags, 0400)) < 0) { print_err("Unable to open file '%s': %s\n", filename, strerror(errno)); return -1; } if (fstat(fd, &st) < 0) { print_err("Unable to fstat opened file: %s\n", strerror(errno)); return -1; } if (!ftype_ok(st.st_mode)) { print_err("File '%s' is not an acceptable file type (i.e. not a " "regular file, socket, or FIFO)\n", filename); errno = EINVAL; return -1; } else if (S_ISDIR(st.st_mode)) { print_err("File '%s' is a directory: use the '--dir' flag for " "directories\n", filename); errno = EISDIR; return -1; } return fd; } #if 0 static int opendirectory(const char *dirname) { int fd; struct stat st; if ( (fd = open(dirname, O_NOCTTY|O_NONBLOCK)) == -1) { print_err("Unable to open directory '%s': %s\n", dirname, strerror(errno)); return -1; } if (fstat(fd, &st)) { print_err("Unable to fstat opened file: %s\n", strerror(errno)); return -1; } if (!S_ISDIR(st.st_mode)) { print_err("'%s' is not a directory\n", dirname); errno = ENOTDIR; return -1; } return fd; } #endif /* file synchronization behaviors */ enum { ATOMIC, BACKUP, CLOBBER }; /* Values for long options w/o single-char equivalents. */ enum { opt_run = 1000, opt_stop, opt_term, opt_kill, opt_abort, opt_cont, opt_early_stop, opt_early_abrt, opt_sync, opt_nosync, opt_atomic, opt_backup, opt_clobber, opt_noclobber, opt_version, opt_save_exe, opt_save_private, opt_save_shared, opt_save_all, opt_save_none, opt_ptraced_error, opt_ptraced_allow, opt_ptraced_skip, opt_ptracer_error, opt_ptracer_skip, opt_kmsg_none, opt_kmsg_error, opt_kmsg_warning, }; /* Type of destination */ enum { dest_default, dest_file, dest_dir, dest_fd, dest_cwd }; /* Mutex */ static pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER; /* "my" pid (done this way due to LinuxThreads limitations */ static int mypid; /* Callback to ensure consistent checkpoints */ static int my_cb(void *arg) { const struct cr_checkpoint_info *info = cr_get_checkpoint_info(); int rc; if (info->requester == mypid) { /* We are checkpointing ourself. Exclude self. */ rc = cr_checkpoint(CR_CHECKPOINT_OMIT); } else { /* Wait for checkpoint to complete (more flexible than a critical section) */ pthread_mutex_lock(&lock); rc = cr_checkpoint(CR_CHECKPOINT_READY); pthread_mutex_unlock(&lock); } return 0; } int real_main(int argc, char **argv) { cr_checkpoint_args_t cr_args; cr_checkpoint_handle_t cr_handle; int dest_type = dest_default; int chkpt_fd = -1; int do_excl = 0; int do_atomic = 1; int do_backup = 0; int do_sync = 1; cr_client_id_t client_id; cr_callback_id_t cb_id; char * chkpt_file = NULL; /* file to checkpoint to */ char * chkpt_dir = NULL; /* directory to checkpoint to */ char * chkpt_to = NULL; /* name of checkpoint file or dir */ char * rename_to = NULL; /* final checkpoint file/dir, if different */ char * backup_to = NULL; /* backup file/dir, if needed */ char * parent_dir = NULL; /* parent directory of checkpoint */ int secs = 0; int err; pid_t target = 0; cr_scope_t target_type = CR_SCOPE_TREE; int signal = 0; unsigned int cr_flags = CR_CHKPT_ASYNC_ERR; /* Parse cmdline options */ char * shortflags = "f:d:F:S:pgsTct:qvh"; /* 1 colon == requires argument */ struct option longflags[] = { /* target_type: */ { "pid", no_argument , 0, 'p' }, { "process", no_argument , 0, 'p' }, { "pgid", no_argument , 0, 'g' }, { "group", no_argument , 0, 'g' }, { "sid", no_argument , 0, 's' }, { "session", no_argument , 0, 's' }, { "tree", no_argument , 0, 'T' }, /* destination: */ { "file", required_argument, 0, 'f' }, { "dir", required_argument, 0, 'd' }, { "fd", required_argument, 0, 'F' }, { "cwd", no_argument, 0, 'c' }, /* creation/replacement policy */ { "atomic", no_argument, 0, opt_atomic }, { "backup", optional_argument, 0, opt_backup }, { "clobber", no_argument, 0, opt_clobber }, { "noclobber", no_argument, 0, opt_noclobber }, /* signal options: */ { "signal", required_argument, 0, 'S' }, { "run", no_argument, 0, opt_run }, { "stop", no_argument, 0, opt_stop }, { "term", no_argument, 0, opt_term }, { "kill", no_argument, 0, opt_kill }, { "abort", no_argument, 0, opt_abort }, { "cont", no_argument, 0, opt_cont }, { "early-stop", no_argument, 0, opt_early_stop }, { "early-abrt", no_argument, 0, opt_early_abrt }, /* fsync options: */ { "sync", no_argument, 0, opt_sync}, { "nosync", no_argument, 0, opt_nosync}, /* vmadump options: */ { "save-exe", no_argument, 0, opt_save_exe}, { "save-private", no_argument, 0, opt_save_private}, { "save-shared", no_argument, 0, opt_save_shared}, { "save-all", no_argument, 0, opt_save_all}, { "save-none", no_argument, 0, opt_save_none}, /* ptraced options: */ { "ptraced-error", no_argument, 0, opt_ptraced_error}, { "ptraced-allow", no_argument, 0, opt_ptraced_allow}, { "ptraced-skip", no_argument, 0, opt_ptraced_skip}, /* ptracer options: */ { "ptracer-error", no_argument, 0, opt_ptracer_error}, { "ptracer-skip", no_argument, 0, opt_ptracer_skip}, /* kmsg options: */ { "kmsg-none", no_argument, 0, opt_kmsg_none}, { "kmsg-error", no_argument, 0, opt_kmsg_error}, { "kmsg-warning", no_argument, 0, opt_kmsg_warning}, /* misc options: */ { "time", required_argument, 0, 't' }, { "quiet", no_argument, 0, 'q' }, { "verbose", no_argument, 0, 'v' }, { "help", no_argument, 0, 'h' }, { "version", no_argument, 0, opt_version }, { 0, 0, 0, 0 } }; opterr = 0; while (1) { int longindex = -1; int opt = getopt_long(argc, argv, shortflags, longflags, &longindex); if (opt == -1) break; /* reached last option */ switch (opt) { /* target_type: */ case 'p': target_type = CR_SCOPE_PROC; break; case 'g': target_type = CR_SCOPE_PGRP; break; case 's': target_type = CR_SCOPE_SESS; break; case 'T': target_type = CR_SCOPE_TREE; break; /* destination: */ case 'f': if (dest_type != dest_default) die (EINVAL, "conflicting destinations provided\n"); dest_type = dest_file; chkpt_file = strdup(optarg); if (!chkpt_file) die(ENOMEM, "strdup failed on string '%s'\n", optarg); break; case 'd': #if 1 die(EINVAL, "-d flag not yet implemented\n"); #else if (dest_type != dest_default) die (EINVAL, "conflicting destinations specified\n"); dest_type = dest_dir; chkpt_dir = strdup(optarg); if (!chkpt_dir) die(ENOMEM, "strdup failed on string '%s'\n", optarg); break; #endif case 'F': if (dest_type != dest_default) die (EINVAL, "conflicting destinations specified\n"); dest_type = dest_fd; chkpt_fd = readint(optarg, argv[0]); break; case 'c': if (dest_type != dest_default) die (EINVAL, "conflicting destinations specified\n"); dest_type = dest_cwd; /* nothing to do */ break; /* creation/replacement policy */ case opt_atomic: do_excl = 0; do_atomic = 1; do_backup = 0; break; case opt_backup: do_excl = 0; do_atomic = 1; do_backup = 1; if (optarg) { backup_to = strdup(optarg); if (!backup_to) die(errno, "Error during strdup: %s\n", strerror(errno)); } break; case opt_clobber: do_excl = 0; do_atomic = 0; do_backup = 0; break; case opt_noclobber: do_excl = 1; do_atomic = 0; do_backup = 0; break; /* signal options: */ case 'S': signal = readint(optarg, argv[0]); if ((signal <= 0) || (signal >= _NSIG)) { die(EINVAL, "Valid signal numbers are from 1 to %d, inclusive.\n", _NSIG - 1); } break; case opt_run: /* --run */ signal = 0; break; case opt_stop: /* --stop */ signal = SIGSTOP; break; case opt_term: /* --term */ signal = SIGTERM; break; case opt_kill: /* --kill */ signal = SIGKILL; break; case opt_abort: /* --abort */ signal = SIGABRT; break; case opt_cont: /* --cont */ signal = SIGCONT; break; case opt_early_stop: /* --early_stop */ signal = -SIGSTOP; break; case opt_early_abrt: /* --early_abrt */ signal = -SIGABRT; break; /* fsync options: */ case opt_nosync: /* --nosync */ do_sync = 0; break; case opt_sync: /* --sync */ do_sync = 1; break; /* vmadump options: */ case opt_save_exe: cr_flags |= CR_CHKPT_DUMP_EXEC; break; case opt_save_private: cr_flags |= CR_CHKPT_DUMP_PRIVATE; break; case opt_save_shared: cr_flags |= CR_CHKPT_DUMP_SHARED; break; case opt_save_all: cr_flags |= CR_CHKPT_DUMP_ALL; break; case opt_save_none: cr_flags &= ~CR_CHKPT_DUMP_ALL; break; /* ptraced options: */ #define PTRACED_MASK (CR_CHKPT_PTRACED_ALLOW | CR_CHKPT_PTRACED_SKIP) case opt_ptraced_allow: cr_flags &= ~PTRACED_MASK; cr_flags |= CR_CHKPT_PTRACED_ALLOW; break; case opt_ptraced_skip: cr_flags &= ~PTRACED_MASK; cr_flags |= CR_CHKPT_PTRACED_SKIP; break; case opt_ptraced_error: cr_flags &= ~PTRACED_MASK; break; /* ptracer options: */ case opt_ptracer_skip: cr_flags |= CR_CHKPT_PTRACER_SKIP; break; case opt_ptracer_error: cr_flags &= ~CR_CHKPT_PTRACER_SKIP; break; /* kmsg options: */ case opt_kmsg_none: kmsg_level = kmsg_none; break; case opt_kmsg_error: kmsg_level = kmsg_err; break; case opt_kmsg_warning: kmsg_level = kmsg_warn; break; /* misc options: */ case 't': secs = readint(optarg, argv[0]); if (secs < 0) { die(EINVAL, "Time limit must be non-negative.\n"); } break; case 'q': verbose = -1; break; case 'v': ++verbose; break; case opt_version: print_version(); exit(0); break; case '?': if (optopt != '?') { /* unrecognized option case */ usage(stderr, -1); } /* fall through to usge on stdout... */ case 'h': usage(stdout, 0); default: /* reachable */ usage(stderr, -1); } } /* Grab id if exactly one arg left. optind is a magic global set by getopt_long, and is index of first non-flag parameter, if any */ if (argc - optind == 1) { target = readint(argv[optind], argv[0]); } else { usage(stderr, -1); } if (dest_type == dest_fd) { #define NAMELEN 64 char buf[NAMELEN]; snprintf(buf, NAMELEN, "", chkpt_fd); chkpt_to = strdup(buf); if (!chkpt_to) die(errno, "Could not duplicate string '%s'\n", buf); } else { char buf[NAMELEN]; switch (dest_type) { case dest_dir: chkpt_to = chkpt_dir; break; case dest_default: /* default -> cwd */ case dest_cwd: snprintf(buf, NAMELEN, "context.%d", target); chkpt_file = strdup(buf); if (!chkpt_file) die(errno, "Could not duplicate string '%s'\n", buf); /* fall through */ case dest_file: chkpt_to = chkpt_file; break; default: die(1, "Invalid dest_type\n"); } /* get parent directory name */ parent_dir = strdup(chkpt_to); if (!parent_dir) die(errno, "Error in strdup: %s", strerror(errno)); parent_dir = dirname(parent_dir); if (do_atomic) { char *base = strdup(chkpt_to); if (!base) die(errno, "Error in strdup: %s\n", strerror(errno)); /* save final target name */ rename_to = chkpt_to; /* use '.context.pid.tmp'-style name for checkpoint file */ chkpt_to = (char *)malloc(strlen(chkpt_to) + 10); if (!chkpt_to) die(errno, "Malloc failed!\n"); strcpy(chkpt_to, parent_dir); strcat(chkpt_to, "/."); strcat(chkpt_to, basename(base)); strcat(chkpt_to, ".tmp"); free(base); } } if (verbose > 0) { printf("targetfile='%s', parent dir='%s', rename=%s\n", chkpt_to, parent_dir, rename_to); } /* TODO: make sure no other checkpoint is occurring to the same file? */ if (chkpt_fd >= 0) { /* silently ignore the atomic/backup flags */ do_excl = do_atomic = do_backup = 0; } else if (chkpt_file) { if (!do_backup && !do_atomic && !do_excl) { /* clobber */ err = access(chkpt_to, W_OK); if (err && (errno != ENOENT)) { /* exists, but can't overwrite */ err = unlink(chkpt_to); if (err) { /* couldn't remove it either */ die(errno, "Unable to remove existing '%s': %s\n", chkpt_to, strerror(errno)); } } } if ((chkpt_fd = openfile(chkpt_to, do_excl)) == -1) die(errno, "Failed to open checkpoint file '%s'\n", chkpt_file); /* after this point, remove checkpoint file if there's an error */ to_remove = chkpt_to; } else { die(EINVAL, "directories not yet supported\n"); } cr_initialize_checkpoint_args_t(&cr_args); cr_args.cr_scope = target_type; cr_args.cr_target = target; cr_args.cr_fd = chkpt_fd; cr_args.cr_signal = signal; cr_args.cr_timeout = secs; /* 0 == unbounded */ cr_args.cr_flags = cr_flags; /* Record our pid */ mypid = getpid(); /* CONNECT TO THE KERNEL */ client_id = cr_init(); if (client_id < 0) { if (errno == ENOSYS) { die(errno, "Checkpoint failed: support missing from kernel\n"); } else { die(errno, "Failed cr_init(): %s\n", cr_strerror(errno)); } } /* Register our callback */ cb_id = cr_register_callback(&my_cb, NULL, CR_THREAD_CONTEXT); if (cb_id < 0) { die(errno, "Failed cr_register_callback(): %s\n", cr_strerror(errno)); } /* Begin our critical section */ pthread_mutex_lock(&lock); /* issue the request */ err = cr_request_checkpoint(&cr_args, &cr_handle); if (err < 0) { if (errno == CR_ENOSUPPORT) { die(errno, "Checkpoint failed: support missing from application\n"); } else { die(errno, "cr_request_checkpoint: %s\n", cr_strerror(errno)); } } else if (verbose > 0) { fprintf(stderr, "checkpoint request issued\n"); } /* wait for the checkpoint to complete */ if (verbose > 0) { fprintf(stderr, "waiting for checkpoint request to complete\n"); } do { /* This loop is necessary in case cr_checkpoint itself was checkpointed (causes EINTR). */ err = cr_wait_checkpoint(&cr_handle, NULL); if (err == 0) { /* 0 would mean timeout, but we passed NULL for the (struct timeval *) */ die(1, "cr_wait_checkpoint returned unexpected 0"); } } while ((err < 0) && (errno == EINTR)); if (err < 0) { die(errno, "cr_wait_checkpoint failed: %s\n", cr_strerror(errno)); } if (kmsg_level != kmsg_none) { if (verbose > 0) { fprintf(stderr, "collecting any kernel log messages\n"); } /* NOTE: we ignore any failure to malloc (EFAULT) or to collect the log */ err = cr_log_checkpoint(&cr_handle, 0, NULL); if (err > 0) { int len = err; kmsgs = malloc(len); (void)cr_log_checkpoint(&cr_handle, len, kmsgs); } } if (verbose > 0) { fprintf(stderr, "reaping checkpoint request\n"); } err = cr_reap_checkpoint(&cr_handle); if (err < 0) { if (errno == CR_ERESTARTED) { /* restarting -- not an error */ /* The pthread mutex actually ensures we won't ever restart here. * However, if modelling your own code after cr_checkpoint.c, then * you'll probably want to recognize this case as not an error. */ if (verbose > 0) { fprintf(stderr, "restarted from completed checkpoint request\n"); } } else if (errno == CR_ETEMPFAIL) { die(errno, "Checkpoint cancelled by application: try again later\n"); } else if (errno == ESRCH) { die(errno, "Checkpoint failed: no processes checkpointed\n"); } else if (errno == CR_EPERMFAIL) { die(errno, "Checkpoint cancelled by application: unable to checkpoint\n"); } else if (errno == CR_ENOSUPPORT) { die(errno, "Checkpoint failed: support missing from application\n"); } else { die(errno, "Checkpoint failed: %s\n", cr_strerror(errno)); } } else if (verbose > 0) { fprintf(stderr, "checkpoint request completed\n"); } if (do_backup) { struct stat s; assert(do_atomic); /* only backup if there's a pre-existing checkpoint */ if (!stat(rename_to, &s)) { if (!backup_to) { int bnum = 1; int len = strlen(rename_to) + 10; backup_to = (char *)malloc(len); while (1) { snprintf(backup_to, len, "%s.~%d~", rename_to, bnum++); if (stat(backup_to, &s)) break; if (bnum > (1<<16)) die(-1, "This is absurd\n"); } } if (rename(rename_to, backup_to)) die(errno, "Unable to rename '%s' to '%s': %s\n", rename_to, backup_to, strerror(errno)); } } if (do_atomic) { assert(rename_to && strlen(rename_to)); if (rename(chkpt_to, rename_to)) die(errno, "Unable to rename '%s' to '%s': %s\n", chkpt_to, rename_to, strerror(errno)); } /* End our critical section */ pthread_mutex_unlock(&lock); /* Show kernel warnings if any. */ if ((verbose >= 0) && (kmsg_level == kmsg_warn)) { show_kmsgs(); } if (do_sync) { DIR *dir; /* COMMIT TO DISK */ err = fsync(chkpt_fd); if ((err < 0) && (errno != EINVAL)) { // EINVAL for non-syncable fd die(errno, "Error syncing checkpoint to disk: %s\n", strerror(errno)); } if (parent_dir != NULL) { /* sync parent directory, too, to ensure checkpoint shows up */ if (!(dir = opendir(parent_dir))) die(errno, "unable to opendir(%s): %s\n", parent_dir, strerror(errno)); /* ignore fsync errors that might be from using NFS */ if (fsync(dirfd(dir)) && errno != EROFS && errno != EINVAL && (verbose > 0)) { fprintf(stderr, "Warning: unable to sync directory '%s': errno=%d\n", parent_dir, errno); } /* TODO: if checkpoint to directory, fsync all context.pid files */ } } return 0; } /* Just fork a child to do the real work. * This allows us to exclude the child from checkpoints while still * including the parent so that there is something to wait() for. */ int main(int argc, char **argv) { int pid, status, err; pid = fork(); if (!pid) { /* In child */ return real_main(argc, argv); } else if (pid < 0) { die(1, "fork() failed: %s", strerror(errno)); /* NOT REACHED */ } do { err = wait(&status); } while ((err < 0) && (errno == EINTR)); if (err < 0) { if (errno == ECHILD) { /* No child means this is a restart. */ err = 0; } else { die(1, "wait() failed: %s", strerror(errno)); /* NOT REACHED */ } } else if (WIFSIGNALED(status)) { int signo = WTERMSIG(status); die(1, "child killed by signal %d (%s)", signo, strsignal(signo)); /* NOT REACHED */ } else { err = WEXITSTATUS(status); } return err; } blcr-0.8.5/util/cr_checkpoint/Makefile.am0000664000000000000000000000250611055336753015176 00000000000000bin_PROGRAMS = cr_checkpoint if CR_INSTALLED_LIBCR LDADD = -L$(libdir) -lcr @CR_CLIENT_LDADD@ INCLUDES = -I$(includedir) else LDADD = -L$(top_builddir)/libcr -lcr @CR_CLIENT_LDADD@ INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include LIBCR = $(top_builddir)/libcr/libcr.la cr_checkpoint_DEPENDENCIES = $(LIBCR) $(LIBCR): @$(MAKE) $(AM_MAKEFLAGS) --no-print-directory -C $(@D) endif AM_CFLAGS = -Wall AM_CPPFLAGS = @CR_NDEBUG@ EXTRA_DIST = cr_checkpoint.extraman if CR_BUILD_MAN manfiles = cr_checkpoint.1 man_MANS = $(manfiles) # delete man page sources during 'clean', since they're generated files. CLEANFILES = $(manfiles) cr_checkpoint.1: $(top_srcdir)/util/cr_checkpoint/cr_checkpoint.extraman cr_checkpoint @PERL@ $(top_srcdir)/man/help2man \ -n "checkpoints a process, process group, or session." \ -i $(top_srcdir)/util/cr_checkpoint/cr_checkpoint.extraman -N \ -o cr_checkpoint.1 -s 1 -S "Berkeley Lab Checkpoint/Restart" \ $(top_builddir)/util/cr_checkpoint/cr_checkpoint # target for man page writers: stores man page in 'man1' subdir, so you can # peruse it with 'man foo' (assuming you have '.' in your MANPATH) dev: clean $(manfiles) if test ! -d man1; then mkdir man1; fi cp $(manfiles) man1 dev-clean: -rm -rf man1 $(manfiles) endif # CR_BUILD_MAN blcr-0.8.5/util/cr_checkpoint/Makefile.in0000664000000000000000000005526512102070011015171 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = cr_checkpoint$(EXEEXT) @CR_INSTALLED_LIBCR_TRUE@cr_checkpoint_DEPENDENCIES = subdir = util/cr_checkpoint DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/blcr_config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" PROGRAMS = $(bin_PROGRAMS) cr_checkpoint_SOURCES = cr_checkpoint.c cr_checkpoint_OBJECTS = cr_checkpoint.$(OBJEXT) cr_checkpoint_LDADD = $(LDADD) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/./config/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = cr_checkpoint.c DIST_SOURCES = cr_checkpoint.c 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' man1dir = $(mandir)/man1 NROFF = nroff MANS = $(man_MANS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CONFIGURE_ARGS = @CONFIGURE_ARGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CR_ARCH = @CR_ARCH@ CR_CLIENT_LDADD = @CR_CLIENT_LDADD@ CR_CPU = @CR_CPU@ CR_FTB_INCLUDES = @CR_FTB_INCLUDES@ CR_FTB_LDADD = @CR_FTB_LDADD@ CR_FTB_LDFLAGS = @CR_FTB_LDFLAGS@ CR_KARCH = @CR_KARCH@ CR_KERNEL = @CR_KERNEL@ CR_KERNEL_BASE = @CR_KERNEL_BASE@ CR_LIBARCH = @CR_LIBARCH@ CR_LIBCR_CFLAGS = @CR_LIBCR_CFLAGS@ CR_MODULE_DIR = @CR_MODULE_DIR@ CR_MODULE_MAJOR = @CR_MODULE_MAJOR@ CR_MODULE_MINOR = @CR_MODULE_MINOR@ CR_MODULE_PATCH = @CR_MODULE_PATCH@ CR_MODULE_VERSION = @CR_MODULE_VERSION@ CR_NDEBUG = @CR_NDEBUG@ CR_RELEASE_MAJOR = @CR_RELEASE_MAJOR@ CR_RELEASE_MINOR = @CR_RELEASE_MINOR@ CR_RELEASE_PATCH = @CR_RELEASE_PATCH@ CR_RELEASE_VERSION = @CR_RELEASE_VERSION@ CR_SIGNUM = @CR_SIGNUM@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GMAKE_ELSE = @GMAKE_ELSE@ GMAKE_ENDIF = @GMAKE_ENDIF@ GMAKE_IFEQ = @GMAKE_IFEQ@ GMAKE_IFNEQ = @GMAKE_IFNEQ@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KBUILD_MAK = @KBUILD_MAK@ KBUILD_MAKE_ARGS = @KBUILD_MAKE_ARGS@ KCC = @KCC@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBCR_MAJOR = @LIBCR_MAJOR@ LIBCR_MINOR = @LIBCR_MINOR@ LIBCR_PATCH = @LIBCR_PATCH@ LIBCR_VERSION = @LIBCR_VERSION@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_AGE = @LIBTOOL_AGE@ LIBTOOL_INTERFACE = @LIBTOOL_INTERFACE@ LIBTOOL_REVISION = @LIBTOOL_REVISION@ LINUX_OBJ = @LINUX_OBJ@ LINUX_SRC = @LINUX_SRC@ LINUX_SYMTAB_CMD = @LINUX_SYMTAB_CMD@ LINUX_SYMTAB_CONF = @LINUX_SYMTAB_CONF@ LINUX_SYMTAB_FILE = @LINUX_SYMTAB_FILE@ LINUX_VER = @LINUX_VER@ LINUX_VERSION_H = @LINUX_VERSION_H@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKE = @MAKE@ MAKEINFO = @MAKEINFO@ 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_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PWD_PROG = @PWD_PROG@ RANLIB = @RANLIB@ RPMBUILD = @RPMBUILD@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TOP_BUILDDIR = @TOP_BUILDDIR@ TOP_SRCDIR = @TOP_SRCDIR@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ 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@ lt_ECHO = @lt_ECHO@ 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@ @CR_INSTALLED_LIBCR_FALSE@LDADD = -L$(top_builddir)/libcr -lcr @CR_CLIENT_LDADD@ @CR_INSTALLED_LIBCR_TRUE@LDADD = -L$(libdir) -lcr @CR_CLIENT_LDADD@ @CR_INSTALLED_LIBCR_FALSE@INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include @CR_INSTALLED_LIBCR_TRUE@INCLUDES = -I$(includedir) @CR_INSTALLED_LIBCR_FALSE@LIBCR = $(top_builddir)/libcr/libcr.la @CR_INSTALLED_LIBCR_FALSE@cr_checkpoint_DEPENDENCIES = $(LIBCR) AM_CFLAGS = -Wall AM_CPPFLAGS = @CR_NDEBUG@ EXTRA_DIST = cr_checkpoint.extraman @CR_BUILD_MAN_TRUE@manfiles = cr_checkpoint.1 @CR_BUILD_MAN_TRUE@man_MANS = $(manfiles) # delete man page sources during 'clean', since they're generated files. @CR_BUILD_MAN_TRUE@CLEANFILES = $(manfiles) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign util/cr_checkpoint/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign util/cr_checkpoint/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) test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ 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 installcheck-binPROGRAMS: $(bin_PROGRAMS) bad=0; pid=$$$$; list="$(bin_PROGRAMS)"; for p in $$list; do \ case ' $(AM_INSTALLCHECK_STD_OPTIONS_EXEMPT) ' in \ *" $$p "* | *" $(srcdir)/$$p "*) continue;; \ esac; \ f=`echo "$$p" | \ sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ for opt in --help --version; do \ if "$(DESTDIR)$(bindir)/$$f" $$opt >c$${pid}_.out \ 2>c$${pid}_.err &2; bad=1; fi; \ done; \ done; rm -f c$${pid}_.???; exit $$bad cr_checkpoint$(EXEEXT): $(cr_checkpoint_OBJECTS) $(cr_checkpoint_DEPENDENCIES) @rm -f cr_checkpoint$(EXEEXT) $(LINK) $(cr_checkpoint_OBJECTS) $(cr_checkpoint_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cr_checkpoint.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-man1: $(man_MANS) @$(NORMAL_INSTALL) test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)" @list=''; test -n "$(man1dir)" || exit 0; \ { for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.1[a-z]*$$/p'; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ done; } uninstall-man1: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man1dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.1[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ test -z "$$files" || { \ echo " ( cd '$(DESTDIR)$(man1dir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(man1dir)" && rm -f $$files; } ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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 CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @list='$(MANS)'; if test -n "$$list"; then \ list=`for p in $$list; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \ if test -n "$$list" && \ grep 'ab help2man is required to generate this page' $$list >/dev/null; then \ echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \ grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/ /' >&2; \ echo " to fix them, install help2man, remove and regenerate the man pages;" >&2; \ echo " typically \`make maintainer-clean' will remove them" >&2; \ exit 1; \ else :; fi; \ else :; fi @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(MANS) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"; 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-binPROGRAMS 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-man install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-man1 install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: installcheck-binPROGRAMS 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-binPROGRAMS uninstall-man uninstall-man: uninstall-man1 .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ clean-generic clean-libtool ctags 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-man1 install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installcheck-binPROGRAMS installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-binPROGRAMS \ uninstall-man uninstall-man1 @CR_INSTALLED_LIBCR_FALSE@$(LIBCR): @CR_INSTALLED_LIBCR_FALSE@ @$(MAKE) $(AM_MAKEFLAGS) --no-print-directory -C $(@D) @CR_BUILD_MAN_TRUE@cr_checkpoint.1: $(top_srcdir)/util/cr_checkpoint/cr_checkpoint.extraman cr_checkpoint @CR_BUILD_MAN_TRUE@ @PERL@ $(top_srcdir)/man/help2man \ @CR_BUILD_MAN_TRUE@ -n "checkpoints a process, process group, or session." \ @CR_BUILD_MAN_TRUE@ -i $(top_srcdir)/util/cr_checkpoint/cr_checkpoint.extraman -N \ @CR_BUILD_MAN_TRUE@ -o cr_checkpoint.1 -s 1 -S "Berkeley Lab Checkpoint/Restart" \ @CR_BUILD_MAN_TRUE@ $(top_builddir)/util/cr_checkpoint/cr_checkpoint # target for man page writers: stores man page in 'man1' subdir, so you can # peruse it with 'man foo' (assuming you have '.' in your MANPATH) @CR_BUILD_MAN_TRUE@dev: clean $(manfiles) @CR_BUILD_MAN_TRUE@ if test ! -d man1; then mkdir man1; fi @CR_BUILD_MAN_TRUE@ cp $(manfiles) man1 @CR_BUILD_MAN_TRUE@dev-clean: @CR_BUILD_MAN_TRUE@ -rm -rf man1 $(manfiles) # 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: blcr-0.8.5/util/cr_checkpoint/cr_checkpoint.extraman0000664000000000000000000001553311077740121017512 00000000000000[DESCRIPTION] Invoking cr_checkpoint causes a process (with or without all of its descendants), all processes within a process group, or all processes within a session, to be checkpointed. The result is a checkpoint file (or a directory with one checkpoint file per process) that contains all the state needed to restart the process(es) at a later time. Checkpointed processes can be restarted via .BR cr_restart (1). To be checkpointed by cr_checkpoint, a process must have the .I libcr.so library (or one of its relatives) loaded. This can be achieved by starting the program with .BR cr_run (1), or by linking your application with .BR -lcr . Or, the library may be loaded by other libraries you have linked with (such as a checkpoint-ready MPI library), or your system's parallel job startup script, etc. Check your system documentation for details. .SS "File creation/replacement" By default (or if .B --atomic is passed) cr_checkpoint creates the new context file/directory atomically: either the checkpoint fails (and any existing context file/directory is unchanged), or it appears in the directory ready to be used by .BR cr_restart . If an existing checkpoint with the same file name exists, it will either be be unmodified (if the new checkpoint fails for any reason), or replaced atomically (via .BR rename (2). If \fB\-\-backup\fR[=\fINAME\fR] is passed, any existing checkpoint will be backed up instead, either to .I NAME or with a numbered extension .RI ( \.~1~ , .IR \.~2~ , etc., with more recent checkpoints having higher numbers). If .B --clobber is passed, the checkpoint will immediately remove any existing checkpoint files, and will write the checkpoint directly out into the target file/directory: this option uses less disk space if an existing checkpoint is present, since the old checkpoint is immediately discarded, but if the checkpoint fails, the pre-existing checkpoint is lost. Finally, if .B --noclobber is passed, then the checkpoint will fail if the target file/directory exists. .SS "File sync" By default (or when .B --sync is passed), cr_checkpoint waits until the checkpoint is complete in memory, and additionally calls .BR fsync (2) on all files and directories involved in the checkpoint (including back-up files) to disk before exiting. Passing .B --nosync causes these fsync calls to be skipped. .SS "Timeout" A maximum timeout in seconds can be set for a checkpoint via the .B --time flag: if the checkpoint takes longer than this, cr_checkpoint will print an error mesage and exit with an error. If a timeout occurs, the state of the process or processes that were being checkpointed is undefined. .SS "Signals" By default checkpointed processes continue to run after a checkpoint is complete. Alternatively, you may specify that they be stopped (via .BR --stop ), or terminated/aborted/killed (via .BR --term , .BR --abort , or .BR --kill ). This is done by sending the appropriate signal to every process that is part of the checkpoint. If the processes were stopped at the time the checkpoint was requested, then .B --cont may be used to send SIGCONT to all processes after the checkpoint is completed. .SS "Memory mapped files" By default, checkpoints do not include any files that are mmap()ed into the process address space unless they are already unlinked at the time the checkpoint is taken. This is a space/time saving optimization under the assumption that the files required will still be present (and uncorrupted) at restart time. Typically the largest savings comes from not saving the executable file or dynamic (a.k.a shared) libraries. However, options exist to cause the checkpoint to save these files as well. The flag .B --save-exe will cause the executable file to be included in the context file. The flag .B --save-private will include in the context file any files that are mapped with the MAP_PRIVATE flag, which under Linux includes the executable and dynamic/shared libaries. The flag .B --save-shared is for saving files that are mapped with the MAP_SHARED flag. Note that this is .I not the flag you want for shared libraries. At restart any file saved by these flags will be mapped into the process regardless of whether any file exists at the original location. If there is file at the original location it remains untouched by the restart. Finally .B --save-all and .B --save-none will cause all (or none) of these optional mmaped files to be saved. The default is .BR --save-none . When passing multiple of these options they are processed from left to right with all options being additive, except for .B --save-none which cancels the effects of any these options appearing earlier. .SS "Checkpointing ptrace()ed processes" There is (currently) no way to fully transparently deal with checkpoints of processes that are being traced with .BR ptrace (2). Therefore, the default behavior (also available via .BR --ptraced-error ) is to return an error if any of the processes to be checkpointed are currently being ptraced. However, there are two other possible behaviors to choose among: .TP .B --ptraced-skip Ptraced processes will be siliently excluded from the checkpoint. No error is generated unless this results in zero processes checkpointed. .TP .B --ptraced-allow Ptraced processes will be checkpointed just like any other processes. .IR WARNING : Because the checkpointed process and the BLCR kernel module must interact using signals and system calls, the debugger (or other tracer) may need to `continue' the target process(es), possibly more than once, to allow the checkpoint to complete. .SS "Checkpointing ptrace()ing processes" There is (currently) no way to fully transparently deal with checkpoints of processes that are tracing other processes using .BR ptrace (2). Therefore, the default behavior (also available via .BR --ptracer-error ) is to return an error if any of the processes to be checkpointed are currently ptracing other processes. However .B --ptracer-skip is available to cause cr_checkpoint to silently exclude such processes from the checkpoint. No error is generated in that case unless this would result in zero processes checkpointed. [EXAMPLES] To checkpoint the process with process ID 23452, saving its state to file .IR context.23452 : .RS .B cr_checkpoint -p .I 23452 .RE To checkpoint all the processes in process group 68473, and save them to file .IR groupie : .RS .B cr_checkpoint -g -f .I groupie 68473 .RE To checkpoint all the process in session 8362, and save separate 'context.PID' files for each process in directory 'my_checkpoints': .RS .B cr_checkpoint -s -d .I my_checkpoints 8362 .RE [BUGS] Some features in this manpage may be unimplemented. [REPORTING BUGS] Bug reports may be filed on the web at .BR http://mantis.lbl.gov/bugzilla . [AUTHORS] Jason Duell, Paul Hargrove, and Eric Roman, Lawrence Berkeley National Laboratory. [SEE ALSO] .BR cr_restart (1), .BR cr_run (1) blcr-0.8.5/util/cr_info/0000755000000000000000000000000012102072124012000 500000000000000blcr-0.8.5/util/cr_info/Makefile.am0000664000000000000000000000105511020123763013763 00000000000000vmadump_dir = @TOP_BUILDDIR@/vmadump4 bin_SCRIPTS = cr_info cr_info: cr_info.in Makefile @PERL@ -pe 's|\@vmadump_dir\@|$(vmadump_dir)|;\ s|\@release_version\@|@CR_RELEASE_VERSION@|;' $(srcdir)/$@.in >$@ chmod +x $@ CLEANFILES = cr_info EXTRA_DIST = cr_info.in # Deal with the possibility that we install to a different directory # than we had at build time by delaying expansion of @libexecdir@ install-exec-hook: @PERL@ -ni -e 's|\@libexecdir\@|$(libexecdir)|; \ print unless /###do_not_install###/' \ $(DESTDIR)$(bindir)/cr_info blcr-0.8.5/util/cr_info/cr_info.in0000664000000000000000000000122711006752633013707 00000000000000#!/bin/sh if [ $# -eq 1 ]; then case "$1" in --help|-\?) echo "$0: program [args...]" echo 'Options:' echo ' -?, --help print this help message.' echo ' --version print version information.' exit 0 ;; --version) echo `basename $0`": version @release_version@" exit 0 ;; esac fi TEMP=`mktemp /tmp/cr_info.XXXXXXXX` || exit 1 trap "rm -f $TEMP; exit 0" 0 1 2 15 perl -0777 -p -e 's/^.*?VMA/VMA/' -- $1 >$TEMP BINDIR=@libexecdir@ ###do_not_install#### following line is to allow use from the build directory BINDIR=@vmadump_dir@ ###do_not_install### exec ${BINDIR}/vmadcheck $TEMP blcr-0.8.5/util/cr_info/Makefile.in0000664000000000000000000003503212102070011013763 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ 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 = util/cr_info DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/blcr_config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__installdirs = "$(DESTDIR)$(bindir)" SCRIPTS = $(bin_SCRIPTS) SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CONFIGURE_ARGS = @CONFIGURE_ARGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CR_ARCH = @CR_ARCH@ CR_CLIENT_LDADD = @CR_CLIENT_LDADD@ CR_CPU = @CR_CPU@ CR_FTB_INCLUDES = @CR_FTB_INCLUDES@ CR_FTB_LDADD = @CR_FTB_LDADD@ CR_FTB_LDFLAGS = @CR_FTB_LDFLAGS@ CR_KARCH = @CR_KARCH@ CR_KERNEL = @CR_KERNEL@ CR_KERNEL_BASE = @CR_KERNEL_BASE@ CR_LIBARCH = @CR_LIBARCH@ CR_LIBCR_CFLAGS = @CR_LIBCR_CFLAGS@ CR_MODULE_DIR = @CR_MODULE_DIR@ CR_MODULE_MAJOR = @CR_MODULE_MAJOR@ CR_MODULE_MINOR = @CR_MODULE_MINOR@ CR_MODULE_PATCH = @CR_MODULE_PATCH@ CR_MODULE_VERSION = @CR_MODULE_VERSION@ CR_NDEBUG = @CR_NDEBUG@ CR_RELEASE_MAJOR = @CR_RELEASE_MAJOR@ CR_RELEASE_MINOR = @CR_RELEASE_MINOR@ CR_RELEASE_PATCH = @CR_RELEASE_PATCH@ CR_RELEASE_VERSION = @CR_RELEASE_VERSION@ CR_SIGNUM = @CR_SIGNUM@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GMAKE_ELSE = @GMAKE_ELSE@ GMAKE_ENDIF = @GMAKE_ENDIF@ GMAKE_IFEQ = @GMAKE_IFEQ@ GMAKE_IFNEQ = @GMAKE_IFNEQ@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KBUILD_MAK = @KBUILD_MAK@ KBUILD_MAKE_ARGS = @KBUILD_MAKE_ARGS@ KCC = @KCC@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBCR_MAJOR = @LIBCR_MAJOR@ LIBCR_MINOR = @LIBCR_MINOR@ LIBCR_PATCH = @LIBCR_PATCH@ LIBCR_VERSION = @LIBCR_VERSION@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_AGE = @LIBTOOL_AGE@ LIBTOOL_INTERFACE = @LIBTOOL_INTERFACE@ LIBTOOL_REVISION = @LIBTOOL_REVISION@ LINUX_OBJ = @LINUX_OBJ@ LINUX_SRC = @LINUX_SRC@ LINUX_SYMTAB_CMD = @LINUX_SYMTAB_CMD@ LINUX_SYMTAB_CONF = @LINUX_SYMTAB_CONF@ LINUX_SYMTAB_FILE = @LINUX_SYMTAB_FILE@ LINUX_VER = @LINUX_VER@ LINUX_VERSION_H = @LINUX_VERSION_H@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKE = @MAKE@ MAKEINFO = @MAKEINFO@ 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_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PWD_PROG = @PWD_PROG@ RANLIB = @RANLIB@ RPMBUILD = @RPMBUILD@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TOP_BUILDDIR = @TOP_BUILDDIR@ TOP_SRCDIR = @TOP_SRCDIR@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ 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@ lt_ECHO = @lt_ECHO@ 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@ vmadump_dir = @TOP_BUILDDIR@/vmadump4 bin_SCRIPTS = cr_info CLEANFILES = cr_info EXTRA_DIST = cr_info.in all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign util/cr_info/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign util/cr_info/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-binSCRIPTS: $(bin_SCRIPTS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n' \ -e 'h;s|.*|.|' \ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) { files[d] = files[d] " " $$1; \ if (++n[d] == $(am__install_max)) { \ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ else { print "f", d "/" $$4, $$1 } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files installcheck-binSCRIPTS: $(bin_SCRIPTS) bad=0; pid=$$$$; list="$(bin_SCRIPTS)"; for p in $$list; do \ case ' $(AM_INSTALLCHECK_STD_OPTIONS_EXEMPT) ' in \ *" $$p "* | *" $(srcdir)/$$p "*) continue;; \ esac; \ f=`echo "$$p" | sed 's,^.*/,,;$(transform)'`; \ for opt in --help --version; do \ if "$(DESTDIR)$(bindir)/$$f" $$opt >c$${pid}_.out \ 2>c$${pid}_.err &2; bad=1; fi; \ done; \ done; rm -f c$${pid}_.???; exit $$bad mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags: TAGS TAGS: ctags: CTAGS CTAGS: 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 $(SCRIPTS) installdirs: for dir in "$(DESTDIR)$(bindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binSCRIPTS @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-exec-hook 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: installcheck-binSCRIPTS maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binSCRIPTS .MAKE: install-am install-exec-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-binSCRIPTS install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-exec-hook \ 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 \ installcheck-binSCRIPTS installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \ uninstall-binSCRIPTS cr_info: cr_info.in Makefile @PERL@ -pe 's|\@vmadump_dir\@|$(vmadump_dir)|;\ s|\@release_version\@|@CR_RELEASE_VERSION@|;' $(srcdir)/$@.in >$@ chmod +x $@ # Deal with the possibility that we install to a different directory # than we had at build time by delaying expansion of @libexecdir@ install-exec-hook: @PERL@ -ni -e 's|\@libexecdir\@|$(libexecdir)|; \ print unless /###do_not_install###/' \ $(DESTDIR)$(bindir)/cr_info # 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: blcr-0.8.5/util/Makefile.am0000664000000000000000000000031310127121626012343 00000000000000# cr_info is disabled since vmadcheck is currently broken -PHH 12.5.03 if BUILD_CR_INFO cr_info=cr_info else cr_info= endif SUBDIRS = cr_checkpoint cr_restart cr_run $(cr_info) EXTRA_DIST = license.txt blcr-0.8.5/util/Makefile.in0000664000000000000000000004367212102070011012355 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ 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 = util DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/blcr_config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-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 uninstall-recursive RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir ETAGS = etags CTAGS = ctags DIST_SUBDIRS = cr_checkpoint cr_restart cr_run cr_info 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@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CONFIGURE_ARGS = @CONFIGURE_ARGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CR_ARCH = @CR_ARCH@ CR_CLIENT_LDADD = @CR_CLIENT_LDADD@ CR_CPU = @CR_CPU@ CR_FTB_INCLUDES = @CR_FTB_INCLUDES@ CR_FTB_LDADD = @CR_FTB_LDADD@ CR_FTB_LDFLAGS = @CR_FTB_LDFLAGS@ CR_KARCH = @CR_KARCH@ CR_KERNEL = @CR_KERNEL@ CR_KERNEL_BASE = @CR_KERNEL_BASE@ CR_LIBARCH = @CR_LIBARCH@ CR_LIBCR_CFLAGS = @CR_LIBCR_CFLAGS@ CR_MODULE_DIR = @CR_MODULE_DIR@ CR_MODULE_MAJOR = @CR_MODULE_MAJOR@ CR_MODULE_MINOR = @CR_MODULE_MINOR@ CR_MODULE_PATCH = @CR_MODULE_PATCH@ CR_MODULE_VERSION = @CR_MODULE_VERSION@ CR_NDEBUG = @CR_NDEBUG@ CR_RELEASE_MAJOR = @CR_RELEASE_MAJOR@ CR_RELEASE_MINOR = @CR_RELEASE_MINOR@ CR_RELEASE_PATCH = @CR_RELEASE_PATCH@ CR_RELEASE_VERSION = @CR_RELEASE_VERSION@ CR_SIGNUM = @CR_SIGNUM@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GMAKE_ELSE = @GMAKE_ELSE@ GMAKE_ENDIF = @GMAKE_ENDIF@ GMAKE_IFEQ = @GMAKE_IFEQ@ GMAKE_IFNEQ = @GMAKE_IFNEQ@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KBUILD_MAK = @KBUILD_MAK@ KBUILD_MAKE_ARGS = @KBUILD_MAKE_ARGS@ KCC = @KCC@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBCR_MAJOR = @LIBCR_MAJOR@ LIBCR_MINOR = @LIBCR_MINOR@ LIBCR_PATCH = @LIBCR_PATCH@ LIBCR_VERSION = @LIBCR_VERSION@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_AGE = @LIBTOOL_AGE@ LIBTOOL_INTERFACE = @LIBTOOL_INTERFACE@ LIBTOOL_REVISION = @LIBTOOL_REVISION@ LINUX_OBJ = @LINUX_OBJ@ LINUX_SRC = @LINUX_SRC@ LINUX_SYMTAB_CMD = @LINUX_SYMTAB_CMD@ LINUX_SYMTAB_CONF = @LINUX_SYMTAB_CONF@ LINUX_SYMTAB_FILE = @LINUX_SYMTAB_FILE@ LINUX_VER = @LINUX_VER@ LINUX_VERSION_H = @LINUX_VERSION_H@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKE = @MAKE@ MAKEINFO = @MAKEINFO@ 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_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PWD_PROG = @PWD_PROG@ RANLIB = @RANLIB@ RPMBUILD = @RPMBUILD@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TOP_BUILDDIR = @TOP_BUILDDIR@ TOP_SRCDIR = @TOP_SRCDIR@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ 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@ lt_ECHO = @lt_ECHO@ 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@ @BUILD_CR_INFO_FALSE@cr_info = # cr_info is disabled since vmadcheck is currently broken -PHH 12.5.03 @BUILD_CR_INFO_TRUE@cr_info = cr_info SUBDIRS = cr_checkpoint cr_restart cr_run $(cr_info) EXTRA_DIST = license.txt 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 util/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign util/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. $(RECURSIVE_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; 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" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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 CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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" 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 \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 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: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-generic clean-libtool \ ctags ctags-recursive 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-recursive \ 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: blcr-0.8.5/util/cr_run/0000755000000000000000000000000012102072123011650 500000000000000blcr-0.8.5/util/cr_run/Makefile.am0000664000000000000000000000124510656261044013646 00000000000000bin_SCRIPTS = cr_run cr_run: cr_run.in Makefile @PERL@ -pe 's|\@top_builddir\@|@TOP_BUILDDIR@|g;\ s|\@libcr_major\@|@LIBCR_MAJOR@|;\ s|\@release_version\@|@CR_RELEASE_VERSION@|;' $(srcdir)/$@.in >$@ chmod +x $@ CLEANFILES = cr_run EXTRA_DIST = cr_run.in cr_run.1 install-exec-hook: @PERL@ -ni -e 'print unless /###do_not_install###/' $(DESTDIR)$(bindir)/cr_run if CR_BUILD_MAN man_MANS = cr_run.1 # target for man page writers: stores man page in 'man1' subdir, so you can # peruse it with 'man foo' (assuming you have '.' in your MANPATH) dev: if test ! -d man1; then mkdir man1; fi cp cr_run.1 man1 dev-clean: -rm -rf man1 endif # CR_BUILD_MAN blcr-0.8.5/util/cr_run/cr_run.10000664000000000000000000000353611026364242013165 00000000000000.\" Hand-rolled... .TH CR_RUN "1" "May 2008" "Berkeley Lab Checkpoint/Restart" "User Commands" .SH NAME cr_run \- runs a subprocess with checkpoint library loaded. .SH SYNOPSIS .B cr_run .I [OPTIONS] COMMAND [ARGS] .SH DESCRIPTION .B cr_run takes an arbitrary command and runs it with the "LD_PRELOAD" environment variable set so that an appropriate shared library is loaded at program startup. Such a library must be loaded if you wish to take a checkpoint of the process with .BR cr_checkpoint (1). .B cr_run assumes that BLCR's libraries .RI ( libcr*.so ) can be found in the default library search path or via the "LD_LIBRARY_PATH" environment variable. You do not need to use .B cr_run if you explicitly link your application with .I -lcr (you may also need to modify your linker's search path with a .I -L directive, depending on the library's location), or if .I libcr.so or a related library is loaded by other libraries you have linked with (such as a checkpoint-ready MPI library), or by your system's parallel job startup script, etc. Check your system documentation for details. .SH OPTIONS .TP .BR -? , --help print a usage message and exit. .TP .B --version print version information and exit. .TP .B -- ends options processing. .TP .B --omit causes executed process(es) to be omitted (rather than included) in any checkpoint taken. .TP .B --run overrides any occurance of .B --omit earlier in the options (restoring the default behavior). .SH BUGS Because .B cr_run relies on the "LD_PRELOAD" environment variable, it is ineffective for statically-linked executables, and for setuid/gid programs. .SH AUTHORS Jason Duell, Paul Hargrove, and Eric Roman, Lawrence Berkeley National Laboratory. .SH "REPORTING BUGS" Bug reports may be filed on the web at .BR http://mantis.lbl.gov/bugzilla . .SH "SEE ALSO" .BR cr_checkpoint (1), .BR cr_restart (1), blcr-0.8.5/util/cr_run/Makefile.in0000664000000000000000000004222512102070011013636 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ 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 = util/cr_run DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/blcr_config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" SCRIPTS = $(bin_SCRIPTS) SOURCES = DIST_SOURCES = man1dir = $(mandir)/man1 NROFF = nroff MANS = $(man_MANS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CONFIGURE_ARGS = @CONFIGURE_ARGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CR_ARCH = @CR_ARCH@ CR_CLIENT_LDADD = @CR_CLIENT_LDADD@ CR_CPU = @CR_CPU@ CR_FTB_INCLUDES = @CR_FTB_INCLUDES@ CR_FTB_LDADD = @CR_FTB_LDADD@ CR_FTB_LDFLAGS = @CR_FTB_LDFLAGS@ CR_KARCH = @CR_KARCH@ CR_KERNEL = @CR_KERNEL@ CR_KERNEL_BASE = @CR_KERNEL_BASE@ CR_LIBARCH = @CR_LIBARCH@ CR_LIBCR_CFLAGS = @CR_LIBCR_CFLAGS@ CR_MODULE_DIR = @CR_MODULE_DIR@ CR_MODULE_MAJOR = @CR_MODULE_MAJOR@ CR_MODULE_MINOR = @CR_MODULE_MINOR@ CR_MODULE_PATCH = @CR_MODULE_PATCH@ CR_MODULE_VERSION = @CR_MODULE_VERSION@ CR_NDEBUG = @CR_NDEBUG@ CR_RELEASE_MAJOR = @CR_RELEASE_MAJOR@ CR_RELEASE_MINOR = @CR_RELEASE_MINOR@ CR_RELEASE_PATCH = @CR_RELEASE_PATCH@ CR_RELEASE_VERSION = @CR_RELEASE_VERSION@ CR_SIGNUM = @CR_SIGNUM@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GMAKE_ELSE = @GMAKE_ELSE@ GMAKE_ENDIF = @GMAKE_ENDIF@ GMAKE_IFEQ = @GMAKE_IFEQ@ GMAKE_IFNEQ = @GMAKE_IFNEQ@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KBUILD_MAK = @KBUILD_MAK@ KBUILD_MAKE_ARGS = @KBUILD_MAKE_ARGS@ KCC = @KCC@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBCR_MAJOR = @LIBCR_MAJOR@ LIBCR_MINOR = @LIBCR_MINOR@ LIBCR_PATCH = @LIBCR_PATCH@ LIBCR_VERSION = @LIBCR_VERSION@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_AGE = @LIBTOOL_AGE@ LIBTOOL_INTERFACE = @LIBTOOL_INTERFACE@ LIBTOOL_REVISION = @LIBTOOL_REVISION@ LINUX_OBJ = @LINUX_OBJ@ LINUX_SRC = @LINUX_SRC@ LINUX_SYMTAB_CMD = @LINUX_SYMTAB_CMD@ LINUX_SYMTAB_CONF = @LINUX_SYMTAB_CONF@ LINUX_SYMTAB_FILE = @LINUX_SYMTAB_FILE@ LINUX_VER = @LINUX_VER@ LINUX_VERSION_H = @LINUX_VERSION_H@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKE = @MAKE@ MAKEINFO = @MAKEINFO@ 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_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PWD_PROG = @PWD_PROG@ RANLIB = @RANLIB@ RPMBUILD = @RPMBUILD@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TOP_BUILDDIR = @TOP_BUILDDIR@ TOP_SRCDIR = @TOP_SRCDIR@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ 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@ lt_ECHO = @lt_ECHO@ 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@ bin_SCRIPTS = cr_run CLEANFILES = cr_run EXTRA_DIST = cr_run.in cr_run.1 @CR_BUILD_MAN_TRUE@man_MANS = cr_run.1 all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign util/cr_run/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign util/cr_run/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-binSCRIPTS: $(bin_SCRIPTS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n' \ -e 'h;s|.*|.|' \ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) { files[d] = files[d] " " $$1; \ if (++n[d] == $(am__install_max)) { \ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ else { print "f", d "/" $$4, $$1 } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files installcheck-binSCRIPTS: $(bin_SCRIPTS) bad=0; pid=$$$$; list="$(bin_SCRIPTS)"; for p in $$list; do \ case ' $(AM_INSTALLCHECK_STD_OPTIONS_EXEMPT) ' in \ *" $$p "* | *" $(srcdir)/$$p "*) continue;; \ esac; \ f=`echo "$$p" | sed 's,^.*/,,;$(transform)'`; \ for opt in --help --version; do \ if "$(DESTDIR)$(bindir)/$$f" $$opt >c$${pid}_.out \ 2>c$${pid}_.err &2; bad=1; fi; \ done; \ done; rm -f c$${pid}_.???; exit $$bad mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-man1: $(man_MANS) @$(NORMAL_INSTALL) test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)" @list=''; test -n "$(man1dir)" || exit 0; \ { for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.1[a-z]*$$/p'; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ done; } uninstall-man1: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man1dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.1[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ test -z "$$files" || { \ echo " ( cd '$(DESTDIR)$(man1dir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(man1dir)" && rm -f $$files; } tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @list='$(MANS)'; if test -n "$$list"; then \ list=`for p in $$list; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \ if test -n "$$list" && \ grep 'ab help2man is required to generate this page' $$list >/dev/null; then \ echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \ grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/ /' >&2; \ echo " to fix them, install help2man, remove and regenerate the man pages;" >&2; \ echo " typically \`make maintainer-clean' will remove them" >&2; \ exit 1; \ else :; fi; \ else :; fi @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(SCRIPTS) $(MANS) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"; 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-man install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binSCRIPTS @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-exec-hook install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-man1 install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: installcheck-binSCRIPTS maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binSCRIPTS uninstall-man uninstall-man: uninstall-man1 .MAKE: install-am install-exec-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-binSCRIPTS install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-exec-hook \ install-html install-html-am install-info install-info-am \ install-man install-man1 install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installcheck-binSCRIPTS installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \ uninstall-binSCRIPTS uninstall-man uninstall-man1 cr_run: cr_run.in Makefile @PERL@ -pe 's|\@top_builddir\@|@TOP_BUILDDIR@|g;\ s|\@libcr_major\@|@LIBCR_MAJOR@|;\ s|\@release_version\@|@CR_RELEASE_VERSION@|;' $(srcdir)/$@.in >$@ chmod +x $@ install-exec-hook: @PERL@ -ni -e 'print unless /###do_not_install###/' $(DESTDIR)$(bindir)/cr_run # target for man page writers: stores man page in 'man1' subdir, so you can # peruse it with 'man foo' (assuming you have '.' in your MANPATH) @CR_BUILD_MAN_TRUE@dev: @CR_BUILD_MAN_TRUE@ if test ! -d man1; then mkdir man1; fi @CR_BUILD_MAN_TRUE@ cp cr_run.1 man1 @CR_BUILD_MAN_TRUE@dev-clean: @CR_BUILD_MAN_TRUE@ -rm -rf man1 # 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: blcr-0.8.5/util/cr_run/cr_run.in0000664000000000000000000000315011026372376013432 00000000000000#!/bin/sh # Default preload is the "run" library _libname=libcr_run # Process args while [ $# -ne 0 ]; do case "$1" in --help|-\?) echo "$0: program [args...]" echo 'Options:' echo ' -?, --help print this help message.' echo ' --version print version information.' echo ' -- ends options procesing.' echo ' --omit exclude process(es) from checkpoints.' echo ' --run negates --omit (this is the default).' exit 0 ;; --version) echo `basename $0`": version @release_version@" exit 0 ;; --) shift break ;; --omit) _libname=libcr_omit shift ;; --run) _libname=libcr_run shift ;; *) break ;; esac done _new=${_libname}.so.@libcr_major@ ###do_not_install#### lines below are a "trick" to allow use from the build directory LD_LIBRARY_PATH=@top_builddir@/libcr/.libs:@top_builddir@/libcr32/libcr/.libs${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH} ###do_not_install### _new=${_libname}.so ###do_not_install### export LD_LIBRARY_PATH ###do_not_install### case "$LD_PRELOAD" in ''|:) LD_PRELOAD="${_new}" ;; *) # Append LD_PRELOAD to _new, filtering out any existing libcr_{omit,run} (and empty elements) saveIFS="$IFS" IFS=: for x in $LD_PRELOAD; do if test -n "$x"; then case "$(basename $x)" in libcr_omit.so*) ;; libcr_run.so*) ;; *) _new="${_new}:${x}";; esac fi done IFS="$saveIFS" ;; esac LD_PRELOAD="${_new}" export LD_PRELOAD exec "$@" blcr-0.8.5/util/cr_restart/0000755000000000000000000000000012102072123012530 500000000000000blcr-0.8.5/util/cr_restart/cr_restart.c0000664000000000000000000006455211212550435015012 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2008, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * 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 * * $Id: cr_restart.c,v 1.68.4.1 2009/06/06 20:27:09 phargrov Exp $ */ #define _LARGEFILE64_SOURCE 1 /* For O_LARGEFILE */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #ifndef O_LARGEFILE #define O_LARGEFILE 0 #endif #include "libcr.h" /* can't use argv[0] to get name, since libtool screws it up */ #define MY_NAME "cr_restart" static int verbose = 0; static enum { kmsg_none = 0, kmsg_err, kmsg_warn, } kmsg_level = kmsg_err; enum { HOOK_SUCCESS = 0, HOOK_FAIL_TEMP, /* transient condition, such as pid conflict */ HOOK_FAIL_ENV, /* "environmental" condition, such as file missing or bad permissions */ HOOK_FAIL_ARGS, /* permanent failure due to invalid args (inc. missing or unreadable file) */ HOOK_FAIL_PERM, /* permanent failure, such as corrupted context file (or unknown failure) */ NUMHOOKS }; static char *event_hooks[NUMHOOKS]; static int run_hook(int hook) { const char *cmd = event_hooks[hook]; int retval = 0; if (cmd && cmd[0]) { int status = system(cmd); retval = WIFEXITED(status) ? WEXITSTATUS(status) : -1; } return retval; } static void usage(FILE *stream, int fail) { if (fail) { int hookval = run_hook(HOOK_FAIL_ARGS); if (hookval) exit(hookval); } if ((verbose < 0) && (stream == stderr)) { exit(fail ? -1 : 0); } fprintf(stream, "Usage: " MY_NAME " [options] [checkpoint_file]\n" "\n" "Options:\n" "General options:\n" " -?, --help print this help message.\n" " -v, --version print version information.\n" " -q, --quiet suppress error/warning messages to stderr.\n" "\n" "Options for source location of the checkpoint:\n" " -d, --dir DIR checkpoint read from directory DIR, with one\n" " 'context.ID' file per process (unimplemented).\n" " -f, --file FILE checkpoint read from FILE.\n" " -F, --fd FD checkpoint read from an open file descriptor.\n" " Options in this group are mutually exclusive.\n" " If no option is given from this group, the default is to take\n" " the final argument as FILE.\n" "\n" "Options for signal sent to process(es) after restart:\n" " --run no signal sent: continue execution (default).\n" " -S, --signal NUM signal NUM sent to all processes/threads.\n" " --stop SIGSTOP sent to all processes.\n" " --term SIGTERM sent to all processes.\n" " --abort SIGABRT sent to all processes.\n" " --kill SIGKILL sent to all processes.\n" " --cont SIGCONT sent to all processes.\n" //" --early-stop freeze processes for a debugger.\n" //" --early-abrt abort processes (dumps core if allowed).\n" " Options in this group are mutually exclusive.\n" " If more than one is given then only the last will be honored.\n" "\n" "Options for checkpoints of restarted process(es):\n" " --omit-maybe use a heuristic to omit cr_restart from checkpoints (default)\n" " --omit-always always omit cr_restart from checkpoints\n" " --omit-never never omit cr_restart from checkpoints\n" "\n" "Options for alternate error handling:\n" " --run-on-success='cmd' run the given command on success\n" " --run-on-fail-args='cmd' run the given command invalid arguments\n" " --run-on-fail-temp='cmd' run the given command on 'temporary' failure\n" " --run-on-fail-env='cmd' run the given command on 'environmental' failure\n" " --run-on-fail-perm='cmd' run the given command on 'permanent' failure\n" " --run-on-failure='cmd' run the given command on any failure\n" "\n" "Options for relocation:\n" " --relocate OLDPATH=NEWPATH map paths of files and directories to\n" " new locations by prefix replacement.\n" "\n" "Options for restoring pid, process group and session ids\n" " --restore-pid restore pids to saved values (default).\n" " --no-restore-pid restart with new pids.\n" " --restore-pgid restore pgid to saved values.\n" " --no-restore-pgid restart with new pgids (default).\n" " --restore-sid restore sid to saved values.\n" " --no-restore-sid restart with new sids (default).\n" " Options in each restore/no-restore pair are mutually exclusive.\n" " If both are given then only the last will be honored.\n" "\n" "Options for kernel log messages (default is --kmsg-error):\n" " --kmsg-none don't report any kernel messages.\n" " --kmsg-error on restart failure, report on stderr any kernel\n" " messages associated with the restart request.\n" " --kmsg-warning report on stderr any kernel messages associated\n" " with the restart request, regardless of success\n" " or failure. Messages generated in the absence of\n" " failure are considered to be warnings.\n" " Options in this group are mutually exclusive.\n" " If more than one is given then only the last will be honored.\n" " Note that --quiet suppresses all stderr output, including these messages.\n" ); exit(fail ? -1 : 0); } sig_atomic_t child = 0; /* who did we spawn? */ static void signal_child (int, siginfo_t *, void *); static void signal_self(int sig) { struct sigaction sa; /* restore default (in kernel) handler */ sa.sa_handler = SIG_DFL; sa.sa_flags = SA_RESTART | SA_NOMASK; sigemptyset(&sa.sa_mask); (void)sigaction(sig, &sa, NULL); /* send to self */ raise(sig); /* restore self as handler */ sa.sa_sigaction = &signal_child; sa.sa_flags = SA_RESTART | SA_NOMASK | SA_SIGINFO; (void)sigaction(sig, &sa, NULL); } /* Best-effort to forward all signals to the restarted child * XXX: This is probably not complete in terms of special-cases */ static void signal_child (int sig, siginfo_t *siginfo, void *context) { if ((siginfo->si_code > 0) && /* si_code > 0 indicates sent by kernel */ (sig == SIGILL || sig == SIGFPE || sig == SIGBUS || sig == SIGSEGV )) { /* This signal is OUR error, so we don't forward */ signal_self(sig); } else if (sig == SIGTSTP || sig == SIGTTIN || sig == SIGTTOU) { /* The catchable stop signals go to child AND self */ (void)kill(child, sig); signal_self(sig); } else { /* default case */ (void)kill(child, sig); } } static char *kmsgs = NULL; /* ... share any error/warning messages from the kernel */ static void show_kmsgs(void) { if (kmsgs) { /* prints each line with "- " as a prefix */ char *p = kmsgs; while (*p) { char *n = strchr(p, '\n'); if (!n) break; *n = '\0'; fputs("- ", stderr); fputs(p, stderr); fputc('\n', stderr); p = n+1; } } free(kmsgs); kmsgs = NULL; } static void die(int code, int hook, const char *format, ...) __attribute__ ((noreturn, format (printf, 3, 4))); /* * die(code, hook, format, args...) * * Runs the indicated hook, exiting w/ its return code if non-zero. * Otherwise sends an error message to stderr and exits program with indicated code. */ static void die(int code, int hook, const char *format, ...) { va_list args; int hookval; hookval = run_hook(hook); if (hookval) exit(hookval); va_start(args, format); if (verbose >= 0) { show_kmsgs(); vfprintf(stderr, format, args); } va_end(args); exit(code); } static void warn(const char *format, ...) __attribute__ ((format (printf, 1, 2))); /* * warn(format, args...) * * Sends a warning message to stderr */ static void warn(const char *format, ...) { va_list args; va_start(args, format); if (verbose >= 0) { vfprintf(stderr, format, args); } va_end(args); } static void print_version() { printf(MY_NAME " version %s\n", CR_RELEASE_VERSION); } static int readint(const char *arg) { int val; char *endptr; val = strtol(arg, &endptr, 10); if ((*arg == '\0') || (*endptr != '\0')) { usage(stderr, 1); } return val; } static char * strip_trailing(char *path, char c) { size_t len; len = strlen(path); while (len--) { if (path[len] != c) { break; } path[len] = '\0'; } return path; } /* Note: path[n].oldpath and .newpath share the storage addressed by .oldpath */ static struct cr_rstrt_relocate * parse_relocate_arg(struct cr_rstrt_relocate *reloc, const char *arg) { char *oldpath, *newpath; char *p; int count; if (!reloc) { reloc = calloc(1, CR_RSTRT_RELOCATE_SIZE(CR_MAX_RSTRT_RELOC)); if (!reloc) { die(ENOMEM, HOOK_FAIL_ARGS, "Out of memory\n"); } } count = reloc->count; if (count >= CR_MAX_RSTRT_RELOC) { die(EINVAL, HOOK_FAIL_ARGS, "Too many relocations (max is %d).\n", CR_MAX_RSTRT_RELOC); } oldpath = strdup(arg); if (!oldpath) { die(ENOMEM, HOOK_FAIL_ARGS, "Out of memory\n"); } /* Parse arg looking for '=' while parsing "\\" and "\=" sequences */ p = oldpath; newpath = NULL; while (p[0]) { if (p[0] == '\\') { /* Handle "\\" and "\=" */ const char c = p[1]; if ((c == '\\') || (c == '=')) { /* Squeeze out the current character */ memmove(p, p+1, strlen(p+1) + 1/* for \0 */); } else { /* '\' not special in any other context */ } } else if (p[0] == '=') { if (!newpath) { p[0] = '\0'; newpath = p+1; /* parsing continues for escape sequences */ } else { die(EINVAL, HOOK_FAIL_ARGS, "Relocation argument '%s' contains multiple unescaped '=' characters.\n", arg); } } ++p; } if (!newpath) { die(EINVAL, HOOK_FAIL_ARGS, "Relocation argument '%s' contains no unescaped '=' characters.\n", arg); } /* Require first char to be '/' - a full path */ if (oldpath[0] != '/' || newpath[0] != '/') { die(EINVAL, HOOK_FAIL_ARGS, "Relocation paths must begin with '/', but have '%s'\n", arg); } /* "Trim" trailing slashes, always keeping the initial one */ strip_trailing(oldpath+1, '/'); strip_trailing(newpath+1, '/'); /* Silently discard useless identity relocations */ if (!strcmp(oldpath, newpath)) { free(oldpath); return reloc; } /* Install */ reloc->path[count].oldpath = oldpath; reloc->path[count].newpath = newpath; reloc->count++; return reloc; } /* getopt enum */ enum { opt_run = 1000, opt_stop, opt_term, opt_kill, opt_abort, opt_cont, opt_early_stop, opt_early_abrt, opt_omit_maybe, opt_omit_always, opt_omit_never, opt_hook_success, opt_hook_fail_temp, opt_hook_fail_env, opt_hook_fail_args, opt_hook_fail_perm, opt_hook_failure, /* equiv to opt_hook_fail_* */ opt_relocate, opt_kmsg_none, opt_kmsg_error, opt_kmsg_warning, opt_restore_pid, opt_no_restore_pid, opt_restore_pgid, opt_no_restore_pgid, opt_restore_sid, opt_no_restore_sid, }; /* try to exit such that our exit code is same as our child */ static void mimic_exit(int status) { if (WIFEXITED(status)) { /* easy to mimic normal return */ exit(WEXITSTATUS(status)); } else if (WIFSIGNALED(status)) { /* disable generation of a 'core' */ struct rlimit r; r.rlim_cur = r.rlim_max = 0; (void)setrlimit(RLIMIT_CORE, &r); /* now raise the signal */ signal_self(WTERMSIG(status)); } else { warn("Unexpected status from child\n"); exit(-1); } } static volatile enum { CR_RSTRT_OMIT_MAYBE = 0, CR_RSTRT_OMIT_ALWAYS, CR_RSTRT_OMIT_NEVER } omit_self = CR_RSTRT_OMIT_MAYBE; static pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER; /* "my" pid (done this way due to LinuxThreads limitations */ static int mypid; /* Callback to perform a critical section OR get us omitted from the checkpoint */ static int my_cb(void *arg) { int status = CR_CHECKPOINT_PERM_FAILURE; const struct cr_checkpoint_info *info = cr_get_checkpoint_info(); switch (omit_self) { case CR_RSTRT_OMIT_ALWAYS: status = CR_CHECKPOINT_OMIT; break; case CR_RSTRT_OMIT_NEVER: status = CR_CHECKPOINT_READY; break; case CR_RSTRT_OMIT_MAYBE: if ((info->target == mypid) || (getppid() == 1)) { /* I am "root" of the checkpoint or an orphan (child of init) */ status = CR_CHECKPOINT_OMIT; } else { status = CR_CHECKPOINT_READY; } break; } /* Ensure that either all or none of the chilren exist */ pthread_mutex_lock(&lock); if (child) { /* Include my children */ int rc = cr_forward_checkpoint(CR_SCOPE_TREE, mypid); if (rc < 0) { if (errno == ESRCH) { /* Empty request, perhaps all children did OMIT. */ } else { warn("WARNING: cr_forward_checkpoint() returned %d (%s)\n", errno, cr_strerror(errno)); } } } else { /* Don't omit if we didn't do anything yet */ status = CR_CHECKPOINT_READY; } /* Go! */ cr_checkpoint(status); pthread_mutex_unlock(&lock); return 0; } /* Type of source */ enum { src_default, src_file, src_dir, src_fd, }; /* Terminate as appropriate for the given error code */ static void failure(void) { int save_errno = errno; int hook = HOOK_FAIL_PERM; /* The default */ switch (save_errno) { /* "TEMPORARY" failures are ones that might resolve themselves: */ case ENOMEM: case EBUSY: /* e.g. PID in use */ hook = HOOK_FAIL_TEMP; break; /* "ENVIRONMENTAL" failures are ones that might be resolved manually: */ case EACCES: /* e.g. file permissions */ case EPERM: /* e.g. directory permissions */ case ENOENT: /* e.g. file is missing */ case EEXIST: /* e.g. fs object conflicts with an existing object */ case EISDIR: /* e.g. fs object conflicts with an existing object */ case ENOTDIR: /* e.g. fs object conflicts with an existing object */ hook = HOOK_FAIL_ENV; break; /* All remaining errno values (including unknown ones) are "PERMANENT" failure */ case ENOSYS: /* e.g. unsupported/unimplemented "thingy" to restore */ case EIO: /* e.g. fs problems */ case EINVAL: /* e.g. corrupted value(s) */ hook = HOOK_FAIL_PERM; } die(save_errno, hook, "Restart failed: %s\n", cr_strerror(errno)); } int main(int argc, char **argv) { cr_restart_args_t args; struct cr_rstrt_relocate *reloc = NULL; int err; char *context_filename = NULL; /*char *context_dirname = NULL;*/ int context_fd = -1; int src_type = src_default; struct sigaction sa; sigset_t sigmask, oldmask; int sig; int child_status; int signal = 0; cr_client_id_t client_id; cr_callback_id_t cb_id; cr_restart_handle_t cr_handle; int flags = CR_RSTRT_ASYNC_ERR | CR_RSTRT_RESTORE_PID; char * shortflags = "qvhS:F:d:f:"; /* 1 colon == requires argument */ struct option longflags[] = { /* misc options: */ { "help", no_argument, 0, 'h' }, { "version", no_argument, 0, 'v' }, { "quiet", no_argument, 0, 'q' }, /* source: */ { "file", required_argument, 0, 'f' }, { "dir", required_argument, 0, 'd' }, { "fd", required_argument, 0, 'F' }, /* signal options: */ { "signal", required_argument, 0, 'S' }, { "run", no_argument, 0, opt_run }, { "stop", no_argument, 0, opt_stop }, { "freeze", no_argument, 0, opt_stop }, { "term", no_argument, 0, opt_term }, { "kill", no_argument, 0, opt_kill }, { "abort", no_argument, 0, opt_abort }, { "cont", no_argument, 0, opt_cont }, { "early-stop", no_argument, 0, opt_early_stop }, { "early-abrt", no_argument, 0, opt_early_abrt }, /* omit options: */ { "omit-maybe", no_argument, 0, opt_omit_maybe }, { "omit-always", no_argument, 0, opt_omit_always }, { "omit-never", no_argument, 0, opt_omit_never }, { "run-on-success", required_argument, 0, opt_hook_success }, { "run-on-fail-temp", required_argument, 0, opt_hook_fail_temp }, { "run-on-fail-env", required_argument, 0, opt_hook_fail_env }, { "run-on-fail-args", required_argument, 0, opt_hook_fail_args }, { "run-on-fail-perm", required_argument, 0, opt_hook_fail_perm }, { "run-on-failure", required_argument, 0, opt_hook_failure }, /* map relocation option: */ { "relocate", required_argument, 0, opt_relocate }, /* kmsg options: */ { "kmsg-none", no_argument, 0, opt_kmsg_none}, { "kmsg-error", no_argument, 0, opt_kmsg_error}, { "kmsg-warning", no_argument, 0, opt_kmsg_warning}, /* pid/pgid/sid restore: */ { "restore-pid", no_argument, 0, opt_restore_pid}, { "no-restore-pid", no_argument, 0, opt_no_restore_pid}, { "restore-pgid", no_argument, 0, opt_restore_pgid}, { "no-restore-pgid", no_argument, 0, opt_no_restore_pgid}, { "restore-sid", no_argument, 0, opt_restore_sid}, { "no-restore-sid", no_argument, 0, opt_no_restore_sid}, { 0, 0, 0, 0 } }; opterr = 0; while (1) { int longindex = -1; int opt = getopt_long(argc, argv, shortflags, longflags, &longindex); if (opt == -1) break; /* reached last option */ switch (opt) { /* source: */ case 'f': if (src_type != src_default) { die(EINVAL, HOOK_FAIL_ARGS, "multiple source arguments specified\n"); } src_type = src_file; context_filename = strdup(optarg); if (!context_filename) { die(ENOMEM, HOOK_FAIL_TEMP, "strdup failed on string '%s'\n", optarg); } break; case 'd': if (src_type != src_default) { die(EINVAL, HOOK_FAIL_ARGS, "multiple source arguments specified\n"); } src_type = src_dir; #if 1 die(EINVAL, HOOK_FAIL_ARGS, "-d flag not yet implemented\n"); #else context_dirname = strdup(optarg); if (!context_dirname) { die(ENOMEM, HOOK_FAIL_TEMP, "strdup failed on string '%s'\n", optarg); } break; #endif case 'F': if (src_type != src_default) { die(EINVAL, HOOK_FAIL_ARGS, "multiple source arguments specified\n"); } src_type = src_fd; context_fd = readint(optarg); if (context_fd < 0) { die(EINVAL, HOOK_FAIL_ARGS, "FD argument must be a non-negatvive integer (%d was given)\n", context_fd); } break; /* Signal */ case 'S': signal = readint(optarg); if ((signal <= 0) || (signal >= _NSIG)) { die(EINVAL, HOOK_FAIL_ARGS, "Valid signal numbers are from 1 to %d, inclusive.\n", _NSIG - 1); } break; case opt_run: /* --run */ signal = 0; break; case opt_stop: /* --stop */ signal = SIGSTOP; break; case opt_term: /* --term */ signal = SIGTERM; break; case opt_kill: /* --kill */ signal = SIGKILL; break; case opt_abort: /* --abort */ signal = SIGABRT; break; case opt_cont: /* --cont */ signal = SIGCONT; break; case opt_early_stop: /* --early_stop */ signal = -SIGSTOP; break; case opt_early_abrt: /* --early_abrt */ signal = -SIGABRT; break; /* Omit */ case opt_omit_maybe: omit_self = CR_RSTRT_OMIT_MAYBE; break; case opt_omit_always: omit_self = CR_RSTRT_OMIT_ALWAYS; break; case opt_omit_never: omit_self = CR_RSTRT_OMIT_NEVER; break; /* Hooks */ case opt_hook_success: event_hooks[HOOK_SUCCESS] = strdup(optarg); break; case opt_hook_fail_temp: event_hooks[HOOK_FAIL_TEMP] = strdup(optarg); break; case opt_hook_fail_env: event_hooks[HOOK_FAIL_ENV] = strdup(optarg); break; case opt_hook_fail_args: event_hooks[HOOK_FAIL_ARGS] = strdup(optarg); break; case opt_hook_fail_perm: event_hooks[HOOK_FAIL_PERM] = strdup(optarg); break; case opt_hook_failure: event_hooks[HOOK_FAIL_TEMP] = strdup(optarg); event_hooks[HOOK_FAIL_ENV] = strdup(optarg); event_hooks[HOOK_FAIL_ARGS] = strdup(optarg); event_hooks[HOOK_FAIL_PERM] = strdup(optarg); break; /* Map Relocation */ case opt_relocate: reloc = parse_relocate_arg(reloc, optarg); break; /* kmsg options: */ case opt_kmsg_none: kmsg_level = kmsg_none; break; case opt_kmsg_error: kmsg_level = kmsg_err; break; case opt_kmsg_warning: kmsg_level = kmsg_warn; break; /* pid/pgid/sid restore options: */ case opt_restore_pid: flags |= CR_RSTRT_RESTORE_PID; break; case opt_no_restore_pid: flags &= ~CR_RSTRT_RESTORE_PID; break; case opt_restore_pgid: flags |= CR_RSTRT_RESTORE_PGID; break; case opt_no_restore_pgid: flags &= ~CR_RSTRT_RESTORE_PGID; break; case opt_restore_sid: flags |= CR_RSTRT_RESTORE_SID; break; case opt_no_restore_sid: flags &= ~CR_RSTRT_RESTORE_SID; break; /* General */ case 'q': verbose = -1; break; case 'v': print_version(); return 0; case '?': if (optopt != '?') { /* Unrecognized option case */ usage(stderr, 1); } /* fall through for help... */ case 'h': usage(stdout, 0); return 0; default: /* reachable? */ usage(stderr, 1); } } /* Require either exactly one filename argument, or none at all */ if (src_type == src_default) { if ((argc - optind) != 1) { usage(stderr, 1); } else { context_filename = argv[optind]; src_type = src_file; } } else if (argc != optind) { usage(stderr, 1); } /* Record our pid */ mypid = getpid(); /* ... connect to the kernel */ client_id = cr_init(); if (client_id < 0) { die(client_id, HOOK_FAIL_PERM, "Failed cr_init(): %d\n", client_id); } /* ... register callback to exclude us from the checkpoint */ cb_id = cr_register_callback(&my_cb, NULL, CR_THREAD_CONTEXT); if (cb_id < 0) { die(cb_id, HOOK_FAIL_PERM, "Failed cr_regsiter_callback(): %d\n", cb_id); } /* ... open up the context file */ if (src_type == src_file) { context_fd = open(context_filename, O_RDONLY | O_LARGEFILE); if (context_fd < 0) { die(context_fd, HOOK_FAIL_ARGS, "Failed to open(%s, O_RDONLY): %s\n", context_filename, strerror(errno)); } } else if (src_type == src_fd) { /* OK */ } else { die(cb_id, HOOK_FAIL_PERM, "Internal error - unknow source type %d\n", src_type); } /* ... initialize the request structure */ cr_initialize_restart_args_t(&args); args.cr_fd = context_fd; args.cr_signal = signal; args.cr_relocate = reloc; args.cr_flags = flags; /* START of critical section. * Since we don't (yet?) try to checkpoint the state associated with * a partially completed restart, we must exclude checkpoints between * CR_OP_RSTRT_REQ and CR_OP_RSTRT_REAP */ pthread_mutex_lock(&lock); /* ... issue the request */ err = cr_request_restart(&args, &cr_handle); if (err < 0) { failure(); } /* ... prepare to forward signals */ /* XXX: what should we use in place of _NSIG? */ sigfillset(&sigmask); sigdelset(&sigmask, SIGSTOP); sigdelset(&sigmask, SIGKILL); sigdelset(&sigmask, SIGCHLD); sigprocmask(SIG_SETMASK, &sigmask, &oldmask); sa.sa_sigaction = &signal_child; sa.sa_flags = SA_RESTART | SA_NOMASK | SA_SIGINFO; sigemptyset(&sa.sa_mask); for (sig = 1; sig < _NSIG; ++sig) { if (sig == SIGCHLD) continue; if (sig == SIGKILL) continue; if (sig == SIGSTOP) continue; if (sig == CR_SIGNUM) continue; /* best-effort so we ignore failures */ (void)sigaction(sig, &sa, NULL); } /* ... close the context file so a restarted cr_restart won't depend on it */ /* XXX: How early can we do this safely? No documented answer! */ (void)close(context_fd); /* ... wait for completion */ do { err = cr_wait_restart(&cr_handle, NULL); if (err == 0) { /* 0 would mean timeout, but we passed NULL for the (struct timeval *) */ die(1, HOOK_FAIL_PERM, "cr_wait_restart returned unexpected 0"); } } while ((err < 0) && (errno == EINTR)); if (err < 0) { die(errno, HOOK_FAIL_PERM, "cr_wait_restart: %s\n", cr_strerror(errno)); } /* ... collect kernel logs if requested */ if (kmsg_level != kmsg_none) { /* NOTE: we ignore any failure to malloc (EFAULT) or to collect the log */ err = cr_log_restart(&cr_handle, 0, NULL); if (err > 0) { int len = err; kmsgs = malloc(len); (void)cr_log_restart(&cr_handle, len, kmsgs); } } /* ... collect result and triage any errors */ err = cr_reap_restart(&cr_handle); if (err < 0) { failure(); } else { int hookval = run_hook(HOOK_SUCCESS); if (hookval) return hookval; /* XXX: do we really want to return here? */ /* Record the pid for signal forwarding */ child = (pid_t)err; } /* END of critical section */ pthread_mutex_unlock(&lock); /* show any warnings from the kernel */ if ((verbose >= 0) && (kmsg_level == kmsg_warn)) { show_kmsgs(); } /* If there is no child (target was a child of init), return now */ if (!child) return 0; /* ... now we forward the signals */ sigprocmask(SIG_SETMASK, &oldmask, NULL); /* XXX should have the option of a non-blocking case */ do { /* wait for the child we've inherited */ err = waitpid(child, &child_status, __WCLONE | __WALL); } while ((err < 0) && (errno == EINTR)); /* retry on non-fatal signals */ /* XXX wait for additional children? */ if (err < 0) { /* Unable to reap the child */ die(err, HOOK_FAIL_PERM, "waitpid(%d): %s\n", child, cr_strerror(errno)); } mimic_exit(child_status); return -1; /* NOT REACHED */ } blcr-0.8.5/util/cr_restart/Makefile.am0000664000000000000000000000246111055336755014535 00000000000000bin_PROGRAMS = cr_restart if CR_INSTALLED_LIBCR LDADD = -L$(libdir) -lcr @CR_CLIENT_LDADD@ INCLUDES = -I$(includedir) else LDADD = -L$(top_builddir)/libcr -lcr @CR_CLIENT_LDADD@ INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include LIBCR = $(top_builddir)/libcr/libcr.la cr_restart_DEPENDENCIES = $(LIBCR) $(LIBCR): @$(MAKE) $(AM_MAKEFLAGS) --no-print-directory -C $(@D) endif AM_CFLAGS = -Wall AM_CPPFLAGS = @CR_NDEBUG@ EXTRA_DIST = cr_restart.extraman if CR_BUILD_MAN manfiles = cr_restart.1 man_MANS = $(manfiles) # delete man page sources during 'clean', since they're generated files. CLEANFILES = $(manfiles) cr_restart.1: $(top_srcdir)/util/cr_restart/cr_restart.extraman cr_restart @PERL@ $(top_srcdir)/man/help2man \ -n "restarts a process, process group, or session from a checkpoint file."\ -i $(top_srcdir)/util/cr_restart/cr_restart.extraman -N \ -o cr_restart.1 -s 1 -S "Berkeley Lab Checkpoint/Restart" \ $(top_builddir)/util/cr_restart/cr_restart # target for man page writers: stores man page in 'man1' subdir, so you can # peruse it with 'man foo' (assuming you have '.' in your MANPATH) dev: clean $(manfiles) if test ! -d man1; then mkdir man1; fi cp $(manfiles) man1 dev-clean: -rm -rf man1 $(manfiles) endif # CR_BUILD_MAN blcr-0.8.5/util/cr_restart/Makefile.in0000664000000000000000000005515312102070011014522 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = cr_restart$(EXEEXT) @CR_INSTALLED_LIBCR_TRUE@cr_restart_DEPENDENCIES = subdir = util/cr_restart DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/blcr_config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" PROGRAMS = $(bin_PROGRAMS) cr_restart_SOURCES = cr_restart.c cr_restart_OBJECTS = cr_restart.$(OBJEXT) cr_restart_LDADD = $(LDADD) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/./config/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = cr_restart.c DIST_SOURCES = cr_restart.c 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' man1dir = $(mandir)/man1 NROFF = nroff MANS = $(man_MANS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CONFIGURE_ARGS = @CONFIGURE_ARGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CR_ARCH = @CR_ARCH@ CR_CLIENT_LDADD = @CR_CLIENT_LDADD@ CR_CPU = @CR_CPU@ CR_FTB_INCLUDES = @CR_FTB_INCLUDES@ CR_FTB_LDADD = @CR_FTB_LDADD@ CR_FTB_LDFLAGS = @CR_FTB_LDFLAGS@ CR_KARCH = @CR_KARCH@ CR_KERNEL = @CR_KERNEL@ CR_KERNEL_BASE = @CR_KERNEL_BASE@ CR_LIBARCH = @CR_LIBARCH@ CR_LIBCR_CFLAGS = @CR_LIBCR_CFLAGS@ CR_MODULE_DIR = @CR_MODULE_DIR@ CR_MODULE_MAJOR = @CR_MODULE_MAJOR@ CR_MODULE_MINOR = @CR_MODULE_MINOR@ CR_MODULE_PATCH = @CR_MODULE_PATCH@ CR_MODULE_VERSION = @CR_MODULE_VERSION@ CR_NDEBUG = @CR_NDEBUG@ CR_RELEASE_MAJOR = @CR_RELEASE_MAJOR@ CR_RELEASE_MINOR = @CR_RELEASE_MINOR@ CR_RELEASE_PATCH = @CR_RELEASE_PATCH@ CR_RELEASE_VERSION = @CR_RELEASE_VERSION@ CR_SIGNUM = @CR_SIGNUM@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GMAKE_ELSE = @GMAKE_ELSE@ GMAKE_ENDIF = @GMAKE_ENDIF@ GMAKE_IFEQ = @GMAKE_IFEQ@ GMAKE_IFNEQ = @GMAKE_IFNEQ@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KBUILD_MAK = @KBUILD_MAK@ KBUILD_MAKE_ARGS = @KBUILD_MAKE_ARGS@ KCC = @KCC@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBCR_MAJOR = @LIBCR_MAJOR@ LIBCR_MINOR = @LIBCR_MINOR@ LIBCR_PATCH = @LIBCR_PATCH@ LIBCR_VERSION = @LIBCR_VERSION@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_AGE = @LIBTOOL_AGE@ LIBTOOL_INTERFACE = @LIBTOOL_INTERFACE@ LIBTOOL_REVISION = @LIBTOOL_REVISION@ LINUX_OBJ = @LINUX_OBJ@ LINUX_SRC = @LINUX_SRC@ LINUX_SYMTAB_CMD = @LINUX_SYMTAB_CMD@ LINUX_SYMTAB_CONF = @LINUX_SYMTAB_CONF@ LINUX_SYMTAB_FILE = @LINUX_SYMTAB_FILE@ LINUX_VER = @LINUX_VER@ LINUX_VERSION_H = @LINUX_VERSION_H@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKE = @MAKE@ MAKEINFO = @MAKEINFO@ 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_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PWD_PROG = @PWD_PROG@ RANLIB = @RANLIB@ RPMBUILD = @RPMBUILD@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TOP_BUILDDIR = @TOP_BUILDDIR@ TOP_SRCDIR = @TOP_SRCDIR@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ 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@ lt_ECHO = @lt_ECHO@ 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@ @CR_INSTALLED_LIBCR_FALSE@LDADD = -L$(top_builddir)/libcr -lcr @CR_CLIENT_LDADD@ @CR_INSTALLED_LIBCR_TRUE@LDADD = -L$(libdir) -lcr @CR_CLIENT_LDADD@ @CR_INSTALLED_LIBCR_FALSE@INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include @CR_INSTALLED_LIBCR_TRUE@INCLUDES = -I$(includedir) @CR_INSTALLED_LIBCR_FALSE@LIBCR = $(top_builddir)/libcr/libcr.la @CR_INSTALLED_LIBCR_FALSE@cr_restart_DEPENDENCIES = $(LIBCR) AM_CFLAGS = -Wall AM_CPPFLAGS = @CR_NDEBUG@ EXTRA_DIST = cr_restart.extraman @CR_BUILD_MAN_TRUE@manfiles = cr_restart.1 @CR_BUILD_MAN_TRUE@man_MANS = $(manfiles) # delete man page sources during 'clean', since they're generated files. @CR_BUILD_MAN_TRUE@CLEANFILES = $(manfiles) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign util/cr_restart/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign util/cr_restart/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) test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ 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 installcheck-binPROGRAMS: $(bin_PROGRAMS) bad=0; pid=$$$$; list="$(bin_PROGRAMS)"; for p in $$list; do \ case ' $(AM_INSTALLCHECK_STD_OPTIONS_EXEMPT) ' in \ *" $$p "* | *" $(srcdir)/$$p "*) continue;; \ esac; \ f=`echo "$$p" | \ sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ for opt in --help --version; do \ if "$(DESTDIR)$(bindir)/$$f" $$opt >c$${pid}_.out \ 2>c$${pid}_.err &2; bad=1; fi; \ done; \ done; rm -f c$${pid}_.???; exit $$bad cr_restart$(EXEEXT): $(cr_restart_OBJECTS) $(cr_restart_DEPENDENCIES) @rm -f cr_restart$(EXEEXT) $(LINK) $(cr_restart_OBJECTS) $(cr_restart_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cr_restart.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-man1: $(man_MANS) @$(NORMAL_INSTALL) test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)" @list=''; test -n "$(man1dir)" || exit 0; \ { for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.1[a-z]*$$/p'; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ done; } uninstall-man1: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man1dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.1[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ test -z "$$files" || { \ echo " ( cd '$(DESTDIR)$(man1dir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(man1dir)" && rm -f $$files; } ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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 CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @list='$(MANS)'; if test -n "$$list"; then \ list=`for p in $$list; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \ if test -n "$$list" && \ grep 'ab help2man is required to generate this page' $$list >/dev/null; then \ echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \ grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/ /' >&2; \ echo " to fix them, install help2man, remove and regenerate the man pages;" >&2; \ echo " typically \`make maintainer-clean' will remove them" >&2; \ exit 1; \ else :; fi; \ else :; fi @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(MANS) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"; 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-binPROGRAMS 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-man install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-man1 install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: installcheck-binPROGRAMS 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-binPROGRAMS uninstall-man uninstall-man: uninstall-man1 .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ clean-generic clean-libtool ctags 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-man1 install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installcheck-binPROGRAMS installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-binPROGRAMS \ uninstall-man uninstall-man1 @CR_INSTALLED_LIBCR_FALSE@$(LIBCR): @CR_INSTALLED_LIBCR_FALSE@ @$(MAKE) $(AM_MAKEFLAGS) --no-print-directory -C $(@D) @CR_BUILD_MAN_TRUE@cr_restart.1: $(top_srcdir)/util/cr_restart/cr_restart.extraman cr_restart @CR_BUILD_MAN_TRUE@ @PERL@ $(top_srcdir)/man/help2man \ @CR_BUILD_MAN_TRUE@ -n "restarts a process, process group, or session from a checkpoint file."\ @CR_BUILD_MAN_TRUE@ -i $(top_srcdir)/util/cr_restart/cr_restart.extraman -N \ @CR_BUILD_MAN_TRUE@ -o cr_restart.1 -s 1 -S "Berkeley Lab Checkpoint/Restart" \ @CR_BUILD_MAN_TRUE@ $(top_builddir)/util/cr_restart/cr_restart # target for man page writers: stores man page in 'man1' subdir, so you can # peruse it with 'man foo' (assuming you have '.' in your MANPATH) @CR_BUILD_MAN_TRUE@dev: clean $(manfiles) @CR_BUILD_MAN_TRUE@ if test ! -d man1; then mkdir man1; fi @CR_BUILD_MAN_TRUE@ cp $(manfiles) man1 @CR_BUILD_MAN_TRUE@dev-clean: @CR_BUILD_MAN_TRUE@ -rm -rf man1 $(manfiles) # 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: blcr-0.8.5/util/cr_restart/cr_restart.extraman0000664000000000000000000002306211070305370016374 00000000000000[DESCRIPTION] cr_restart restarts a process (or set of processes) from a checkpoint file created with .BR cr_checkpoint (1). A restarted process has all of the attributes they had at checkpoint time, including its process id. If any needed resources cannot be attained for the processes in a checkpoint file (ex: a pid is in use), cr_restart will fail. If a process group or session is restarted, all parent/child relations and pipes, etc., between the processes in the checkpoint will be correctly restored. If the .IR stdin / stdout / stderr of any restarted process was directed to a terminal at checkpoint time, it is redirected to the controlling terminal of the cr_restart program. The current working directory of a restarted process is the same as when it was checkpointed, regardless of where the context file is located, or where cr_restart is invoked. The cr_restart process becomes the parent of the 'eldest' process in any restarted job. This means that .BR getppid (2) may return a different value to the eldest process after restart. When the eldest restarted process exits (or dies from a signal), cr_restart will exit with the same error code (or kill itself with the same signal), so it is largely invisible (it is necessary to keep cr_restart `in-between' your shell and restarted processes, however, as most Unix shells get quite confused if they observe their children changing process ids). .SS Signals By default restarted processes begin to run after the restart is complete. Alternatively, you may specify that they be stopped (via .BR --stop ), or terminated/aborted/killed (via .BR --term , .BR --abort , or .BR --kill ). This is done by sending the appropriate signal to every process that is part of the restart. If the processes were stopped at the time the checkpoint was requested, then .B --cont may be used to send SIGCONT to all processes after the restart is completed. .SS "Error handling" By default cr_restart will block until the restarted process has completed, and will exit with the same exit value as the restarted process (even if the restarted process died with a fatal signal). This can make it nearly impossible to determine if a non-zero exit from cr_restart is due to a failure to restart, or is the exit code of a correctly restarted process. The simple approach of looking for 'Restart failed:' is not reliable. Therefore, the .B --run-on-* family of flags are available to supply alternative (or supplementary) error handling. When any of the .B --run-on-* flags is passed, a hook is installed for the given category of failure (or success), as defined below. When an error (or success) is detected and a corresponding hook is installed, the hook is run via the .BR system (3) function. If the exit code of the hook is non-zero, then cr_restart returns this value, suppressing any error message that would otherwise be generated. If no hook is installed, the hook is an empty string, or if the hook returns an exit code of zero, then an explanatory error message is printed and an exit code related to the errno value at the time of failure is returned. .TP .B --run-on-success='cmd' Runs the given command as soon as the restarted process(es) are known to be running. If the return value of 'cmd' is non-zero, this also results in cr_restart terminating without waiting on termination of the restarted process(es). .TP .B --run-on-fail-args='cmd' Runs the given command if the arguments are invalid. This includes the case in which the given context file is missing or unreadable. .TP .B --run-on-fail-temp='cmd' Runs the given command if a "temporary" failure is detected. This includes the case of a required pid being in use. .TP .B --run-on-fail-perm='cmd' Runs the given command if a "permanent" failure is detected. This is most commonly due to a corrupted context file. .TP .B --run-on-fail-env='cmd' Runs the given command if an "environmental" failure is detected. This includes when files required for restarting are missing or inaccessible. .TP .B --run-on-failure='cmd' This installs the given command for all of the .B --run-on-fail-* hooks. .SS "File relocation" By default, files and directories are saved `by reference', storing their full pathname in the context file. This includes files associated with a process via .BR open (2) and/or .BR mmap (2) and directories associated via .BR opendir (3) or as the current working directory. Use of .B --relocate oldpath=newpath allows remapping of such paths to new locations at restart-time. When parsing the .B --relocate argument the sequences `\\=' and `\\\\' are interpreted as `=' and `\\', respectively, to allow for paths that contain the `=' character. The `\\' character is not special in any other context. (Note that command shells also have special treatment of `\\' and you may therefore need quotes or additional `\\' characters to pass the argument you intend.) When file or directory associations are restored, the .I oldpath is compared to the saved fullpath of each file or directory. If it matches the leading components of the path, the matching portion is replaced by the value of .IR newpath . Note that .I oldpath must match .B entire path components, and only .B leading components. Therefore an .I oldpath of .I /tmp/foo will match .I /tmp/foo or .IR /tmp/foo/1 , but will .B not match to .I /tmp/fooz (not matching the full component .IR fooz ) or to .I /var/tmp/foo (not matching the leading component .IR /var .) It is important to be aware the the saved fullpaths in a context file are the canonical paths. Therefore the .I oldpath you provide must also be a canonical path, though the .I newpath doesn't need to be. For instance, if .I /tmp is a symbolic link to .IR /var/tmp , then if your application opens the file .I /tmp/work/1234 the path stored in the context file will be .IR /var/tmp/work/1234 . Therefore, .RS .br .B --relocate .IR /tmp/work = /tmp/play .RE .br would .B not work as desired, but either of the following would: .RS .br .B --relocate .IR /var/tmp/work = /tmp/play .br .B --relocate .IR /var/tmp/work = /var/tmp/play .RE If the .B --relocate option is passed multiple times, all are applied to restored file or directory associations, but only the first match is applied to any given path. Currently a maximum of 16 relocations is supported. .SS "PID and related identifiers" By default, processes are restarted with the same pid and thread id (as returned by .BR getpid (2), and .BR gettid (2) respectively). This default ensures that processes and threads that signal each other and processes that wait on children will continue to function correctly. However, this prevents restarting concurrent instances of the same context file. By default, the process group and session (as returned by .BR getpgrp (2), and .BR getsid (2)) are set to those of the cr_restart program. This ensures that job control via the requester's session leader (typically a login shell) will continue to function correctly. However, this interferes with any job control or process group signaling that may be take place among the restarted processes. There are options to individually control whether the pid, process group and session are restored to their saved values or assume new values (the process group and session inherited from cr_restart and a fresh pid obtained from .BR fork (2)). There is no separate control for the thread ids, as they must always follow the same policy as the pid. The following describes each option, along with outlining some of the risks associated with the non-default ones: .TP .B --restore-pid (default) This causes pid and thread ids to be restored to their saved values. .TP .B --no-restore-pid This causes pid and thread ids to assume new values. Any multi-threaded process has the possibility of using functions like .BR tkill (2) which will not behave as desired if the thread ids are not restored. Similarly, any multi-process application may make use of .BR kill (2) or .BR waitpid (2), among others, that require restored pids for correct operation. It is also worth noting that many versions of glibc will cache the result of getpid(), which may result in calls after restore returning the original value, even though the pid was changed by the restart. .TP .B --restore-pgid This causes the process group ids to be restored to their saved values. This is required for correct operation of any multi-process application that may perform signal or wait operations on process groups (as by passing a negative pid value to .BR kill (2) or .BR waitpid (2), among others), or which uses process groups for POSIX job control operations. This is NOT the default behavior because restoring the process group ids will prevent job control by the requester's shell (or other controlling process). .TP .B --no-restore-pgid (default) This causes the restarted processes to join the process group of the cr_restart process. .TP .B --restore-sid This causes the session ids to be restored to their saved values. This is required, for instance, for systems that are performing batch accounting based on the session id. .TP .B --no-restore-sid (default) This causes the restarted processes to join the session of the cr_restart process. .P Note that use of .B --restore-pgid or .B --restore-sid will produce an error in the case that the required identifiers are in use in the system. This includes the possibility that they conflict the the process group or session of cr_restart. [REPORTING BUGS] Bug reports may be filed on the web at .BR http://mantis.lbl.gov/bugzilla . [AUTHORS] Jason Duell, Paul Hargrove, and Eric Roman, Lawrence Berkeley National Laboratory. [SEE ALSO] .BR cr_run (1), .BR cr_checkpoint (1), blcr-0.8.5/util/license.txt0000664000000000000000000000143707755231473012521 00000000000000This 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 If you are recieving this as part of BLCR, you will find the GNU GPL in the file COPYING in the top-level BLCR directory. blcr-0.8.5/config/0000755000000000000000000000000012102072123010650 500000000000000blcr-0.8.5/config/install-sh0000755000000000000000000003253712102070007012605 00000000000000#!/bin/sh # install - install a program, script, or datafile scriptversion=2009-04-28.21; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. nl=' ' IFS=" "" $nl" # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit=${DOITPROG-} if test -z "$doit"; then doit_exec=exec else doit_exec=$doit fi # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_glob='?' initialize_posix_glob=' test "$posix_glob" != "?" || { if (set -f) 2>/dev/null; then posix_glob= else posix_glob=: fi } ' posix_mkdir= # Desired mode of installed file. mode=0755 chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false no_target_directory= usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve the last data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *' '* | *' '* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -s) stripcmd=$stripprog;; -t) dst_arg=$2 shift;; -T) no_target_directory=true;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call `install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then trap '(exit $?); exit' 1 2 13 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names starting with `-'. case $src in -*) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # Protect names starting with `-'. case $dst in -*) dst=./$dst;; esac # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test -n "$no_target_directory"; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dst=$dstdir/`basename "$src"` dstdir_status=0 else # Prefer dirname, but fall back on a substitute if dirname fails. dstdir=` (dirname "$dst") 2>/dev/null || expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$dst" : 'X\(//\)[^/]' \| \ X"$dst" : 'X\(//\)$' \| \ X"$dst" : 'X\(/\)' \| . 2>/dev/null || echo X"$dst" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q' ` test -d "$dstdir" dstdir_status=$? fi fi obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # Create intermediate dirs using mode 755 as modified by the umask. # This is like FreeBSD 'install' as of 1997-10-28. umask=`umask` case $stripcmd.$umask in # Optimize common cases. *[2367][2367]) mkdir_umask=$umask;; .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; *[0-7]) mkdir_umask=`expr $umask + 22 \ - $umask % 100 % 40 + $umask % 20 \ - $umask % 10 % 4 + $umask % 2 `;; *) mkdir_umask=$umask,go-w;; esac # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false case $umask in *[123567][0-7][0-7]) # POSIX mkdir -p sets u+wx bits regardless of umask, which # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 if (umask $mkdir_umask && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writeable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. ls_ld_tmpdir=`ls -ld "$tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/d" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null fi trap '' 0;; esac;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # The umask is ridiculous, or mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; -*) prefix='./';; *) prefix='';; esac eval "$initialize_posix_glob" oIFS=$IFS IFS=/ $posix_glob set -f set fnord $dstdir shift $posix_glob set +f IFS=$oIFS prefixes= for d do test -z "$d" && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask=$mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && eval "$initialize_posix_glob" && $posix_glob set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && $posix_glob set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd -f "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: blcr-0.8.5/config/kbuild.mak.in0000664000000000000000000000743012064463026013164 00000000000000# Here are the configuration bits needed in the "caller" to use this file #SUBDIR = vmadump4 #TARGET = vmadump #SOURCES = vmadump_common.c vmadump_@CR_KARCH@.c optional.h #[optional]EXTRA_CFLAGS = -I$(top_builddir)/include -I$(top_builddir) -I$(srcdir) #[optional]IMPORTS_FROM = /some/other/kbuild/module/dir /and/another # # Note: we support only 2.6.x kernels # Here is the automake-like stuff SHELL := @SHELL@ INSTALL_data := @INSTALL@ -c -m 644 top_srcdir := @TOP_SRCDIR@ top_builddir := @TOP_BUILDDIR@ prefix := @prefix@ exec_prefix := ${prefix} installdir := $(DESTDIR)@CR_MODULE_DIR@ LINUX := @LINUX_SRC@ LINUX_OBJ := @LINUX_OBJ@ srcdir := $(top_srcdir)/$(SUBDIR) builddir := $(top_builddir)/$(SUBDIR)/kbuild mkinstalldirs := $(SHELL) $(top_srcdir)/config/install-sh -d CLEAN_FILES := *.o *.ko *.ko.unsigned *.mod.c .*.cmd .tmp_versions *.symvers modules.order Module.markers TARGET_SUFFIX := .ko # Remove headers from the list of sources, and sort to remove possible duplicates DOT_C := $(sort $(filter %.c,$(SOURCES))) ifeq ($(srctree),) # not within KBUILD - implement automake's standard goals all: $(LINUX_OBJ)/.config prepare $(MAKE) -C $(LINUX) @KBUILD_MAKE_ARGS@ CC="@KCC@" clean: [ -z "$(CLEAN_FILES)" ] || rm -Rf $(CLEAN_FILES) distclean: clean rm -f Makefile $(patsubst $(TARGET).c,$(TARGET)_.c,$(notdir $(DOT_C))) install: all install-exec @: # Empty install-exec: -$(mkinstalldirs) $(installdir) $(INSTALL_data) $(TARGET)$(TARGET_SUFFIX) $(installdir)/$(TARGET)$(TARGET_SUFFIX) uninstall: [ -z "$(TARGET)$(TARGET_SUFFIX)" ] || rm -f $(installdir)/$(TARGET)$(TARGET_SUFFIX) distdir: @: # automake-1.9 copies Makefile.in, but eariler do not test -f $(distdir)/Makefile.in || cp $(srcdir)/kbuild/Makefile.in $(distdir)/ configfiles := Makefile $(top_builddir)/config/kbuild.mak AM_TARGETS := all clean distclean install uninstall distdir install-exec EMPTY_AM_TARGETS := dvi check installcheck install-data .PHONY : prepare $(AM_TARGETS) $(EMPTY_AM_TARGETS) $(AM_TARGETS) $(EMPTY_AM_TARGETS) : $(configfiles) $(EMPTY_AM_TARGETS): @: # Empty prepare: @: # Use symlinks in place of VPATH @: # 1) VPATH doesn't work w/ kbuild in Linux 2.6 @: # 2) we may have generated files in .. (such as cr_imports.c) @: # 3) we can get around having a SOURCE and TARGET w/ the same basename @cd $(builddir); \ for file in $(DOT_C); do \ dest=`basename $$file`; \ case $$dest in $(TARGET).c) dest=$(TARGET)_.c;; esac; \ if expr $$file : / >/dev/null; then \ ln -sf $$file $$dest; \ elif [ -f ../$$file ]; then \ ln -sf ../$$file $$dest; \ else \ ln -sf $(srcdir)/$$file $$dest; \ fi ; \ done @: # Setup to help MODPOST find the symbols we import from other modules @: # .tmp_versions - for kernels 2.6.0 through 2.6.16 @: # Modules.symvers - for 2.6.17 @: # Module.symvers - for 2.6.18 and up @mkdir -p $(builddir)/.tmp_versions @rm -f $(builddir)/Module.symvers $(builddir)/Modules.symvers @cd $(builddir); \ for dir in $(IMPORTS_FROM); do \ [ -d "$$dir/.tmp_versions" ] && ln -sf $$dir/.tmp_versions/*.mod .tmp_versions/; \ [ -e "$$dir/Modules.symvers" ] && cat $$dir/Modules.symvers >> Modules.symvers; \ [ -e "$$dir/Module.symvers" ] && cat $$dir/Module.symvers >> Module.symvers; \ done; \ true # Ignore failures Makefile: $(srcdir)/kbuild/Makefile.in $(top_builddir)/config.status cd $(top_builddir) && $(SHELL) ./config.status $(SUBDIR)/kbuild/$@ $(top_builddir)/config/kbuild.mak: $(top_srcdir)/config/kbuild.mak.in $(top_builddir)/config.status cd $(top_builddir) && $(SHELL) ./config.status config/kbuild.mak else # If within KBUILD - configure it # Strip possible relative path, rename if conflict w/ target, change .c to .o OBJECTS := $(patsubst %.c,%.o,$(patsubst $(TARGET).c,$(TARGET)_.c,$(notdir $(DOT_C)))) obj-m := $(TARGET).o $(TARGET)-objs := $(OBJECTS) endif blcr-0.8.5/config/ltmain.sh0000755000000000000000000073306012102070003012417 00000000000000# Generated from ltmain.m4sh. # ltmain.sh (GNU libtool) 2.2.6b # Written by Gordon Matzigkeit , 1996 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007 2008 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # GNU Libtool is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, # or obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Usage: $progname [OPTION]... [MODE-ARG]... # # Provide generalized library-building support services. # # --config show all configuration variables # --debug enable verbose shell tracing # -n, --dry-run display commands without modifying any files # --features display basic configuration information and exit # --mode=MODE use operation mode MODE # --preserve-dup-deps don't remove duplicate dependency libraries # --quiet, --silent don't print informational messages # --tag=TAG use configuration variables from tag TAG # -v, --verbose print informational messages (default) # --version print version information # -h, --help print short or long help message # # MODE must be one of the following: # # clean remove files from the build directory # compile compile a source file into a libtool object # execute automatically set library path, then run a program # finish complete the installation of libtool libraries # install install libraries or executables # link create a library or an executable # uninstall remove libraries from an installed directory # # MODE-ARGS vary depending on the MODE. # Try `$progname --help --mode=MODE' for a more detailed description of MODE. # # When reporting a bug, please describe a test case to reproduce it and # include the following information: # # host-triplet: $host # shell: $SHELL # compiler: $LTCC # compiler flags: $LTCFLAGS # linker: $LD (gnu? $with_gnu_ld) # $progname: (GNU libtool) 2.2.6b # automake: $automake_version # autoconf: $autoconf_version # # Report bugs to . PROGRAM=ltmain.sh PACKAGE=libtool VERSION=2.2.6b TIMESTAMP="" package_revision=1.3017 # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # NLS nuisances: We save the old values to restore during execute mode. # Only set LANG and LC_ALL to C if already set. # These must not be set unconditionally because not all systems understand # e.g. LANG=C (notably SCO). lt_user_locale= lt_safe_locale= for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${$lt_var+set}\" = set; then save_$lt_var=\$$lt_var $lt_var=C export $lt_var lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\" lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\" fi" done $lt_unset CDPATH : ${CP="cp -f"} : ${ECHO="echo"} : ${EGREP="/bin/grep -E"} : ${FGREP="/bin/grep -F"} : ${GREP="/bin/grep"} : ${LN_S="ln -s"} : ${MAKE="make"} : ${MKDIR="mkdir"} : ${MV="mv -f"} : ${RM="rm -f"} : ${SED="/bin/sed"} : ${SHELL="${CONFIG_SHELL-/bin/sh}"} : ${Xsed="$SED -e 1s/^X//"} # Global variables: EXIT_SUCCESS=0 EXIT_FAILURE=1 EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. exit_status=$EXIT_SUCCESS # Make sure IFS has a sensible default lt_nl=' ' IFS=" $lt_nl" dirname="s,/[^/]*$,," basename="s,^.*/,," # func_dirname_and_basename file append nondir_replacement # perform func_basename and func_dirname in a single function # call: # dirname: Compute the dirname of FILE. If nonempty, # add APPEND to the result, otherwise set result # to NONDIR_REPLACEMENT. # value returned in "$func_dirname_result" # basename: Compute filename of FILE. # value retuned in "$func_basename_result" # Implementation must be kept synchronized with func_dirname # and func_basename. For efficiency, we do not delegate to # those functions but instead duplicate the functionality here. func_dirname_and_basename () { # Extract subdirectory from the argument. func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"` if test "X$func_dirname_result" = "X${1}"; then func_dirname_result="${3}" else func_dirname_result="$func_dirname_result${2}" fi func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"` } # Generated shell functions inserted here. # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh # is ksh but when the shell is invoked as "sh" and the current value of # the _XPG environment variable is not equal to 1 (one), the special # positional parameter $0, within a function call, is the name of the # function. progpath="$0" # The name of this program: # In the unlikely event $progname began with a '-', it would play havoc with # func_echo (imagine progname=-n), so we prepend ./ in that case: func_dirname_and_basename "$progpath" progname=$func_basename_result case $progname in -*) progname=./$progname ;; esac # Make sure we have an absolute path for reexecution: case $progpath in [\\/]*|[A-Za-z]:\\*) ;; *[\\/]*) progdir=$func_dirname_result progdir=`cd "$progdir" && pwd` progpath="$progdir/$progname" ;; *) save_IFS="$IFS" IFS=: for progdir in $PATH; do IFS="$save_IFS" test -x "$progdir/$progname" && break done IFS="$save_IFS" test -n "$progdir" || progdir=`pwd` progpath="$progdir/$progname" ;; esac # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed="${SED}"' -e 1s/^X//' sed_quote_subst='s/\([`"$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' # Re-`\' parameter expansions in output of double_quote_subst that were # `\'-ed in input to the same. If an odd number of `\' preceded a '$' # in input to double_quote_subst, that '$' was protected from expansion. # Since each input `\' is now two `\'s, look for any number of runs of # four `\'s followed by two `\'s and then a '$'. `\' that '$'. bs='\\' bs2='\\\\' bs4='\\\\\\\\' dollar='\$' sed_double_backslash="\ s/$bs4/&\\ /g s/^$bs2$dollar/$bs&/ s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g s/\n//g" # Standard options: opt_dry_run=false opt_help=false opt_quiet=false opt_verbose=false opt_warning=: # func_echo arg... # Echo program name prefixed message, along with the current mode # name if it has been set yet. func_echo () { $ECHO "$progname${mode+: }$mode: $*" } # func_verbose arg... # Echo program name prefixed message in verbose mode only. func_verbose () { $opt_verbose && func_echo ${1+"$@"} # A bug in bash halts the script if the last line of a function # fails when set -e is in force, so we need another command to # work around that: : } # func_error arg... # Echo program name prefixed message to standard error. func_error () { $ECHO "$progname${mode+: }$mode: "${1+"$@"} 1>&2 } # func_warning arg... # Echo program name prefixed warning message to standard error. func_warning () { $opt_warning && $ECHO "$progname${mode+: }$mode: warning: "${1+"$@"} 1>&2 # bash bug again: : } # func_fatal_error arg... # Echo program name prefixed message to standard error, and exit. func_fatal_error () { func_error ${1+"$@"} exit $EXIT_FAILURE } # func_fatal_help arg... # Echo program name prefixed message to standard error, followed by # a help hint, and exit. func_fatal_help () { func_error ${1+"$@"} func_fatal_error "$help" } help="Try \`$progname --help' for more information." ## default # func_grep expression filename # Check whether EXPRESSION matches any line of FILENAME, without output. func_grep () { $GREP "$1" "$2" >/dev/null 2>&1 } # func_mkdir_p directory-path # Make sure the entire path to DIRECTORY-PATH is available. func_mkdir_p () { my_directory_path="$1" my_dir_list= if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then # Protect directory names starting with `-' case $my_directory_path in -*) my_directory_path="./$my_directory_path" ;; esac # While some portion of DIR does not yet exist... while test ! -d "$my_directory_path"; do # ...make a list in topmost first order. Use a colon delimited # list incase some portion of path contains whitespace. my_dir_list="$my_directory_path:$my_dir_list" # If the last portion added has no slash in it, the list is done case $my_directory_path in */*) ;; *) break ;; esac # ...otherwise throw away the child directory and loop my_directory_path=`$ECHO "X$my_directory_path" | $Xsed -e "$dirname"` done my_dir_list=`$ECHO "X$my_dir_list" | $Xsed -e 's,:*$,,'` save_mkdir_p_IFS="$IFS"; IFS=':' for my_dir in $my_dir_list; do IFS="$save_mkdir_p_IFS" # mkdir can fail with a `File exist' error if two processes # try to create one of the directories concurrently. Don't # stop in that case! $MKDIR "$my_dir" 2>/dev/null || : done IFS="$save_mkdir_p_IFS" # Bail out if we (or some other process) failed to create a directory. test -d "$my_directory_path" || \ func_fatal_error "Failed to create \`$1'" fi } # func_mktempdir [string] # Make a temporary directory that won't clash with other running # libtool processes, and avoids race conditions if possible. If # given, STRING is the basename for that directory. func_mktempdir () { my_template="${TMPDIR-/tmp}/${1-$progname}" if test "$opt_dry_run" = ":"; then # Return a directory name, but don't create it in dry-run mode my_tmpdir="${my_template}-$$" else # If mktemp works, use that first and foremost my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` if test ! -d "$my_tmpdir"; then # Failing that, at least try and use $RANDOM to avoid a race my_tmpdir="${my_template}-${RANDOM-0}$$" save_mktempdir_umask=`umask` umask 0077 $MKDIR "$my_tmpdir" umask $save_mktempdir_umask fi # If we're not in dry-run mode, bomb out on failure test -d "$my_tmpdir" || \ func_fatal_error "cannot create temporary directory \`$my_tmpdir'" fi $ECHO "X$my_tmpdir" | $Xsed } # func_quote_for_eval arg # Aesthetically quote ARG to be evaled later. # This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT # is double-quoted, suitable for a subsequent eval, whereas # FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters # which are still active within double quotes backslashified. func_quote_for_eval () { case $1 in *[\\\`\"\$]*) func_quote_for_eval_unquoted_result=`$ECHO "X$1" | $Xsed -e "$sed_quote_subst"` ;; *) func_quote_for_eval_unquoted_result="$1" ;; esac case $func_quote_for_eval_unquoted_result in # Double-quote args containing shell metacharacters to delay # word splitting, command substitution and and variable # expansion for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\"" ;; *) func_quote_for_eval_result="$func_quote_for_eval_unquoted_result" esac } # func_quote_for_expand arg # Aesthetically quote ARG to be evaled later; same as above, # but do not quote variable references. func_quote_for_expand () { case $1 in *[\\\`\"]*) my_arg=`$ECHO "X$1" | $Xsed \ -e "$double_quote_subst" -e "$sed_double_backslash"` ;; *) my_arg="$1" ;; esac case $my_arg in # Double-quote args containing shell metacharacters to delay # word splitting and command substitution for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") my_arg="\"$my_arg\"" ;; esac func_quote_for_expand_result="$my_arg" } # func_show_eval cmd [fail_exp] # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. func_show_eval () { my_cmd="$1" my_fail_exp="${2-:}" ${opt_silent-false} || { func_quote_for_expand "$my_cmd" eval "func_echo $func_quote_for_expand_result" } if ${opt_dry_run-false}; then :; else eval "$my_cmd" my_status=$? if test "$my_status" -eq 0; then :; else eval "(exit $my_status); $my_fail_exp" fi fi } # func_show_eval_locale cmd [fail_exp] # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. Use the saved locale for evaluation. func_show_eval_locale () { my_cmd="$1" my_fail_exp="${2-:}" ${opt_silent-false} || { func_quote_for_expand "$my_cmd" eval "func_echo $func_quote_for_expand_result" } if ${opt_dry_run-false}; then :; else eval "$lt_user_locale $my_cmd" my_status=$? eval "$lt_safe_locale" if test "$my_status" -eq 0; then :; else eval "(exit $my_status); $my_fail_exp" fi fi } # func_version # Echo version message to standard output and exit. func_version () { $SED -n '/^# '$PROGRAM' (GNU /,/# warranty; / { s/^# // s/^# *$// s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/ p }' < "$progpath" exit $? } # func_usage # Echo short help message to standard output and exit. func_usage () { $SED -n '/^# Usage:/,/# -h/ { s/^# // s/^# *$// s/\$progname/'$progname'/ p }' < "$progpath" $ECHO $ECHO "run \`$progname --help | more' for full usage" exit $? } # func_help # Echo long help message to standard output and exit. func_help () { $SED -n '/^# Usage:/,/# Report bugs to/ { s/^# // s/^# *$// s*\$progname*'$progname'* s*\$host*'"$host"'* s*\$SHELL*'"$SHELL"'* s*\$LTCC*'"$LTCC"'* s*\$LTCFLAGS*'"$LTCFLAGS"'* s*\$LD*'"$LD"'* s/\$with_gnu_ld/'"$with_gnu_ld"'/ s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/ s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/ p }' < "$progpath" exit $? } # func_missing_arg argname # Echo program name prefixed message to standard error and set global # exit_cmd. func_missing_arg () { func_error "missing argument for $1" exit_cmd=exit } exit_cmd=: # Check that we have a working $ECHO. if test "X$1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X$1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t'; then # Yippee, $ECHO works! : else # Restart under the correct shell, and then maybe $ECHO will work. exec $SHELL "$progpath" --no-reexec ${1+"$@"} fi if test "X$1" = X--fallback-echo; then # used as fallback echo shift cat </dev/null 2>&1; then taglist="$taglist $tagname" # Evaluate the configuration. Be careful to quote the path # and the sed script, to avoid splitting on whitespace, but # also don't use non-portable quotes within backquotes within # quotes we have to do it in 2 steps: extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` eval "$extractedcf" else func_error "ignoring unknown tag $tagname" fi ;; esac } # Parse options once, thoroughly. This comes as soon as possible in # the script to make things like `libtool --version' happen quickly. { # Shorthand for --mode=foo, only valid as the first argument case $1 in clean|clea|cle|cl) shift; set dummy --mode clean ${1+"$@"}; shift ;; compile|compil|compi|comp|com|co|c) shift; set dummy --mode compile ${1+"$@"}; shift ;; execute|execut|execu|exec|exe|ex|e) shift; set dummy --mode execute ${1+"$@"}; shift ;; finish|finis|fini|fin|fi|f) shift; set dummy --mode finish ${1+"$@"}; shift ;; install|instal|insta|inst|ins|in|i) shift; set dummy --mode install ${1+"$@"}; shift ;; link|lin|li|l) shift; set dummy --mode link ${1+"$@"}; shift ;; uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) shift; set dummy --mode uninstall ${1+"$@"}; shift ;; esac # Parse non-mode specific arguments: while test "$#" -gt 0; do opt="$1" shift case $opt in --config) func_config ;; --debug) preserve_args="$preserve_args $opt" func_echo "enabling shell trace mode" opt_debug='set -x' $opt_debug ;; -dlopen) test "$#" -eq 0 && func_missing_arg "$opt" && break execute_dlfiles="$execute_dlfiles $1" shift ;; --dry-run | -n) opt_dry_run=: ;; --features) func_features ;; --finish) mode="finish" ;; --mode) test "$#" -eq 0 && func_missing_arg "$opt" && break case $1 in # Valid mode arguments: clean) ;; compile) ;; execute) ;; finish) ;; install) ;; link) ;; relink) ;; uninstall) ;; # Catch anything else as an error *) func_error "invalid argument for $opt" exit_cmd=exit break ;; esac mode="$1" shift ;; --preserve-dup-deps) opt_duplicate_deps=: ;; --quiet|--silent) preserve_args="$preserve_args $opt" opt_silent=: ;; --verbose| -v) preserve_args="$preserve_args $opt" opt_silent=false ;; --tag) test "$#" -eq 0 && func_missing_arg "$opt" && break preserve_args="$preserve_args $opt $1" func_enable_tag "$1" # tagname is set here shift ;; # Separate optargs to long options: -dlopen=*|--mode=*|--tag=*) func_opt_split "$opt" set dummy "$func_opt_split_opt" "$func_opt_split_arg" ${1+"$@"} shift ;; -\?|-h) func_usage ;; --help) opt_help=: ;; --version) func_version ;; -*) func_fatal_help "unrecognized option \`$opt'" ;; *) nonopt="$opt" break ;; esac done case $host in *cygwin* | *mingw* | *pw32* | *cegcc*) # don't eliminate duplications in $postdeps and $predeps opt_duplicate_compiler_generated_deps=: ;; *) opt_duplicate_compiler_generated_deps=$opt_duplicate_deps ;; esac # Having warned about all mis-specified options, bail out if # anything was wrong. $exit_cmd $EXIT_FAILURE } # func_check_version_match # Ensure that we are using m4 macros, and libtool script from the same # release of libtool. func_check_version_match () { if test "$package_revision" != "$macro_revision"; then if test "$VERSION" != "$macro_version"; then if test -z "$macro_version"; then cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from an older release. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from $PACKAGE $macro_version. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF fi else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, $progname: but the definition of this LT_INIT comes from revision $macro_revision. $progname: You should recreate aclocal.m4 with macros from revision $package_revision $progname: of $PACKAGE $VERSION and run autoconf again. _LT_EOF fi exit $EXIT_MISMATCH fi } ## ----------- ## ## Main. ## ## ----------- ## $opt_help || { # Sanity checks first: func_check_version_match if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then func_fatal_configuration "not configured to build any kind of library" fi test -z "$mode" && func_fatal_error "error: you must specify a MODE." # Darwin sucks eval std_shrext=\"$shrext_cmds\" # Only execute mode is allowed to have -dlopen flags. if test -n "$execute_dlfiles" && test "$mode" != execute; then func_error "unrecognized option \`-dlopen'" $ECHO "$help" 1>&2 exit $EXIT_FAILURE fi # Change the help message to a mode-specific one. generic_help="$help" help="Try \`$progname --help --mode=$mode' for more information." } # func_lalib_p file # True iff FILE is a libtool `.la' library or `.lo' object file. # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_lalib_p () { test -f "$1" && $SED -e 4q "$1" 2>/dev/null \ | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 } # func_lalib_unsafe_p file # True iff FILE is a libtool `.la' library or `.lo' object file. # This function implements the same check as func_lalib_p without # resorting to external programs. To this end, it redirects stdin and # closes it afterwards, without saving the original file descriptor. # As a safety measure, use it only where a negative result would be # fatal anyway. Works if `file' does not exist. func_lalib_unsafe_p () { lalib_p=no if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then for lalib_p_l in 1 2 3 4 do read lalib_p_line case "$lalib_p_line" in \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; esac done exec 0<&5 5<&- fi test "$lalib_p" = yes } # func_ltwrapper_script_p file # True iff FILE is a libtool wrapper script # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_script_p () { func_lalib_p "$1" } # func_ltwrapper_executable_p file # True iff FILE is a libtool wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_executable_p () { func_ltwrapper_exec_suffix= case $1 in *.exe) ;; *) func_ltwrapper_exec_suffix=.exe ;; esac $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 } # func_ltwrapper_scriptname file # Assumes file is an ltwrapper_executable # uses $file to determine the appropriate filename for a # temporary ltwrapper_script. func_ltwrapper_scriptname () { func_ltwrapper_scriptname_result="" if func_ltwrapper_executable_p "$1"; then func_dirname_and_basename "$1" "" "." func_stripname '' '.exe' "$func_basename_result" func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper" fi } # func_ltwrapper_p file # True iff FILE is a libtool wrapper script or wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_p () { func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" } # func_execute_cmds commands fail_cmd # Execute tilde-delimited COMMANDS. # If FAIL_CMD is given, eval that upon failure. # FAIL_CMD may read-access the current command in variable CMD! func_execute_cmds () { $opt_debug save_ifs=$IFS; IFS='~' for cmd in $1; do IFS=$save_ifs eval cmd=\"$cmd\" func_show_eval "$cmd" "${2-:}" done IFS=$save_ifs } # func_source file # Source FILE, adding directory component if necessary. # Note that it is not necessary on cygwin/mingw to append a dot to # FILE even if both FILE and FILE.exe exist: automatic-append-.exe # behavior happens only for exec(3), not for open(2)! Also, sourcing # `FILE.' does not work on cygwin managed mounts. func_source () { $opt_debug case $1 in */* | *\\*) . "$1" ;; *) . "./$1" ;; esac } # func_infer_tag arg # Infer tagged configuration to use if any are available and # if one wasn't chosen via the "--tag" command line option. # Only attempt this if the compiler in the base compile # command doesn't match the default compiler. # arg is usually of the form 'gcc ...' func_infer_tag () { $opt_debug if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do func_quote_for_eval "$arg" CC_quoted="$CC_quoted $func_quote_for_eval_result" done case $@ in # Blanks in the command may have been stripped by the calling shell, # but not from the CC environment variable when configure was run. " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*) ;; # Blanks at the start of $base_compile will cause this to fail # if we don't check for them as well. *) for z in $available_tags; do if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then # Evaluate the configuration. eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" CC_quoted= for arg in $CC; do # Double-quote args containing other shell metacharacters. func_quote_for_eval "$arg" CC_quoted="$CC_quoted $func_quote_for_eval_result" done case "$@ " in " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*) # The compiler in the base compile command matches # the one in the tagged configuration. # Assume this is the tagged configuration we want. tagname=$z break ;; esac fi done # If $tagname still isn't set, then no tagged configuration # was found and let the user know that the "--tag" command # line option must be used. if test -z "$tagname"; then func_echo "unable to infer tagged configuration" func_fatal_error "specify a tag with \`--tag'" # else # func_verbose "using $tagname tagged configuration" fi ;; esac fi } # func_write_libtool_object output_name pic_name nonpic_name # Create a libtool object file (analogous to a ".la" file), # but don't create it if we're doing a dry run. func_write_libtool_object () { write_libobj=${1} if test "$build_libtool_libs" = yes; then write_lobj=\'${2}\' else write_lobj=none fi if test "$build_old_libs" = yes; then write_oldobj=\'${3}\' else write_oldobj=none fi $opt_dry_run || { cat >${write_libobj}T <?"'"'"' &()|`$[]' \ && func_warning "libobj name \`$libobj' may not contain shell special characters." func_dirname_and_basename "$obj" "/" "" objname="$func_basename_result" xdir="$func_dirname_result" lobj=${xdir}$objdir/$objname test -z "$base_compile" && \ func_fatal_help "you must specify a compilation command" # Delete any leftover library objects. if test "$build_old_libs" = yes; then removelist="$obj $lobj $libobj ${libobj}T" else removelist="$lobj $libobj ${libobj}T" fi # On Cygwin there's no "real" PIC flag so we must build both object types case $host_os in cygwin* | mingw* | pw32* | os2* | cegcc*) pic_mode=default ;; esac if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then # non-PIC code in shared libraries is not supported pic_mode=default fi # Calculate the filename of the output object if compiler does # not support -o with -c if test "$compiler_c_o" = no; then output_obj=`$ECHO "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext} lockfile="$output_obj.lock" else output_obj= need_locks=no lockfile= fi # Lock this critical section if it is needed # We use this script file to make the link, it avoids creating a new file if test "$need_locks" = yes; then until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done elif test "$need_locks" = warn; then if test -f "$lockfile"; then $ECHO "\ *** ERROR, $lockfile exists and contains: `cat $lockfile 2>/dev/null` This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi removelist="$removelist $output_obj" $ECHO "$srcfile" > "$lockfile" fi $opt_dry_run || $RM $removelist removelist="$removelist $lockfile" trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 if test -n "$fix_srcfile_path"; then eval srcfile=\"$fix_srcfile_path\" fi func_quote_for_eval "$srcfile" qsrcfile=$func_quote_for_eval_result # Only build a PIC object if we are building libtool libraries. if test "$build_libtool_libs" = yes; then # Without this assignment, base_compile gets emptied. fbsd_hideous_sh_bug=$base_compile if test "$pic_mode" != no; then command="$base_compile $qsrcfile $pic_flag" else # Don't build PIC code command="$base_compile $qsrcfile" fi func_mkdir_p "$xdir$objdir" if test -z "$output_obj"; then # Place PIC objects in $objdir command="$command -o $lobj" fi func_show_eval_locale "$command" \ 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' if test "$need_locks" = warn && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed, then go on to compile the next one if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then func_show_eval '$MV "$output_obj" "$lobj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi # Allow error messages only from the first compilation. if test "$suppress_opt" = yes; then suppress_output=' >/dev/null 2>&1' fi fi # Only build a position-dependent object if we build old libraries. if test "$build_old_libs" = yes; then if test "$pic_mode" != yes; then # Don't build PIC code command="$base_compile $qsrcfile$pie_flag" else command="$base_compile $qsrcfile $pic_flag" fi if test "$compiler_c_o" = yes; then command="$command -o $obj" fi # Suppress compiler output if we already did a PIC compilation. command="$command$suppress_output" func_show_eval_locale "$command" \ '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' if test "$need_locks" = warn && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then func_show_eval '$MV "$output_obj" "$obj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi fi $opt_dry_run || { func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" # Unlock the critical section if it was locked if test "$need_locks" != no; then removelist=$lockfile $RM "$lockfile" fi } exit $EXIT_SUCCESS } $opt_help || { test "$mode" = compile && func_mode_compile ${1+"$@"} } func_mode_help () { # We need to display help for each of the modes. case $mode in "") # Generic help is extracted from the usage comments # at the start of this file. func_help ;; clean) $ECHO \ "Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE... Remove files from the build directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, object or program, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; compile) $ECHO \ "Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE Compile a source file into a libtool library object. This mode accepts the following additional options: -o OUTPUT-FILE set the output file name to OUTPUT-FILE -no-suppress do not suppress compiler output for multiple passes -prefer-pic try to building PIC objects only -prefer-non-pic try to building non-PIC objects only -shared do not build a \`.o' file suitable for static linking -static only build a \`.o' file suitable for static linking COMPILE-COMMAND is a command to be used in creating a \`standard' object file from the given SOURCEFILE. The output file name is determined by removing the directory component from SOURCEFILE, then substituting the C source code suffix \`.c' with the library object suffix, \`.lo'." ;; execute) $ECHO \ "Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]... Automatically set library path, then run a program. This mode accepts the following additional options: -dlopen FILE add the directory containing FILE to the library path This mode sets the library path environment variable according to \`-dlopen' flags. If any of the ARGS are libtool executable wrappers, then they are translated into their corresponding uninstalled binary, and any of their required library directories are added to the library path. Then, COMMAND is executed, with ARGS as arguments." ;; finish) $ECHO \ "Usage: $progname [OPTION]... --mode=finish [LIBDIR]... Complete the installation of libtool libraries. Each LIBDIR is a directory that contains libtool libraries. The commands that this mode executes may require superuser privileges. Use the \`--dry-run' option if you just want to see what would be executed." ;; install) $ECHO \ "Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND... Install executables or libraries. INSTALL-COMMAND is the installation command. The first component should be either the \`install' or \`cp' program. The following components of INSTALL-COMMAND are treated specially: -inst-prefix PREFIX-DIR Use PREFIX-DIR as a staging area for installation The rest of the components are interpreted as arguments to that command (only BSD-compatible install options are recognized)." ;; link) $ECHO \ "Usage: $progname [OPTION]... --mode=link LINK-COMMAND... Link object files or libraries together to form another library, or to create an executable program. LINK-COMMAND is a command using the C compiler that you would use to create a program from several object files. The following components of LINK-COMMAND are treated specially: -all-static do not do any dynamic linking at all -avoid-version do not add a version suffix if possible -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) -export-symbols SYMFILE try to export only the symbols listed in SYMFILE -export-symbols-regex REGEX try to export only the symbols matching REGEX -LLIBDIR search LIBDIR for required installed libraries -lNAME OUTPUT-FILE requires the installed library libNAME -module build a library that can dlopened -no-fast-install disable the fast-install mode -no-install link a not-installable executable -no-undefined declare that a library does not refer to external symbols -o OUTPUT-FILE create OUTPUT-FILE from the specified objects -objectlist FILE Use a list of object files found in FILE to specify objects -precious-files-regex REGEX don't remove output files matching REGEX -release RELEASE specify package release information -rpath LIBDIR the created library will eventually be installed in LIBDIR -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries -shared only do dynamic linking of libtool libraries -shrext SUFFIX override the standard shared library file extension -static do not do any dynamic linking of uninstalled libtool libraries -static-libtool-libs do not do any dynamic linking of libtool libraries -version-info CURRENT[:REVISION[:AGE]] specify library version info [each variable defaults to 0] -weak LIBNAME declare that the target provides the LIBNAME interface All other options (arguments beginning with \`-') are ignored. Every other argument is treated as a filename. Files ending in \`.la' are treated as uninstalled libtool libraries, other files are standard or library object files. If the OUTPUT-FILE ends in \`.la', then a libtool library is created, only library objects (\`.lo' files) may be specified, and \`-rpath' is required, except when creating a convenience library. If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created using \`ar' and \`ranlib', or on Windows using \`lib'. If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file is created, otherwise an executable program is created." ;; uninstall) $ECHO \ "Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... Remove libraries from an installation directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; *) func_fatal_help "invalid operation mode \`$mode'" ;; esac $ECHO $ECHO "Try \`$progname --help' for more information about other modes." exit $? } # Now that we've collected a possible --mode arg, show help if necessary $opt_help && func_mode_help # func_mode_execute arg... func_mode_execute () { $opt_debug # The first argument is the command name. cmd="$nonopt" test -z "$cmd" && \ func_fatal_help "you must specify a COMMAND" # Handle -dlopen flags immediately. for file in $execute_dlfiles; do test -f "$file" \ || func_fatal_help "\`$file' is not a file" dir= case $file in *.la) # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "\`$lib' is not a valid libtool archive" # Read the libtool library. dlname= library_names= func_source "$file" # Skip this library if it cannot be dlopened. if test -z "$dlname"; then # Warn if it was a shared library. test -n "$library_names" && \ func_warning "\`$file' was not linked with \`-export-dynamic'" continue fi func_dirname "$file" "" "." dir="$func_dirname_result" if test -f "$dir/$objdir/$dlname"; then dir="$dir/$objdir" else if test ! -f "$dir/$dlname"; then func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" fi fi ;; *.lo) # Just add the directory containing the .lo file. func_dirname "$file" "" "." dir="$func_dirname_result" ;; *) func_warning "\`-dlopen' is ignored for non-libtool libraries and objects" continue ;; esac # Get the absolute pathname. absdir=`cd "$dir" && pwd` test -n "$absdir" && dir="$absdir" # Now add the directory to shlibpath_var. if eval "test -z \"\$$shlibpath_var\""; then eval "$shlibpath_var=\"\$dir\"" else eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" fi done # This variable tells wrapper scripts just to set shlibpath_var # rather than running their programs. libtool_execute_magic="$magic" # Check if any of the arguments is a wrapper script. args= for file do case $file in -*) ;; *) # Do a test to see if this is really a libtool program. if func_ltwrapper_script_p "$file"; then func_source "$file" # Transform arg to wrapped name. file="$progdir/$program" elif func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" func_source "$func_ltwrapper_scriptname_result" # Transform arg to wrapped name. file="$progdir/$program" fi ;; esac # Quote arguments (to preserve shell metacharacters). func_quote_for_eval "$file" args="$args $func_quote_for_eval_result" done if test "X$opt_dry_run" = Xfalse; then if test -n "$shlibpath_var"; then # Export the shlibpath_var. eval "export $shlibpath_var" fi # Restore saved environment variables for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${save_$lt_var+set}\" = set; then $lt_var=\$save_$lt_var; export $lt_var else $lt_unset $lt_var fi" done # Now prepare to actually exec the command. exec_cmd="\$cmd$args" else # Display what would be done. if test -n "$shlibpath_var"; then eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" $ECHO "export $shlibpath_var" fi $ECHO "$cmd$args" exit $EXIT_SUCCESS fi } test "$mode" = execute && func_mode_execute ${1+"$@"} # func_mode_finish arg... func_mode_finish () { $opt_debug libdirs="$nonopt" admincmds= if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then for dir do libdirs="$libdirs $dir" done for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. func_execute_cmds "$finish_cmds" 'admincmds="$admincmds '"$cmd"'"' fi if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" $opt_dry_run || eval "$cmds" || admincmds="$admincmds $cmds" fi done fi # Exit here if they wanted silent mode. $opt_silent && exit $EXIT_SUCCESS $ECHO "X----------------------------------------------------------------------" | $Xsed $ECHO "Libraries have been installed in:" for libdir in $libdirs; do $ECHO " $libdir" done $ECHO $ECHO "If you ever happen to want to link against installed libraries" $ECHO "in a given directory, LIBDIR, you must either use libtool, and" $ECHO "specify the full pathname of the library, or use the \`-LLIBDIR'" $ECHO "flag during linking and do at least one of the following:" if test -n "$shlibpath_var"; then $ECHO " - add LIBDIR to the \`$shlibpath_var' environment variable" $ECHO " during execution" fi if test -n "$runpath_var"; then $ECHO " - add LIBDIR to the \`$runpath_var' environment variable" $ECHO " during linking" fi if test -n "$hardcode_libdir_flag_spec"; then libdir=LIBDIR eval flag=\"$hardcode_libdir_flag_spec\" $ECHO " - use the \`$flag' linker flag" fi if test -n "$admincmds"; then $ECHO " - have your system administrator run these commands:$admincmds" fi if test -f /etc/ld.so.conf; then $ECHO " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" fi $ECHO $ECHO "See any operating system documentation about shared libraries for" case $host in solaris2.[6789]|solaris2.1[0-9]) $ECHO "more information, such as the ld(1), crle(1) and ld.so(8) manual" $ECHO "pages." ;; *) $ECHO "more information, such as the ld(1) and ld.so(8) manual pages." ;; esac $ECHO "X----------------------------------------------------------------------" | $Xsed exit $EXIT_SUCCESS } test "$mode" = finish && func_mode_finish ${1+"$@"} # func_mode_install arg... func_mode_install () { $opt_debug # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || # Allow the use of GNU shtool's install command. $ECHO "X$nonopt" | $GREP shtool >/dev/null; then # Aesthetically quote it. func_quote_for_eval "$nonopt" install_prog="$func_quote_for_eval_result " arg=$1 shift else install_prog= arg=$nonopt fi # The real first argument should be the name of the installation program. # Aesthetically quote it. func_quote_for_eval "$arg" install_prog="$install_prog$func_quote_for_eval_result" # We need to accept at least all the BSD install flags. dest= files= opts= prev= install_type= isdir=no stripme= for arg do if test -n "$dest"; then files="$files $dest" dest=$arg continue fi case $arg in -d) isdir=yes ;; -f) case " $install_prog " in *[\\\ /]cp\ *) ;; *) prev=$arg ;; esac ;; -g | -m | -o) prev=$arg ;; -s) stripme=" -s" continue ;; -*) ;; *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then prev= else dest=$arg continue fi ;; esac # Aesthetically quote the argument. func_quote_for_eval "$arg" install_prog="$install_prog $func_quote_for_eval_result" done test -z "$install_prog" && \ func_fatal_help "you must specify an install program" test -n "$prev" && \ func_fatal_help "the \`$prev' option requires an argument" if test -z "$files"; then if test -z "$dest"; then func_fatal_help "no file or destination specified" else func_fatal_help "you must specify a destination" fi fi # Strip any trailing slash from the destination. func_stripname '' '/' "$dest" dest=$func_stripname_result # Check to see that the destination is a directory. test -d "$dest" && isdir=yes if test "$isdir" = yes; then destdir="$dest" destname= else func_dirname_and_basename "$dest" "" "." destdir="$func_dirname_result" destname="$func_basename_result" # Not a directory, so check to see that there is only one file specified. set dummy $files; shift test "$#" -gt 1 && \ func_fatal_help "\`$dest' is not a directory" fi case $destdir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) for file in $files; do case $file in *.lo) ;; *) func_fatal_help "\`$destdir' must be an absolute directory name" ;; esac done ;; esac # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" staticlibs= future_libdirs= current_libdirs= for file in $files; do # Do each installation. case $file in *.$libext) # Do the static libraries later. staticlibs="$staticlibs $file" ;; *.la) # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "\`$file' is not a valid libtool archive" library_names= old_library= relink_command= func_source "$file" # Add the libdir to current_libdirs if it is the destination. if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; *) current_libdirs="$current_libdirs $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; *) future_libdirs="$future_libdirs $libdir" ;; esac fi func_dirname "$file" "/" "" dir="$func_dirname_result" dir="$dir$objdir" if test -n "$relink_command"; then # Determine the prefix the user has applied to our future dir. inst_prefix_dir=`$ECHO "X$destdir" | $Xsed -e "s%$libdir\$%%"` # Don't allow the user to place us outside of our expected # location b/c this prevents finding dependent libraries that # are installed to the same prefix. # At present, this check doesn't affect windows .dll's that # are installed into $libdir/../bin (currently, that works fine) # but it's something to keep an eye on. test "$inst_prefix_dir" = "$destdir" && \ func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir" if test -n "$inst_prefix_dir"; then # Stick the inst_prefix_dir data into the link command. relink_command=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` else relink_command=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%%"` fi func_warning "relinking \`$file'" func_show_eval "$relink_command" \ 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"' fi # See the names of the shared library. set dummy $library_names; shift if test -n "$1"; then realname="$1" shift srcname="$realname" test -n "$relink_command" && srcname="$realname"T # Install the shared library and build the symlinks. func_show_eval "$install_prog $dir/$srcname $destdir/$realname" \ 'exit $?' tstripme="$stripme" case $host_os in cygwin* | mingw* | pw32* | cegcc*) case $realname in *.dll.a) tstripme="" ;; esac ;; esac if test -n "$tstripme" && test -n "$striplib"; then func_show_eval "$striplib $destdir/$realname" 'exit $?' fi if test "$#" -gt 0; then # Delete the old symlinks, and create new ones. # Try `ln -sf' first, because the `ln' binary might depend on # the symlink we replace! Solaris /bin/ln does not understand -f, # so we also need to try rm && ln -s. for linkname do test "$linkname" != "$realname" \ && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" done fi # Do each command in the postinstall commands. lib="$destdir/$realname" func_execute_cmds "$postinstall_cmds" 'exit $?' fi # Install the pseudo-library for information purposes. func_basename "$file" name="$func_basename_result" instname="$dir/$name"i func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' # Maybe install the static library, too. test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library" ;; *.lo) # Install (i.e. copy) a libtool object. # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else func_basename "$file" destfile="$func_basename_result" destfile="$destdir/$destfile" fi # Deduce the name of the destination old-style object file. case $destfile in *.lo) func_lo2o "$destfile" staticdest=$func_lo2o_result ;; *.$objext) staticdest="$destfile" destfile= ;; *) func_fatal_help "cannot copy a libtool object to \`$destfile'" ;; esac # Install the libtool object if requested. test -n "$destfile" && \ func_show_eval "$install_prog $file $destfile" 'exit $?' # Install the old object if enabled. if test "$build_old_libs" = yes; then # Deduce the name of the old-style object file. func_lo2o "$file" staticobj=$func_lo2o_result func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?' fi exit $EXIT_SUCCESS ;; *) # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else func_basename "$file" destfile="$func_basename_result" destfile="$destdir/$destfile" fi # If the file is missing, and there is a .exe on the end, strip it # because it is most likely a libtool script we actually want to # install stripped_ext="" case $file in *.exe) if test ! -f "$file"; then func_stripname '' '.exe' "$file" file=$func_stripname_result stripped_ext=".exe" fi ;; esac # Do a test to see if this is really a libtool program. case $host in *cygwin* | *mingw*) if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" wrapper=$func_ltwrapper_scriptname_result else func_stripname '' '.exe' "$file" wrapper=$func_stripname_result fi ;; *) wrapper=$file ;; esac if func_ltwrapper_script_p "$wrapper"; then notinst_deplibs= relink_command= func_source "$wrapper" # Check the variables that should have been set. test -z "$generated_by_libtool_version" && \ func_fatal_error "invalid libtool wrapper script \`$wrapper'" finalize=yes for lib in $notinst_deplibs; do # Check to see that each library is installed. libdir= if test -f "$lib"; then func_source "$lib" fi libfile="$libdir/"`$ECHO "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test if test -n "$libdir" && test ! -f "$libfile"; then func_warning "\`$lib' has not been installed in \`$libdir'" finalize=no fi done relink_command= func_source "$wrapper" outputname= if test "$fast_install" = no && test -n "$relink_command"; then $opt_dry_run || { if test "$finalize" = yes; then tmpdir=`func_mktempdir` func_basename "$file$stripped_ext" file="$func_basename_result" outputname="$tmpdir/$file" # Replace the output file specification. relink_command=`$ECHO "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'` $opt_silent || { func_quote_for_expand "$relink_command" eval "func_echo $func_quote_for_expand_result" } if eval "$relink_command"; then : else func_error "error: relink \`$file' with the above command before installing it" $opt_dry_run || ${RM}r "$tmpdir" continue fi file="$outputname" else func_warning "cannot relink \`$file'" fi } else # Install the binary that we compiled earlier. file=`$ECHO "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"` fi fi # remove .exe since cygwin /usr/bin/install will append another # one anyway case $install_prog,$host in */usr/bin/install*,*cygwin*) case $file:$destfile in *.exe:*.exe) # this is ok ;; *.exe:*) destfile=$destfile.exe ;; *:*.exe) func_stripname '' '.exe' "$destfile" destfile=$func_stripname_result ;; esac ;; esac func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' $opt_dry_run || if test -n "$outputname"; then ${RM}r "$tmpdir" fi ;; esac done for file in $staticlibs; do func_basename "$file" name="$func_basename_result" # Set up the ranlib parameters. oldlib="$destdir/$name" func_show_eval "$install_prog \$file \$oldlib" 'exit $?' if test -n "$stripme" && test -n "$old_striplib"; then func_show_eval "$old_striplib $oldlib" 'exit $?' fi # Do each command in the postinstall commands. func_execute_cmds "$old_postinstall_cmds" 'exit $?' done test -n "$future_libdirs" && \ func_warning "remember to run \`$progname --finish$future_libdirs'" if test -n "$current_libdirs"; then # Maybe just do a dry run. $opt_dry_run && current_libdirs=" -n$current_libdirs" exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' else exit $EXIT_SUCCESS fi } test "$mode" = install && func_mode_install ${1+"$@"} # func_generate_dlsyms outputname originator pic_p # Extract symbols from dlprefiles and create ${outputname}S.o with # a dlpreopen symbol table. func_generate_dlsyms () { $opt_debug my_outputname="$1" my_originator="$2" my_pic_p="${3-no}" my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'` my_dlsyms= if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then if test -n "$NM" && test -n "$global_symbol_pipe"; then my_dlsyms="${my_outputname}S.c" else func_error "not configured to extract global symbols from dlpreopened files" fi fi if test -n "$my_dlsyms"; then case $my_dlsyms in "") ;; *.c) # Discover the nlist of each of the dlfiles. nlist="$output_objdir/${my_outputname}.nm" func_show_eval "$RM $nlist ${nlist}S ${nlist}T" # Parse the name list into a source file. func_verbose "creating $output_objdir/$my_dlsyms" $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ /* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */ /* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */ #ifdef __cplusplus extern \"C\" { #endif /* External symbol declarations for the compiler. */\ " if test "$dlself" = yes; then func_verbose "generating symbol list for \`$output'" $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. progfiles=`$ECHO "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` for progfile in $progfiles; do func_verbose "extracting global C symbols from \`$progfile'" $opt_dry_run || eval "$NM $progfile | $global_symbol_pipe >> '$nlist'" done if test -n "$exclude_expsyms"; then $opt_dry_run || { eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi if test -n "$export_symbols_regex"; then $opt_dry_run || { eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi # Prepare the list of exported symbols if test -z "$export_symbols"; then export_symbols="$output_objdir/$outputname.exp" $opt_dry_run || { $RM $export_symbols eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' ;; esac } else $opt_dry_run || { eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' case $host in *cygwin | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' ;; esac } fi fi for dlprefile in $dlprefiles; do func_verbose "extracting global C symbols from \`$dlprefile'" func_basename "$dlprefile" name="$func_basename_result" $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' eval "$NM $dlprefile 2>/dev/null | $global_symbol_pipe >> '$nlist'" } done $opt_dry_run || { # Make sure we have at least an empty file. test -f "$nlist" || : > "$nlist" if test -n "$exclude_expsyms"; then $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T $MV "$nlist"T "$nlist" fi # Try sorting and uniquifying the output. if $GREP -v "^: " < "$nlist" | if sort -k 3 /dev/null 2>&1; then sort -k 3 else sort +2 fi | uniq > "$nlist"S; then : else $GREP -v "^: " < "$nlist" > "$nlist"S fi if test -f "$nlist"S; then eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' else $ECHO '/* NONE */' >> "$output_objdir/$my_dlsyms" fi $ECHO >> "$output_objdir/$my_dlsyms" "\ /* The mapping between symbol names and symbols. */ typedef struct { const char *name; void *address; } lt_dlsymlist; " case $host in *cygwin* | *mingw* | *cegcc* ) $ECHO >> "$output_objdir/$my_dlsyms" "\ /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */" lt_dlsym_const= ;; *osf5*) echo >> "$output_objdir/$my_dlsyms" "\ /* This system does not cope well with relocations in const data */" lt_dlsym_const= ;; *) lt_dlsym_const=const ;; esac $ECHO >> "$output_objdir/$my_dlsyms" "\ extern $lt_dlsym_const lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[]; $lt_dlsym_const lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[] = {\ { \"$my_originator\", (void *) 0 }," case $need_lib_prefix in no) eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; *) eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; esac $ECHO >> "$output_objdir/$my_dlsyms" "\ {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt_${my_prefix}_LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif\ " } # !$opt_dry_run pic_flag_for_symtable= case "$compile_command " in *" -static "*) ;; *) case $host in # compiling the symbol table file with pic_flag works around # a FreeBSD bug that causes programs to crash when -lm is # linked before any other PIC object. But we must not use # pic_flag when linking with -static. The problem exists in # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; *-*-hpux*) pic_flag_for_symtable=" $pic_flag" ;; *) if test "X$my_pic_p" != Xno; then pic_flag_for_symtable=" $pic_flag" fi ;; esac ;; esac symtab_cflags= for arg in $LTCFLAGS; do case $arg in -pie | -fpie | -fPIE) ;; *) symtab_cflags="$symtab_cflags $arg" ;; esac done # Now compile the dynamic symbol file. func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' # Clean up the generated files. func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"' # Transform the symbol file into the correct name. symfileobj="$output_objdir/${my_outputname}S.$objext" case $host in *cygwin* | *mingw* | *cegcc* ) if test -f "$output_objdir/$my_outputname.def"; then compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` else compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"` fi ;; *) compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"` ;; esac ;; *) func_fatal_error "unknown suffix for \`$my_dlsyms'" ;; esac else # We keep going just in case the user didn't refer to # lt_preloaded_symbols. The linker will fail if global_symbol_pipe # really was required. # Nullify the symbol file. compile_command=`$ECHO "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"` finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"` fi } # func_win32_libid arg # return the library type of file 'arg' # # Need a lot of goo to handle *both* DLLs and import libs # Has to be a shell function in order to 'eat' the argument # that is supplied when $file_magic_command is called. func_win32_libid () { $opt_debug win32_libid_type="unknown" win32_fileres=`file -L $1 2>/dev/null` case $win32_fileres in *ar\ archive\ import\ library*) # definitely import win32_libid_type="x86 archive import" ;; *ar\ archive*) # could be an import, or static if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | $EGREP 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then win32_nmres=`eval $NM -f posix -A $1 | $SED -n -e ' 1,100{ / I /{ s,.*,import, p q } }'` case $win32_nmres in import*) win32_libid_type="x86 archive import";; *) win32_libid_type="x86 archive static";; esac fi ;; *DLL*) win32_libid_type="x86 DLL" ;; *executable*) # but shell scripts are "executable" too... case $win32_fileres in *MS\ Windows\ PE\ Intel*) win32_libid_type="x86 DLL" ;; esac ;; esac $ECHO "$win32_libid_type" } # func_extract_an_archive dir oldlib func_extract_an_archive () { $opt_debug f_ex_an_ar_dir="$1"; shift f_ex_an_ar_oldlib="$1" func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" 'exit $?' if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then : else func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" fi } # func_extract_archives gentop oldlib ... func_extract_archives () { $opt_debug my_gentop="$1"; shift my_oldlibs=${1+"$@"} my_oldobjs="" my_xlib="" my_xabs="" my_xdir="" for my_xlib in $my_oldlibs; do # Extract the objects. case $my_xlib in [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; *) my_xabs=`pwd`"/$my_xlib" ;; esac func_basename "$my_xlib" my_xlib="$func_basename_result" my_xlib_u=$my_xlib while :; do case " $extracted_archives " in *" $my_xlib_u "*) func_arith $extracted_serial + 1 extracted_serial=$func_arith_result my_xlib_u=lt$extracted_serial-$my_xlib ;; *) break ;; esac done extracted_archives="$extracted_archives $my_xlib_u" my_xdir="$my_gentop/$my_xlib_u" func_mkdir_p "$my_xdir" case $host in *-darwin*) func_verbose "Extracting $my_xabs" # Do not bother doing anything if just a dry run $opt_dry_run || { darwin_orig_dir=`pwd` cd $my_xdir || exit $? darwin_archive=$my_xabs darwin_curdir=`pwd` darwin_base_archive=`basename "$darwin_archive"` darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` if test -n "$darwin_arches"; then darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` darwin_arch= func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" for darwin_arch in $darwin_arches ; do func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}" $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" func_extract_an_archive "`pwd`" "${darwin_base_archive}" cd "$darwin_curdir" $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" done # $darwin_arches ## Okay now we've a bunch of thin objects, gotta fatten them up :) darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u` darwin_file= darwin_files= for darwin_file in $darwin_filelist; do darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP` $LIPO -create -output "$darwin_file" $darwin_files done # $darwin_filelist $RM -rf unfat-$$ cd "$darwin_orig_dir" else cd $darwin_orig_dir func_extract_an_archive "$my_xdir" "$my_xabs" fi # $darwin_arches } # !$opt_dry_run ;; *) func_extract_an_archive "$my_xdir" "$my_xabs" ;; esac my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` done func_extract_archives_result="$my_oldobjs" } # func_emit_wrapper_part1 [arg=no] # # Emit the first part of a libtool wrapper script on stdout. # For more information, see the description associated with # func_emit_wrapper(), below. func_emit_wrapper_part1 () { func_emit_wrapper_part1_arg1=no if test -n "$1" ; then func_emit_wrapper_part1_arg1=$1 fi $ECHO "\ #! $SHELL # $output - temporary wrapper script for $objdir/$outputname # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION # # The $output program cannot be directly executed until all the libtool # libraries that it depends on are installed. # # This wrapper script should never be moved out of the build directory. # If it is, it will not operate correctly. # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed='${SED} -e 1s/^X//' sed_quote_subst='$sed_quote_subst' # Be Bourne compatible if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH relink_command=\"$relink_command\" # This environment variable determines our operation mode. if test \"\$libtool_install_magic\" = \"$magic\"; then # install mode needs the following variables: generated_by_libtool_version='$macro_version' notinst_deplibs='$notinst_deplibs' else # When we are sourced in execute mode, \$file and \$ECHO are already set. if test \"\$libtool_execute_magic\" != \"$magic\"; then ECHO=\"$qecho\" file=\"\$0\" # Make sure echo works. if test \"X\$1\" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test \"X\`{ \$ECHO '\t'; } 2>/dev/null\`\" = 'X\t'; then # Yippee, \$ECHO works! : else # Restart under the correct shell, and then maybe \$ECHO will work. exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"} fi fi\ " $ECHO "\ # Find the directory that this script lives in. thisdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\` test \"x\$thisdir\" = \"x\$file\" && thisdir=. # Follow symbolic links until we get to the real thisdir. file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\` while test -n \"\$file\"; do destdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\` # If there was a directory component, then change thisdir. if test \"x\$destdir\" != \"x\$file\"; then case \"\$destdir\" in [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; *) thisdir=\"\$thisdir/\$destdir\" ;; esac fi file=\`\$ECHO \"X\$file\" | \$Xsed -e 's%^.*/%%'\` file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\` done " } # end: func_emit_wrapper_part1 # func_emit_wrapper_part2 [arg=no] # # Emit the second part of a libtool wrapper script on stdout. # For more information, see the description associated with # func_emit_wrapper(), below. func_emit_wrapper_part2 () { func_emit_wrapper_part2_arg1=no if test -n "$1" ; then func_emit_wrapper_part2_arg1=$1 fi $ECHO "\ # Usually 'no', except on cygwin/mingw when embedded into # the cwrapper. WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_part2_arg1 if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then # special case for '.' if test \"\$thisdir\" = \".\"; then thisdir=\`pwd\` fi # remove .libs from thisdir case \"\$thisdir\" in *[\\\\/]$objdir ) thisdir=\`\$ECHO \"X\$thisdir\" | \$Xsed -e 's%[\\\\/][^\\\\/]*$%%'\` ;; $objdir ) thisdir=. ;; esac fi # Try to get the absolute directory name. absdir=\`cd \"\$thisdir\" && pwd\` test -n \"\$absdir\" && thisdir=\"\$absdir\" " if test "$fast_install" = yes; then $ECHO "\ program=lt-'$outputname'$exeext progdir=\"\$thisdir/$objdir\" if test ! -f \"\$progdir/\$program\" || { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ test \"X\$file\" != \"X\$progdir/\$program\"; }; then file=\"\$\$-\$program\" if test ! -d \"\$progdir\"; then $MKDIR \"\$progdir\" else $RM \"\$progdir/\$file\" fi" $ECHO "\ # relink executable if necessary if test -n \"\$relink_command\"; then if relink_command_output=\`eval \$relink_command 2>&1\`; then : else $ECHO \"\$relink_command_output\" >&2 $RM \"\$progdir/\$file\" exit 1 fi fi $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || { $RM \"\$progdir/\$program\"; $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } $RM \"\$progdir/\$file\" fi" else $ECHO "\ program='$outputname' progdir=\"\$thisdir/$objdir\" " fi $ECHO "\ if test -f \"\$progdir/\$program\"; then" # Export our shlibpath_var if we have one. if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $ECHO "\ # Add our own library path to $shlibpath_var $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" # Some systems cannot cope with colon-terminated $shlibpath_var # The second colon is a workaround for a bug in BeOS R4 sed $shlibpath_var=\`\$ECHO \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\` export $shlibpath_var " fi # fixup the dll searchpath if we need to. if test -n "$dllsearchpath"; then $ECHO "\ # Add the dll search path components to the executable PATH PATH=$dllsearchpath:\$PATH " fi $ECHO "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. " case $host in # Backslashes separate directories on plain windows *-*-mingw | *-*-os2* | *-cegcc*) $ECHO "\ exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} " ;; *) $ECHO "\ exec \"\$progdir/\$program\" \${1+\"\$@\"} " ;; esac $ECHO "\ \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 exit 1 fi else # The program doesn't exist. \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 $ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 exit 1 fi fi\ " } # end: func_emit_wrapper_part2 # func_emit_wrapper [arg=no] # # Emit a libtool wrapper script on stdout. # Don't directly open a file because we may want to # incorporate the script contents within a cygwin/mingw # wrapper executable. Must ONLY be called from within # func_mode_link because it depends on a number of variables # set therein. # # ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR # variable will take. If 'yes', then the emitted script # will assume that the directory in which it is stored is # the $objdir directory. This is a cygwin/mingw-specific # behavior. func_emit_wrapper () { func_emit_wrapper_arg1=no if test -n "$1" ; then func_emit_wrapper_arg1=$1 fi # split this up so that func_emit_cwrapperexe_src # can call each part independently. func_emit_wrapper_part1 "${func_emit_wrapper_arg1}" func_emit_wrapper_part2 "${func_emit_wrapper_arg1}" } # func_to_host_path arg # # Convert paths to host format when used with build tools. # Intended for use with "native" mingw (where libtool itself # is running under the msys shell), or in the following cross- # build environments: # $build $host # mingw (msys) mingw [e.g. native] # cygwin mingw # *nix + wine mingw # where wine is equipped with the `winepath' executable. # In the native mingw case, the (msys) shell automatically # converts paths for any non-msys applications it launches, # but that facility isn't available from inside the cwrapper. # Similar accommodations are necessary for $host mingw and # $build cygwin. Calling this function does no harm for other # $host/$build combinations not listed above. # # ARG is the path (on $build) that should be converted to # the proper representation for $host. The result is stored # in $func_to_host_path_result. func_to_host_path () { func_to_host_path_result="$1" if test -n "$1" ; then case $host in *mingw* ) lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' case $build in *mingw* ) # actually, msys # awkward: cmd appends spaces to result lt_sed_strip_trailing_spaces="s/[ ]*\$//" func_to_host_path_tmp1=`( cmd //c echo "$1" |\ $SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo ""` func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\ $SED -e "$lt_sed_naive_backslashify"` ;; *cygwin* ) func_to_host_path_tmp1=`cygpath -w "$1"` func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\ $SED -e "$lt_sed_naive_backslashify"` ;; * ) # Unfortunately, winepath does not exit with a non-zero # error code, so we are forced to check the contents of # stdout. On the other hand, if the command is not # found, the shell will set an exit code of 127 and print # *an error message* to stdout. So we must check for both # error code of zero AND non-empty stdout, which explains # the odd construction: func_to_host_path_tmp1=`winepath -w "$1" 2>/dev/null` if test "$?" -eq 0 && test -n "${func_to_host_path_tmp1}"; then func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\ $SED -e "$lt_sed_naive_backslashify"` else # Allow warning below. func_to_host_path_result="" fi ;; esac if test -z "$func_to_host_path_result" ; then func_error "Could not determine host path corresponding to" func_error " '$1'" func_error "Continuing, but uninstalled executables may not work." # Fallback: func_to_host_path_result="$1" fi ;; esac fi } # end: func_to_host_path # func_to_host_pathlist arg # # Convert pathlists to host format when used with build tools. # See func_to_host_path(), above. This function supports the # following $build/$host combinations (but does no harm for # combinations not listed here): # $build $host # mingw (msys) mingw [e.g. native] # cygwin mingw # *nix + wine mingw # # Path separators are also converted from $build format to # $host format. If ARG begins or ends with a path separator # character, it is preserved (but converted to $host format) # on output. # # ARG is a pathlist (on $build) that should be converted to # the proper representation on $host. The result is stored # in $func_to_host_pathlist_result. func_to_host_pathlist () { func_to_host_pathlist_result="$1" if test -n "$1" ; then case $host in *mingw* ) lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' # Remove leading and trailing path separator characters from # ARG. msys behavior is inconsistent here, cygpath turns them # into '.;' and ';.', and winepath ignores them completely. func_to_host_pathlist_tmp2="$1" # Once set for this call, this variable should not be # reassigned. It is used in tha fallback case. func_to_host_pathlist_tmp1=`echo "$func_to_host_pathlist_tmp2" |\ $SED -e 's|^:*||' -e 's|:*$||'` case $build in *mingw* ) # Actually, msys. # Awkward: cmd appends spaces to result. lt_sed_strip_trailing_spaces="s/[ ]*\$//" func_to_host_pathlist_tmp2=`( cmd //c echo "$func_to_host_pathlist_tmp1" |\ $SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo ""` func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp2" |\ $SED -e "$lt_sed_naive_backslashify"` ;; *cygwin* ) func_to_host_pathlist_tmp2=`cygpath -w -p "$func_to_host_pathlist_tmp1"` func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp2" |\ $SED -e "$lt_sed_naive_backslashify"` ;; * ) # unfortunately, winepath doesn't convert pathlists func_to_host_pathlist_result="" func_to_host_pathlist_oldIFS=$IFS IFS=: for func_to_host_pathlist_f in $func_to_host_pathlist_tmp1 ; do IFS=$func_to_host_pathlist_oldIFS if test -n "$func_to_host_pathlist_f" ; then func_to_host_path "$func_to_host_pathlist_f" if test -n "$func_to_host_path_result" ; then if test -z "$func_to_host_pathlist_result" ; then func_to_host_pathlist_result="$func_to_host_path_result" else func_to_host_pathlist_result="$func_to_host_pathlist_result;$func_to_host_path_result" fi fi fi IFS=: done IFS=$func_to_host_pathlist_oldIFS ;; esac if test -z "$func_to_host_pathlist_result" ; then func_error "Could not determine the host path(s) corresponding to" func_error " '$1'" func_error "Continuing, but uninstalled executables may not work." # Fallback. This may break if $1 contains DOS-style drive # specifications. The fix is not to complicate the expression # below, but for the user to provide a working wine installation # with winepath so that path translation in the cross-to-mingw # case works properly. lt_replace_pathsep_nix_to_dos="s|:|;|g" func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp1" |\ $SED -e "$lt_replace_pathsep_nix_to_dos"` fi # Now, add the leading and trailing path separators back case "$1" in :* ) func_to_host_pathlist_result=";$func_to_host_pathlist_result" ;; esac case "$1" in *: ) func_to_host_pathlist_result="$func_to_host_pathlist_result;" ;; esac ;; esac fi } # end: func_to_host_pathlist # func_emit_cwrapperexe_src # emit the source code for a wrapper executable on stdout # Must ONLY be called from within func_mode_link because # it depends on a number of variable set therein. func_emit_cwrapperexe_src () { cat < #include #ifdef _MSC_VER # include # include # include # define setmode _setmode #else # include # include # ifdef __CYGWIN__ # include # define HAVE_SETENV # ifdef __STRICT_ANSI__ char *realpath (const char *, char *); int putenv (char *); int setenv (const char *, const char *, int); # endif # endif #endif #include #include #include #include #include #include #include #include #if defined(PATH_MAX) # define LT_PATHMAX PATH_MAX #elif defined(MAXPATHLEN) # define LT_PATHMAX MAXPATHLEN #else # define LT_PATHMAX 1024 #endif #ifndef S_IXOTH # define S_IXOTH 0 #endif #ifndef S_IXGRP # define S_IXGRP 0 #endif #ifdef _MSC_VER # define S_IXUSR _S_IEXEC # define stat _stat # ifndef _INTPTR_T_DEFINED # define intptr_t int # endif #endif #ifndef DIR_SEPARATOR # define DIR_SEPARATOR '/' # define PATH_SEPARATOR ':' #endif #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ defined (__OS2__) # define HAVE_DOS_BASED_FILE_SYSTEM # define FOPEN_WB "wb" # ifndef DIR_SEPARATOR_2 # define DIR_SEPARATOR_2 '\\' # endif # ifndef PATH_SEPARATOR_2 # define PATH_SEPARATOR_2 ';' # endif #endif #ifndef DIR_SEPARATOR_2 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) #else /* DIR_SEPARATOR_2 */ # define IS_DIR_SEPARATOR(ch) \ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) #endif /* DIR_SEPARATOR_2 */ #ifndef PATH_SEPARATOR_2 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) #else /* PATH_SEPARATOR_2 */ # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) #endif /* PATH_SEPARATOR_2 */ #ifdef __CYGWIN__ # define FOPEN_WB "wb" #endif #ifndef FOPEN_WB # define FOPEN_WB "w" #endif #ifndef _O_BINARY # define _O_BINARY 0 #endif #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) #define XFREE(stale) do { \ if (stale) { free ((void *) stale); stale = 0; } \ } while (0) #undef LTWRAPPER_DEBUGPRINTF #if defined DEBUGWRAPPER # define LTWRAPPER_DEBUGPRINTF(args) ltwrapper_debugprintf args static void ltwrapper_debugprintf (const char *fmt, ...) { va_list args; va_start (args, fmt); (void) vfprintf (stderr, fmt, args); va_end (args); } #else # define LTWRAPPER_DEBUGPRINTF(args) #endif const char *program_name = NULL; void *xmalloc (size_t num); char *xstrdup (const char *string); const char *base_name (const char *name); char *find_executable (const char *wrapper); char *chase_symlinks (const char *pathspec); int make_executable (const char *path); int check_executable (const char *path); char *strendzap (char *str, const char *pat); void lt_fatal (const char *message, ...); void lt_setenv (const char *name, const char *value); char *lt_extend_str (const char *orig_value, const char *add, int to_end); void lt_opt_process_env_set (const char *arg); void lt_opt_process_env_prepend (const char *arg); void lt_opt_process_env_append (const char *arg); int lt_split_name_value (const char *arg, char** name, char** value); void lt_update_exe_path (const char *name, const char *value); void lt_update_lib_path (const char *name, const char *value); static const char *script_text_part1 = EOF func_emit_wrapper_part1 yes | $SED -e 's/\([\\"]\)/\\\1/g' \ -e 's/^/ "/' -e 's/$/\\n"/' echo ";" cat <"))); for (i = 0; i < newargc; i++) { LTWRAPPER_DEBUGPRINTF (("(main) newargz[%d] : %s\n", i, (newargz[i] ? newargz[i] : ""))); } EOF case $host_os in mingw*) cat <<"EOF" /* execv doesn't actually work on mingw as expected on unix */ rval = _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz); if (rval == -1) { /* failed to start process */ LTWRAPPER_DEBUGPRINTF (("(main) failed to launch target \"%s\": errno = %d\n", lt_argv_zero, errno)); return 127; } return rval; EOF ;; *) cat <<"EOF" execv (lt_argv_zero, newargz); return rval; /* =127, but avoids unused variable warning */ EOF ;; esac cat <<"EOF" } void * xmalloc (size_t num) { void *p = (void *) malloc (num); if (!p) lt_fatal ("Memory exhausted"); return p; } char * xstrdup (const char *string) { return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL; } const char * base_name (const char *name) { const char *base; #if defined (HAVE_DOS_BASED_FILE_SYSTEM) /* Skip over the disk name in MSDOS pathnames. */ if (isalpha ((unsigned char) name[0]) && name[1] == ':') name += 2; #endif for (base = name; *name; name++) if (IS_DIR_SEPARATOR (*name)) base = name + 1; return base; } int check_executable (const char *path) { struct stat st; LTWRAPPER_DEBUGPRINTF (("(check_executable) : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!")); if ((!path) || (!*path)) return 0; if ((stat (path, &st) >= 0) && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) return 1; else return 0; } int make_executable (const char *path) { int rval = 0; struct stat st; LTWRAPPER_DEBUGPRINTF (("(make_executable) : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!")); if ((!path) || (!*path)) return 0; if (stat (path, &st) >= 0) { rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); } return rval; } /* Searches for the full path of the wrapper. Returns newly allocated full path name if found, NULL otherwise Does not chase symlinks, even on platforms that support them. */ char * find_executable (const char *wrapper) { int has_slash = 0; const char *p; const char *p_next; /* static buffer for getcwd */ char tmp[LT_PATHMAX + 1]; int tmp_len; char *concat_name; LTWRAPPER_DEBUGPRINTF (("(find_executable) : %s\n", wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!")); if ((wrapper == NULL) || (*wrapper == '\0')) return NULL; /* Absolute path? */ #if defined (HAVE_DOS_BASED_FILE_SYSTEM) if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } else { #endif if (IS_DIR_SEPARATOR (wrapper[0])) { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } #if defined (HAVE_DOS_BASED_FILE_SYSTEM) } #endif for (p = wrapper; *p; p++) if (*p == '/') { has_slash = 1; break; } if (!has_slash) { /* no slashes; search PATH */ const char *path = getenv ("PATH"); if (path != NULL) { for (p = path; *p; p = p_next) { const char *q; size_t p_len; for (q = p; *q; q++) if (IS_PATH_SEPARATOR (*q)) break; p_len = q - p; p_next = (*q == '\0' ? q : q + 1); if (p_len == 0) { /* empty path: current directory */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal ("getcwd failed"); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); } else { concat_name = XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, p, p_len); concat_name[p_len] = '/'; strcpy (concat_name + p_len + 1, wrapper); } if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } } /* not found in PATH; assume curdir */ } /* Relative path | not found in path: prepend cwd */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal ("getcwd failed"); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); return NULL; } char * chase_symlinks (const char *pathspec) { #ifndef S_ISLNK return xstrdup (pathspec); #else char buf[LT_PATHMAX]; struct stat s; char *tmp_pathspec = xstrdup (pathspec); char *p; int has_symlinks = 0; while (strlen (tmp_pathspec) && !has_symlinks) { LTWRAPPER_DEBUGPRINTF (("checking path component for symlinks: %s\n", tmp_pathspec)); if (lstat (tmp_pathspec, &s) == 0) { if (S_ISLNK (s.st_mode) != 0) { has_symlinks = 1; break; } /* search backwards for last DIR_SEPARATOR */ p = tmp_pathspec + strlen (tmp_pathspec) - 1; while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) p--; if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) { /* no more DIR_SEPARATORS left */ break; } *p = '\0'; } else { char *errstr = strerror (errno); lt_fatal ("Error accessing file %s (%s)", tmp_pathspec, errstr); } } XFREE (tmp_pathspec); if (!has_symlinks) { return xstrdup (pathspec); } tmp_pathspec = realpath (pathspec, buf); if (tmp_pathspec == 0) { lt_fatal ("Could not follow symlinks for %s", pathspec); } return xstrdup (tmp_pathspec); #endif } char * strendzap (char *str, const char *pat) { size_t len, patlen; assert (str != NULL); assert (pat != NULL); len = strlen (str); patlen = strlen (pat); if (patlen <= len) { str += len - patlen; if (strcmp (str, pat) == 0) *str = '\0'; } return str; } static void lt_error_core (int exit_status, const char *mode, const char *message, va_list ap) { fprintf (stderr, "%s: %s: ", program_name, mode); vfprintf (stderr, message, ap); fprintf (stderr, ".\n"); if (exit_status >= 0) exit (exit_status); } void lt_fatal (const char *message, ...) { va_list ap; va_start (ap, message); lt_error_core (EXIT_FAILURE, "FATAL", message, ap); va_end (ap); } void lt_setenv (const char *name, const char *value) { LTWRAPPER_DEBUGPRINTF (("(lt_setenv) setting '%s' to '%s'\n", (name ? name : ""), (value ? value : ""))); { #ifdef HAVE_SETENV /* always make a copy, for consistency with !HAVE_SETENV */ char *str = xstrdup (value); setenv (name, str, 1); #else int len = strlen (name) + 1 + strlen (value) + 1; char *str = XMALLOC (char, len); sprintf (str, "%s=%s", name, value); if (putenv (str) != EXIT_SUCCESS) { XFREE (str); } #endif } } char * lt_extend_str (const char *orig_value, const char *add, int to_end) { char *new_value; if (orig_value && *orig_value) { int orig_value_len = strlen (orig_value); int add_len = strlen (add); new_value = XMALLOC (char, add_len + orig_value_len + 1); if (to_end) { strcpy (new_value, orig_value); strcpy (new_value + orig_value_len, add); } else { strcpy (new_value, add); strcpy (new_value + add_len, orig_value); } } else { new_value = xstrdup (add); } return new_value; } int lt_split_name_value (const char *arg, char** name, char** value) { const char *p; int len; if (!arg || !*arg) return 1; p = strchr (arg, (int)'='); if (!p) return 1; *value = xstrdup (++p); len = strlen (arg) - strlen (*value); *name = XMALLOC (char, len); strncpy (*name, arg, len-1); (*name)[len - 1] = '\0'; return 0; } void lt_opt_process_env_set (const char *arg) { char *name = NULL; char *value = NULL; if (lt_split_name_value (arg, &name, &value) != 0) { XFREE (name); XFREE (value); lt_fatal ("bad argument for %s: '%s'", env_set_opt, arg); } lt_setenv (name, value); XFREE (name); XFREE (value); } void lt_opt_process_env_prepend (const char *arg) { char *name = NULL; char *value = NULL; char *new_value = NULL; if (lt_split_name_value (arg, &name, &value) != 0) { XFREE (name); XFREE (value); lt_fatal ("bad argument for %s: '%s'", env_prepend_opt, arg); } new_value = lt_extend_str (getenv (name), value, 0); lt_setenv (name, new_value); XFREE (new_value); XFREE (name); XFREE (value); } void lt_opt_process_env_append (const char *arg) { char *name = NULL; char *value = NULL; char *new_value = NULL; if (lt_split_name_value (arg, &name, &value) != 0) { XFREE (name); XFREE (value); lt_fatal ("bad argument for %s: '%s'", env_append_opt, arg); } new_value = lt_extend_str (getenv (name), value, 1); lt_setenv (name, new_value); XFREE (new_value); XFREE (name); XFREE (value); } void lt_update_exe_path (const char *name, const char *value) { LTWRAPPER_DEBUGPRINTF (("(lt_update_exe_path) modifying '%s' by prepending '%s'\n", (name ? name : ""), (value ? value : ""))); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); /* some systems can't cope with a ':'-terminated path #' */ int len = strlen (new_value); while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1])) { new_value[len-1] = '\0'; } lt_setenv (name, new_value); XFREE (new_value); } } void lt_update_lib_path (const char *name, const char *value) { LTWRAPPER_DEBUGPRINTF (("(lt_update_lib_path) modifying '%s' by prepending '%s'\n", (name ? name : ""), (value ? value : ""))); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); lt_setenv (name, new_value); XFREE (new_value); } } EOF } # end: func_emit_cwrapperexe_src # func_mode_link arg... func_mode_link () { $opt_debug case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) # It is impossible to link a dll without this setting, and # we shouldn't force the makefile maintainer to figure out # which system we are compiling for in order to pass an extra # flag for every libtool invocation. # allow_undefined=no # FIXME: Unfortunately, there are problems with the above when trying # to make a dll which has undefined symbols, in which case not # even a static library is built. For now, we need to specify # -no-undefined on the libtool link line when we can be certain # that all symbols are satisfied, otherwise we get a static library. allow_undefined=yes ;; *) allow_undefined=yes ;; esac libtool_args=$nonopt base_compile="$nonopt $@" compile_command=$nonopt finalize_command=$nonopt compile_rpath= finalize_rpath= compile_shlibpath= finalize_shlibpath= convenience= old_convenience= deplibs= old_deplibs= compiler_flags= linker_flags= dllsearchpath= lib_search_path=`pwd` inst_prefix_dir= new_inherited_linker_flags= avoid_version=no dlfiles= dlprefiles= dlself=no export_dynamic=no export_symbols= export_symbols_regex= generated= libobjs= ltlibs= module=no no_install=no objs= non_pic_objects= precious_files_regex= prefer_static_libs=no preload=no prev= prevarg= release= rpath= xrpath= perm_rpath= temp_rpath= thread_safe=no vinfo= vinfo_number=no weak_libs= single_module="${wl}-single_module" func_infer_tag $base_compile # We need to know -static, to get the right output filenames. for arg do case $arg in -shared) test "$build_libtool_libs" != yes && \ func_fatal_configuration "can not build a shared library" build_old_libs=no break ;; -all-static | -static | -static-libtool-libs) case $arg in -all-static) if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then func_warning "complete static linking is impossible in this configuration" fi if test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; -static) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=built ;; -static-libtool-libs) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; esac build_libtool_libs=no build_old_libs=yes break ;; esac done # See if our shared archives depend on static archives. test -n "$old_archive_from_new_cmds" && build_old_libs=yes # Go through the arguments, transforming them on the way. while test "$#" -gt 0; do arg="$1" shift func_quote_for_eval "$arg" qarg=$func_quote_for_eval_unquoted_result func_append libtool_args " $func_quote_for_eval_result" # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in output) func_append compile_command " @OUTPUT@" func_append finalize_command " @OUTPUT@" ;; esac case $prev in dlfiles|dlprefiles) if test "$preload" = no; then # Add the symbol object into the linking commands. func_append compile_command " @SYMFILE@" func_append finalize_command " @SYMFILE@" preload=yes fi case $arg in *.la | *.lo) ;; # We handle these cases below. force) if test "$dlself" = no; then dlself=needless export_dynamic=yes fi prev= continue ;; self) if test "$prev" = dlprefiles; then dlself=yes elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then dlself=yes else dlself=needless export_dynamic=yes fi prev= continue ;; *) if test "$prev" = dlfiles; then dlfiles="$dlfiles $arg" else dlprefiles="$dlprefiles $arg" fi prev= continue ;; esac ;; expsyms) export_symbols="$arg" test -f "$arg" \ || func_fatal_error "symbol file \`$arg' does not exist" prev= continue ;; expsyms_regex) export_symbols_regex="$arg" prev= continue ;; framework) case $host in *-*-darwin*) case "$deplibs " in *" $qarg.ltframework "*) ;; *) deplibs="$deplibs $qarg.ltframework" # this is fixed later ;; esac ;; esac prev= continue ;; inst_prefix) inst_prefix_dir="$arg" prev= continue ;; objectlist) if test -f "$arg"; then save_arg=$arg moreargs= for fil in `cat "$save_arg"` do # moreargs="$moreargs $fil" arg=$fil # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test "$pic_object" = none && test "$non_pic_object" = none; then func_fatal_error "cannot find name of object for \`$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then dlfiles="$dlfiles $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. dlprefiles="$dlprefiles $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "\`$arg' is not a valid libtool object" fi fi done else func_fatal_error "link input file \`$arg' does not exist" fi arg=$save_arg prev= continue ;; precious_regex) precious_files_regex="$arg" prev= continue ;; release) release="-$arg" prev= continue ;; rpath | xrpath) # We need an absolute path. case $arg in [\\/]* | [A-Za-z]:[\\/]*) ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac if test "$prev" = rpath; then case "$rpath " in *" $arg "*) ;; *) rpath="$rpath $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; *) xrpath="$xrpath $arg" ;; esac fi prev= continue ;; shrext) shrext_cmds="$arg" prev= continue ;; weak) weak_libs="$weak_libs $arg" prev= continue ;; xcclinker) linker_flags="$linker_flags $qarg" compiler_flags="$compiler_flags $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xcompiler) compiler_flags="$compiler_flags $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xlinker) linker_flags="$linker_flags $qarg" compiler_flags="$compiler_flags $wl$qarg" prev= func_append compile_command " $wl$qarg" func_append finalize_command " $wl$qarg" continue ;; *) eval "$prev=\"\$arg\"" prev= continue ;; esac fi # test -n "$prev" prevarg="$arg" case $arg in -all-static) if test -n "$link_static_flag"; then # See comment for -static flag below, for more details. func_append compile_command " $link_static_flag" func_append finalize_command " $link_static_flag" fi continue ;; -allow-undefined) # FIXME: remove this flag sometime in the future. func_fatal_error "\`-allow-undefined' must not be used because it is the default" ;; -avoid-version) avoid_version=yes continue ;; -dlopen) prev=dlfiles continue ;; -dlpreopen) prev=dlprefiles continue ;; -export-dynamic) export_dynamic=yes continue ;; -export-symbols | -export-symbols-regex) if test -n "$export_symbols" || test -n "$export_symbols_regex"; then func_fatal_error "more than one -exported-symbols argument is not allowed" fi if test "X$arg" = "X-export-symbols"; then prev=expsyms else prev=expsyms_regex fi continue ;; -framework) prev=framework continue ;; -inst-prefix-dir) prev=inst_prefix continue ;; # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* # so, if we see these flags be careful not to treat them like -L -L[A-Z][A-Z]*:*) case $with_gcc/$host in no/*-*-irix* | /*-*-irix*) func_append compile_command " $arg" func_append finalize_command " $arg" ;; esac continue ;; -L*) func_stripname '-L' '' "$arg" dir=$func_stripname_result if test -z "$dir"; then if test "$#" -gt 0; then func_fatal_error "require no space between \`-L' and \`$1'" else func_fatal_error "need path for \`-L' option" fi fi # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) absdir=`cd "$dir" && pwd` test -z "$absdir" && \ func_fatal_error "cannot determine absolute directory name of \`$dir'" dir="$absdir" ;; esac case "$deplibs " in *" -L$dir "*) ;; *) deplibs="$deplibs -L$dir" lib_search_path="$lib_search_path $dir" ;; esac case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`$ECHO "X$dir" | $Xsed -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$dir:"*) ;; ::) dllsearchpath=$dir;; *) dllsearchpath="$dllsearchpath:$dir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) dllsearchpath="$dllsearchpath:$testbindir";; esac ;; esac continue ;; -l*) if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc*) # These systems don't actually have a C or math library (as such) continue ;; *-*-os2*) # These systems don't actually have a C library (as such) test "X$arg" = "X-lc" && continue ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. test "X$arg" = "X-lc" && continue ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C and math libraries are in the System framework deplibs="$deplibs System.ltframework" continue ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype test "X$arg" = "X-lc" && continue ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work test "X$arg" = "X-lc" && continue ;; esac elif test "X$arg" = "X-lc_r"; then case $host in *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc_r directly, use -pthread flag. continue ;; esac fi deplibs="$deplibs $arg" continue ;; -module) module=yes continue ;; # Tru64 UNIX uses -model [arg] to determine the layout of C++ # classes, name mangling, and exception handling. # Darwin uses the -arch flag to determine output architecture. -model|-arch|-isysroot) compiler_flags="$compiler_flags $arg" func_append compile_command " $arg" func_append finalize_command " $arg" prev=xcompiler continue ;; -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads) compiler_flags="$compiler_flags $arg" func_append compile_command " $arg" func_append finalize_command " $arg" case "$new_inherited_linker_flags " in *" $arg "*) ;; * ) new_inherited_linker_flags="$new_inherited_linker_flags $arg" ;; esac continue ;; -multi_module) single_module="${wl}-multi_module" continue ;; -no-fast-install) fast_install=no continue ;; -no-install) case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) # The PATH hackery in wrapper scripts is required on Windows # and Darwin in order for the loader to find any dlls it needs. func_warning "\`-no-install' is ignored for $host" func_warning "assuming \`-no-fast-install' instead" fast_install=no ;; *) no_install=yes ;; esac continue ;; -no-undefined) allow_undefined=no continue ;; -objectlist) prev=objectlist continue ;; -o) prev=output ;; -precious-files-regex) prev=precious_regex continue ;; -release) prev=release continue ;; -rpath) prev=rpath continue ;; -R) prev=xrpath continue ;; -R*) func_stripname '-R' '' "$arg" dir=$func_stripname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac case "$xrpath " in *" $dir "*) ;; *) xrpath="$xrpath $dir" ;; esac continue ;; -shared) # The effects of -shared are defined in a previous loop. continue ;; -shrext) prev=shrext continue ;; -static | -static-libtool-libs) # The effects of -static are defined in a previous loop. # We used to do the same as -all-static on platforms that # didn't have a PIC flag, but the assumption that the effects # would be equivalent was wrong. It would break on at least # Digital Unix and AIX. continue ;; -thread-safe) thread_safe=yes continue ;; -version-info) prev=vinfo continue ;; -version-number) prev=vinfo vinfo_number=yes continue ;; -weak) prev=weak continue ;; -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" func_quote_for_eval "$flag" arg="$arg $wl$func_quote_for_eval_result" compiler_flags="$compiler_flags $func_quote_for_eval_result" done IFS="$save_ifs" func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Wl,*) func_stripname '-Wl,' '' "$arg" args=$func_stripname_result arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" func_quote_for_eval "$flag" arg="$arg $wl$func_quote_for_eval_result" compiler_flags="$compiler_flags $wl$func_quote_for_eval_result" linker_flags="$linker_flags $func_quote_for_eval_result" done IFS="$save_ifs" func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Xcompiler) prev=xcompiler continue ;; -Xlinker) prev=xlinker continue ;; -XCClinker) prev=xcclinker continue ;; # -msg_* for osf cc -msg_*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; # -64, -mips[0-9] enable 64-bit mode on the SGI compiler # -r[0-9][0-9]* specifies the processor on the SGI compiler # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler # +DA*, +DD* enable 64-bit mode on the HP compiler # -q* pass through compiler args for the IBM compiler # -m*, -t[45]*, -txscale* pass through architecture-specific # compiler args for GCC # -F/path gives path to uninstalled frameworks, gcc on darwin # -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC # @file GCC response files -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" func_append compile_command " $arg" func_append finalize_command " $arg" compiler_flags="$compiler_flags $arg" continue ;; # Some other compiler flag. -* | +*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; *.$objext) # A standard object. objs="$objs $arg" ;; *.lo) # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test "$pic_object" = none && test "$non_pic_object" = none; then func_fatal_error "cannot find name of object for \`$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then dlfiles="$dlfiles $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. dlprefiles="$dlprefiles $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "\`$arg' is not a valid libtool object" fi fi ;; *.$libext) # An archive. deplibs="$deplibs $arg" old_deplibs="$old_deplibs $arg" continue ;; *.la) # A libtool-controlled library. if test "$prev" = dlfiles; then # This library was specified with -dlopen. dlfiles="$dlfiles $arg" prev= elif test "$prev" = dlprefiles; then # The library was specified with -dlpreopen. dlprefiles="$dlprefiles $arg" prev= else deplibs="$deplibs $arg" fi continue ;; # Some other compiler argument. *) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; esac # arg # Now actually substitute the argument into the commands. if test -n "$arg"; then func_append compile_command " $arg" func_append finalize_command " $arg" fi done # argument parsing loop test -n "$prev" && \ func_fatal_help "the \`$prevarg' option requires an argument" if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then eval arg=\"$export_dynamic_flag_spec\" func_append compile_command " $arg" func_append finalize_command " $arg" fi oldlibs= # calculate the name of the file, without its directory func_basename "$output" outputname="$func_basename_result" libobjs_save="$libobjs" if test -n "$shlibpath_var"; then # get the directories listed in $shlibpath_var eval shlib_search_path=\`\$ECHO \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\` else shlib_search_path= fi eval sys_lib_search_path=\"$sys_lib_search_path_spec\" eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" func_dirname "$output" "/" "" output_objdir="$func_dirname_result$objdir" # Create the object directory. func_mkdir_p "$output_objdir" # Determine the type of output case $output in "") func_fatal_help "you must specify an output file" ;; *.$libext) linkmode=oldlib ;; *.lo | *.$objext) linkmode=obj ;; *.la) linkmode=lib ;; *) linkmode=prog ;; # Anything else should be a program. esac specialdeplibs= libs= # Find all interdependent deplibs by searching for libraries # that are linked more than once (e.g. -la -lb -la) for deplib in $deplibs; do if $opt_duplicate_deps ; then case "$libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi libs="$libs $deplib" done if test "$linkmode" = lib; then libs="$predeps $libs $compiler_lib_search_path $postdeps" # Compute libraries that are listed more than once in $predeps # $postdeps and mark them as special (i.e., whose duplicates are # not to be eliminated). pre_post_deps= if $opt_duplicate_compiler_generated_deps; then for pre_post_dep in $predeps $postdeps; do case "$pre_post_deps " in *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;; esac pre_post_deps="$pre_post_deps $pre_post_dep" done fi pre_post_deps= fi deplibs= newdependency_libs= newlib_search_path= need_relink=no # whether we're linking any uninstalled libtool libraries notinst_deplibs= # not-installed libtool libraries notinst_path= # paths that contain not-installed libtool libraries case $linkmode in lib) passes="conv dlpreopen link" for file in $dlfiles $dlprefiles; do case $file in *.la) ;; *) func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file" ;; esac done ;; prog) compile_deplibs= finalize_deplibs= alldeplibs=no newdlfiles= newdlprefiles= passes="conv scan dlopen dlpreopen link" ;; *) passes="conv" ;; esac for pass in $passes; do # The preopen pass in lib mode reverses $deplibs; put it back here # so that -L comes before libs that need it for instance... if test "$linkmode,$pass" = "lib,link"; then ## FIXME: Find the place where the list is rebuilt in the wrong ## order, and fix it there properly tmp_deplibs= for deplib in $deplibs; do tmp_deplibs="$deplib $tmp_deplibs" done deplibs="$tmp_deplibs" fi if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan"; then libs="$deplibs" deplibs= fi if test "$linkmode" = prog; then case $pass in dlopen) libs="$dlfiles" ;; dlpreopen) libs="$dlprefiles" ;; link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; esac fi if test "$linkmode,$pass" = "lib,dlpreopen"; then # Collect and forward deplibs of preopened libtool libs for lib in $dlprefiles; do # Ignore non-libtool-libs dependency_libs= case $lib in *.la) func_source "$lib" ;; esac # Collect preopened libtool deplibs, except any this library # has declared as weak libs for deplib in $dependency_libs; do deplib_base=`$ECHO "X$deplib" | $Xsed -e "$basename"` case " $weak_libs " in *" $deplib_base "*) ;; *) deplibs="$deplibs $deplib" ;; esac done done libs="$dlprefiles" fi if test "$pass" = dlopen; then # Collect dlpreopened libraries save_deplibs="$deplibs" deplibs= fi for deplib in $libs; do lib= found=no case $deplib in -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else compiler_flags="$compiler_flags $deplib" if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;; esac fi fi continue ;; -l*) if test "$linkmode" != lib && test "$linkmode" != prog; then func_warning "\`-l' is ignored for archives/objects" continue fi func_stripname '-l' '' "$deplib" name=$func_stripname_result if test "$linkmode" = lib; then searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" else searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" fi for searchdir in $searchdirs; do for search_ext in .la $std_shrext .so .a; do # Search the libtool library lib="$searchdir/lib${name}${search_ext}" if test -f "$lib"; then if test "$search_ext" = ".la"; then found=yes else found=no fi break 2 fi done done if test "$found" != yes; then # deplib doesn't seem to be a libtool library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue else # deplib is a libtool library # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, # We need to do some special things here, and not later. if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $deplib "*) if func_lalib_p "$lib"; then library_names= old_library= func_source "$lib" for l in $old_library $library_names; do ll="$l" done if test "X$ll" = "X$old_library" ; then # only static version available found=no func_dirname "$lib" "" "." ladir="$func_dirname_result" lib=$ladir/$old_library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue fi fi ;; *) ;; esac fi fi ;; # -l *.ltframework) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;; esac fi fi continue ;; -L*) case $linkmode in lib) deplibs="$deplib $deplibs" test "$pass" = conv && continue newdependency_libs="$deplib $newdependency_libs" func_stripname '-L' '' "$deplib" newlib_search_path="$newlib_search_path $func_stripname_result" ;; prog) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi if test "$pass" = scan; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi func_stripname '-L' '' "$deplib" newlib_search_path="$newlib_search_path $func_stripname_result" ;; *) func_warning "\`-L' is ignored for archives/objects" ;; esac # linkmode continue ;; # -L -R*) if test "$pass" = link; then func_stripname '-R' '' "$deplib" dir=$func_stripname_result # Make sure the xrpath contains only unique directories. case "$xrpath " in *" $dir "*) ;; *) xrpath="$xrpath $dir" ;; esac fi deplibs="$deplib $deplibs" continue ;; *.la) lib="$deplib" ;; *.$libext) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi case $linkmode in lib) # Linking convenience modules into shared libraries is allowed, # but linking other static libraries is non-portable. case " $dlpreconveniencelibs " in *" $deplib "*) ;; *) valid_a_lib=no case $deplibs_check_method in match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` if eval "\$ECHO \"X$deplib\"" 2>/dev/null | $Xsed -e 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then valid_a_lib=yes fi ;; pass_all) valid_a_lib=yes ;; esac if test "$valid_a_lib" != yes; then $ECHO $ECHO "*** Warning: Trying to link with static lib archive $deplib." $ECHO "*** I have the capability to make that library automatically link in when" $ECHO "*** you link to this library. But I can only do this if you have a" $ECHO "*** shared version of the library, which you do not appear to have" $ECHO "*** because the file extensions .$libext of this argument makes me believe" $ECHO "*** that it is just a static archive that I should not use here." else $ECHO $ECHO "*** Warning: Linking the shared library $output against the" $ECHO "*** static library $deplib is not portable!" deplibs="$deplib $deplibs" fi ;; esac continue ;; prog) if test "$pass" != link; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi continue ;; esac # linkmode ;; # *.$libext *.lo | *.$objext) if test "$pass" = conv; then deplibs="$deplib $deplibs" elif test "$linkmode" = prog; then if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlopen support or we're linking statically, # we need to preload. newdlprefiles="$newdlprefiles $deplib" compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else newdlfiles="$newdlfiles $deplib" fi fi continue ;; %DEPLIBS%) alldeplibs=yes continue ;; esac # case $deplib if test "$found" = yes || test -f "$lib"; then : else func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'" fi # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$lib" \ || func_fatal_error "\`$lib' is not a valid libtool archive" func_dirname "$lib" "" "." ladir="$func_dirname_result" dlname= dlopen= dlpreopen= libdir= library_names= old_library= inherited_linker_flags= # If the library was installed with an old release of libtool, # it will not redefine variables installed, or shouldnotlink installed=yes shouldnotlink=no avoidtemprpath= # Read the .la file func_source "$lib" # Convert "-framework foo" to "foo.ltframework" if test -n "$inherited_linker_flags"; then tmp_inherited_linker_flags=`$ECHO "X$inherited_linker_flags" | $Xsed -e 's/-framework \([^ $]*\)/\1.ltframework/g'` for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do case " $new_inherited_linker_flags " in *" $tmp_inherited_linker_flag "*) ;; *) new_inherited_linker_flags="$new_inherited_linker_flags $tmp_inherited_linker_flag";; esac done fi dependency_libs=`$ECHO "X $dependency_libs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan" || { test "$linkmode" != prog && test "$linkmode" != lib; }; then test -n "$dlopen" && dlfiles="$dlfiles $dlopen" test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen" fi if test "$pass" = conv; then # Only check for convenience libraries deplibs="$lib $deplibs" if test -z "$libdir"; then if test -z "$old_library"; then func_fatal_error "cannot find name of link library for \`$lib'" fi # It is a libtool convenience library, so add in its objects. convenience="$convenience $ladir/$objdir/$old_library" old_convenience="$old_convenience $ladir/$objdir/$old_library" 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_duplicate_deps ; then case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi tmp_libs="$tmp_libs $deplib" done continue fi # $pass = conv # Get the name of the library we link against. linklib= for l in $old_library $library_names; do linklib="$l" done if test -z "$linklib"; then func_fatal_error "cannot find name of link library for \`$lib'" fi # This library was specified with -dlopen. if test "$pass" = dlopen; then if test -z "$libdir"; then func_fatal_error "cannot -dlopen a convenience library: \`$lib'" fi if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlname, no dlopen support or we're linking # statically, we need to preload. We also need to preload any # dependent libraries so libltdl's deplib preloader doesn't # bomb out in the load deplibs phase. dlprefiles="$dlprefiles $lib $dependency_libs" else newdlfiles="$newdlfiles $lib" fi continue fi # $pass = dlopen # We need an absolute path. case $ladir in [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; *) abs_ladir=`cd "$ladir" && pwd` if test -z "$abs_ladir"; then func_warning "cannot determine absolute directory name of \`$ladir'" func_warning "passing it literally to the linker, although it might fail" abs_ladir="$ladir" fi ;; esac func_basename "$lib" laname="$func_basename_result" # Find the relevant object directory and library name. if test "X$installed" = Xyes; then if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then func_warning "library \`$lib' was moved." dir="$ladir" absdir="$abs_ladir" libdir="$abs_ladir" else dir="$libdir" absdir="$libdir" fi test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes else if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then dir="$ladir" absdir="$abs_ladir" # Remove this search path later notinst_path="$notinst_path $abs_ladir" else dir="$ladir/$objdir" absdir="$abs_ladir/$objdir" # Remove this search path later notinst_path="$notinst_path $abs_ladir" fi fi # $installed = yes func_stripname 'lib' '.la' "$laname" name=$func_stripname_result # This library was specified with -dlpreopen. if test "$pass" = dlpreopen; then if test -z "$libdir" && test "$linkmode" = prog; then func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'" fi # Prefer using a static library (so that no silly _DYNAMIC symbols # are required to link). if test -n "$old_library"; then newdlprefiles="$newdlprefiles $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ dlpreconveniencelibs="$dlpreconveniencelibs $dir/$old_library" # Otherwise, use the dlname, so that lt_dlopen finds it. elif test -n "$dlname"; then newdlprefiles="$newdlprefiles $dir/$dlname" else newdlprefiles="$newdlprefiles $dir/$linklib" fi fi # $pass = dlpreopen if test -z "$libdir"; then # Link the convenience library if test "$linkmode" = lib; then deplibs="$dir/$old_library $deplibs" elif test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$dir/$old_library $compile_deplibs" finalize_deplibs="$dir/$old_library $finalize_deplibs" else deplibs="$lib $deplibs" # used for prog,scan pass fi continue fi if test "$linkmode" = prog && test "$pass" != link; then newlib_search_path="$newlib_search_path $ladir" deplibs="$lib $deplibs" linkalldeplibs=no if test "$link_all_deplibs" != no || test -z "$library_names" || test "$build_libtool_libs" = no; then linkalldeplibs=yes fi tmp_libs= for deplib in $dependency_libs; do case $deplib in -L*) func_stripname '-L' '' "$deplib" newlib_search_path="$newlib_search_path $func_stripname_result" ;; esac # Need to link against all dependency_libs? if test "$linkalldeplibs" = yes; then deplibs="$deplib $deplibs" else # Need to hardcode shared library paths # or/and link against static libraries newdependency_libs="$deplib $newdependency_libs" fi if $opt_duplicate_deps ; then case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi tmp_libs="$tmp_libs $deplib" done # for deplib continue fi # $linkmode = prog... if test "$linkmode,$pass" = "prog,link"; then if test -n "$library_names" && { { test "$prefer_static_libs" = no || test "$prefer_static_libs,$installed" = "built,yes"; } || test -z "$old_library"; }; then # We need to hardcode the library path if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then # Make sure the rpath contains only unique directories. case "$temp_rpath:" in *"$absdir:"*) ;; *) temp_rpath="$temp_rpath$absdir:" ;; esac fi # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) compile_rpath="$compile_rpath $absdir" esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" esac ;; esac fi # $linkmode,$pass = prog,link... if test "$alldeplibs" = yes && { test "$deplibs_check_method" = pass_all || { test "$build_libtool_libs" = yes && test -n "$library_names"; }; }; then # We only need to search for static libraries continue fi fi link_static=no # Whether the deplib will be linked statically use_static_libs=$prefer_static_libs if test "$use_static_libs" = built && test "$installed" = yes; then use_static_libs=no fi if test -n "$library_names" && { test "$use_static_libs" = no || test -z "$old_library"; }; then case $host in *cygwin* | *mingw* | *cegcc*) # No point in relinking DLLs because paths are not encoded notinst_deplibs="$notinst_deplibs $lib" need_relink=no ;; *) if test "$installed" = no; then notinst_deplibs="$notinst_deplibs $lib" need_relink=yes fi ;; esac # This is a shared library # Warn about portability, can't link against -module's on some # systems (darwin). Don't bleat about dlopened modules though! dlopenmodule="" for dlpremoduletest in $dlprefiles; do if test "X$dlpremoduletest" = "X$lib"; then dlopenmodule="$dlpremoduletest" break fi done if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then $ECHO if test "$linkmode" = prog; then $ECHO "*** Warning: Linking the executable $output against the loadable module" else $ECHO "*** Warning: Linking the shared library $output against the loadable module" fi $ECHO "*** $linklib is not portable!" fi if test "$linkmode" = lib && test "$hardcode_into_libs" = yes; then # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) compile_rpath="$compile_rpath $absdir" esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" esac ;; esac fi if test -n "$old_archive_from_expsyms_cmds"; then # figure out the soname set dummy $library_names shift realname="$1" shift libname=`eval "\\$ECHO \"$libname_spec\""` # use dlname if we got it. it's perfectly good, no? if test -n "$dlname"; then soname="$dlname" elif test -n "$soname_spec"; then # bleh windows case $host in *cygwin* | mingw* | *cegcc*) func_arith $current - $age major=$func_arith_result versuffix="-$major" ;; esac eval soname=\"$soname_spec\" else soname="$realname" fi # Make a new name for the extract_expsyms_cmds to use soroot="$soname" func_basename "$soroot" soname="$func_basename_result" func_stripname 'lib' '.dll' "$soname" newlib=libimp-$func_stripname_result.a # If the library has no export list, then create one now if test -f "$output_objdir/$soname-def"; then : else func_verbose "extracting exported symbol list from \`$soname'" func_execute_cmds "$extract_expsyms_cmds" 'exit $?' fi # Create $newlib if test -f "$output_objdir/$newlib"; then :; else func_verbose "generating import library for \`$soname'" func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?' fi # make sure the library variables are pointing to the new library dir=$output_objdir linklib=$newlib fi # test -n "$old_archive_from_expsyms_cmds" if test "$linkmode" = prog || test "$mode" != relink; then add_shlibpath= add_dir= add= lib_linked=yes case $hardcode_action in immediate | unsupported) if test "$hardcode_direct" = no; then add="$dir/$linklib" case $host in *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; *-*-sysv4*uw2*) add_dir="-L$dir" ;; *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ *-*-unixware7*) add_dir="-L$dir" ;; *-*-darwin* ) # if the lib is a (non-dlopened) module then we can not # link against it, someone is ignoring the earlier warnings if /usr/bin/file -L $add 2> /dev/null | $GREP ": [^:]* bundle" >/dev/null ; then if test "X$dlopenmodule" != "X$lib"; then $ECHO "*** Warning: lib $linklib is a module, not a shared library" if test -z "$old_library" ; then $ECHO $ECHO "*** And there doesn't seem to be a static archive available" $ECHO "*** The link will probably fail, sorry" else add="$dir/$old_library" fi elif test -n "$old_library"; then add="$dir/$old_library" fi fi esac elif test "$hardcode_minus_L" = no; then case $host in *-*-sunos*) add_shlibpath="$dir" ;; esac add_dir="-L$dir" add="-l$name" elif test "$hardcode_shlibpath_var" = no; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; relink) if test "$hardcode_direct" = yes && test "$hardcode_direct_absolute" = no; then add="$dir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$dir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) add_dir="$add_dir -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; *) lib_linked=no ;; esac if test "$lib_linked" != yes; then func_fatal_configuration "unsupported hardcode properties" fi if test -n "$add_shlibpath"; then case :$compile_shlibpath: in *":$add_shlibpath:"*) ;; *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;; esac fi if test "$linkmode" = prog; then test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" test -n "$add" && compile_deplibs="$add $compile_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" if test "$hardcode_direct" != yes && test "$hardcode_minus_L" != yes && test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; esac fi fi fi if test "$linkmode" = prog || test "$mode" = relink; then add_shlibpath= add_dir= add= # Finalize command for both is simple: just hardcode it. if test "$hardcode_direct" = yes && test "$hardcode_direct_absolute" = no; then add="$libdir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$libdir" add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; esac add="-l$name" elif test "$hardcode_automatic" = yes; then if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib" ; then add="$inst_prefix_dir$libdir/$linklib" else add="$libdir/$linklib" fi else # We cannot seem to hardcode it, guess we'll fake it. add_dir="-L$libdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) add_dir="$add_dir -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" fi if test "$linkmode" = prog; then test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" test -n "$add" && finalize_deplibs="$add $finalize_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" fi fi elif test "$linkmode" = prog; then # Here we assume that one of hardcode_direct or hardcode_minus_L # is not unsupported. This is valid on all known static and # shared platforms. if test "$hardcode_direct" != unsupported; then test -n "$old_library" && linklib="$old_library" compile_deplibs="$dir/$linklib $compile_deplibs" finalize_deplibs="$dir/$linklib $finalize_deplibs" else compile_deplibs="-l$name -L$dir $compile_deplibs" finalize_deplibs="-l$name -L$dir $finalize_deplibs" fi elif test "$build_libtool_libs" = yes; then # Not a shared library if test "$deplibs_check_method" != pass_all; then # We're trying link a shared library against a static one # but the system doesn't support it. # Just print a warning and add the library to dependency_libs so # that the program can be linked against the static library. $ECHO $ECHO "*** Warning: This system can not link to static lib archive $lib." $ECHO "*** I have the capability to make that library automatically link in when" $ECHO "*** you link to this library. But I can only do this if you have a" $ECHO "*** shared version of the library, which you do not appear to have." if test "$module" = yes; then $ECHO "*** But as you try to build a module library, libtool will still create " $ECHO "*** a static module, that should work as long as the dlopening application" $ECHO "*** is linked with the -dlopen flag to resolve symbols at runtime." if test -z "$global_symbol_pipe"; then $ECHO $ECHO "*** However, this would only work if libtool was able to extract symbol" $ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could" $ECHO "*** not find such a program. So, this module is probably useless." $ECHO "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi else deplibs="$dir/$old_library $deplibs" link_static=yes fi fi # link shared/static library? if test "$linkmode" = lib; then if test -n "$dependency_libs" && { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes || test "$link_static" = yes; }; then # Extract -R from dependency_libs temp_deplibs= for libdir in $dependency_libs; do case $libdir in -R*) func_stripname '-R' '' "$libdir" temp_xrpath=$func_stripname_result case " $xrpath " in *" $temp_xrpath "*) ;; *) xrpath="$xrpath $temp_xrpath";; esac;; *) temp_deplibs="$temp_deplibs $libdir";; esac done dependency_libs="$temp_deplibs" fi newlib_search_path="$newlib_search_path $absdir" # Link against this library test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" # ... and its dependency_libs tmp_libs= for deplib in $dependency_libs; do newdependency_libs="$deplib $newdependency_libs" if $opt_duplicate_deps ; then case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi tmp_libs="$tmp_libs $deplib" done if test "$link_all_deplibs" != no; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do case $deplib in -L*) path="$deplib" ;; *.la) func_dirname "$deplib" "" "." dir="$func_dirname_result" # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then func_warning "cannot determine absolute directory name of \`$dir'" absdir="$dir" fi ;; esac if $GREP "^installed=no" $deplib > /dev/null; then case $host in *-*-darwin*) depdepl= eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` if test -n "$deplibrary_names" ; then for tmp in $deplibrary_names ; do depdepl=$tmp done if test -f "$absdir/$objdir/$depdepl" ; then depdepl="$absdir/$objdir/$depdepl" darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` if test -z "$darwin_install_name"; then darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` fi compiler_flags="$compiler_flags ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}" linker_flags="$linker_flags -dylib_file ${darwin_install_name}:${depdepl}" path= fi fi ;; *) path="-L$absdir/$objdir" ;; esac else eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` test -z "$libdir" && \ func_fatal_error "\`$deplib' is not a valid libtool archive" test "$absdir" != "$libdir" && \ func_warning "\`$deplib' seems to be moved" path="-L$absdir" fi ;; esac case " $deplibs " in *" $path "*) ;; *) deplibs="$path $deplibs" ;; esac done fi # link_all_deplibs != no fi # linkmode = lib done # for deplib in $libs if test "$pass" = link; then if test "$linkmode" = "prog"; then compile_deplibs="$new_inherited_linker_flags $compile_deplibs" finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" else compiler_flags="$compiler_flags "`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` fi fi dependency_libs="$newdependency_libs" if test "$pass" = dlpreopen; then # Link the dlpreopened libraries before other libraries for deplib in $save_deplibs; do deplibs="$deplib $deplibs" done fi if test "$pass" != dlopen; then if test "$pass" != conv; then # Make sure lib_search_path contains only unique directories. lib_search_path= for dir in $newlib_search_path; do case "$lib_search_path " in *" $dir "*) ;; *) lib_search_path="$lib_search_path $dir" ;; esac done newlib_search_path= fi if test "$linkmode,$pass" != "prog,link"; then vars="deplibs" else vars="compile_deplibs finalize_deplibs" fi for var in $vars dependency_libs; do # Add libraries to $var in reverse order eval tmp_libs=\"\$$var\" new_libs= for deplib in $tmp_libs; do # FIXME: Pedantically, this is the right thing to do, so # that some nasty dependency loop isn't accidentally # broken: #new_libs="$deplib $new_libs" # Pragmatically, this seems to cause very few problems in # practice: case $deplib in -L*) new_libs="$deplib $new_libs" ;; -R*) ;; *) # And here is the reason: when a library appears more # than once as an explicit dependence of a library, or # is implicitly linked in more than once by the # compiler, it is considered special, and multiple # occurrences thereof are not removed. Compare this # with having the same library being listed as a # dependency of multiple other libraries: in this case, # we know (pedantically, we assume) the library does not # need to be listed more than once, so we keep only the # last copy. This is not always right, but it is rare # enough that we require users that really mean to play # such unportable linking tricks to link the library # using -Wl,-lname, so that libtool does not consider it # for duplicate removal. case " $specialdeplibs " in *" $deplib "*) new_libs="$deplib $new_libs" ;; *) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$deplib $new_libs" ;; esac ;; esac ;; esac done tmp_libs= for deplib in $new_libs; do case $deplib in -L*) case " $tmp_libs " in *" $deplib "*) ;; *) tmp_libs="$tmp_libs $deplib" ;; esac ;; *) tmp_libs="$tmp_libs $deplib" ;; esac done eval $var=\"$tmp_libs\" done # for var fi # Last step: remove runtime libs from dependency_libs # (they stay in deplibs) tmp_libs= for i in $dependency_libs ; do case " $predeps $postdeps $compiler_lib_search_path " in *" $i "*) i="" ;; esac if test -n "$i" ; then tmp_libs="$tmp_libs $i" fi done dependency_libs=$tmp_libs done # for pass if test "$linkmode" = prog; then dlfiles="$newdlfiles" fi if test "$linkmode" = prog || test "$linkmode" = lib; then dlprefiles="$newdlprefiles" fi case $linkmode in oldlib) if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then func_warning "\`-dlopen' is ignored for archives" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "\`-l' and \`-L' are ignored for archives" ;; esac test -n "$rpath" && \ func_warning "\`-rpath' is ignored for archives" test -n "$xrpath" && \ func_warning "\`-R' is ignored for archives" test -n "$vinfo" && \ func_warning "\`-version-info/-version-number' is ignored for archives" test -n "$release" && \ func_warning "\`-release' is ignored for archives" test -n "$export_symbols$export_symbols_regex" && \ func_warning "\`-export-symbols' is ignored for archives" # Now set the variables for building old libraries. build_libtool_libs=no oldlibs="$output" objs="$objs$old_deplibs" ;; lib) # Make sure we only generate libraries of the form `libNAME.la'. case $outputname in lib*) func_stripname 'lib' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" ;; *) test "$module" = no && \ func_fatal_help "libtool library \`$output' must begin with \`lib'" if test "$need_lib_prefix" != no; then # Add the "lib" prefix for modules if required func_stripname '' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" else func_stripname '' '.la' "$outputname" libname=$func_stripname_result fi ;; esac if test -n "$objs"; then if test "$deplibs_check_method" != pass_all; then func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs" else $ECHO $ECHO "*** Warning: Linking the shared library $output against the non-libtool" $ECHO "*** objects $objs is not portable!" libobjs="$libobjs $objs" fi fi test "$dlself" != no && \ func_warning "\`-dlopen self' is ignored for libtool libraries" set dummy $rpath shift test "$#" -gt 1 && \ func_warning "ignoring multiple \`-rpath's for a libtool library" install_libdir="$1" oldlibs= if test -z "$rpath"; then if test "$build_libtool_libs" = yes; then # Building a libtool convenience library. # Some compilers have problems with a `.al' extension so # convenience libraries should have the same extension an # archive normally would. oldlibs="$output_objdir/$libname.$libext $oldlibs" build_libtool_libs=convenience build_old_libs=yes fi test -n "$vinfo" && \ func_warning "\`-version-info/-version-number' is ignored for convenience libraries" test -n "$release" && \ func_warning "\`-release' is ignored for convenience libraries" else # Parse the version information argument. save_ifs="$IFS"; IFS=':' set dummy $vinfo 0 0 0 shift IFS="$save_ifs" test -n "$7" && \ func_fatal_help "too many parameters to \`-version-info'" # convert absolute version numbers to libtool ages # this retains compatibility with .la files and attempts # to make the code below a bit more comprehensible case $vinfo_number in yes) number_major="$1" number_minor="$2" number_revision="$3" # # There are really only two kinds -- those that # use the current revision as the major version # and those that subtract age and use age as # a minor version. But, then there is irix # which has an extra 1 added just for fun # case $version_type in darwin|linux|osf|windows|none) func_arith $number_major + $number_minor current=$func_arith_result age="$number_minor" revision="$number_revision" ;; freebsd-aout|freebsd-elf|sunos) current="$number_major" revision="$number_minor" age="0" ;; irix|nonstopux) func_arith $number_major + $number_minor current=$func_arith_result age="$number_minor" revision="$number_minor" lt_irix_increment=no ;; esac ;; no) current="$1" revision="$2" age="$3" ;; esac # Check that each of the things are valid numbers. case $current in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "CURRENT \`$current' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac case $revision in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "REVISION \`$revision' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac case $age in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "AGE \`$age' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac if test "$age" -gt "$current"; then func_error "AGE \`$age' is greater than the current interface number \`$current'" func_fatal_error "\`$vinfo' is not valid version information" fi # Calculate the version variables. major= versuffix= verstring= case $version_type in none) ;; darwin) # Like Linux, but with the current version available in # verstring for coding it into the library header func_arith $current - $age major=.$func_arith_result versuffix="$major.$age.$revision" # Darwin ld doesn't like 0 for these options... func_arith $current + 1 minor_current=$func_arith_result xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" ;; freebsd-aout) major=".$current" versuffix=".$current.$revision"; ;; freebsd-elf) major=".$current" versuffix=".$current" ;; irix | nonstopux) if test "X$lt_irix_increment" = "Xno"; then func_arith $current - $age else func_arith $current - $age + 1 fi major=$func_arith_result case $version_type in nonstopux) verstring_prefix=nonstopux ;; *) verstring_prefix=sgi ;; esac verstring="$verstring_prefix$major.$revision" # Add in all the interfaces that we are compatible with. loop=$revision while test "$loop" -ne 0; do func_arith $revision - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring="$verstring_prefix$major.$iface:$verstring" done # Before this point, $major must not contain `.'. major=.$major versuffix="$major.$revision" ;; linux) func_arith $current - $age major=.$func_arith_result versuffix="$major.$age.$revision" ;; osf) func_arith $current - $age major=.$func_arith_result versuffix=".$current.$age.$revision" verstring="$current.$age.$revision" # Add in all the interfaces that we are compatible with. loop=$age while test "$loop" -ne 0; do func_arith $current - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring="$verstring:${iface}.0" done # Make executables depend on our current version. verstring="$verstring:${current}.0" ;; qnx) major=".$current" versuffix=".$current" ;; sunos) major=".$current" versuffix=".$current.$revision" ;; windows) # Use '-' rather than '.', since we only want one # extension on DOS 8.3 filesystems. func_arith $current - $age major=$func_arith_result versuffix="-$major" ;; *) func_fatal_configuration "unknown library version type \`$version_type'" ;; esac # Clear the version info if we defaulted, and they specified a release. if test -z "$vinfo" && test -n "$release"; then major= case $version_type in darwin) # we can't check for "0.0" in archive_cmds due to quoting # problems, so we reset it completely verstring= ;; *) verstring="0.0" ;; esac if test "$need_version" = no; then versuffix= else versuffix=".0.0" fi fi # Remove version info from name if versioning should be avoided if test "$avoid_version" = yes && test "$need_version" = no; then major= versuffix= verstring="" fi # Check to see if the archive will have undefined symbols. if test "$allow_undefined" = yes; then if test "$allow_undefined_flag" = unsupported; then func_warning "undefined symbols not allowed in $host shared libraries" build_libtool_libs=no build_old_libs=yes fi else # Don't allow undefined symbols. allow_undefined_flag="$no_undefined_flag" fi fi func_generate_dlsyms "$libname" "$libname" "yes" libobjs="$libobjs $symfileobj" test "X$libobjs" = "X " && libobjs= if test "$mode" != relink; then # Remove our outputs, but don't remove object files since they # may have been created when compiling PIC objects. removelist= tempremovelist=`$ECHO "$output_objdir/*"` for p in $tempremovelist; do case $p in *.$objext | *.gcno) ;; $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) if test "X$precious_files_regex" != "X"; then if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 then continue fi fi removelist="$removelist $p" ;; *) ;; esac done test -n "$removelist" && \ func_show_eval "${RM}r \$removelist" fi # Now set the variables for building old libraries. if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then oldlibs="$oldlibs $output_objdir/$libname.$libext" # Transform .lo files to .o files. oldobjs="$objs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP` fi # Eliminate all temporary directories. #for path in $notinst_path; do # lib_search_path=`$ECHO "X$lib_search_path " | $Xsed -e "s% $path % %g"` # deplibs=`$ECHO "X$deplibs " | $Xsed -e "s% -L$path % %g"` # dependency_libs=`$ECHO "X$dependency_libs " | $Xsed -e "s% -L$path % %g"` #done if test -n "$xrpath"; then # If the user specified any rpath flags, then add them. temp_xrpath= for libdir in $xrpath; do temp_xrpath="$temp_xrpath -R$libdir" case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" ;; esac done if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then dependency_libs="$temp_xrpath $dependency_libs" fi fi # Make sure dlfiles contains only unique files that won't be dlpreopened old_dlfiles="$dlfiles" dlfiles= for lib in $old_dlfiles; do case " $dlprefiles $dlfiles " in *" $lib "*) ;; *) dlfiles="$dlfiles $lib" ;; esac done # Make sure dlprefiles contains only unique files old_dlprefiles="$dlprefiles" dlprefiles= for lib in $old_dlprefiles; do case "$dlprefiles " in *" $lib "*) ;; *) dlprefiles="$dlprefiles $lib" ;; esac done if test "$build_libtool_libs" = yes; then if test -n "$rpath"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc*) # these systems don't actually have a c library (as such)! ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C library is in the System framework deplibs="$deplibs System.ltframework" ;; *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work ;; *) # Add libc to deplibs on all other systems if necessary. if test "$build_libtool_need_lc" = "yes"; then deplibs="$deplibs -lc" fi ;; esac fi # Transform deplibs into only deplibs that can be linked in shared. name_save=$name libname_save=$libname release_save=$release versuffix_save=$versuffix major_save=$major # I'm not sure if I'm treating the release correctly. I think # release should show up in the -l (ie -lgmp5) so we don't want to # add it in twice. Is that correct? release="" versuffix="" major="" newdeplibs= droppeddeps=no case $deplibs_check_method in pass_all) # Don't check for shared/static. Everything works. # This might be a little naive. We might want to check # whether the library exists or not. But this is on # osf3 & osf4 and I'm not really sure... Just # implementing what was already the behavior. newdeplibs=$deplibs ;; test_compile) # This code stresses the "libraries are programs" paradigm to its # limits. Maybe even breaks it. We compile a program, linking it # against the deplibs as a proxy for the library. Then we can check # whether they linked in statically or dynamically with ldd. $opt_dry_run || $RM conftest.c cat > conftest.c </dev/null` for potent_lib in $potential_libs; do # Follow soft links. if ls -lLd "$potent_lib" 2>/dev/null | $GREP " -> " >/dev/null; then continue fi # The statement above tries to avoid entering an # endless loop below, in case of cyclic links. # We might still enter an endless loop, since a link # loop can be closed while we follow links, # but so what? potlib="$potent_lib" while test -h "$potlib" 2>/dev/null; do potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` case $potliblink in [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; *) potlib=`$ECHO "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | $SED -e 10q | $EGREP "$file_magic_regex" > /dev/null; then newdeplibs="$newdeplibs $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes $ECHO $ECHO "*** Warning: linker path does not have real file for library $a_deplib." $ECHO "*** I have the capability to make that library automatically link in when" $ECHO "*** you link to this library. But I can only do this if you have a" $ECHO "*** shared version of the library, which you do not appear to have" $ECHO "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $ECHO "*** with $libname but no candidates were found. (...for file magic test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a file magic. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. newdeplibs="$newdeplibs $a_deplib" ;; esac done # Gone through all deplibs. ;; match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` for a_deplib in $deplibs; do case $a_deplib in -l*) func_stripname -l '' "$a_deplib" name=$func_stripname_result if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $a_deplib "*) newdeplibs="$newdeplibs $a_deplib" a_deplib="" ;; esac fi if test -n "$a_deplib" ; then libname=`eval "\\$ECHO \"$libname_spec\""` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do potential_libs=`ls $i/$libname[.-]* 2>/dev/null` for potent_lib in $potential_libs; do potlib="$potent_lib" # see symlink-check above in file_magic test if eval "\$ECHO \"X$potent_lib\"" 2>/dev/null | $Xsed -e 10q | \ $EGREP "$match_pattern_regex" > /dev/null; then newdeplibs="$newdeplibs $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes $ECHO $ECHO "*** Warning: linker path does not have real file for library $a_deplib." $ECHO "*** I have the capability to make that library automatically link in when" $ECHO "*** you link to this library. But I can only do this if you have a" $ECHO "*** shared version of the library, which you do not appear to have" $ECHO "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a regex pattern. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. newdeplibs="$newdeplibs $a_deplib" ;; esac done # Gone through all deplibs. ;; none | unknown | *) newdeplibs="" tmp_deplibs=`$ECHO "X $deplibs" | $Xsed \ -e 's/ -lc$//' -e 's/ -[LR][^ ]*//g'` if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then for i in $predeps $postdeps ; do # can't use Xsed below, because $i might contain '/' tmp_deplibs=`$ECHO "X $tmp_deplibs" | $Xsed -e "s,$i,,"` done fi if $ECHO "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' | $GREP . >/dev/null; then $ECHO if test "X$deplibs_check_method" = "Xnone"; then $ECHO "*** Warning: inter-library dependencies are not supported in this platform." else $ECHO "*** Warning: inter-library dependencies are not known to be supported." fi $ECHO "*** All declared inter-library dependencies are being dropped." droppeddeps=yes fi ;; esac versuffix=$versuffix_save major=$major_save release=$release_save libname=$libname_save name=$name_save case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library with the System framework newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's/ -lc / System.ltframework /'` ;; esac if test "$droppeddeps" = yes; then if test "$module" = yes; then $ECHO $ECHO "*** Warning: libtool could not satisfy all declared inter-library" $ECHO "*** dependencies of module $libname. Therefore, libtool will create" $ECHO "*** a static module, that should work as long as the dlopening" $ECHO "*** application is linked with the -dlopen flag." if test -z "$global_symbol_pipe"; then $ECHO $ECHO "*** However, this would only work if libtool was able to extract symbol" $ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could" $ECHO "*** not find such a program. So, this module is probably useless." $ECHO "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi else $ECHO "*** The inter-library dependencies that have been dropped here will be" $ECHO "*** automatically added whenever a program is linked with this library" $ECHO "*** or is declared to -dlopen it." if test "$allow_undefined" = no; then $ECHO $ECHO "*** Since this library must not contain undefined symbols," $ECHO "*** because either the platform does not support them or" $ECHO "*** it was explicitly requested with -no-undefined," $ECHO "*** libtool will only create a static version of it." if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi fi fi # Done checking deplibs! deplibs=$newdeplibs fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" case $host in *-*-darwin*) newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` new_inherited_linker_flags=`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` deplibs=`$ECHO "X $deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $deplibs " in *" -L$path/$objdir "*) new_libs="$new_libs -L$path/$objdir" ;; esac ;; esac done for deplib in $deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$new_libs $deplib" ;; esac ;; *) new_libs="$new_libs $deplib" ;; esac done deplibs="$new_libs" # All the library-specific variables (install_libdir is set above). library_names= old_library= dlname= # Test again, we may have decided not to build it any more if test "$build_libtool_libs" = yes; then if test "$hardcode_into_libs" = yes; then # Hardcode the library paths hardcode_libdirs= dep_rpath= rpath="$finalize_rpath" test "$mode" != relink && rpath="$compile_rpath$rpath" for libdir in $rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" dep_rpath="$dep_rpath $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) perm_rpath="$perm_rpath $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" if test -n "$hardcode_libdir_flag_spec_ld"; then eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" else eval dep_rpath=\"$hardcode_libdir_flag_spec\" fi fi if test -n "$runpath_var" && test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do rpath="$rpath$dir:" done eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" fi test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" fi shlibpath="$finalize_shlibpath" test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath" if test -n "$shlibpath"; then eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" fi # Get the real and link names of the library. eval shared_ext=\"$shrext_cmds\" eval library_names=\"$library_names_spec\" set dummy $library_names shift realname="$1" shift if test -n "$soname_spec"; then eval soname=\"$soname_spec\" else soname="$realname" fi if test -z "$dlname"; then dlname=$soname fi lib="$output_objdir/$realname" linknames= for link do linknames="$linknames $link" done # Use standard objects if they are pic test -z "$pic_flag" && libobjs=`$ECHO "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` test "X$libobjs" = "X " && libobjs= delfiles= if test -n "$export_symbols" && test -n "$include_expsyms"; then $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" export_symbols="$output_objdir/$libname.uexp" delfiles="$delfiles $export_symbols" fi orig_export_symbols= case $host_os in cygwin* | mingw* | cegcc*) if test -n "$export_symbols" && test -z "$export_symbols_regex"; then # exporting using user supplied symfile if test "x`$SED 1q $export_symbols`" != xEXPORTS; then # and it's NOT already a .def file. Must figure out # which of the given symbols are data symbols and tag # them as such. So, trigger use of export_symbols_cmds. # export_symbols gets reassigned inside the "prepare # the list of exported symbols" if statement, so the # include_expsyms logic still works. orig_export_symbols="$export_symbols" export_symbols= always_export_symbols=yes fi fi ;; esac # Prepare the list of exported symbols if test -z "$export_symbols"; then if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then func_verbose "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $opt_dry_run || $RM $export_symbols cmds=$export_symbols_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" func_len " $cmd" len=$func_len_result if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then func_show_eval "$cmd" 'exit $?' skipped_export=false else # The command line is too long to execute in one step. func_verbose "using reloadable object file for export list..." skipped_export=: # Break out early, otherwise skipped_export may be # set to false by a later but shorter cmd. break fi done IFS="$save_ifs" if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi fi if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols="$export_symbols" test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" $opt_dry_run || eval '$ECHO "X$include_expsyms" | $Xsed | $SP2NL >> "$tmp_export_symbols"' fi if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter delfiles="$delfiles $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi tmp_deplibs= for test_deplib in $deplibs; do case " $convenience " in *" $test_deplib "*) ;; *) tmp_deplibs="$tmp_deplibs $test_deplib" ;; esac done deplibs="$tmp_deplibs" if test -n "$convenience"; then if test -n "$whole_archive_flag_spec" && test "$compiler_needs_object" = yes && test -z "$libobjs"; then # extract the archives, so we have objects to list. # TODO: could optimize this to just extract one archive. whole_archive_flag_spec= fi if test -n "$whole_archive_flag_spec"; then save_libobjs=$libobjs eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= else gentop="$output_objdir/${outputname}x" generated="$generated $gentop" func_extract_archives $gentop $convenience libobjs="$libobjs $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi fi if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" linker_flags="$linker_flags $flag" fi # Make a backup of the uninstalled library when relinking if test "$mode" = relink; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? fi # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then eval test_cmds=\"$module_expsym_cmds\" cmds=$module_expsym_cmds else eval test_cmds=\"$module_cmds\" cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then eval test_cmds=\"$archive_expsym_cmds\" cmds=$archive_expsym_cmds else eval test_cmds=\"$archive_cmds\" cmds=$archive_cmds fi fi if test "X$skipped_export" != "X:" && func_len " $test_cmds" && len=$func_len_result && test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then : else # The command line is too long to link in one step, link piecewise # or, if using GNU ld and skipped_export is not :, use a linker # script. # Save the value of $output and $libobjs because we want to # use them later. If we have whole_archive_flag_spec, we # want to use save_libobjs as it was before # whole_archive_flag_spec was expanded, because we can't # assume the linker understands whole_archive_flag_spec. # This may have to be revisited, in case too many # convenience libraries get linked in and end up exceeding # the spec. if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then save_libobjs=$libobjs fi save_output=$output output_la=`$ECHO "X$output" | $Xsed -e "$basename"` # Clear the reloadable object creation command queue and # initialize k to one. test_cmds= concat_cmds= objlist= last_robj= k=1 if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then output=${output_objdir}/${output_la}.lnkscript func_verbose "creating GNU ld script: $output" $ECHO 'INPUT (' > $output for obj in $save_libobjs do $ECHO "$obj" >> $output done $ECHO ')' >> $output delfiles="$delfiles $output" elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then output=${output_objdir}/${output_la}.lnk func_verbose "creating linker input file list: $output" : > $output set x $save_libobjs shift firstobj= if test "$compiler_needs_object" = yes; then firstobj="$1 " shift fi for obj do $ECHO "$obj" >> $output done delfiles="$delfiles $output" output=$firstobj\"$file_list_spec$output\" else if test -n "$save_libobjs"; then func_verbose "creating reloadable object files..." output=$output_objdir/$output_la-${k}.$objext eval test_cmds=\"$reload_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 # Loop over the list of objects to be linked. for obj in $save_libobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result if test "X$objlist" = X || test "$len" -lt "$max_cmd_len"; then func_append objlist " $obj" else # The command $test_cmds is almost too long, add a # command to the queue. if test "$k" -eq 1 ; then # The first file doesn't have a previous command to add. eval concat_cmds=\"$reload_cmds $objlist $last_robj\" else # All subsequent reloadable object files will link in # the last one created. eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj~\$RM $last_robj\" fi last_robj=$output_objdir/$output_la-${k}.$objext func_arith $k + 1 k=$func_arith_result output=$output_objdir/$output_la-${k}.$objext objlist=$obj func_len " $last_robj" func_arith $len0 + $func_len_result len=$func_arith_result fi done # Handle the remaining objects by creating one last # reloadable object file. All subsequent reloadable object # files will link in the last one created. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\" if test -n "$last_robj"; then eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\" fi delfiles="$delfiles $output" else output= fi if ${skipped_export-false}; then func_verbose "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $opt_dry_run || $RM $export_symbols libobjs=$output # Append the command to create the export file. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" fi fi test -n "$save_libobjs" && func_verbose "creating a temporary reloadable object file: $output" # Loop through the commands generated above and execute them. save_ifs="$IFS"; IFS='~' for cmd in $concat_cmds; do IFS="$save_ifs" $opt_silent || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS="$save_ifs" if test -n "$export_symbols_regex" && ${skipped_export-false}; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi if ${skipped_export-false}; then if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols="$export_symbols" test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" $opt_dry_run || eval '$ECHO "X$include_expsyms" | $Xsed | $SP2NL >> "$tmp_export_symbols"' fi if test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter delfiles="$delfiles $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi fi libobjs=$output # Restore the value of output. output=$save_output if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= fi # Expand the library linking commands again to reset the # value of $libobjs for piecewise linking. # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then cmds=$module_expsym_cmds else cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then cmds=$archive_expsym_cmds else cmds=$archive_cmds fi fi fi if test -n "$delfiles"; then # Append the command to remove temporary files to $cmds. eval cmds=\"\$cmds~\$RM $delfiles\" fi # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop="$output_objdir/${outputname}x" generated="$generated $gentop" func_extract_archives $gentop $dlprefiles libobjs="$libobjs $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $opt_silent || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS="$save_ifs" # Restore the uninstalled library and exit if test "$mode" = relink; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? if test -n "$convenience"; then if test -z "$whole_archive_flag_spec"; then func_show_eval '${RM}r "$gentop"' fi fi exit $EXIT_SUCCESS fi # Create links to the real library. for linkname in $linknames; do if test "$realname" != "$linkname"; then func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?' fi done # If -module or -export-dynamic was specified, set the dlname. if test "$module" = yes || test "$export_dynamic" = yes; then # On all known operating systems, these are identical. dlname="$soname" fi fi ;; obj) if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then func_warning "\`-dlopen' is ignored for objects" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "\`-l' and \`-L' are ignored for objects" ;; esac test -n "$rpath" && \ func_warning "\`-rpath' is ignored for objects" test -n "$xrpath" && \ func_warning "\`-R' is ignored for objects" test -n "$vinfo" && \ func_warning "\`-version-info' is ignored for objects" test -n "$release" && \ func_warning "\`-release' is ignored for objects" case $output in *.lo) test -n "$objs$old_deplibs" && \ func_fatal_error "cannot build library object \`$output' from non-libtool objects" libobj=$output func_lo2o "$libobj" obj=$func_lo2o_result ;; *) libobj= obj="$output" ;; esac # Delete the old objects. $opt_dry_run || $RM $obj $libobj # Objects from convenience libraries. This assumes # single-version convenience libraries. Whenever we create # different ones for PIC/non-PIC, this we'll have to duplicate # the extraction. reload_conv_objs= gentop= # reload_cmds runs $LD directly, so let us get rid of # -Wl from whole_archive_flag_spec and hope we can get by with # turning comma into space.. wl= if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" reload_conv_objs=$reload_objs\ `$ECHO "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'` else gentop="$output_objdir/${obj}x" generated="$generated $gentop" func_extract_archives $gentop $convenience reload_conv_objs="$reload_objs $func_extract_archives_result" fi fi # Create the old-style object. reload_objs="$objs$old_deplibs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test output="$obj" func_execute_cmds "$reload_cmds" 'exit $?' # Exit if we aren't doing a library object file. if test -z "$libobj"; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS fi if test "$build_libtool_libs" != yes; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi # Create an invalid libtool object if no PIC, so that we don't # accidentally link it into a program. # $show "echo timestamp > $libobj" # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? exit $EXIT_SUCCESS fi if test -n "$pic_flag" || test "$pic_mode" != default; then # Only do commands if we really have different PIC objects. reload_objs="$libobjs $reload_conv_objs" output="$libobj" func_execute_cmds "$reload_cmds" 'exit $?' fi if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS ;; prog) case $host in *cygwin*) func_stripname '' '.exe' "$output" output=$func_stripname_result.exe;; esac test -n "$vinfo" && \ func_warning "\`-version-info' is ignored for programs" test -n "$release" && \ func_warning "\`-release' is ignored for programs" test "$preload" = yes \ && test "$dlopen_support" = unknown \ && test "$dlopen_self" = unknown \ && test "$dlopen_self_static" = unknown && \ func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support." case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'` finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'` ;; esac case $host in *-*-darwin*) # Don't allow lazy linking, it breaks C++ global constructors # But is supposedly fixed on 10.4 or later (yay!). if test "$tagname" = CXX ; then case ${MACOSX_DEPLOYMENT_TARGET-10.0} in 10.[0123]) compile_command="$compile_command ${wl}-bind_at_load" finalize_command="$finalize_command ${wl}-bind_at_load" ;; esac fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $compile_deplibs " in *" -L$path/$objdir "*) new_libs="$new_libs -L$path/$objdir" ;; esac ;; esac done for deplib in $compile_deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$new_libs $deplib" ;; esac ;; *) new_libs="$new_libs $deplib" ;; esac done compile_deplibs="$new_libs" compile_command="$compile_command $compile_deplibs" finalize_command="$finalize_command $finalize_deplibs" if test -n "$rpath$xrpath"; then # If the user specified any rpath flags, then add them. for libdir in $rpath $xrpath; do # This is the magic to use -rpath. case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" ;; esac done fi # Now hardcode the library paths rpath= hardcode_libdirs= for libdir in $compile_rpath $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" rpath="$rpath $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) perm_rpath="$perm_rpath $libdir" ;; esac fi case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$libdir:"*) ;; ::) dllsearchpath=$libdir;; *) dllsearchpath="$dllsearchpath:$libdir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) dllsearchpath="$dllsearchpath:$testbindir";; esac ;; esac done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi compile_rpath="$rpath" rpath= hardcode_libdirs= for libdir in $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" rpath="$rpath $flag" fi elif test -n "$runpath_var"; then case "$finalize_perm_rpath " in *" $libdir "*) ;; *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi finalize_rpath="$rpath" if test -n "$libobjs" && test "$build_old_libs" = yes; then # Transform all the library objects into standard objects. compile_command=`$ECHO "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` finalize_command=`$ECHO "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` fi func_generate_dlsyms "$outputname" "@PROGRAM@" "no" # template prelinking step if test -n "$prelink_cmds"; then func_execute_cmds "$prelink_cmds" 'exit $?' fi wrappers_required=yes case $host in *cygwin* | *mingw* ) if test "$build_libtool_libs" != yes; then wrappers_required=no fi ;; *cegcc) # Disable wrappers for cegcc, we are cross compiling anyway. wrappers_required=no ;; *) if test "$need_relink" = no || test "$build_libtool_libs" != yes; then wrappers_required=no fi ;; esac if test "$wrappers_required" = no; then # Replace the output file specification. compile_command=`$ECHO "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` link_command="$compile_command$compile_rpath" # We have no uninstalled library dependencies, so finalize right now. exit_status=0 func_show_eval "$link_command" 'exit_status=$?' # Delete the generated files. if test -f "$output_objdir/${outputname}S.${objext}"; then func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"' fi exit $exit_status fi if test -n "$compile_shlibpath$finalize_shlibpath"; then compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" fi if test -n "$finalize_shlibpath"; then finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" fi compile_var= finalize_var= if test -n "$runpath_var"; then if test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do rpath="$rpath$dir:" done compile_var="$runpath_var=\"$rpath\$$runpath_var\" " fi if test -n "$finalize_perm_rpath"; then # We should set the runpath_var. rpath= for dir in $finalize_perm_rpath; do rpath="$rpath$dir:" done finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " fi fi if test "$no_install" = yes; then # We don't need to create a wrapper script. link_command="$compile_var$compile_command$compile_rpath" # Replace the output file specification. link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` # Delete the old output file. $opt_dry_run || $RM $output # Link the executable and exit func_show_eval "$link_command" 'exit $?' exit $EXIT_SUCCESS fi if test "$hardcode_action" = relink; then # Fast installation is not supported link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" func_warning "this platform does not like uninstalled shared libraries" func_warning "\`$output' will be relinked during installation" else if test "$fast_install" != no; then link_command="$finalize_var$compile_command$finalize_rpath" if test "$fast_install" = yes; then relink_command=`$ECHO "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'` else # fast_install is set to needless relink_command= fi else link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" fi fi # Replace the output file specification. link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` # Delete the old output files. $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname func_show_eval "$link_command" 'exit $?' # Now create the wrapper script. func_verbose "creating $output" # Quote the relink command for shipping. if test -n "$relink_command"; then # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done relink_command="(cd `pwd`; $relink_command)" relink_command=`$ECHO "X$relink_command" | $Xsed -e "$sed_quote_subst"` fi # Quote $ECHO for shipping. if test "X$ECHO" = "X$SHELL $progpath --fallback-echo"; then case $progpath in [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";; *) qecho="$SHELL `pwd`/$progpath --fallback-echo";; esac qecho=`$ECHO "X$qecho" | $Xsed -e "$sed_quote_subst"` else qecho=`$ECHO "X$ECHO" | $Xsed -e "$sed_quote_subst"` fi # Only actually do things if not in dry run mode. $opt_dry_run || { # win32 will think the script is a binary if it has # a .exe suffix, so we strip it off here. case $output in *.exe) func_stripname '' '.exe' "$output" output=$func_stripname_result ;; esac # test for cygwin because mv fails w/o .exe extensions case $host in *cygwin*) exeext=.exe func_stripname '' '.exe' "$outputname" outputname=$func_stripname_result ;; *) exeext= ;; esac case $host in *cygwin* | *mingw* ) func_dirname_and_basename "$output" "" "." output_name=$func_basename_result output_path=$func_dirname_result cwrappersource="$output_path/$objdir/lt-$output_name.c" cwrapper="$output_path/$output_name.exe" $RM $cwrappersource $cwrapper trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 func_emit_cwrapperexe_src > $cwrappersource # The wrapper executable is built using the $host compiler, # because it contains $host paths and files. If cross- # compiling, it, like the target executable, must be # executed on the $host or under an emulation environment. $opt_dry_run || { $LTCC $LTCFLAGS -o $cwrapper $cwrappersource $STRIP $cwrapper } # Now, create the wrapper script for func_source use: func_ltwrapper_scriptname $cwrapper $RM $func_ltwrapper_scriptname_result trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 $opt_dry_run || { # note: this script will not be executed, so do not chmod. if test "x$build" = "x$host" ; then $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result else func_emit_wrapper no > $func_ltwrapper_scriptname_result fi } ;; * ) $RM $output trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 func_emit_wrapper no > $output chmod +x $output ;; esac } exit $EXIT_SUCCESS ;; esac # See if we need to build an old-fashioned archive. for oldlib in $oldlibs; do if test "$build_libtool_libs" = convenience; then oldobjs="$libobjs_save $symfileobj" addlibs="$convenience" build_libtool_libs=no else if test "$build_libtool_libs" = module; then oldobjs="$libobjs_save" build_libtool_libs=no else oldobjs="$old_deplibs $non_pic_objects" if test "$preload" = yes && test -f "$symfileobj"; then oldobjs="$oldobjs $symfileobj" fi fi addlibs="$old_convenience" fi if test -n "$addlibs"; then gentop="$output_objdir/${outputname}x" generated="$generated $gentop" func_extract_archives $gentop $addlibs oldobjs="$oldobjs $func_extract_archives_result" fi # Do each command in the archive commands. if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then cmds=$old_archive_from_new_cmds else # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop="$output_objdir/${outputname}x" generated="$generated $gentop" func_extract_archives $gentop $dlprefiles oldobjs="$oldobjs $func_extract_archives_result" fi # POSIX demands no paths to be encoded in archives. We have # to avoid creating archives with duplicate basenames if we # might have to extract them afterwards, e.g., when creating a # static archive out of a convenience library, or when linking # the entirety of a libtool archive into another (currently # not supported by libtool). if (for obj in $oldobjs do func_basename "$obj" $ECHO "$func_basename_result" done | sort | sort -uc >/dev/null 2>&1); then : else $ECHO "copying selected object files to avoid basename conflicts..." gentop="$output_objdir/${outputname}x" generated="$generated $gentop" func_mkdir_p "$gentop" save_oldobjs=$oldobjs oldobjs= counter=1 for obj in $save_oldobjs do func_basename "$obj" objbase="$func_basename_result" case " $oldobjs " in " ") oldobjs=$obj ;; *[\ /]"$objbase "*) while :; do # Make sure we don't pick an alternate name that also # overlaps. newobj=lt$counter-$objbase func_arith $counter + 1 counter=$func_arith_result case " $oldobjs " in *[\ /]"$newobj "*) ;; *) if test ! -f "$gentop/$newobj"; then break; fi ;; esac done func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" oldobjs="$oldobjs $gentop/$newobj" ;; *) oldobjs="$oldobjs $obj" ;; esac done fi eval cmds=\"$old_archive_cmds\" func_len " $cmds" len=$func_len_result if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then cmds=$old_archive_cmds else # the command line is too long to link in one step, link in parts func_verbose "using piecewise archive linking..." save_RANLIB=$RANLIB RANLIB=: objlist= concat_cmds= save_oldobjs=$oldobjs oldobjs= # Is there a better way of finding the last object in the list? for obj in $save_oldobjs do last_oldobj=$obj done eval test_cmds=\"$old_archive_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 for obj in $save_oldobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result func_append objlist " $obj" if test "$len" -lt "$max_cmd_len"; then : else # the above command should be used before it gets too long oldobjs=$objlist if test "$obj" = "$last_oldobj" ; then RANLIB=$save_RANLIB fi test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" objlist= len=$len0 fi done RANLIB=$save_RANLIB oldobjs=$objlist if test "X$oldobjs" = "X" ; then eval cmds=\"\$concat_cmds\" else eval cmds=\"\$concat_cmds~\$old_archive_cmds\" fi fi fi func_execute_cmds "$cmds" 'exit $?' done test -n "$generated" && \ func_show_eval "${RM}r$generated" # Now create the libtool archive. case $output in *.la) old_library= test "$build_old_libs" = yes && old_library="$libname.$libext" func_verbose "creating $output" # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done # Quote the link command for shipping. relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" relink_command=`$ECHO "X$relink_command" | $Xsed -e "$sed_quote_subst"` if test "$hardcode_automatic" = yes ; then relink_command= fi # Only create the output if not a dry run. $opt_dry_run || { for installed in no yes; do if test "$installed" = yes; then if test -z "$install_libdir"; then break fi output="$output_objdir/$outputname"i # Replace all uninstalled libtool libraries with the installed ones newdependency_libs= for deplib in $dependency_libs; do case $deplib in *.la) func_basename "$deplib" name="$func_basename_result" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` test -z "$libdir" && \ func_fatal_error "\`$deplib' is not a valid libtool archive" newdependency_libs="$newdependency_libs $libdir/$name" ;; *) newdependency_libs="$newdependency_libs $deplib" ;; esac done dependency_libs="$newdependency_libs" newdlfiles= for lib in $dlfiles; do case $lib in *.la) func_basename "$lib" name="$func_basename_result" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "\`$lib' is not a valid libtool archive" newdlfiles="$newdlfiles $libdir/$name" ;; *) newdlfiles="$newdlfiles $lib" ;; esac done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in *.la) # Only pass preopened files to the pseudo-archive (for # eventual linking with the app. that links it) if we # didn't already link the preopened objects directly into # the library: func_basename "$lib" name="$func_basename_result" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "\`$lib' is not a valid libtool archive" newdlprefiles="$newdlprefiles $libdir/$name" ;; esac done dlprefiles="$newdlprefiles" else newdlfiles= for lib in $dlfiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac newdlfiles="$newdlfiles $abs" done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac newdlprefiles="$newdlprefiles $abs" done dlprefiles="$newdlprefiles" fi $RM $output # place dlname in correct position for cygwin tdlname=$dlname case $host,$output,$installed,$module,$dlname in *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; esac $ECHO > $output "\ # $outputname - a libtool library file # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION # # Please DO NOT delete this file! # It is necessary for linking the library. # The name that we can dlopen(3). dlname='$tdlname' # Names of this library. library_names='$library_names' # The name of the static archive. old_library='$old_library' # Linker flags that can not go in dependency_libs. inherited_linker_flags='$new_inherited_linker_flags' # Libraries that this one depends upon. dependency_libs='$dependency_libs' # Names of additional weak libraries provided by this library weak_library_names='$weak_libs' # Version information for $libname. current=$current age=$age revision=$revision # Is this an already installed library? installed=$installed # Should we warn about portability when linking against -modules? shouldnotlink=$module # Files to dlopen/dlpreopen dlopen='$dlfiles' dlpreopen='$dlprefiles' # Directory that this library needs to be installed in: libdir='$install_libdir'" if test "$installed" = no && test "$need_relink" = yes; then $ECHO >> $output "\ relink_command=\"$relink_command\"" fi done } # Do a symbolic link so that the libtool archive can be found in # LD_LIBRARY_PATH before the program is installed. func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?' ;; esac exit $EXIT_SUCCESS } { test "$mode" = link || test "$mode" = relink; } && func_mode_link ${1+"$@"} # func_mode_uninstall arg... func_mode_uninstall () { $opt_debug RM="$nonopt" files= rmforce= exit_status=0 # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" for arg do case $arg in -f) RM="$RM $arg"; rmforce=yes ;; -*) RM="$RM $arg" ;; *) files="$files $arg" ;; esac done test -z "$RM" && \ func_fatal_help "you must specify an RM program" rmdirs= origobjdir="$objdir" for file in $files; do func_dirname "$file" "" "." dir="$func_dirname_result" if test "X$dir" = X.; then objdir="$origobjdir" else objdir="$dir/$origobjdir" fi func_basename "$file" name="$func_basename_result" test "$mode" = uninstall && objdir="$dir" # Remember objdir for removal later, being careful to avoid duplicates if test "$mode" = clean; then case " $rmdirs " in *" $objdir "*) ;; *) rmdirs="$rmdirs $objdir" ;; esac fi # Don't error if the file doesn't exist and rm -f was used. if { test -L "$file"; } >/dev/null 2>&1 || { test -h "$file"; } >/dev/null 2>&1 || test -f "$file"; then : elif test -d "$file"; then exit_status=1 continue elif test "$rmforce" = yes; then continue fi rmfiles="$file" case $name in *.la) # Possibly a libtool archive, so verify it. if func_lalib_p "$file"; then func_source $dir/$name # Delete the libtool libraries and symlinks. for n in $library_names; do rmfiles="$rmfiles $objdir/$n" done test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" case "$mode" in clean) case " $library_names " in # " " in the beginning catches empty $dlname *" $dlname "*) ;; *) rmfiles="$rmfiles $objdir/$dlname" ;; esac test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" ;; uninstall) if test -n "$library_names"; then # Do each command in the postuninstall commands. func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' fi if test -n "$old_library"; then # Do each command in the old_postuninstall commands. func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' fi # FIXME: should reinstall the best remaining shared library. ;; esac fi ;; *.lo) # Possibly a libtool object, so verify it. if func_lalib_p "$file"; then # Read the .lo file func_source $dir/$name # Add PIC object to the list of files to remove. if test -n "$pic_object" && test "$pic_object" != none; then rmfiles="$rmfiles $dir/$pic_object" fi # Add non-PIC object to the list of files to remove. if test -n "$non_pic_object" && test "$non_pic_object" != none; then rmfiles="$rmfiles $dir/$non_pic_object" fi fi ;; *) if test "$mode" = clean ; then noexename=$name case $file in *.exe) func_stripname '' '.exe' "$file" file=$func_stripname_result func_stripname '' '.exe' "$name" noexename=$func_stripname_result # $file with .exe has already been added to rmfiles, # add $file without .exe rmfiles="$rmfiles $file" ;; esac # Do a test to see if this is a libtool program. if func_ltwrapper_p "$file"; then if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" relink_command= func_source $func_ltwrapper_scriptname_result rmfiles="$rmfiles $func_ltwrapper_scriptname_result" else relink_command= func_source $dir/$noexename fi # note $name still contains .exe if it was in $file originally # as does the version of $file that was added into $rmfiles rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" if test "$fast_install" = yes && test -n "$relink_command"; then rmfiles="$rmfiles $objdir/lt-$name" fi if test "X$noexename" != "X$name" ; then rmfiles="$rmfiles $objdir/lt-${noexename}.c" fi fi fi ;; esac func_show_eval "$RM $rmfiles" 'exit_status=1' done objdir="$origobjdir" # Try to remove the ${objdir}s in the directories where we deleted files for dir in $rmdirs; do if test -d "$dir"; then func_show_eval "rmdir $dir >/dev/null 2>&1" fi done exit $exit_status } { test "$mode" = uninstall || test "$mode" = clean; } && func_mode_uninstall ${1+"$@"} test -z "$mode" && { help="$generic_help" func_fatal_help "you must specify a MODE" } test -z "$exec_cmd" && \ func_fatal_help "invalid operation mode \`$mode'" if test -n "$exec_cmd"; then eval exec "$exec_cmd" exit $EXIT_FAILURE fi exit $exit_status # The TAGs below are defined such that we never get into a situation # in which we disable both kinds of libraries. Given conflicting # choices, we go for a static library, that is the most portable, # since we can't tell whether shared libraries were disabled because # the user asked for that or because the platform doesn't support # them. This is particularly important on AIX, because we don't # support having both static and shared libraries enabled at the same # time on that platform, so we default to a shared-only configuration. # If a disable-shared tag is given, we'll fallback to a static-only # configuration. But we'll never go from static-only to shared-only. # ### BEGIN LIBTOOL TAG CONFIG: disable-shared build_libtool_libs=no build_old_libs=yes # ### END LIBTOOL TAG CONFIG: disable-shared # ### BEGIN LIBTOOL TAG CONFIG: disable-static build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` # ### END LIBTOOL TAG CONFIG: disable-static # Local Variables: # mode:shell-script # sh-indentation:2 # End: # vi:sw=2 blcr-0.8.5/config/config.sub0000755000000000000000000010316712102070007012562 00000000000000#! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 # Free Software Foundation, Inc. timestamp='2009-11-20' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software # can handle that machine. It does not imply ALL GNU software can. # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA # 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Please send patches to . Submit a context # diff and a properly formatted 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 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \ uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ kopensolaris*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray | -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*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ | fido | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64octeon | mips64octeonel \ | mips64orion | mips64orionel \ | mips64r5900 | mips64r5900el \ | mips64vr | mips64vrel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | moxie \ | mt \ | msp430 \ | nios | nios2 \ | ns16k | ns32k \ | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ | 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 | strongarm \ | tahoe | thumb | tic4x | tic80 | tron \ | ubicom32 \ | v850 | v850e \ | we32k \ | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown ;; m6811 | m68hc11 | m6812 | m68hc12 | picochip) # Motorola 68HC11/12. basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; ms1) basic_machine=mt-unknown ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | 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-* \ | nios-* | nios2-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ | 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-* | strongarm-* | sv1-* | sx?-* \ | tahoe-* | thumb-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \ | tron-* \ | ubicom32-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-* | z80-*) ;; # Recognize the basic CPU types without company name, with glob match. xtensa*) basic_machine=$basic_machine-unknown ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aros) basic_machine=i386-pc os=-aros ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; blackfin) basic_machine=bfin-unknown os=-linux ;; blackfin-*) basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; bluegene*) basic_machine=powerpc-ibm os=-cnk ;; c90) basic_machine=c90-cray os=-unicos ;; cegcc) basic_machine=arm-unknown os=-cegcc ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16) basic_machine=cr16-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; dicos) basic_machine=i686-pc os=-dicos ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; # I'm not sure what "Sysv32" means. Should this be sysv3.2? i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; m68knommu) basic_machine=m68k-unknown os=-linux ;; m68knommu-*) basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; 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-/'` ;; mvs) basic_machine=i370-ibm os=-mvs ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; parisc) basic_machine=hppa-unknown os=-linux ;; parisc-*) basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pc98) basic_machine=i386-pc ;; pc98-*) basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc) basic_machine=powerpc-unknown ;; ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rdos) basic_machine=i386-pc os=-rdos ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sde) basic_machine=mipsisa32-sde os=-elf ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh5el) basic_machine=sh5le-unknown ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tic54x | c54x*) basic_machine=tic54x-unknown os=-coff ;; tic55x | c55x*) basic_machine=tic55x-unknown os=-coff ;; tic6x | c6x*) basic_machine=tic6x-unknown os=-coff ;; tile*) basic_machine=tile-unknown os=-linux-gnu ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; z80-*-coff) basic_machine=z80-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -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* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -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 ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in score-*) os=-elf ;; spu-*) os=-elf ;; *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 # This also exists in the configure program, but was not the # default. # os=-sunos4 ;; m68*-cisco) os=-aout ;; mep-*) os=-elf ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-haiku) os=-haiku ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -cnk*|-aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: blcr-0.8.5/config/config.guess0000755000000000000000000012761512102070007013123 00000000000000#! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 # Free Software Foundation, Inc. timestamp='2009-11-20' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA # 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Per Bothner. Please send patches (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 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ; set_cc_for_build= ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; *:SolidBSD:*:*) echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} exit ;; macppc:MirBSD:*:*) echo powerpc-unknown-mirbsd${UNAME_RELEASE} exit ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE="alpha" ;; "EV4.5 (21064)") UNAME_MACHINE="alpha" ;; "LCA4 (21066/21068)") UNAME_MACHINE="alpha" ;; "EV5 (21164)") UNAME_MACHINE="alphaev5" ;; "EV5.6 (21164A)") UNAME_MACHINE="alphaev56" ;; "EV5.6 (21164PC)") UNAME_MACHINE="alphapca56" ;; "EV5.7 (21164PC)") UNAME_MACHINE="alphapca57" ;; "EV6 (21264)") UNAME_MACHINE="alphaev6" ;; "EV6.7 (21264A)") UNAME_MACHINE="alphaev67" ;; "EV6.8CB (21264C)") UNAME_MACHINE="alphaev68" ;; "EV6.8AL (21264B)") UNAME_MACHINE="alphaev68" ;; "EV6.8CX (21264D)") UNAME_MACHINE="alphaev68" ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE="alphaev69" ;; "EV7 (21364)") UNAME_MACHINE="alphaev7" ;; "EV7.9 (21364A)") UNAME_MACHINE="alphaev79" ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` exit ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit ;; *:OS400:*:*) echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; arm:riscos:*:*|arm:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; s390x:SunOS:*:*) echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; i86pc: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-unknown-mint${UNAME_RELEASE} exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`$dummy $dummyarg` && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos${UNAME_RELEASE} exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` then echo "$SYSTEM_NAME" else echo rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit ;; *:AIX:*:[456]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ ${HP_ARCH} = "hppa2.0w" ] then eval $set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) case ${UNAME_MACHINE} in pc98) echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; *:Interix*:*) case ${UNAME_MACHINE} in x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; authenticamd | genuineintel | EM64T) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; IA64) echo ia64-unknown-interix${UNAME_RELEASE} exit ;; esac ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; 8664:Windows_NT:*) echo x86_64-pc-mks exit ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} exit ;; arm*:Linux:*:*) eval $set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then echo ${UNAME_MACHINE}-unknown-linux-gnu else echo ${UNAME_MACHINE}-unknown-linux-gnueabi fi exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; cris:Linux:*:*) echo cris-axis-linux-gnu exit ;; crisv32:Linux:*:*) echo crisv32-axis-linux-gnu exit ;; frv:Linux:*:*) echo frv-unknown-linux-gnu exit ;; 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}-unknown-linux-gnu exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; mips:Linux:*:* | mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef ${UNAME_MACHINE} #undef ${UNAME_MACHINE}el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=${UNAME_MACHINE}el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=${UNAME_MACHINE} #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; or32:Linux:*:*) echo or32-unknown-linux-gnu exit ;; padre:Linux:*:*) echo sparc-unknown-linux-gnu exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-gnu exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-gnu ;; PA8*) echo hppa2.0-unknown-linux-gnu ;; *) echo hppa-unknown-linux-gnu ;; esac exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-gnu exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-gnu exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-gnu exit ;; x86_64:Linux:*:*) echo x86_64-unknown-linux-gnu exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configury will decide that # this is a cross-build. echo i586-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo ${UNAME_MACHINE}-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. echo i586-pc-haiku exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit ;; SX-7:SUPER-UX:*:*) echo sx7-nec-superux${UNAME_RELEASE} exit ;; SX-8:SUPER-UX:*:*) echo sx8-nec-superux${UNAME_RELEASE} exit ;; SX-8R:SUPER-UX:*:*) echo sx8r-nec-superux${UNAME_RELEASE} exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown case $UNAME_PROCESSOR in 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 ;; NSE-?:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit ;; *:ITS:*:*) echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' exit ;; i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos exit ;; i*86:AROS:*:*) echo ${UNAME_MACHINE}-pc-aros exit ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 eval $set_cc_for_build cat >$dummy.c < # include #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (__arm) && defined (__acorn) && defined (__unix) printf ("arm-acorn-riscix\n"); exit (0); #endif #if defined (hp300) && !defined (hpux) printf ("m68k-hp-bsd\n"); exit (0); #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) # if !defined (ultrix) # include # if defined (BSD) # if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); # else # if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); # else printf ("vax-dec-bsd\n"); exit (0); # endif # endif # else printf ("vax-dec-bsd\n"); exit (0); # endif # else printf ("vax-dec-ultrix\n"); exit (0); # endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } # Convex versions that predate uname can use getsysinfo(1) if [ -x /usr/convex/getsysinfo ] then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd exit ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; c34*) echo c34-convex-bsd exit ;; c38*) echo c38-convex-bsd exit ;; c4*) echo c4-convex-bsd exit ;; esac fi cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: blcr-0.8.5/config/missing0000755000000000000000000002623312102070007012174 00000000000000#! /bin/sh # Common stub for a few missing GNU programs while installing. scriptversion=2009-04-28.21; # UTC # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006, # 2008, 2009 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 tar try tar, gnutar, gtar, then tar without non-portable flags 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. ;; tar*) if test -n "$run"; then echo 1>&2 "ERROR: \`tar' requires --run" exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then exit 1 fi ;; *) 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 ;; tar*) shift # We have already tried tar in the generic part. # Look for gnutar/gtar before invocation to avoid ugly error # messages. if (gnutar --version > /dev/null 2>&1); then gnutar "$@" && exit 0 fi if (gtar --version > /dev/null 2>&1); then gtar "$@" && exit 0 fi firstarg="$1" if shift; then case $firstarg in *o*) firstarg=`echo "$firstarg" | sed s/o//` tar "$firstarg" "$@" && exit 0 ;; esac case $firstarg in *h*) firstarg=`echo "$firstarg" | sed s/h//` tar "$firstarg" "$@" && exit 0 ;; esac fi echo 1>&2 "\ WARNING: I can't seem to be able to run \`tar' with the given arguments. You may want to install GNU tar or Free paxutils, or check the command line arguments." exit 1 ;; *) 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: blcr-0.8.5/config/depcomp0000755000000000000000000004426712102070007012161 00000000000000#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2009-04-28.21; # UTC # Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009 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 outputing dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac 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 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 ' ' ' ' < "$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. ## 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" ;; 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 ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ tr ' ' ' ' >> "$depfile" echo >> "$depfile" # The second pass generates a dummy entry for each header file. tr ' ' ' ' < "$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" ;; 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" # That's a tab and a space in the []. sed -e 's,^.*\.[a-z]*:[ ]*,,' -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 understands `-MD -MF file'. However on # icc -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 ... \ # ... "$@" -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 "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp2) # The "hp" stanza above does not work with aCC (C++) and HP's ia64 # compilers, which have integrated preprocessors. The correct option # to use with these is +Maked; it writes dependencies to a file named # 'foo.d', which lands next to the object file, wherever that # happens to be. # Much of this is similar to the tru64 case; see comments there. 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" # That's a tab and a space in the []. sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; #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:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" tr ' ' ' ' < "$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" cat < "$tmpdepfile" > "$depfile" sed '1,2d' "$tmpdepfile" | tr ' ' ' ' | \ ## 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:: \1 \\:p' >> "$depfile" echo " " >> "$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: blcr-0.8.5/config/cross_helper.c0000664000000000000000000003155511055320533013446 00000000000000/* * Instructions for building BLCR with a cross-compiler. * * NOTE: Cross-compilation of BLCR is experimental at this point and may * not always go smoothly. We are currently considering only systems for * which the cross-compilation tool-chain has been installed in what we * believe is a "standard" manner (tool-chain executables prefixed with * a host-tuple recognized by config.sub). * * We welcome your feedback on how these instructions and/or the script * output by this program can be made more general and more robust. * * In the instructions that follow, we use "Target" to refer to the platform * on which you plan to run BLCR and "Build" to refer to the platform on * which you plan to compile BLCR. * * We recommend you read all the steps before you begin following any of them. * * 1. "Build the cross-helper program" * This file is a C source file. On Build, compile it with the cross- * compiler, using the options you need/want to pass at configure time (to * get the same ABI, libc version, etc.). Examples of options to pass * include "-m64" if using a biarch compiler that defaults to 32-bit. * Unless you dissable (see below) CHECK_LINUXTHREADS, you will need to * pass -lpthread to link correctly. * If your compilation fails with errors, you may need to disable building * one or more of the tests. To do so, try changing the CHECK_* settings * below to disable the problematic test(s). However, if you do so you'll * need some other way to determine the test result. So, you'll probably * want to contact us at checkpoint@lbl.gov for assistance. * * 2. "Run the cross-helper program" * Run the built program on Target, saving the output to a file in the top- * level BLCR source directory on Build. Getting the executable from * Build to Target and the output file back to Build are up to you - we * have no way to portably automate this. * In what follows, we'll assume you've named the file "cross-configure", * but any name is fine. However, it is crucial that the file be saved * in the top-level source directory (the same directory that contains * "configure"). * * 3. "Edit the cross-configure script" * Edit the new cross-configure script for completeness, fixing anything * you can identify as incorrect and adding manually-determined answers * for any CHECK_* settings you disabled in step #1. * Look for the string "%MISSING%" to identify anything that is required * before you can move to the next step. * The one thing you will always need to supply is the Target type. * If using a standard installation of a gcc cross compiler, then the * type string is the prefix of the cross-compiler, minus the final * hyphen. For instance, if in step #1 you build this file using * i586-redhat-linux-gcc, then TARGET_TYPE should be "i586-redhat-linux". * * 4. "Make the cross-configure script executable" * chmod +x cross-configure * * 5. "Satisfy the build prerequisites" * Ensure that you have, on the Build system, configured kernel source * for the Target system as described in doc/html/BLCR_Admin_Guide.html * and in the FAQ entry "What if I my kernel sources are unconfigured?" * in doc/html/FAQ/html. You will also need, on the Build system, either * the "System.map" file or the "vmlinux" file from the Target's kernel. * If you need to use the instructions in the FAQ to configure your kernel * sources, then you'll need to replace "make" in those instructions with * "make ARCH= CROSS_COMPILE=". * * 6. "Prepare configure options" * Read the BLCR Admin Guide (in doc/html) to understand what options you * want or need to pass to "configure", but don't run configure directly! * In the next step we'll run the newly create "cross-configure" script * instead. In this step just determine the options you'll need. * + You must provide the option --with-linux=[DIR] and one of either * --with-system-map=[FILE] or --with-vmlinux=[FILE]. Otherwise the * configure logic will default to trying to use the currently running * kernel on the Build machine! * + When considering a value for --prefix (or any other options that will * determine placement of BLCR files), specify the values as they will * appear in the Target's filesystem regardless of if/how they may appear * on the Build machine. * + If you want to build a BLCR test suite runnable on Target, include * --enable-testsuite in your options (see the step "Running the tests on * Target", below, for more details on this). We recommend this option. * + If in step 1 you passed any compiler flags to control ABI, then we * recommend that you add them to the definition of CC. For instance, * for a biarch compiler defaulting to 32-bits, you might pass * CC='ppc-linux-gcc -m64' on the cross-configure command line. * * 7. "Run the cross-configure script" * On Build, run "cross-configure" with the options you determined in * the previous step. * * 8. "Compile BLCR" * On Build, run "make" to build BLCR using the cross tool-chain. * Don't run "make install" yet; it is covered in the steps that follow. * Don't try to run "make insmod" or "make check" on Build, since they * use binaries that have been built for Target. However, you may * optionally run "make tests" on the Build machine to compile (but not * run) the test programs, though if you configured with --enable-testsuite * then they will be compiled by default. * * 9. "Installing BLCR (part 1 of 3)" * When considering --prefix and related configure options above, we told * you to consider only the paths as they appear in the filesystem of the * Target system. This is important because some of these paths get encoded * in the programs and/or libraries. However, the next step is to run * the installation step on Build. So, now we will assume that you have * one of two situations. If your situation falls somewhere in between, * then we recommend using case B. * A) The Target filesystem is mounted (writable) on the Build machine, * rooted at some single prefix such as /export/example. * B) The Target filesystem is not mounted on the Build machine. * On Build, run "make install DESTDIR=" where the value of * is your mount point for case A, or any empty directory of your choosing * for case B (something like /tmp/blcr-destdir is a good choice). * * 10. "Installing BLCR (part 2 of 3)" * If your system fell into case A of the previous step, then your files * are now present on the Target filesystem. If your system fell into case * B, then you now must use some mechanism of your choice to copy all the * files in the chosen DESTDIR to the Target filesystem. You can then * remove the temporary directory you used for DESTDIR. * * 11. "Installing BLCR (part 3 of 3)" * You should now connect to Target, and continue the steps in the BLCR * Admin Guide for "Loading the Kernel Modules", "Updating ld.so.cache" * and "Configuring Users' Environments". * * 12. [OPTIONAL] "Running the tests on Target" * Note that while releases prior to 0.8.0 required "perl" on Target to * run most of the tests, that is no longer the case. * There are two possible ways to run the BLCR test suite on Target: * A) "Option 1 - cross compilation" * If you passed "--enable-testsuite" to the cross-configure script, * then you will find a script named "RUN_ME" installed in * "$prefix/libexec/blcr-testsuite" on Target. Once you have loaded the * kernel modules and setup your environment correctly (LD_LIBRARY_PATH * in particular), on Target, you can execute "RUN_ME" to run the same * testsuite that "make check" runs in a native build. * A message like * ERROR: ld.so: object 'libcr.so.0' from LD_PRELOAD cannot be preloaded: ignored. * is a sign that you have not set LD_LIBRARY_PATH correctly, or if you * installed in a "system directory" it may mean you need to run * "ldconfig" as root to update /etc/ld.so.cache. * If you are concerned over disk space, you may safely remove the * blcr-testsuite directory when you are done with it - no other parts * of BLCR depend on it existing. * B) "Option 2 - native compilation" * If you have a native tool-chain for compilation on Target you also * have the option to configure BLCR on Target to build only the * testsuite. To do so, run * "configure --with-installed-util --with-installed-modules \ * --with-installed-libcr" * on Target, adding any --prefix or related options passed to the * cross-configure script on Build. However, you don't need to pass * the --with-linux, --with-system-map or --with-vmlinux options. * When invoked this way, configure will do only a minimum amount of * work, far less than when configuring for a full build with the * kernel modules. You can then run "make -C tests check" to build * and run the testsuite (without the lengthy build of the library * and kernel modules). * * 13. [OPTIONAL] "BLCR Manual pages" * Because of the way BLCR generates its man pages, cross-compiled builds * don't have man pages. If you need/want man pages on the Target system, * then you can build BLCR natively on any system of your choosing and * manually copy the resulting man pages to Target. There are no platform- * specific elements to the man pages. * * * $Id: cross_helper.c,v 1.10 2008/08/27 18:47:55 phargrov Exp $ */ /* BEGIN CHECK_* variables for optional configuration. */ #define CHECK_STACK_DIRECTION 1 #define CHECK_SIGNUM 1 #define CHECK_LINUXTHREADS 1 /* END optional configuration. * If you think you need to modify anything below this line, * then please contact us at checkpoint@lbl.gov. * */ #include #include #ifndef CHECK_STACK_DIRECTION #define CHECK_STACK_DIRECTION 1 #endif #ifndef CHECK_SIGNUM #define CHECK_SIGNUM 1 #endif #ifndef CHECK_LINUXTHREADS #define CHECK_LINUXTHREADS 1 #endif static void die(const char *msg) { fprintf(stderr, msg); exit(1); } #if CHECK_STACK_DIRECTION static void cross_stack_direction(void) { static char *addr = 0; auto char dummy; if (addr == 0) { addr = &dummy; cross_stack_direction(); return; } printf("cross_stack_direction=%d\n", (&dummy > addr) ? 1 : -1); } #else static void cross_stack_direction(void) { printf("cross_stack_direction=%%MISSING%%\n"); } #endif #if CHECK_SIGNUM extern int __libc_allocate_rtsig(int); static void cross_signum(void) { int i = __libc_allocate_rtsig(0); if (i <= 0) die("Unable to determine CR_SIGNUM\n"); printf("cross_signum=%d\n", i); } #else static void cross_signum(void) { printf("cross_signum=%%MISSING%%\n"); } #endif #if CHECK_LINUXTHREADS #include #include #include static void *thread_pid(void *arg) { return (void *)(long)getpid(); } static void cross_linuxthreads(void) { pthread_t th; void *join_val; if (0 != pthread_create(&th, NULL, &thread_pid, NULL)) { die("Error calling pthread_create()\n"); } if (0 != pthread_join(th, &join_val)) { die("Error calling pthread_join()\n"); } printf("cross_linuxthreads=%i\n", (long)join_val != (long)getpid()); } #else static void cross_linuxthreads(void) { printf("cross_linuxthreads=%%MISSING%%\n"); } #endif static void print_header(void) { puts( "# Automatically-generated file for cross-configuration of BLCR.\n" "# You will always need to perform at least some manual editing.\n" "# So, see the file \"cross_helper.c\" for instructions.\n" "\n" "# You always need to set this one manually.\n" "TARGET_TYPE=%MISSING%\n" "\n" ); } static void print_trailer(void) { puts( "extra_conf_args=\"cross_signum=$cross_signum cross_stack_direction=$cross_stack_direction cross_linuxthreads=$cross_linuxthreads cross_linuxthreads_static=$cross_linuxthreads_static\"\n" "\n" "srcdir=`dirname $0`\n" "if test ! -f \"$srcdir/configure\" ; then\n" " echo \"The script $0 must be in the same directory as the configure script.\"\n" " exit 1\n" "fi\n" "${srcdir}/configure --host=$TARGET_TYPE --program-prefix='' $extra_conf_args \"$@\"\n" ); } int main(void) { print_header(); cross_stack_direction(); cross_signum(); cross_linuxthreads(); puts( "\n" "# ONLY if configuring with --enable-static or --disable-shared, you'll need to\n" "# set cross_linuxthreads_static on the following line. The value to use can be\n" "# taken from the cross_linuxthreads value output by a version of the \"cross_helper\"\n" "# compiled with -static.\n" "# If NOT passing --enable-static or --disable-shared at configure time, this\n" "# value will be unused and need not be set.\n" "cross_linuxthreads_static=%MISSING%\n" "\n" ); print_trailer(); return 0; } blcr-0.8.5/LICENSE.txt0000664000000000000000000000135612064450414011167 00000000000000Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) 2012, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy). All rights reserved. Portions may be copyrighted by others, as may be noted in specific copyright notices within specific files. Use is permitted under the terms of either the GPL or LGPL as specified in the license.txt file contained each directory. Specifically, the library libcr and its associated source and header files are covered by the LGPL, while all remaining files are covered by the GPL. You will find copies of the GPL and LGPL licenses in the files COPYING and COPYING.LIB, respectively. blcr-0.8.5/Makefile.am0000664000000000000000000001372012064133244011375 00000000000000### # Optional directories ### # Example init script if CR_BUILD_ETC etc_dir = etc endif # Kernel modules if CR_BUILD_MODULES module_dirs = blcr_imports cr_module module_blcr = @TOP_BUILDDIR@/cr_module/kbuild/blcr.ko module_imports = @TOP_BUILDDIR@/blcr_imports/kbuild/blcr_imports.ko endif # Libraries if CR_BUILD_LIBCR libcr_dirs = libcr endif # User-space utils if CR_BUILD_UTIL util_dirs = util man endif # Tests if CR_BUILD_TESTS tests_dirs = tests endif # Contrib if CR_BUILD_CONTRIB contrib_dirs = contrib endif # cr_info is disabled since vmadcheck is currently broken -PHH 12.5.03 if BUILD_CR_INFO cr_info=cr_info else cr_info= endif if CRI_DEBUG cr_ktrace_mask = 0xffff cr_read_fault_rate = 0 cr_write_fault_rate = 0 insmod_blcr_args = \ cr_ktrace_mask=$(cr_ktrace_mask) \ cr_read_fault_rate=$(cr_read_fault_rate) \ cr_write_fault_rate=$(cr_write_fault_rate) endif # Never build as part of 'all', 'check' or 'install', but may be built manually. NOAUTO_DIRS = examples rpm doc # include comes first to ensure up-to-date headers for all later steps # module_dirs preceedes . due to _depmod rule # libcr_dirs preceedes util_dirs to ensure up-to-date libs for the utils SUBDIRS = include $(module_dirs) $(libcr_dirs) $(util_dirs) \ $(etc_dir) $(tests_dirs) $(contrib_dirs) . # Automake has been observed to build DIST_SUBDIRS incorrectly, so we build it DIST_SUBDIRS = man include libcr util tests contrib etc \ blcr_imports cr_module vmadump4 $(NOAUTO_DIRS) EXTRA_DIST = README README.devel LICENSE.txt COPYING COPYING.LIB NEWS \ config/kbuild.mak.in config/cross_helper.c autogen.sh \ README.FTB # Clean out CVS droppings dist-hook: find $(distdir) -depth -name CVS -type d -exec rm -Rf '{}' \; find $(distdir) -name .#\* -type f -exec rm -f '{}' \; # PHH 07_Dec_2004: disabled, since our dist_blcr script does even more # We want to check that our RPM building works #distcheck-hook: # $(MAKE) $(AM_MAKEFLAGS) -C rpm $@ # Target to build the source rpm for distribution, creating the # source tarball (blcr-X.Y.Z.tar.gz) as a prereq. dist-srpm: $(MAKE) $(AM_MAKEFLAGS) -C rpm srpm # Target to build source and binary rpms rpms: $(MAKE) $(AM_MAKEFLAGS) -C rpm all if CR_BUILD_MODULES # Target to build the kernel modules modules: $(CONFIG_HEADER) $(MAKE) $(AM_MAKEFLAGS) --no-print-directory -C include for dir in $(module_dirs); do \ $(MAKE) $(AM_MAKEFLAGS) --no-print-directory -C $$dir || exit 1; \ done # Target to build and check the kernel modules against System.map _depmod: # No rebuild of modules @@LINUX_SYMTAB_CMD@ | env NM='$(NM)' @PERL@ -- $(srcdir)/contrib/cr_depmod $(module_imports) $(module_blcr) >.depmod.err 2>&1; \ rc=$$?; \ if test $$rc '!=' 0; then \ echo "ERROR: 'depmod' check FAILED (rc=$$rc)"; \ cat .depmod.err; \ else \ echo "'depmod' check PASSED"; \ fi >&2; \ rm -f .depmod.err; \ exit $$rc depmod: modules @$(MAKE) $(AM_MAKEFLAGS) _$@ # For strong dependency ordering w/ -j SUDO = $(shell [ `id -u ` = 0 ] || echo sudo) # Targets to (un)load the kernel modules # NOTE: we rmmod blcr_vmadump in case of upgrade from 0.7.X rmmod: if /sbin/lsmod | grep '^blcr ' > /dev/null 2>&1; then $(SUDO) /sbin/rmmod blcr; fi if /sbin/lsmod | grep '^blcr_vmadump ' > /dev/null 2>&1; then $(SUDO) /sbin/rmmod blcr_vmadump; fi if /sbin/lsmod | grep '^blcr_imports ' > /dev/null 2>&1; then $(SUDO) /sbin/rmmod blcr_imports; fi _insmod: rmmod # No rebuild of modules or depmod check $(SUDO) /sbin/insmod $(module_imports) $(insmod_imports_args) $(SUDO) /sbin/insmod $(module_blcr) $(insmod_blcr_args) insmod: depmod @$(MAKE) $(AM_MAKEFLAGS) _$@ # For strong dependency ordering w/ -j module_phony = modules _depmod depmod _insmod insmod rmmod # Reconfigure if the kernel config, version or symbol table have changed # or if our imports template has changed CONFIG_STATUS_DEPENDENCIES = \ @LINUX_OBJ@/.config \ @LINUX_VERSION_H@ \ @LINUX_SYMTAB_FILE@ \ @TOP_SRCDIR@/include/blcr_imports.h.in # Check module dependencies at end of build all_local_depmod = _depmod endif # Convenience util libcr examples: $(MAKE) $(AM_MAKEFLAGS) -C $@ all tests: $(MAKE) $(AM_MAKEFLAGS) -C $@ all $@ if test -d libcr32/$@; then $(MAKE) $(AM_MAKEFLAGS) -C libcr32/$@ all $@; fi bonus-tests: $(MAKE) $(AM_MAKEFLAGS) -C tests all $@ bonus-check: $(MAKE) $(AM_MAKEFLAGS) all $(MAKE) $(AM_MAKEFLAGS) -C tests bonus-check if test -d libcr32/tests; then $(MAKE) $(AM_MAKEFLAGS) -C libcr32 check; fi if CR_INSTALLED_UTIL symlinks: mkdir -p bin for f in cr_checkpoint cr_restart cr_run $(cr_info); do \ test -h bin/$$f || ln -s $(bindir)/$$f bin/; \ done else symlinks: mkdir -p bin for f in cr_checkpoint cr_restart cr_run $(cr_info); do \ test -h bin/$$f || ln -s @TOP_BUILDDIR@/util/$$f/$$f bin/; \ done endif # Local hooks/extensions clean-local: @for dir in $(NOAUTO_DIRS); do \ test -f $$dir/Makefile && $(MAKE) $(AM_MAKEFLAGS) -C $$dir clean; \ done; true if test -d libcr32; then $(MAKE) $(AM_MAKEFLAGS) -C libcr32 clean; fi all-local: symlinks if test -d libcr32; then $(MAKE) $(AM_MAKEFLAGS) -C libcr32 all; fi if test -n "$(all_local_depmod)"; then $(MAKE) $(AM_MAKEFLAGS) $(all_local_depmod); fi check-local: if test -d libcr32; then $(MAKE) $(AM_MAKEFLAGS) libcr util; fi if test -d libcr32; then $(MAKE) $(AM_MAKEFLAGS) -C libcr32 check; fi install-data-local: if test -d libcr32; then $(MAKE) $(AM_MAKEFLAGS) -C libcr32 install-data; fi install-exec-local: if test -d libcr32; then $(MAKE) $(AM_MAKEFLAGS) -C libcr32 install-exec; fi uninstall-local: if test -d libcr32; then $(MAKE) $(AM_MAKEFLAGS) -C libcr32 uninstall; fi -if test -d "$(DESTDIR)@CR_MODULE_DIR@"; then rmdir "$(DESTDIR)@CR_MODULE_DIR@"; fi distclean-local: rm -rf libcr32 bin # Our rpm specfile wants to query some vars LINUX_VER=@LINUX_VER@ LINUX_SRC=@LINUX_SRC@ echoval: @echo $($(VARNAME)) | sed 's/"/\\"/'g .PHONY: dist-srpm dist-oscar rpms examples util libcr tests bonus-check echoval $(module_phony) DISTCLEANFILES = .import_decls .import_calls .cached_kconfig .cached_ksymtab blcr-0.8.5/tests/0000755000000000000000000000000012102072124010546 500000000000000blcr-0.8.5/tests/pid_restore.c0000664000000000000000000001334411060300042013153 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2008, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * 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 * * $Id: pid_restore.c,v 1.3 2008/09/05 18:53:22 phargrov Exp $ */ #define _LARGEFILE64_SOURCE 1 // For O_LARGEFILE #define _XOPEN_SOURCE 500 // for getsid() #define _BSD_SOURCE 1 // for setlinebuf() #include #include #include #include #include #include #include #include #include #include "libcr.h" #include "crut_util.h" #ifndef O_LARGEFILE #define O_LARGEFILE 0 #endif static const char *chkpt_cmd = NULL; static const char *rstrt_cmd = NULL; static const char *filename = NULL; static int check_ids(int orig) { int result = 0; #if 0 // glibc caching polutes the result int pid = getpid(); #else int pid = syscall(SYS_getpid); #endif int pgid = getpgrp(); int sid = getsid(0); if (pid == orig) result |= CR_RSTRT_RESTORE_PID; if (pgid == orig) result |= CR_RSTRT_RESTORE_PGID; if (sid == orig) result |= CR_RSTRT_RESTORE_SID; return result; } static volatile int cb_ran = 0; static int child_cb(void *arg) { cb_ran = 1; return 0; } static int child_main(void) { int pid = getpid(); cr_client_id_t my_id = cr_init(); cr_callback_id_t cb_id = cr_register_callback(child_cb, NULL, CR_SIGNAL_CONTEXT); if (my_id < 0) { printf("XXX cr_init() failed, returning %d\n", my_id); return -1; } if (cb_id < 0) { printf("XXX cr_register_callbask() failed, returning %d\n", cb_id); return -1; } if (setsid() < 0) { printf("XXX setsid() failed\n"); return -1; } while (!cb_ran) sched_yield(); return check_ids(pid) + EBUSY + 1; // Ensure no accidental collision w/ EBUSY } static void do_checkpoint(int count, int pid) { char *cmd; int rc; cmd = crut_aprintf("exec %s --file %s --pid %d", chkpt_cmd, filename, pid); rc = system(cmd); if ((rc < 0) || !WIFEXITED(rc) || WEXITSTATUS(rc)) { printf("XXX system(%s) failed (%d)\n", cmd, rc); exit(-1); } else { printf("%03d cr_checkpoint OK\n", count); } free(cmd); } static void do_restart(int count, int orig_pid, int pid_opt, int pgid_opt, int sid_opt) { cr_restart_args_t args; cr_restart_handle_t handle; int flags; int rc; int fd; int pid; flags = pid_opt ? CR_RSTRT_RESTORE_PID : 0; flags |= pgid_opt ? CR_RSTRT_RESTORE_PGID : 0; flags |= sid_opt ? CR_RSTRT_RESTORE_SID : 0; fd = open(filename, O_RDONLY|O_LARGEFILE); if (fd < 0) { perror("XXX open(context_file) failed"); } cr_initialize_restart_args_t(&args); args.cr_fd = fd; args.cr_flags &= ~(CR_RSTRT_RESTORE_PID|CR_RSTRT_RESTORE_PGID|CR_RSTRT_RESTORE_SID); args.cr_flags |= flags; rc = cr_request_restart(&args, &handle); if (rc < 0) { printf("XXX: cr_restart_request() failed: %s", cr_strerror(errno)); } rc = cr_poll_restart(&handle, NULL); if (rc < 0) { printf("XXX: cr_poll_request() failed: %s", cr_strerror(errno)); } pid = rc; if (pid_opt) { if (pid != orig_pid) { printf("XXX restart w/ flags=0x%x has the wrong pid\n", flags); } } else { if (pid == orig_pid) { printf("XXX restart w/ flags=0x%x unexpectedly has the original pid\n", flags); } } crut_waitpid_expect(pid, EBUSY + 1 + flags); printf("%03d restart w/ flags=0x%x produced the expected result\n", count, flags); } int main(int argc, char * const argv[]) { cr_client_id_t my_id; int my_pid = getpid(); int pid; int count, i, j, k; setlinebuf(stdout); /* Intialize our globals */ chkpt_cmd = crut_find_cmd(argv[0], "cr_checkpoint"); rstrt_cmd = crut_find_cmd(argv[0], "cr_restart"); printf("000 Process started with pid %d\n", my_pid); printf("#ST_ALARM:120\n"); my_id = cr_init(); if (my_id < 0) { printf("XXX cr_init() failed, returning %d\n", my_id); exit(-1); } else { printf("001 cr_init() succeeded\n"); } pid = fork(); if (!pid) { /* In the child */ exit(child_main()); } else if (pid < 0) { printf("XXX fork() failed\n"); exit(-1); } printf("002 child started with pid %d\n", pid); filename = crut_aprintf("context.%d", pid); do_checkpoint(3, pid); alarm(20); crut_waitpid_expect(pid, EBUSY + 1 + (CR_RSTRT_RESTORE_PID|CR_RSTRT_RESTORE_PGID|CR_RSTRT_RESTORE_SID)); alarm(0); printf("004 child with pid %d terminated\n", pid); /* Tests all 8 possible combinations */ count = 5; for (i=0; i<2; ++i) { for (j=0; j<2; ++j) { for (k=0; k<2; ++k) { do_restart(count++, pid, i, j, k); } } } (void)unlink(filename); // might fail silently printf("%03d DONE\n", count); return 0; } blcr-0.8.5/tests/stage0003.c0000664000000000000000000001200011156265612012251 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2008, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * 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 * * $Id: stage0003.c,v 1.13.12.1 2009/03/12 20:07:38 phargrov Exp $ */ const char description[] = "Description of tests/Stage0003:\n" "\n" "This test verifies the basic 'Stage III' functionality of both libcr and the\n" "blcr.o kernel module:\n" " + Externally initiated checkpoint of process group (runs cr_checkpoint utility).\n" ; #include #include #include #include #include #include #include #include #include #include #include "crut_util.h" static volatile int done = 0; enum { CHILD_MAIN = 0, PARENT_PRE, PARENT_POST, CHILD_PRE, CHILD_POST }; static int parent_signal_callback(void *arg) { struct crut_pipes *pipes = arg; int rc; printf("002 callback running in parent\n"); fflush(stdout); crut_pipes_putchar(pipes, PARENT_PRE); crut_pipes_expect(pipes, CHILD_PRE); printf("004 callback recv PRE ack from child\n"); fflush(stdout); rc = cr_checkpoint(0); if (rc == 0) { printf("005 callback continuing in parent\n"); fflush(stdout); crut_pipes_putchar(pipes, PARENT_POST); crut_pipes_expect(pipes, CHILD_POST); printf("007 callback recv POST ack from child\n"); fflush(stdout); } /* Pthreads not safe in signal context: use a volatile int */ done = 1; return 0; } static int child_signal_callback(void *arg) { struct crut_pipes *pipes = arg; int rc; crut_pipes_expect(pipes, PARENT_PRE); printf("003 child recv PRE from parent\n"); fflush(stdout); crut_pipes_putchar(pipes, CHILD_PRE); rc = cr_checkpoint(0); if (rc == 0) { crut_pipes_expect(pipes, PARENT_POST); printf("006 child recv POST from parent\n"); fflush(stdout); crut_pipes_putchar(pipes, CHILD_POST); } /* Pthreads not safe in signal context: use a volatile int */ done = 1; return 0; } int child_main(struct crut_pipes *pipes) { printf("001 Child process started with pid %d\n", getpid()); fflush(stdout); (void)cr_init(); (void)cr_register_callback(child_signal_callback, pipes, CR_SIGNAL_CONTEXT); crut_pipes_putchar(pipes, CHILD_MAIN); while (!done) { sched_yield(); } /* Pthreads not safe in signal context */ exit(0); } int main(int argc, char **argv) { struct crut_pipes *pipes = malloc(sizeof(*pipes)); pid_t child2; struct stat s; char *filename; int pgid; int rc; crut_program_name = argv[0]; /* For crut output */ setlinebuf(stdout); (void)cr_init(); printf("000 Parent process started with pid %d\n", getpid()); printf("#ST_ALARM:120\n"); fflush(stdout); crut_block_sigttou(); setpgid(0,0); pgid = getpgrp(); if (!crut_pipes_fork(pipes)) { child_main(pipes); exit(-1); } (void)cr_register_callback(parent_signal_callback, pipes, CR_SIGNAL_CONTEXT); crut_pipes_expect(pipes, CHILD_MAIN); child2 = fork(); if (child2 == 0) { const char *cmd = crut_find_cmd(argv[0], "cr_checkpoint"); const char arg1[] = "-g"; char *arg2; setpgid(0,0); arg2 = crut_aprintf("%d", pgid); execlp(cmd, cmd, arg1, arg2, NULL); printf("XXX child2 failed to execl()\n"); exit(-1); } else if (child2 < 0) { printf("XXX main failed second fork()\n"); exit(-1); } while (!done) { sched_yield(); } /* Pthreads not safe in signal context */ crut_waitpid_expect(child2, 0); crut_waitpid_expect(pipes->child, 0); filename = crut_aprintf("context.%d", pgid); rc = stat(filename, &s); if (rc < 0) { printf("XXX failed to stat() %s\n", filename); exit(-1); } else if (s.st_size == 0) { printf("XXX failed to stat() %s\n", filename); exit(-1); } else { printf("008 %s has size %lu\n", filename, (unsigned long)s.st_size); } (void)unlink(filename); // might fail silently free(filename); printf("009 DONE\n"); return 0; } blcr-0.8.5/tests/save_share.sh0000664000000000000000000000047711011503203013147 00000000000000#!/bin/sh set -e . ${cr_testsdir:-`dirname $0`}/shellinit context=Context1 # cp -f ${cr_testsdir}/save_aux tstexe trap "\rm -f $context tstexe tstmap[12] 2>/dev/null" 0 rm -f tstmap[12] ${cr_run} ./tstexe "--file $context --clobber --save-shared" S # Unlink unlink mmap()ed file rm -f tstmap[12] ${cr_restart} $context blcr-0.8.5/tests/mosml_test.sh0000664000000000000000000000201211047112665013221 00000000000000#!/bin/sh # # Test of checkpoint/restart of a mosml script. # Note that the outer script is bourne shell # Check for mosml (mosml -quietdec /dev/null) || exit 77 . ${cr_testsdir:-`dirname $0`}/shellinit \rm -f Context[12] .Context[12].tmp 2>/dev/null echo '#ST_ALARM:120' exec 2>/dev/null # Drop job control message(s) $cr_run mosml -quietdec <<-'__EOF__' 2>&1 & load "Int"; load "Process"; let val itoa = Int.toString; fun sleep x = Process.system("sleep " ^ (itoa x)) fun greet x = (if x > 0 then ignore (greet(x - 1); sleep 1) else (); print ((itoa x) ^ " Hello\n")) in greet 9 end; quit() __EOF__ sleep 3; echo "# Checkpoint original child" $cr_checkpoint --file=Context1 --tree --term $! 2>&1 wait; sleep 1; echo "# Restart 1" $cr_restart Context1 2>&1 & sleep 3; echo "# Checkpoint restarted child" $cr_checkpoint --file=Context2 --tree --term $! 2>&1 wait; sleep 1; echo "# Restart^2" exec 2>&1 $cr_restart Context2 echo "10 DONE" \rm -f Context[12] .Context[12].tmp 2>/dev/null blcr-0.8.5/tests/guile_test.sh0000664000000000000000000000217311005167617013210 00000000000000#!/bin/sh # First check that we *have* guile guile -c '(quit)' || exit 77 . ${cr_testsdir:-`dirname $0`}/shellinit \rm -f Context[123] .Context[123].tmp 2>/dev/null exec 2>/dev/null # To drop job control messages echo '#ST_ALARM:120' # Alas, (format) is not portable across guile versions $cr_run guile -c ' (define greet (lambda (n) (if (< n 10) (begin (display n)(display " Hello\n")(force-output) (sleep 1) (greet (+ n 1)))))) (greet 0) (display "# Checkpoint self\n")(force-output) (system (string-append (getenv "cr_checkpoint") " --file=Context3 --term --tree " (number->string (getpid)))) (display "11 DONE\n") (quit)' 2>&1 & pid=$! sleep 3 echo "# Checkpoint original child" $cr_checkpoint --file=Context1 --term $pid 2>&1 wait sleep 1 echo "# Restart 1" $cr_restart Context1 2>&1 & pid=$! sleep 3 echo "# Checkpoint restarted child" $cr_checkpoint --file=Context2 --term --tree $pid 2>&1 wait sleep 1 echo "# Restart^2" $cr_restart Context2 2>&1 & pid=$! wait echo "10 Restart interpreter" $cr_restart Context3 2>&1 \rm -f Context[123] .Context[123].tmp 2>/dev/null blcr-0.8.5/tests/ptrace.c0000664000000000000000000001466411122032350012123 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2007, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * 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 * * $Id: ptrace.c,v 1.13 2008/12/16 23:08:24 phargrov Exp $ */ /* Tests interaction w/ ptrace */ #include #include #include #include #include #include #include #include "libcr.h" #include "crut_util.h" static char *filename; const char *chkpt_cmd; enum { MSG_CHILD_READY = 42, MSG_TEST_ALLOW, MSG_TEST_DONE, TEST_EXIT_VAL }; // count+1 static void check_exit(struct crut_pipes *pipes, int count) { crut_pipes_putchar(pipes, MSG_TEST_DONE); crut_waitpid_expect(pipes->child, TEST_EXIT_VAL); printf("%03d child %d completed\n", count, pipes->child); crut_pipes_close(pipes); } // Wait for our direct child to stop static int wait_child_stop(int child) { int rc, status; do { rc = waitpid(child, &status, WUNTRACED); } while ((rc < 0) && (errno == EINTR)); if ((rc > 0) && WIFSTOPPED(status)) { return WSTOPSIG(status); } else { printf("XXX waitpid(%d,...) failed rc=%d errno=%d status=%d\n", child, rc, errno, status); kill(child, SIGKILL); exit(1); } return -1; } static void detach_child(int child) { int rc; rc = ptrace(PTRACE_CONT, child, NULL, 0); if (rc < 0) { printf("XXX ptrace(PTRACE_CONT,%d,...) failed\n", child); exit(1); } rc = wait_child_stop(child); rc = ptrace(PTRACE_DETACH, child, NULL, rc); if (rc < 0) { printf("XXX ptrace(PTRACE_DETACH,%d,...) failed\n", child); exit(1); } } int child_main(struct crut_pipes *pipes) { crut_pipes_putchar(pipes, MSG_CHILD_READY); crut_pipes_expect(pipes, MSG_TEST_DONE); return TEST_EXIT_VAL; } int parent_main(struct crut_pipes *pipes, int traced) { int rc; rc = ptrace(PTRACE_ATTACH, traced, NULL, 0); if (rc < 0) { printf("XXX ptrace(PTRACE_ATTACH,%d,...) failed\n", traced); } (void)wait_child_stop(traced); crut_pipes_putchar(pipes, MSG_CHILD_READY); /* This is to detach on --ptraced-allow */ crut_pipes_expect(pipes, MSG_TEST_ALLOW); detach_child(traced); crut_pipes_expect(pipes, MSG_TEST_DONE); return TEST_EXIT_VAL; } static void checkpoint(int pid, const char *arg, int status, int count) { char *cmd = NULL; int rc; printf("#ST_ALARM:10\n"); cmd = crut_aprintf("exec %s --pid --file %s %s --quiet %d", chkpt_cmd, filename, arg, pid); rc = system(cmd); if (!WIFEXITED(rc)) { printf("XXX system(%s) unexpectedly failed\n", cmd); } else if ((unsigned char)WEXITSTATUS(rc) != (unsigned char)status) { printf("XXX system(%s) unexpectedly exited with %d\n", cmd, WEXITSTATUS(rc)); } else { printf("%03d cr_checkpoint(%d, \"%s\") exited with expected code %d\n", count, pid, arg, WEXITSTATUS(rc)); } free(cmd); } // count+2 static int launch_children(struct crut_pipes *pipes, int count) { int traced, tracer; /* The traced child */ traced = crut_pipes_fork(pipes+0); if (!traced) { exit(child_main(pipes+0)); } crut_pipes_expect(pipes+0, MSG_CHILD_READY); printf("%03d ptrace child %d is READY\n", count++, traced); /* The tracing child */ tracer = crut_pipes_fork(pipes+1); if (!tracer) { exit(parent_main(pipes+1,traced)); } crut_pipes_expect(pipes+1, MSG_CHILD_READY); printf("%03d ptrace parent %d is READY\n", count++, tracer); return 2; } int main(int argc, char * const argv[]) { int count = 0; int mypid = getpid(); struct crut_pipes pipes[2]; int parent, child; setlinebuf(stdout); printf("%03d Process started with pid %d\n", count++, mypid); filename = crut_aprintf("context.%d", mypid); chkpt_cmd = crut_find_cmd(argv[0], "cr_checkpoint"); count += launch_children(pipes, count); child = pipes[0].child; parent = pipes[1].child; /* Check for expected basic error cases */ checkpoint(child, "", CR_EPTRACED, count++); checkpoint(child, "--ptraced-error", CR_EPTRACED, count++); checkpoint(parent, "", CR_EPTRACER, count++); checkpoint(parent, "--ptracer-error", CR_EPTRACER, count++); /* Check for skip options */ checkpoint(child, "--ptraced-skip", ESRCH, count++); checkpoint(child, "--ptracer-skip", CR_EPTRACED, count++); checkpoint(parent, "--ptraced-skip", CR_EPTRACER, count++); checkpoint(parent, "--ptracer-skip", ESRCH, count++); /* Check for the allow option */ checkpoint(parent, "--ptraced-allow", CR_EPTRACER, count++); crut_pipes_putchar(pipes+1, MSG_TEST_ALLOW); checkpoint(child, "--ptraced-allow", 0, count++); // parent is waiting to PTRACE_DETACH /* Sanity check, all should pass since no longer ptraced or tracing */ checkpoint(child, "", 0, count++); checkpoint(child, "--ptraced-error", 0, count++); checkpoint(child, "--ptraced-skip", 0, count++); checkpoint(child, "--ptraced-allow", 0, count++); checkpoint(child, "--ptracer-error", 0, count++); checkpoint(child, "--ptracer-skip", 0, count++); checkpoint(parent, "", 0, count++); checkpoint(parent, "--ptraced-error", 0, count++); checkpoint(parent, "--ptraced-skip", 0, count++); checkpoint(parent, "--ptraced-allow", 0, count++); checkpoint(parent, "--ptracer-error", 0, count++); checkpoint(parent, "--ptracer-skip", 0, count++); check_exit(pipes+0, count++); check_exit(pipes+1, count++); printf("%03d DONE\n", count); (void)unlink(filename); return 0; } blcr-0.8.5/tests/forward.c0000664000000000000000000006123611056065765012334 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2003, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * 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 * * $Id: forward.c,v 1.7 2008/08/29 21:36:53 phargrov Exp $ * * Simple example for using crut */ #define _GNU_SOURCE /* To get prototype for getpgid() */ #include #include #include #include #include #include #include #include #include #include #include "crut.h" #include "crut_util.h" #include "libcr.h" /* * What this test is supposed to do. * * 1. Make sure that checkpoint is sent to child * a. From parent -- phase 1 handler * b. From parent -- phase 2 handler * 2. Ensure that the child handlers are run * a. No handlers (XXX: not implemented.) * b. Phase 1 handler * c. Phase 2 handler * 3. Test all the scope arguments * PROC, PGRP, SESS, and TREE XXX: Session not implemented. * 4. Can we test the task merging? * 5. Test that we abort correctly if propagating to nothing * 6. Test abort if we propagate to something that's checkpointing * 7. Make SURE that forwarding to YOURSELF doesn't send you into an infinite * loop! * 8. See what happens if we forward to something that isn't checkpointable */ enum child_state { child_started=1, child_waiting_for_handler, child_handled_checkpoint, child_handled_restart, child_handled_error, child_finished, child_error, child_ready, }; enum parent_state { parent_forked=1, parent_checkpointed, }; /* * Arguments for the child */ struct child_s { int pid; int do_setpgrp; /* 0 = false, 1 = true */ int to_context; /* CR_SIGNAL_CONTEXT or CR_THREAD_CONTEXT */ }; /* * Arguments for the PARENT */ struct forwardrequest_s { int from_context; /* CR_SIGNAL_CONTEXT or CR_THREAD_CONTEXT */ cr_scope_t scope; int id; int retval; int saved_errno; }; /* the parent */ struct forwardrequest_s the_forwardrequest; /* the child */ static enum child_state child_status; struct crut_pipes *child_pipes; /* shared between parent and child */ static int pipefds[2]; struct child_s thechild; /* * handlers for the parent */ static int parents_handler(void *arg) { int ret; /* forward the request to the child */ the_forwardrequest.retval = cr_forward_checkpoint(the_forwardrequest.scope, the_forwardrequest.id); the_forwardrequest.saved_errno = errno; /* we still need to do this when forwarding */ ret = cr_checkpoint(0); if (ret > 0) ret = 0; return ret; } /* * handler for the child */ static int childs_handler(void *arg) { int ret; ret = cr_checkpoint(0); if (ret > 0) { child_status = child_handled_restart; ret = 0; } else if (ret == 0) { child_status = child_handled_checkpoint; } else { child_status = child_handled_error; } return ret; } /* * Generic forwarding tests * * This next set of tests * check for normal operation of forwarding. The next set of tests makes * sure that forwarding works both from and to phase1 and phase2 handlers * in in all of the various target scopes */ static void do_child_work(void) { int ret; int child_handler_context = thechild.to_context; cr_client_id_t client_id = 0; client_id = cr_init(); if (client_id < 0) { child_status = -1; CRUT_FAIL("child: cr_init() failed"); } else { /* register a checkpoint handler */ ret = cr_register_callback(childs_handler, NULL, child_handler_context); if (ret < 0) { CRUT_FAIL("forward_setup: Child failed to register callback."); } } if (thechild.do_setpgrp) { ret = setpgrp(); if (ret < 0) { perror("setpgrp(child)"); goto out; } } child_status = child_waiting_for_handler; /* tell pop that we're ready */ CRUT_DEBUG("child: Child successfully registered handler %p", childs_handler); ret = write(pipefds[1], &child_status, sizeof(child_status)); if (ret < 0) { perror("write(child)"); goto out; } /* wait for the checkpoint -- is there a better way? */ CRUT_DEBUG("Waiting for handler to run."); while (child_status == child_waiting_for_handler) { sleep(1); } /* tell pop I ran my handler */ CRUT_DEBUG("child: Child ran handler."); ret = write(pipefds[1], &child_status, sizeof(child_status)); if (ret < 0) { perror("write(child)"); goto out; } CRUT_DEBUG("Handler ran. Exiting"); exit(0); out: exit(-1); } static int generic_forward_setup(struct child_s *thischild) { int ret; memcpy(&thechild, thischild, sizeof(thechild)); ret = pipe(pipefds); if (ret < 0) { perror("pipe"); goto out; } /* Create a pipe to read data back from the child */ CRUT_DEBUG("Forking a child."); thechild.pid = fork(); if (thechild.pid < 0) { perror("fork"); goto out; } else if (thechild.pid == 0) { close(pipefds[0]); do_child_work(); /* --- NOT REACHED --- */ CRUT_FAIL("I should never have reached this far!!!"); exit(-1); } else { /* PARENT */ close(pipefds[1]); } out: return ret; } static int to_signal_proc_setup(void **testdata) { struct child_s mychild = { .do_setpgrp = 0, .to_context = CR_SIGNAL_CONTEXT, }; return generic_forward_setup(&mychild); } static int to_thread_proc_setup(void **testdata) { struct child_s mychild = { .do_setpgrp = 0, .to_context = CR_THREAD_CONTEXT, }; return generic_forward_setup(&mychild); } static int to_signal_pgrp_setup(void **testdata) { struct child_s mychild = { .do_setpgrp = 1, .to_context = CR_SIGNAL_CONTEXT, }; return generic_forward_setup(&mychild); } static int to_thread_pgrp_setup(void **testdata) { struct child_s mychild = { .do_setpgrp = 1, .to_context = CR_THREAD_CONTEXT, }; return generic_forward_setup(&mychild); } static int generic_precheckpoint(struct forwardrequest_s *this_forwardrequest) { int ret; int status; memcpy(&the_forwardrequest, this_forwardrequest, sizeof(the_forwardrequest)); /* register a checkpoint handler */ ret = cr_register_callback(parents_handler, NULL, the_forwardrequest.from_context); if (ret < 0) { CRUT_FAIL("generic_precheckpoint: Failed to register callback"); } CRUT_DEBUG("parent registered handler %p", parents_handler); /* wait for the child to start up */ ret = read(pipefds[0], &status, sizeof(status)); if (ret < 0) { perror("read(parent)"); } CRUT_DEBUG("parent: child reports status = %d.", status); if (status < 0) { CRUT_FAIL("forward_setup: Child has a problem."); } /* proceed to the checkpoint */ return 0; } static int from_signal_to_process(void *p) { struct forwardrequest_s myreq = { .scope = CR_SCOPE_PROC, .id = thechild.pid, .from_context = CR_SIGNAL_CONTEXT, }; return generic_precheckpoint(&myreq); } static int from_thread_to_process(void *p) { struct forwardrequest_s myreq = { .scope = CR_SCOPE_PROC, .id = thechild.pid, .from_context = CR_THREAD_CONTEXT, }; return generic_precheckpoint(&myreq); } static int from_signal_to_tree(void *p) { struct forwardrequest_s myreq = { .scope = CR_SCOPE_TREE, .id = getpid(), .from_context = CR_SIGNAL_CONTEXT, }; return generic_precheckpoint(&myreq); } static int from_thread_to_tree(void *p) { struct forwardrequest_s myreq = { .scope = CR_SCOPE_TREE, .id = getpid(), .from_context = CR_THREAD_CONTEXT, }; return generic_precheckpoint(&myreq); } static int from_signal_to_pgrp(void *p) { struct forwardrequest_s myreq = { .scope = CR_SCOPE_PGRP, .id = thechild.pid, .from_context = CR_SIGNAL_CONTEXT, }; return generic_precheckpoint(&myreq); } static int from_thread_to_pgrp(void *p) { struct forwardrequest_s myreq = { .scope = CR_SCOPE_PGRP, .id = thechild.pid, .from_context = CR_THREAD_CONTEXT, }; return generic_precheckpoint(&myreq); } static int forward_continue_or_restart(void *p) { int ret; int exit_status; int status; if (the_forwardrequest.retval < 0) { CRUT_DEBUG("parent: saved_errno = %d.", the_forwardrequest.saved_errno); CRUT_FAIL("Could not forward the checkpoint to the child."); ret = -1; goto out; } /* wait for the child to run its handler */ ret = read(pipefds[0], &status, sizeof(status)); if (ret < 0) { perror("read(parent)"); } CRUT_DEBUG("parent: child reports status = %d.", status); /* wait for the child */ ret = waitpid(thechild.pid, &exit_status, 0); if (ret < 0) { perror("waitpid"); goto out; } else if (ret == 0) { CRUT_FAIL("waitpid returned 0! This should be impossible!"); ret = -1; goto out; } /* check the exit status of the child */ if (WIFEXITED(exit_status)) { if (WEXITSTATUS(exit_status)) { CRUT_FAIL("Child returned %d on exit.", WEXITSTATUS(exit_status)); ret = -1; } else { CRUT_DEBUG("Child exited normally."); } } else if (WIFSIGNALED(exit_status)) { CRUT_FAIL("Child terminated by signal %d", WTERMSIG(exit_status)); ret = -1; } else { /* This is nonsense */ CRUT_FAIL("Confused! exit_status=%d", exit_status); ret = -1; } out: return ret; } static int forward_teardown(void *p) { return 0; } /* * The nochild tests. * * This bunch is set up to test forwarding routines when we don't have a * child present. These test certain error cases. */ static int nochild_setup(void **testdata) { return 0; } static int nochild_precheckpoint(struct forwardrequest_s *this_forwardrequest) { int ret; memcpy(&the_forwardrequest, this_forwardrequest, sizeof(the_forwardrequest)); /* register a checkpoint handler */ ret = cr_register_callback(parents_handler, NULL, the_forwardrequest.from_context); if (ret < 0) { CRUT_FAIL("nochild_precheckpoint: Failed to register callback"); } CRUT_DEBUG("parent registered handler %p", parents_handler); return 0; } static int from_sig_to_self(void *p) { struct forwardrequest_s myreq = { .scope = CR_SCOPE_TREE, .id = getpid(), .from_context = CR_SIGNAL_CONTEXT, }; return nochild_precheckpoint(&myreq); } static int from_sig_to_init(void *p) { struct forwardrequest_s myreq = { .scope = CR_SCOPE_TREE, .id = 1, .from_context = CR_SIGNAL_CONTEXT, }; return nochild_precheckpoint(&myreq); } static int from_sig_to_junk(void *p) { struct forwardrequest_s myreq = { .scope = CR_SCOPE_TREE, .id = -1, .from_context = CR_SIGNAL_CONTEXT, }; return nochild_precheckpoint(&myreq); } static int nochild_continue(void *p) { int ret; ret = 0; if (the_forwardrequest.retval < 0) { CRUT_FAIL("Could not forward the checkpoint to the child."); ret = -1; } return ret; } static int expect_handler_to_fail(void *p) { int ret; ret = 0; if (the_forwardrequest.retval >= 0) { CRUT_FAIL("Unexpectedly forwarded the checkpoint to the child!"); ret = -1; } return ret; } /* * The busy tests. * * These make sure that forwarding works correctly (i.e. fails without messing * up the rest of the checkpoint) if we try to forward * to something that's already checkpointing as part of a DIFFERENT checkpoint * request. */ /* * handler for the child */ static int child_busy_handler(void *arg) { int ret; crut_pipes_putchar(child_pipes, child_ready); crut_pipes_expect(child_pipes, parent_checkpointed); ret = cr_checkpoint(0); if (ret > 0) { child_status = child_handled_restart; ret = 0; } else if (ret == 0) { child_status = child_handled_checkpoint; } else { child_status = child_handled_error; } return ret; } int request_checkpoint_to_file(const char *filename, int scope) { int ret; cr_checkpoint_args_t cr_args; cr_checkpoint_handle_t cr_handle; /* open the context file */ CRUT_VERBOSE("requesting checkpoint to file: %s", filename); ret = open(filename, O_WRONLY | O_CREAT | O_TRUNC | O_LARGEFILE, 0600); if (ret < 0) { perror("open"); goto out; } cr_initialize_checkpoint_args_t(&cr_args); cr_args.cr_fd = ret; cr_args.cr_scope = scope; /* issue the request */ ret = cr_request_checkpoint(&cr_args, &cr_handle); if (ret < 0) { if (errno == EINVAL) { CRUT_VERBOSE("cr_request_checkpoint returned EINVAL"); /* restarted before cr_request_checkpoint returned! */ ; } else if (errno == EAGAIN) { CRUT_VERBOSE("cr_request_checkpoint returned EAGAIN"); /* the checkpoint has not yet completed... this is ok */ ; } else { perror("cr_request_checkpoint"); } } close(cr_args.cr_fd); out: return ret; } /* * child portion of the busy test */ static int do_child_busy_work(void) { cr_client_id_t client_id = 0; int exitval; int ret; crut_pipes_expect(child_pipes, parent_forked); client_id = cr_init(); if (client_id < 0) { child_status = -1; CRUT_FAIL("child: cr_init() failed"); } else { /* register a checkpoint handler */ ret = cr_register_callback(child_busy_handler, NULL, CR_SIGNAL_CONTEXT); if (ret < 0) { CRUT_FAIL("forward_setup: Child failed to register callback."); exitval = ret; goto out; } } crut_pipes_putchar(child_pipes, child_started); request_checkpoint_to_file("/dev/null", CR_SCOPE_PROC); /* wait for the checkpoint -- is there a better way? */ CRUT_DEBUG("Waiting for handler to run."); while (child_status == child_waiting_for_handler) { sleep(1); } exitval = child_finished; out: exit(child_finished); } static int busy_setup(void **p) { struct crut_pipes *pipes = malloc(sizeof(struct crut_pipes)); int retval; CRUT_DEBUG("Creating pipes and forking."); retval = crut_pipes_fork(pipes); if (!retval) { child_pipes = pipes; do_child_busy_work(); } crut_pipes_putchar(pipes, parent_forked); crut_pipes_expect(pipes, child_started); *p = pipes; return retval; } static int busy_precheckpoint(void *p) { struct crut_pipes *pipes = p; int ret; struct forwardrequest_s myreq = { .scope = CR_SCOPE_TREE, .id = pipes->parent, .from_context = CR_SIGNAL_CONTEXT, }; memcpy(&the_forwardrequest, &myreq, sizeof(myreq)); /* register a checkpoint handler */ ret = cr_register_callback(parents_handler, NULL, the_forwardrequest.from_context); if (ret < 0) { CRUT_FAIL("busy_precheckpoint: Failed to register callback"); goto out; } crut_pipes_expect(pipes, child_ready); ret = 0; out: return ret; } static int busy_continue(void *p) { struct crut_pipes *pipes = p; int ret; ret = 0; if ((the_forwardrequest.retval != -1) || (the_forwardrequest.saved_errno != EBUSY)) { CRUT_FAIL("Forward request failed unexpectedly! saved_errno = %d", the_forwardrequest.saved_errno); ret = -1; } crut_pipes_putchar(pipes, parent_checkpointed); crut_waitpid_expect(pipes->child, child_finished); return ret; } static int busy_restart(void *p) { int status; pid_t wait_ret; int retval; /* make sure we didn't forward successfully to the child */ wait_ret = wait(&status); if (wait_ret != -1) { CRUT_FAIL("wait succeeded? We shouldn't have a child!"); retval = -1; goto out; } if (errno != ECHILD) { perror("wait"); retval = -1; goto out; } retval = 0; out: return retval; } static int busy_teardown(void *p) { struct crut_pipes *pipes = p; free(pipes); return 0; } int main(int argc, char *argv[]) { int is_lt = crut_is_linuxthreads(); int ret; struct crut_operations process_signal_to_signal_test_ops = { test_scope:CR_SCOPE_PROC, test_name:"proc_sig_to_sig", test_description:"Forward from a signal context to a process with a thread handler", test_setup:to_signal_proc_setup, test_precheckpoint:from_signal_to_process, test_continue:forward_continue_or_restart, test_restart:forward_continue_or_restart, test_teardown:forward_teardown, }; struct crut_operations process_signal_to_thread_test_ops = { test_scope:CR_SCOPE_PROC, test_name:"proc_sig_to_thr", test_description:"Forward from a signal context to a process with a thread handler", test_setup:to_thread_proc_setup, test_precheckpoint:from_signal_to_process, test_continue:forward_continue_or_restart, test_restart:forward_continue_or_restart, test_teardown:forward_teardown, }; struct crut_operations process_thread_to_signal_test_ops = { test_scope:CR_SCOPE_PROC, test_name:"proc_thr_to_sig", test_description:"Forward from a thread context to a process with a signal handler", test_setup:to_signal_proc_setup, test_precheckpoint:from_thread_to_process, test_continue:forward_continue_or_restart, test_restart:forward_continue_or_restart, test_teardown:forward_teardown, }; struct crut_operations process_thread_to_thread_test_ops = { test_scope:CR_SCOPE_PROC, test_name:"proc_thr_to_thr", test_description:"Forward from a thread context to a process with a thread handler", test_setup:to_thread_proc_setup, test_precheckpoint:from_thread_to_process, test_continue:forward_continue_or_restart, test_restart:forward_continue_or_restart, test_teardown:forward_teardown, }; struct crut_operations tree_signal_to_signal_test_ops = { test_scope:CR_SCOPE_PROC, test_name:"tree_sig_to_sig", test_description:"Forward from a signal context to a tree with a thread handler", test_setup:to_signal_proc_setup, test_precheckpoint:from_signal_to_tree, test_continue:forward_continue_or_restart, test_restart:forward_continue_or_restart, test_teardown:forward_teardown, }; struct crut_operations tree_signal_to_thread_test_ops = { test_scope:CR_SCOPE_PROC, test_name:"tree_sig_to_thr", test_description:"Forward from a signal context to a tree with a thread handler", test_setup:to_thread_proc_setup, test_precheckpoint:from_signal_to_tree, test_continue:forward_continue_or_restart, test_restart:forward_continue_or_restart, test_teardown:forward_teardown, }; struct crut_operations tree_thread_to_signal_test_ops = { test_scope:CR_SCOPE_PROC, test_name:"tree_thr_to_sig", test_description:"Forward from a thread context to a tree with a signal handler", test_setup:to_signal_proc_setup, test_precheckpoint:from_thread_to_tree, test_continue:forward_continue_or_restart, test_restart:forward_continue_or_restart, test_teardown:forward_teardown, }; struct crut_operations tree_thread_to_thread_test_ops = { test_scope:CR_SCOPE_PROC, test_name:"tree_thr_to_thr", test_description:"Forward from a thread context to a tree with a thread handler", test_setup:to_thread_proc_setup, test_precheckpoint:from_thread_to_tree, test_continue:forward_continue_or_restart, test_restart:forward_continue_or_restart, test_teardown:forward_teardown, }; struct crut_operations pgrp_signal_to_signal_test_ops = { test_scope:CR_SCOPE_PROC, test_name:"pgrp_sig_to_sig", test_description:"Forward from a signal context to a pgrp with a thread handler", test_setup:to_signal_pgrp_setup, test_precheckpoint:from_signal_to_pgrp, test_continue:forward_continue_or_restart, test_restart:forward_continue_or_restart, test_teardown:forward_teardown, }; struct crut_operations pgrp_signal_to_thread_test_ops = { test_scope:CR_SCOPE_PROC, test_name:"pgrp_sig_to_thr", test_description:"Forward from a signal context to a pgrp with a thread handler", test_setup:to_thread_pgrp_setup, test_precheckpoint:from_signal_to_pgrp, test_continue:forward_continue_or_restart, test_restart:forward_continue_or_restart, test_teardown:forward_teardown, }; struct crut_operations pgrp_thread_to_signal_test_ops = { test_scope:CR_SCOPE_PROC, test_name:"pgrp_thr_to_sig", test_description:"Forward from a thread context to a pgrp with a signal handler", test_setup:to_signal_pgrp_setup, test_precheckpoint:from_thread_to_pgrp, test_continue:forward_continue_or_restart, test_restart:forward_continue_or_restart, test_teardown:forward_teardown, }; struct crut_operations pgrp_thread_to_thread_test_ops = { test_scope:CR_SCOPE_PROC, test_name:"pgrp_thr_to_thr", test_description:"Forward from a thread context to a pgrp with a thread handler", test_setup:to_thread_pgrp_setup, test_precheckpoint:from_thread_to_pgrp, test_continue:forward_continue_or_restart, test_restart:forward_continue_or_restart, test_teardown:forward_teardown, }; struct crut_operations fwd_to_self_test_ops = { test_scope:CR_SCOPE_PROC, test_name:"fwd_to_self", test_description:"Forward to the current process (should succeed)", test_setup:nochild_setup, test_precheckpoint:from_sig_to_self, test_continue:nochild_continue, test_restart:nochild_continue, test_teardown:forward_teardown, }; struct crut_operations fwd_to_init_test_ops = { test_scope:CR_SCOPE_PROC, test_name:"fwd_to_init", test_description:"Forward to the init process (should fail)", test_setup:nochild_setup, test_precheckpoint:from_sig_to_init, test_continue:expect_handler_to_fail, test_restart:expect_handler_to_fail, test_teardown:forward_teardown, }; struct crut_operations fwd_to_junk_test_ops = { test_scope:CR_SCOPE_PROC, test_name:"fwd_to_junk", test_description:"Forward to the junk process (should fail)", test_setup:nochild_setup, test_precheckpoint:from_sig_to_junk, test_continue:expect_handler_to_fail, test_restart:expect_handler_to_fail, test_teardown:forward_teardown, }; struct crut_operations fwd_to_busy_test_ops = { test_scope:CR_SCOPE_PROC, test_name:"fwd_to_busy", test_description:"Forward to to a checkpointing process", test_setup:busy_setup, test_precheckpoint:busy_precheckpoint, test_continue:busy_continue, test_restart:busy_restart, test_teardown:busy_teardown, }; /* add the basic tests */ crut_add_test(&process_signal_to_signal_test_ops); crut_add_test(&process_signal_to_thread_test_ops); crut_add_test(&process_thread_to_signal_test_ops); crut_add_test(&process_thread_to_thread_test_ops); crut_add_test(&tree_signal_to_signal_test_ops); crut_add_test(&tree_signal_to_thread_test_ops); crut_add_test(&tree_thread_to_signal_test_ops); crut_add_test(&tree_thread_to_thread_test_ops); crut_add_test(&pgrp_signal_to_signal_test_ops); if (!is_lt) crut_add_test(&pgrp_signal_to_thread_test_ops); // Known bug 2243 crut_add_test(&pgrp_thread_to_signal_test_ops); if (!is_lt) crut_add_test(&pgrp_thread_to_thread_test_ops); // Known bug 2243 /* add the silly tests */ crut_add_test(&fwd_to_self_test_ops); crut_add_test(&fwd_to_init_test_ops); crut_add_test(&fwd_to_junk_test_ops); /* test forwarding to something that's checkpointing already */ crut_add_test(&fwd_to_busy_test_ops); ret = crut_main(argc, argv); return ret; } blcr-0.8.5/tests/reloc_exe.sh0000664000000000000000000000107411015417120012774 00000000000000#!/bin/sh set -e . ${cr_testsdir:-`dirname $0`}/shellinit context=`pwd`/Context1 # TMPDIR=`cd ${TMPDIR:-/tmp} && $cr_pwd` MY_TMPDIR1=`mktemp -d ${TMPDIR}/blcr_reloc.XXXXXX` MY_TMPDIR2=`mktemp -d ${TMPDIR}/blcr_reloc.XXXXXX` trap "\rm -rf ${MY_TMPDIR1} ${MY_TMPDIR2} $context 2>/dev/null" 0 cp -f ${cr_testsdir}/reloc_aux ${MY_TMPDIR1}/reloc_exe ${cr_run} ${MY_TMPDIR1}/reloc_exe ${MY_TMPDIR1} "$context --clobber" # Move the mmap()ed executable mv -f ${MY_TMPDIR1}/reloc_exe ${MY_TMPDIR2}/ ${cr_restart} --relocate ${MY_TMPDIR1}/reloc_exe=${MY_TMPDIR2}/reloc_exe $context blcr-0.8.5/tests/crut_util_pth.c0000664000000000000000000000661211114413226013532 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2008, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * 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 * * $Id: crut_util_pth.c,v 1.2 2008/11/30 04:29:10 phargrov Exp $ * * Utility functions for BLCR tests - thread portion */ #include #include #include #include #include #include #include "blcr_config.h" #include "crut_util.h" /* * Wait for other threads by watching a counter */ void crut_barrier(int *counter) { static pthread_mutex_t my_mutex = PTHREAD_MUTEX_INITIALIZER; static pthread_cond_t my_cond = PTHREAD_COND_INITIALIZER; pthread_mutex_lock(&my_mutex); --(*counter); if (*counter <= 0) { if (*counter < 0) { CRUT_FAIL("Barrier underflow"); } pthread_cond_broadcast(&my_cond); } else { while (*counter > 0) { pthread_cond_wait(&my_cond, &my_mutex); } } pthread_mutex_unlock(&my_mutex); } /* * Create a pthread w/ a small stack (avoiding issues like shown in bug 2232) */ int crut_pthread_create(pthread_t *thread, pthread_attr_t *attr, void *(*start_routine)(void *), void *arg) { #if HAVE_PTHREAD_ATTR_SETSTACKSIZE pthread_attr_t my_attr, *attr_p; size_t size; int rc; if (attr) { attr_p = attr; } else { rc = pthread_attr_init(&my_attr); if (rc != 0) { CRUT_FAIL("Error calling pthread_attr_init()"); } attr_p = &my_attr; } /* MAX(4MB, PTHREAD_STACK_MIN) */ size = 4 * 1024 * 1024; if (size < PTHREAD_STACK_MIN) size = PTHREAD_STACK_MIN; rc = pthread_attr_setstacksize(attr_p, size); if (rc != 0) { CRUT_FAIL("Error calling pthread_attr_setstacksize()"); } rc = pthread_create(thread, attr_p, start_routine, arg); if (!attr) { (void)pthread_attr_destroy(&my_attr); } return rc; #else return pthread_create(thread, attr, start_routine, arg); #endif } static void *crut_is_linuxthreads_aux(void *arg) { return ((int)getpid() == *(int *)arg) ? NULL : (void *)1UL; } int crut_is_linuxthreads(void) { int mypid = (int)getpid(); pthread_t th; void *join_val; if (0 != crut_pthread_create(&th, NULL, &crut_is_linuxthreads_aux, (void *)(&mypid))) { CRUT_FAIL("Error calling pthread_create()"); exit(-1); } if (0 != pthread_join(th, &join_val)) { CRUT_FAIL("Error calling pthread_join()"); exit(-1); } return (join_val != NULL); } blcr-0.8.5/tests/cr_targ.sh0000664000000000000000000000067311010246535012461 00000000000000#!/bin/sh . ${cr_testsdir:-`dirname $0`}/shellinit # ${cr_run} -- ${cr_testsdir}/pause >/dev/null 2>/dev/null & pid=$! sleep 1 \rm -f context.$pid 2>/dev/null trap "\rm -f context.$pid 2>/dev/null" 0 ${cr_checkpoint} --clobber --quiet $pid result=$? if test $result = 0; then : # OK else echo "Checkpoint unexpectedly failed with exit code $result" >&2 exit 1 fi exec 2>/dev/null # Drop job control message(s) kill $pid wait $pid exit 0 blcr-0.8.5/tests/child.c0000664000000000000000000001314611114414150011725 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2007, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * 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 * * $Id: child.c,v 1.8 2008/11/30 04:36:56 phargrov Exp $ * * Test of pipes w/ child and grandchild captured via CR_SCOPE_TREE * and of parent w/ a zombie child */ #include #include #include #include #include #include #include #include #include #include "crut.h" #include "crut_util.h" enum { MSG_CHILD_GOOD = 18, MSG_CHILD_BAD, MSG_PARENT_READY, MSG_PARENT_DONE, MSG_CHILD_DONE }; static void sigpipe(int signo) { fprintf(stderr, "%d exiting on SIGPIPE\n", getpid()); exit(-1); } static void *thread_main(void *arg) { while(1) { pthread_testcancel(); sleep(1); } return NULL; } static int child_setup(void **p) { struct crut_pipes *pipes = malloc(sizeof(struct crut_pipes)); int retval; signal(SIGPIPE, &sigpipe); CRUT_DEBUG("Creating pipes and forking."); retval = crut_pipes_fork(pipes); if (!retval) { /* In the child */ int parent = pipes->child; int child = fork(); if (child < 0) { CRUT_FAIL("Error forking grandchild."); } else if (!child) { /* In the grandchild */ pthread_t th; if (crut_pthread_create(&th, NULL, &thread_main, NULL) != 0) { exit(1); } while (1) { CRUT_DEBUG("Grandchild entering read()"); crut_pipes_expect(pipes, MSG_PARENT_READY); CRUT_DEBUG("Grandchild sees ppid %d", getppid()); crut_pipes_putchar(pipes, getppid() == parent ? MSG_CHILD_GOOD : MSG_CHILD_BAD); } exit(-1); // unreached } else { crut_waitpid_expect(child, MSG_PARENT_DONE); exit(MSG_CHILD_DONE); } exit(-1); // unreached } crut_pipes_putchar(pipes, MSG_PARENT_READY); crut_pipes_expect(pipes, MSG_CHILD_GOOD); *p = pipes; return retval; } static int child_precheckpoint(void *p) { int retval = 0; CRUT_DEBUG("Getting ready to checkpoint"); crut_pipes_putchar(p, MSG_PARENT_READY); crut_pipes_expect(p, MSG_CHILD_GOOD); return retval; } static int child_continue(void *p) { struct crut_pipes *pipes = p; int retval = 0; CRUT_DEBUG("Continuing after checkpoint."); crut_pipes_putchar(pipes, MSG_PARENT_READY); crut_pipes_expect(pipes, MSG_CHILD_GOOD); crut_pipes_putchar(pipes, MSG_PARENT_DONE); crut_waitpid_expect(pipes->child, MSG_CHILD_DONE); return retval; } static int child_restart(void *p) { int retval = 0; CRUT_DEBUG("Restarting from checkpoint."); crut_pipes_putchar(p, MSG_PARENT_READY); crut_pipes_expect(p, MSG_CHILD_GOOD); return retval; } static int child_teardown(void *p) { struct crut_pipes *pipes = p; int retval = 0; CRUT_DEBUG("Entering child_teardown."); crut_pipes_putchar(pipes, MSG_PARENT_DONE); crut_waitpid_expect(pipes->child, MSG_CHILD_DONE); return retval; } static int zombie_setup(void **p) { struct crut_pipes *pipes = malloc(sizeof(struct crut_pipes)); int retval; retval = crut_pipes_fork(pipes); if (!retval) { /* Am child */ exit(0); return -1; } else { int rc = crut_pipes_getchar(pipes); if (rc != -1) { CRUT_FAIL("Read returned %d when expected EOF", rc); return -1; } rc = crut_pipes_close(pipes); if (rc < 0) { CRUT_FAIL("Close failed"); return -1; } } *p = pipes; return 0; } static int zombie_teardown(void *p) { return 0; } static int zombie_precheckpoint(void *p) { return 0; } static int zombie_continue(void *p) { struct crut_pipes *pipes = p; crut_waitpid_expect(pipes->child, 0); return 0; } static int zombie_restart(void *p) { return 0; } int main(int argc, char *argv[]) { int ret; struct crut_operations child_test_ops = { test_scope:CR_SCOPE_TREE, test_name:"child", test_description:"Child tester. Tests checkpoint of children via CR_SCOPE_TREE.", test_setup:child_setup, test_precheckpoint:child_precheckpoint, test_continue:child_continue, test_restart:child_restart, test_teardown:child_teardown }; struct crut_operations zombie_test_ops = { test_scope:CR_SCOPE_TREE, test_name:"zombie", test_description:"Zombie child tester. Tests checkpoint with dead/unreaped children via CR_SCOPE_TREE.", test_setup:zombie_setup, test_precheckpoint:zombie_precheckpoint, test_continue:zombie_continue, test_restart:zombie_restart, test_teardown:zombie_teardown }; /* add the tests */ crut_add_test(&child_test_ops); crut_add_test(&zombie_test_ops); ret = crut_main(argc, argv); return ret; } blcr-0.8.5/tests/cb_exit.c0000664000000000000000000004013711116333011012255 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2007, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * 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 * * $Id: cb_exit.c,v 1.15 2008/12/05 23:15:21 phargrov Exp $ */ #include #include #include #include #include #include #include #include #include #include "libcr.h" #include "crut_util.h" static char *filename = NULL; static const char *chkpt_cmd; static const char *rstrt_cmd; volatile int done = 0; enum { MSG_CHILD_READY = 42, MSG_CHILD_DONE, MSG_PARENT_DONE, TEST_EXIT_VAL1, TEST_EXIT_VAL2, TEST_EXIT_VAL3, TEST_EXIT_VAL4 }; static void do_segv(void) { #if 0 struct rlimit r; int rc; /* disable generation of a 'core' */ r.rlim_cur = r.rlim_max = 0; rc = setrlimit(RLIMIT_CORE, &r); if (rc < 0) { perror("setrlimit(RLIMIT_CORE->0):"); exit(-1); } #endif *(int *)0UL = 0; raise(SIGSEGV); } static void uncore(struct crut_pipes *pipes) { char *corename = crut_aprintf("core.%d", pipes->child); (void)unlink(corename); free(corename); (void)unlink("core"); } static void exec_exit(int code) { execl("/bin/bash", "sh", "-c", crut_aprintf("exit %d", code), NULL); } // Callback that exits from CHECKPOINT portion of callback static int cb_chkpt_exit(void* arg) { int count = (uintptr_t)arg; printf("%03d enter cb_chkpt_exit\n", count++); printf("%03d child exit()\n", count++); fflush(NULL); exit(TEST_EXIT_VAL1); printf("XXX exit() returned unexpectedly\n"); exit(-1); return 1; } // Callback that SEGVs from CHECKPOINT portion of callback static int cb_chkpt_segv(void* arg) { int count = (uintptr_t)arg; printf("%03d enter cb_chkpt_segv\n", count++); printf("%03d child SEGV\n", count++); fflush(NULL); do_segv(); printf("XXX do_segv() returned unexpectedly\n"); exit(-1); return 1; } // Callback that exec()s from CHECKPOINT portion of callback static int cb_chkpt_exec(void* arg) { int count = (uintptr_t)arg; printf("%03d enter cb_chkpt_exec\n", count++); printf("%03d child exec()\n", count++); fflush(NULL); exec_exit(TEST_EXIT_VAL1); printf("XXX exec() returned unexpectedly\n"); exit(-1); return 1; } // Callback that exits from CONTINUE and RESTART portions of callback static int cb_exit23(void* arg) { int count = (uintptr_t)arg; int rc; printf("%03d enter cb_exit23\n", count++); rc = cr_checkpoint(CR_CHECKPOINT_READY); if (!rc) { printf("%03d child CONT exit()\n", count++); fflush(NULL); exit(TEST_EXIT_VAL2); printf("XXX exit() returned unexpectedly\n"); } else if (rc > 0) { ++count; // match the CONT printf("%03d child RSTRT exit()\n", count++); exit(TEST_EXIT_VAL3); printf("XXX exit() returned unexpectedly\n"); } else { printf("XXX cr_checkpoint() failed\n"); } return 0; } // Callback that SEGVs from CONTINUE and RESTART portions of callback static int cb_segv23(void* arg) { int count = (uintptr_t)arg; int rc; printf("%03d enter cb_segv23\n", count++); rc = cr_checkpoint(CR_CHECKPOINT_READY); if (!rc) { printf("%03d child CONT SEGV\n", count++); fflush(NULL); do_segv(); printf("XXX do_segv() returned unexpectedly\n"); } else if (rc > 0) { ++count; // match the CONT printf("%03d child RSTRT SEGV\n", count++); do_segv(); printf("XXX do_segv() returned unexpectedly\n"); } else { printf("XXX cr_checkpoint() failed\n"); } return 0; } // Callback that exec()s from CONTINUE and RESTART portions of callback static int cb_exec23(void* arg) { int count = (uintptr_t)arg; int rc; printf("%03d enter cb_exec23\n", count++); rc = cr_checkpoint(CR_CHECKPOINT_READY); if (!rc) { printf("%03d child CONT exec()\n", count++); fflush(NULL); exec_exit(TEST_EXIT_VAL2); printf("XXX exec() returned unexpectedly\n"); } else if (rc > 0) { ++count; // match the CONT printf("%03d child RSTRT exec()\n", count++); exec_exit(TEST_EXIT_VAL3); printf("XXX exec() returned unexpectedly\n"); } else { printf("XXX cr_checkpoint() failed\n"); } return 0; } // Callback that returns non-zero from CONTINUE portion of callback static int cb_return_cont(void* arg) { int count = (uintptr_t)arg; int rc; printf("%03d enter cb_return_cont\n", count++); rc = cr_checkpoint(CR_CHECKPOINT_READY); if (!rc) { printf("%03d child CONT return(1)\n", count++); fflush(NULL); return 1; } else if (rc > 0) { printf("XXX restarted unexpectedly failed\n"); } else { printf("XXX cr_checkpoint() failed\n"); } return 0; } // Callback that returns non-zero from RESTART portion of callback static int cb_return_rstrt(void* arg) { int count = (uintptr_t)arg; int rc; printf("%03d enter cb_return_rstrt\n", count++); rc = cr_checkpoint(CR_CHECKPOINT_READY); if (rc > 0) { printf("%03d child RESTART return(1)\n", count++); fflush(NULL); return 1; } else if (rc < 0) { printf("XXX cr_checkpoint() failed\n"); } done = 1; return 0; } void child_main(struct crut_pipes *pipes, int count, int flags, int (*cb)(void*)) { cr_callback_id_t cb_id; cr_client_id_t my_id; int mypid = getpid(); printf("#ST_ALARM:60\n"); filename = crut_aprintf("context.%d", mypid); my_id = cr_init(); if (my_id < 0) { printf("XXX child %d cr_init() failed, returning %d\n", mypid, my_id); exit(-1); } else { printf("%03d child %d cr_init() succeeded\n", count++, mypid); } cb_id = cr_register_callback(cb, (void*)(uintptr_t)(count+1), flags); if (cb_id < 0) { printf("XXX cr_register_callback() unexpectedly returned %d\n", cb_id); exit(-1); } else { printf("%03d child %d cr_register_callback() succeeded\n", count++, mypid); } crut_pipes_putchar(pipes, MSG_CHILD_READY); while (!done) pause(); exit(TEST_EXIT_VAL4); } int run_tests(int base, int flags) { char *cmd; struct crut_pipes pipes; int rc; printf("# test: exit() in CHECKPOINT portion of a callback\n"); if (!crut_pipes_fork(&pipes)) { child_main(&pipes, base, flags, cb_chkpt_exit); exit(1); } else { cmd = crut_aprintf("exec %s --pid %d --kill --file %s --quiet", chkpt_cmd, pipes.child, filename); crut_pipes_expect(&pipes, MSG_CHILD_READY); rc = system(cmd); if (!WIFEXITED(rc) || (WEXITSTATUS(rc) != ESRCH)) { printf("XXX system(%s) unexpectedly returned %d\n", cmd, rc); exit(1); } free(cmd); crut_waitpid_expect(pipes.child, TEST_EXIT_VAL1); } crut_pipes_close(&pipes); (void)unlink(filename); printf("# test: SEGV in CHECKPOINT portion of a callback\n"); if (!crut_pipes_fork(&pipes)) { child_main(&pipes, base+4, flags, cb_chkpt_segv); exit(1); } else { cmd = crut_aprintf("exec %s --pid %d --kill --file %s --quiet", chkpt_cmd, pipes.child, filename); crut_pipes_expect(&pipes, MSG_CHILD_READY); rc = system(cmd); if (!WIFEXITED(rc) || (WEXITSTATUS(rc) != ESRCH)) { printf("XXX system(%s) unexpectedly returned %d\n", cmd, rc); exit(1); } free(cmd); crut_waitpid_expect_signal(pipes.child, SIGSEGV); } crut_pipes_close(&pipes); uncore(&pipes); (void)unlink(filename); printf("# test: exec() in CHECKPOINT portion of a callback\n"); if (!crut_pipes_fork(&pipes)) { child_main(&pipes, base+8, flags, cb_chkpt_exec); exit(1); } else { cmd = crut_aprintf("exec %s --pid %d --kill --file %s --quiet", chkpt_cmd, pipes.child, filename); crut_pipes_expect(&pipes, MSG_CHILD_READY); rc = system(cmd); if (!WIFEXITED(rc) || (WEXITSTATUS(rc) != ESRCH)) { printf("XXX system(%s) unexpectedly returned %d\n", cmd, rc); exit(1); } free(cmd); crut_waitpid_expect(pipes.child, TEST_EXIT_VAL1); } crut_pipes_close(&pipes); (void)unlink(filename); printf("# test: exit() in CONTINUE and RESTART portions of a callback\n"); if (!crut_pipes_fork(&pipes)) { child_main(&pipes, base+12, flags, cb_exit23); exit(1); } else { cmd = crut_aprintf("exec %s --pid %d --kill --file %s --quiet", chkpt_cmd, pipes.child, filename); crut_pipes_expect(&pipes, MSG_CHILD_READY); rc = system(cmd); if (!WIFEXITED(rc) || (WEXITSTATUS(rc) != 0)) { printf("XXX system(%s) unexpectedly returned %d\n", cmd, rc); exit(1); } free(cmd); crut_waitpid_expect(pipes.child, TEST_EXIT_VAL2); } crut_pipes_close(&pipes); cmd = crut_aprintf("exec %s %s", rstrt_cmd, filename); rc = system(cmd); if (!WIFEXITED(rc) || (WEXITSTATUS(rc) != TEST_EXIT_VAL3)) { printf("XXX system(%s) unexpectedly returned %d\n", cmd, rc); exit(1); } free(cmd); (void)unlink(filename); printf("# test: repeat previous test w/ --kill in the restart flags\n"); if (!crut_pipes_fork(&pipes)) { child_main(&pipes, base+17, flags, cb_exit23); exit(1); } else { cmd = crut_aprintf("exec %s --pid %d --kill --file %s --quiet", chkpt_cmd, pipes.child, filename); crut_pipes_expect(&pipes, MSG_CHILD_READY); rc = system(cmd); if (!WIFEXITED(rc) || (WEXITSTATUS(rc) != 0)) { printf("XXX system(%s) unexpectedly returned %d\n", cmd, rc); exit(1); } free(cmd); crut_waitpid_expect(pipes.child, TEST_EXIT_VAL2); } crut_pipes_close(&pipes); cmd = crut_aprintf("exec %s --kill %s", rstrt_cmd, filename); rc = system(cmd); if (!WIFEXITED(rc) || (WEXITSTATUS(rc) != TEST_EXIT_VAL3)) { printf("XXX system(%s) unexpectedly returned %d\n", cmd, rc); exit(1); } free(cmd); (void)unlink(filename); printf("# test: SEGV in CONTINUE and RESTART portions of a callback\n"); if (!crut_pipes_fork(&pipes)) { child_main(&pipes, base+22, flags, cb_segv23); exit(1); } else { cmd = crut_aprintf("exec %s --pid %d --kill --file %s --quiet", chkpt_cmd, pipes.child, filename); crut_pipes_expect(&pipes, MSG_CHILD_READY); rc = system(cmd); if (!WIFEXITED(rc) || (WEXITSTATUS(rc) != 0)) { printf("XXX system(%s) unexpectedly returned %d\n", cmd, rc); exit(1); } free(cmd); crut_waitpid_expect_signal(pipes.child, SIGSEGV); } crut_pipes_close(&pipes); cmd = crut_aprintf("exec %s %s", rstrt_cmd, filename); rc = system(cmd); if (!WIFSIGNALED(rc) || (WTERMSIG(rc) != SIGSEGV)) { printf("XXX system(%s) unexpectedly returned %d\n", cmd, rc); exit(1); } free(cmd); uncore(&pipes); (void)unlink(filename); printf("# test: repeat previous test w/ --kill in the restart flags\n"); if (!crut_pipes_fork(&pipes)) { child_main(&pipes, base+27, flags, cb_segv23); exit(1); } else { cmd = crut_aprintf("exec %s --pid %d --kill --file %s --quiet", chkpt_cmd, pipes.child, filename); crut_pipes_expect(&pipes, MSG_CHILD_READY); rc = system(cmd); if (!WIFEXITED(rc) || (WEXITSTATUS(rc) != 0)) { printf("XXX system(%s) unexpectedly returned %d\n", cmd, rc); exit(1); } free(cmd); crut_waitpid_expect_signal(pipes.child, SIGSEGV); } crut_pipes_close(&pipes); cmd = crut_aprintf("exec %s --kill %s", rstrt_cmd, filename); rc = system(cmd); if (!WIFSIGNALED(rc) || (WTERMSIG(rc) != SIGSEGV)) { printf("XXX system(%s) unexpectedly returned %d\n", cmd, rc); exit(1); } free(cmd); uncore(&pipes); (void)unlink(filename); printf("# test: exec() in CONTINUE and RESTART portions of a callback\n"); if (!crut_pipes_fork(&pipes)) { child_main(&pipes, base+32, flags, cb_exec23); exit(1); } else { cmd = crut_aprintf("exec %s --pid %d --kill --file %s --quiet", chkpt_cmd, pipes.child, filename); crut_pipes_expect(&pipes, MSG_CHILD_READY); rc = system(cmd); if (!WIFEXITED(rc) || (WEXITSTATUS(rc) != 0)) { printf("XXX system(%s) unexpectedly returned %d\n", cmd, rc); exit(1); } free(cmd); crut_waitpid_expect(pipes.child, TEST_EXIT_VAL2); } crut_pipes_close(&pipes); cmd = crut_aprintf("exec %s %s", rstrt_cmd, filename); rc = system(cmd); if (!WIFEXITED(rc) || (WEXITSTATUS(rc) != TEST_EXIT_VAL3)) { printf("XXX system(%s) unexpectedly returned %d\n", cmd, rc); exit(1); } free(cmd); (void)unlink(filename); printf("# test: repeat previous test w/ --kill in the restart flags\n"); if (!crut_pipes_fork(&pipes)) { child_main(&pipes, base+37, flags, cb_exec23); exit(1); } else { cmd = crut_aprintf("exec %s --pid %d --kill --file %s --quiet", chkpt_cmd, pipes.child, filename); crut_pipes_expect(&pipes, MSG_CHILD_READY); rc = system(cmd); if (!WIFEXITED(rc) || (WEXITSTATUS(rc) != 0)) { printf("XXX system(%s) unexpectedly returned %d\n", cmd, rc); exit(1); } free(cmd); crut_waitpid_expect(pipes.child, TEST_EXIT_VAL2); } crut_pipes_close(&pipes); cmd = crut_aprintf("exec %s --kill %s", rstrt_cmd, filename); rc = system(cmd); if (!WIFEXITED(rc) || (WEXITSTATUS(rc) != TEST_EXIT_VAL3)) { printf("XXX system(%s) unexpectedly returned %d\n", cmd, rc); exit(1); } free(cmd); (void)unlink(filename); printf("# test: non-zero return from CONTINUE portion of a callback\n"); if (!crut_pipes_fork(&pipes)) { child_main(&pipes, base+42, flags, cb_return_cont); exit(1); } else { cmd = crut_aprintf("exec %s --pid %d --file %s --quiet", chkpt_cmd, pipes.child, filename); crut_pipes_expect(&pipes, MSG_CHILD_READY); rc = system(cmd); if (!WIFEXITED(rc) || (WEXITSTATUS(rc) != (CR_EPERMFAIL & 255))) { printf("XXX system(%s) unexpectedly returned %d\n", cmd, rc); exit(1); } free(cmd); crut_waitpid_expect_signal(pipes.child, SIGKILL); } crut_pipes_close(&pipes); (void)unlink(filename); printf("# test: non-zero return from RESTART portion of a callback\n"); if (!crut_pipes_fork(&pipes)) { child_main(&pipes, base+46, flags, cb_return_rstrt); exit(1); } else { cmd = crut_aprintf("exec %s --pid %d --file %s --quiet", chkpt_cmd, pipes.child, filename); crut_pipes_expect(&pipes, MSG_CHILD_READY); rc = system(cmd); if (!WIFEXITED(rc) || (WEXITSTATUS(rc) != 0)) { printf("XXX system(%s) unexpectedly returned %d\n", cmd, rc); exit(1); } free(cmd); crut_waitpid_expect(pipes.child, TEST_EXIT_VAL4); } crut_pipes_close(&pipes); cmd = crut_aprintf("exec %s %s --quiet", rstrt_cmd, filename); rc = system(cmd); if (!WIFEXITED(rc) || (WEXITSTATUS(rc) != (CR_ERSTRTABRT & 255))) { printf("XXX system(%s) unexpectedly returned %d\n", cmd, rc); exit(1); } free(cmd); (void)unlink(filename); return 50; } int main(int argc, char * const argv[]) { int count = 0; int mypid = getpid(); chkpt_cmd = crut_find_cmd(argv[0], "cr_checkpoint"); rstrt_cmd = crut_find_cmd(argv[0], "cr_restart"); setlinebuf(stdout); printf("%03d Process started with pid %d\n", count++, mypid); filename = crut_aprintf("context.%d", mypid); printf("## Begin CR_SIGNAL_CONTEXT tests\n"); count += run_tests(count, CR_SIGNAL_CONTEXT); if (crut_is_linuxthreads()) { fprintf(stderr, "Skipping threaded portion of 'cb_exit' tests due to LinuxThreads issues\n"); } else { printf("## Begin CR_THREAD_CONTEXT tests\n"); count += run_tests(count, CR_THREAD_CONTEXT); } printf("%03d DONE\n", count); return 0; } blcr-0.8.5/tests/dlopen_aux.c0000664000000000000000000000277611014417411013011 00000000000000#define _GNU_SOURCE 1 // For RTLD_DEFAULT #include #include #include #include #include #include #include #include "libcr.h" int main(void) { cr_client_id_t (*my_cr_init)(void); void *self_handle = dlopen(NULL, RTLD_LAZY); void *libcr_handle; cr_client_id_t client_id; my_cr_init = dlsym(self_handle, "cr_init"); if (my_cr_init != NULL) { fprintf(stderr, "cr_init found unexpectedly in 'self', before dlopen()\n"); exit(1); } my_cr_init = dlsym(RTLD_DEFAULT, "cr_init"); if (my_cr_init != NULL) { fprintf(stderr, "cr_init found unexpectedly in default search, before dlopen()\n"); exit(1); } libcr_handle = dlopen("libcr.so", RTLD_NOW); if (libcr_handle == NULL) { fprintf(stderr, "dlopen(libcr.so) failed unexpectedly. Bad LD_LIBRARY_PATH?\n"); exit(1); } my_cr_init = dlsym(self_handle, "cr_init"); if (my_cr_init != NULL) { fprintf(stderr, "cr_init found unexpectedly in 'self', after dlopen()\n"); exit(1); } my_cr_init = dlsym(RTLD_DEFAULT, "cr_init"); if (my_cr_init != NULL) { fprintf(stderr, "cr_init found unexpectedly in default search, after dlopen()\n"); exit(1); } my_cr_init = dlsym(libcr_handle, "cr_init"); if (my_cr_init == NULL) { fprintf(stderr, "cr_init not in dlopen()ed library\n"); exit(1); } client_id = my_cr_init(); if (client_id < 0) { fprintf(stderr, "cr_init() call failed\n"); exit(1); } return 0; } blcr-0.8.5/tests/orphan.c0000664000000000000000000000730111056065765012150 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2006, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * 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 * * $Id: orphan.c,v 1.5 2008/08/29 21:36:53 phargrov Exp $ * * Test of pipes w/ orphaned grandchild (a child of init). */ #include #include #include #include #include #include #include #include "crut.h" enum { MSG_PARENT_READY = 1, MSG_ORPHAN_GOOD, MSG_ORPHAN_BAD, MSG_CHILD_DONE }; static void sigpipe(int signo) { fprintf(stderr, "%d exiting on SIGPIPE\n", getpid()); exit(-1); } static int orphan_setup(void **p) { struct crut_pipes *pipes = malloc(sizeof(*pipes)); int retval; signal(SIGPIPE, &sigpipe); retval = crut_pipes_fork(pipes); if (!retval) { /* In the child */ int pid = fork(); if (pid < 0) { exit (-1); } else if (!pid) { /* In the grandchild */ while (1) { CRUT_DEBUG("Orphan entering read()"); crut_pipes_expect(pipes, MSG_PARENT_READY); CRUT_DEBUG("Orphan sees ppid %d", getppid()); crut_pipes_putchar(pipes, (getppid() == 1) ? MSG_ORPHAN_GOOD : MSG_ORPHAN_BAD); } exit(-1); // unreached } else { CRUT_DEBUG("Forked grandchild %d", pid); } exit(MSG_CHILD_DONE); } crut_waitpid_expect(pipes->child, MSG_CHILD_DONE); crut_pipes_putchar(pipes, MSG_PARENT_READY); crut_pipes_expect(pipes, MSG_ORPHAN_GOOD); *p = pipes; return retval; } static int orphan_precheckpoint(void *p) { struct crut_pipes *pipes = p; int retval = 0; CRUT_DEBUG("Getting ready to checkpoint"); crut_pipes_putchar(pipes, MSG_PARENT_READY); crut_pipes_expect(pipes, MSG_ORPHAN_GOOD); return retval; } static int orphan_continue(void *p) { struct crut_pipes *pipes = p; int retval = 0; CRUT_DEBUG("Continuing after checkpoint."); crut_pipes_putchar(pipes, MSG_PARENT_READY); crut_pipes_expect(pipes, MSG_ORPHAN_GOOD); return retval; } static int orphan_restart(void *p) { struct crut_pipes *pipes = p; int retval = 0; CRUT_DEBUG("Restarting from checkpoint."); crut_pipes_putchar(pipes, MSG_PARENT_READY); crut_pipes_expect(pipes, MSG_ORPHAN_GOOD); return retval; } int main(int argc, char *argv[]) { int ret; struct crut_operations orphan_test_ops = { test_scope:CR_SCOPE_PGRP, test_name:"orphan", test_description:"Orphan tester. Tests BLCR recovery of children of init.", test_setup:orphan_setup, test_precheckpoint:orphan_precheckpoint, test_continue:orphan_continue, test_restart:orphan_restart, test_teardown:NULL, }; /* add the test */ crut_add_test(&orphan_test_ops); ret = crut_main(argc, argv); return ret; } blcr-0.8.5/tests/crut_wrapper.c0000664000000000000000000002330511156265612013372 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2008, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * 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 * * $Id: crut_wrapper.c,v 1.16.4.1 2009/03/12 20:07:38 phargrov Exp $ * * Runs a crut-style test. * * Runs the checkpoint. Checks the error code. * Restarts from context file. Checks error code again. * */ #define _LARGEFILE64_SOURCE 1 #include #include #include #include #include #include #include #include #include #ifndef O_LARGEFILE #define O_LARGEFILE 0 #endif #include "crut_util.h" static int test_timeout = 60; static const char *argv0 = ","; static char *test_path = ","; static char *crut_arguments = NULL; static const char *crut_cmd[6]; /* Max is PROG, -v, -d, -F, subtest, NULL */ static int crut_argc = 1; static int opt_verbose = 0; static int opt_debug = 0; static int opt_keep = 0; static int opt_fake = 0; /* * die(format, args...) * * Sends an error message to stderr and exits */ static void die(const char *format, ...) { va_list args; va_start(args, format); vfprintf(stderr, format, args); va_end(args); fputc('\n', stderr); exit(1); } static void blabber(const char *format, ...) { va_list args; if (opt_verbose >= 2) { va_start(args, format); vfprintf(stdout, format, args); va_end(args); if (opt_debug) putchar('\n'); } } static void verbose(const char *format, ...) { va_list args; if (opt_verbose == 1) { va_start(args, format); vfprintf(stdout, format, args); va_end(args); if (opt_debug) putchar('\n'); } } static void subdued(const char *format, ...) { va_list args; if (opt_verbose == 0) { va_start(args, format); vfprintf(stdout, format, args); va_end(args); if (opt_debug) putchar('\n'); } } /* * Setup variables from env, args, etc. * Returns NULL-terminated array of tests */ static char **setup(int argc, const char **argv) { char **retval = NULL; const char *val; int opt_quiet = 0; int argi; val = getenv("CRUT_TIMEOUT"); if (val && (atoi(val) > 0)) { test_timeout = atoi(val); } test_path = crut_find_testsdir(argv[0]); argv0 = argv[0]; for (argi = 1; argi < argc; ++argi) { val = argv[argi]; if ((val[0] != '-') || (strlen(val) != 2)) break; switch (val[1]) { case 'k': opt_keep=1; break; case 'v': ++opt_verbose; break; case 'q': opt_quiet = 1; break; case 'F': opt_fake=1; break; case 'd': opt_debug=1; break; default: die("Unknown option '%s'", val); } } if (opt_verbose == 3) { crut_arguments = strdup("-d"); crut_cmd[crut_argc++] = "-d"; putenv("LIBCR_TRACE_MASK=0xffff"); } else if (opt_verbose == 2) { crut_arguments = strdup("-v"); crut_cmd[crut_argc++] = "-v"; } else { crut_arguments = strdup(""); } if (opt_fake) { crut_arguments = crut_sappendf(crut_arguments, " -F"); crut_cmd[crut_argc++] = "-F"; } if (opt_debug) { crut_arguments = crut_sappendf(crut_arguments, " -d"); crut_cmd[crut_argc++] = "-d"; } crut_cmd[crut_argc+1] = NULL; if (crut_argc+1 > 5) die("OOPS"); if (argi < argc) { int len = argc - argi; int i; retval = malloc((1+len) * sizeof(char *)); for (i=0; i #include #include #include #include #include #include #include #include #include #include #include "crut_util.h" volatile struct { int limit; int next; char **array; } output; struct ignore_s { struct ignore_s *next; regex_t regex; char *patt; // For debuging } *ignore_list = NULL; volatile int fail = 0; volatile int child_pid = 0; int opt_verbose = 0; static void verbose(const char *fmt, ...) __attribute__((format (printf, 1, 2))); static void verbose(const char *fmt, ...) { if (opt_verbose) { va_list args; va_start(args, fmt); vfprintf(stderr, fmt, args); va_end(args); } } /* Spawn the child * Like popen(cmd, "r"), but w/ a setpgrp() and storing the pid */ FILE *spawn_child(const char *argv0) { char *tmp, *dir, *test, *cmd; int pipefds[2]; int rc; /* Extract dirname from argv0 */ dir = crut_find_testsdir(argv0); /* Extract basename from argv0 */ test = crut_basename(argv0); /* Chop the .st suffix */ tmp = strstr(test, ".st"); if (!tmp) { fprintf(stderr, "'%s' has no .st suffix\n", test); return NULL; } *tmp = '\0'; /* check the path */ cmd = crut_aprintf("%s/%s", dir, test); free(test); free(dir); if (access(cmd, X_OK)) { fprintf(stderr, "Cannot access '%s': %s\n", cmd, strerror(errno)); return NULL; } /* prepare pipe for test output */ rc = pipe(pipefds); if (rc) { perror("pipe()"); return NULL; } /* fork() and exec() it */ crut_block_sigttou(); rc = fork(); if (rc < 0) { perror("fork()"); return NULL; } else if (!rc) { /* Child */ setpgid(0,0); alarm(0); rc = dup2(pipefds[1], STDOUT_FILENO); if (rc < 0) { perror("dup2(stdout)"); exit(-1); } (void)close(pipefds[0]); (void)close(pipefds[1]); rc = execl(cmd, cmd, NULL); perror("execl()"); exit(-1); } setpgid(rc,rc); (void)close(pipefds[1]); child_pid = rc; free(cmd); return fdopen(pipefds[0], "r"); } /* Add a (compiled) regex to the list of patterns to ignore. * "eats" expr. */ void push_ignore(char *expr) { struct ignore_s *elem = malloc(sizeof(struct ignore_s)); int rc = regcomp(&elem->regex, expr, REG_EXTENDED|REG_NOSUB); if (rc) { fprintf(stderr, "ERROR: bad regexp '%s'\n", expr); free(elem); } else { elem->patt = expr; elem->next = ignore_list; ignore_list = elem; } } /* Check a string against the list of patterns */ int check_ignore(const char *line) { struct ignore_s *elem; for (elem = ignore_list; elem; elem = elem->next) { if (0 == regexec(&elem->regex, line, 0, NULL, 0)) { verbose("@ ignore line '%s' by pattern '%s'\n", line, elem->patt); return 1; } } return 0; } /* Init the array of saved lines of output */ void init_output(void) { const char *str = getenv("SEQ_STDERR_LIMIT"); int val; output.limit = 40; if (str && (sscanf(str, "%d", &val) == 1) && (val > 0)) { output.limit = val; } output.next = 0; output.array = calloc(output.limit, sizeof(char *)); } /* Add a line to the saved output, discarding an old one if needed */ void push_line(char *line) { int i = output.next; output.next = i+1; if (output.next == output.limit) output.next = 0; free(output.array[i]); output.array[i] = line; } /* Add a line to saved output, making a copy of the argument */ void push_dup(const char *line) { push_line(strdup(line)); } /* Dump the saved output */ void dump_lines(void) { int i = output.next; int j; if (output.array[i]) { fprintf(stderr, "...showing only last %i lines...\n", output.limit); } for (j = 0; j < output.limit; ++j) { if (output.array[i]) { fputs(output.array[i], stderr); } if (++i == output.limit) i = 0; } } void cleanup(void) { struct ignore_s *elem; int i; for (i = 0; i < output.limit; ++i) { free(output.array[i]); } free(output.array); elem = ignore_list; while (elem) { struct ignore_s *next = elem->next; regfree(&elem->regex); free(elem->patt); free(elem); elem = next; } } /* Kill the child's pgrp on SIGALRM */ void alarm_handler(int signo) { if (child_pid) { kill(-child_pid, SIGKILL); } push_dup("!!! Alarm clock expired\n"); fail++; } int main(int argc, char **argv) { FILE *child; char *line = NULL; size_t len = 0; int lineno = 0; int done = 0; int exit_status = 0; int exit_signal = -1; int rc; /* Initialization */ init_output(); push_ignore(strdup("^#")); signal(SIGALRM, alarm_handler); /* Parse command line */ if ((argc > 1) && !strcmp(argv[1], "-v")) { opt_verbose = 1; } /* Start the actual test program */ child = spawn_child(argv[0]); if (!child) { fprintf(stderr, "Failed to start the test\n"); return -1; } /* Process the tests output */ /* loop over lines of the child's output */ while (crut_getline(&line, &len, child) != -1) { int tmp_int; char *tmp_str; /* Save in the output ring buffer */ push_dup(line); /* Drop the newline */ line = crut_chomp(line); /* Process directive lines and ignored patterns */ if (!strncmp(line, "#ST_IGNORE:", 11)) { tmp_str = strdup(line+11); push_ignore(tmp_str); verbose("@ ignore pattern '%s'\n", tmp_str); continue; } else if (!strncmp(line, "#ST_SIGNAL:", 11)) { exit_signal = atoi(line+11); exit_status = -1; verbose("@ expect fatal signal %d\n", exit_signal); continue; } else if (!strncmp(line, "#ST_RETURN:", 11)) { exit_status = atoi(line+11); exit_signal = -1; verbose("@ expect exit status %d\n", exit_status); continue; } else if (!strncmp(line, "#ST_ALARM:", 10)) { alarm(atoi(line+10)); verbose("@ set alarm %d\n", atoi(line+10)); continue; } else if (check_ignore(line)) { continue; } /* look for the required "tag": an integer at the start of the line. * Note the check of strspn() here ensures we DON'T allow any leading * whitespace as use of sscanf() alone would do. */ tmp_str = line + strspn(line, "0123456789"); if ((tmp_str == line) || (1 != sscanf(line, "%d ", &tmp_int)) || (tmp_int != lineno)) { push_line(crut_aprintf("!!! Expecting tag %d, but got '%s'\n", lineno, line)); ++fail; continue; } /* Look for possible whitespace+"DONE" */ tmp_int = strspn(tmp_str, "\t "); if (tmp_int && !strcmp(tmp_str+tmp_int, "DONE")) { done = lineno + 1; } /* Advance the lineno that the tag will be checked against */ ++lineno; } fclose(child); free(line); /* Check that the output is properly terminated */ if (!done) { push_dup("!!! Missing final DONE\n"); ++fail; } else if (done != lineno) { push_dup("!!! Output follows DONE\n"); ++fail; } /* Reap the child and check the exit status */ while ((waitpid(child_pid, &rc, 0) < 0) && (errno == EINTR)) { ; /* retry on non-fatal signals */ } if (WIFEXITED(rc) && (WEXITSTATUS(rc) == 77)) { /* Automake's special "skipped test" case. */ return 77; } else if (WIFEXITED(rc)) { int tmp = WEXITSTATUS(rc); if (tmp != exit_status) { push_line(crut_aprintf("!!! Test exited with unexpected status %d\n", tmp)); fail++; } } else { int tmp = WTERMSIG(rc); if (tmp != exit_signal) { push_line(crut_aprintf("!!! Test killed unexpectedly by signal %d\n", tmp)); fail++; } } if (fail) { fprintf(stderr, "Detected %d failures in %s:\n", fail, argv[0]); dump_lines(); } cleanup(); return fail ? 1 : 0; } blcr-0.8.5/tests/simple.c0000664000000000000000000000571211056065765012156 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2003, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * 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 * * $Id: simple.c,v 1.9 2008/08/29 21:36:53 phargrov Exp $ * * Simple example for using crut */ #include #include #include #include #include #include #include #include #include "crut.h" #define MSG "Hello world!\n" static int my_pid; static int simple_setup(void **testdata) { char msg[] = MSG; void *p; CRUT_DEBUG("Initializing simple."); CRUT_DEBUG("sizeof(msg) = %d", (int)sizeof(msg)+1); p = malloc(sizeof(msg)+1); if (p == NULL) { return -1; } memcpy(p, msg, sizeof(msg)+1); *testdata = p; return 0; } static int simple_precheckpoint(void *p) { int retval; CRUT_DEBUG("Testing sanity before we checkpoint"); retval = strncmp((char *)p, MSG, sizeof(MSG)) ? -1 : 0; my_pid = (int)getpid(); return retval; } static int simple_continue(void *p) { int retval; CRUT_DEBUG("Continuing after checkpoint."); retval = strncmp((char *)p, MSG, sizeof(MSG)) ? -1 : 0; if (my_pid != (int)getpid()) { retval = -1; } return retval; } static int simple_restart(void *p) { int retval; CRUT_DEBUG("Restarting from checkpoint."); retval = strncmp((char *)p, MSG, sizeof(MSG)) ? -1 : 0; if (my_pid != (int)getpid()) { retval = -1; } return retval; } static int simple_teardown(void *p) { free(p); return 0; } int main(int argc, char *argv[]) { int ret; struct crut_operations simple_test_ops = { test_scope:CR_SCOPE_PROC, test_name:"simple_rw", test_description:"Simple example test.", test_setup:simple_setup, test_precheckpoint:simple_precheckpoint, test_continue:simple_continue, test_restart:simple_restart, test_teardown:simple_teardown, }; /* add the basic tests */ crut_add_test(&simple_test_ops); ret = crut_main(argc, argv); return ret; } blcr-0.8.5/tests/cr_tryenter_cs.c0000664000000000000000000000626311125133373013700 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2008, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * 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 * * $Id: cr_tryenter_cs.c,v 1.10 2008/12/26 10:50:35 phargrov Exp $ */ #include #include #include #include #include #include #include "libcr.h" #include "crut_util.h" #define LIMIT 30 static volatile int dummy = 0; static volatile int counter = 0; static volatile int done = 0; static int my_callback(void *arg) { printf("%d enter callback\n", 3*counter+1); (void)cr_checkpoint(CR_CHECKPOINT_READY); printf("%d leave callback\n", 3*counter+2); return 0; } static void *thread_main(void *arg) { cr_client_id_t my_id; my_id = cr_init(); if (my_id < 0) { printf("XXX cr_init() failed\n"); exit(-1); } fprintf(stderr, "cr_tryenter_cs:"); crut_progress_start(time(NULL), LIMIT, 10); do { int prev = dummy; printf("%d issue request %d\n", 3*counter, counter); crut_checkpoint_block(NULL); ++counter; while (dummy == prev) sched_yield(); // Avoid overflowing stack with nested signal frames } while (crut_progress_step(time(NULL))); done = 1 | dummy; return NULL; } int main(void) { pthread_t th; int join_ret; void *join_val; cr_callback_id_t cb_id; cr_client_id_t my_id; unsigned long count = 0; setlinebuf(stdout); printf("#ST_ALARM:%d\n", 2*LIMIT); my_id = cr_init(); if (my_id < 0) { printf("XXX cr_init() failed\n"); exit(-1); } cb_id = cr_register_callback(my_callback, NULL, CR_THREAD_CONTEXT); if (cb_id < 0) { printf("XXX cr_register_callback() unexpectedly returned %d\n", cb_id); exit(-1); } if (crut_pthread_create(&th, NULL, &thread_main, NULL) != 0) { printf("XXX pthread_create() unexpectedly failed\n"); exit(-1); } do { while (cr_tryenter_cs(my_id)) { ++count; sched_yield(); } dummy = dummy ^ counter; cr_leave_cs(my_id); } while (!done); join_ret = pthread_join(th, &join_val); if (join_ret || join_val) { printf("XXX pthread_join() unexpectedly failed\n"); exit(-1); } printf("# %lu retries\n", count); printf("%d DONE\n", 3*counter); return 0; } blcr-0.8.5/tests/gcj_test.sh0000664000000000000000000000170611005167617012647 00000000000000#!/bin/sh # Test gcj (the Java native compiler from the GNU Compiler Collection) # First check that we *have* gcj gcj --version >/dev/null || exit 77 . ${cr_testsdir:-`dirname $0`}/shellinit top_srcdir=${top_srcdir:-..} filelist="CountingApp Context[12] .Context[12].tmp" \rm -f $filelist 2>/dev/null trap "\rm -f $filelist 2>/dev/null" 0 gcj --main=CountingApp -o CountingApp $top_srcdir/tests/CountingApp.java >/dev/null 2>&1 if [ $? != 0 ]; then echo "Warning: gcj failed to compile CountingApp.java" >&2 exit 77 fi exec 2>/dev/null # To drop job control messages echo '#ST_ALARM:120' $cr_run ./CountingApp 2>&1 & pid=$! sleep 3 echo "# Checkpoint 1" $cr_checkpoint --file=Context1 --term $pid 2>&1 wait sleep 3 echo "# Restart 1" $cr_restart Context1 2>&1 & pid=$! sleep 3 echo "# Checkpoint restarted child" $cr_checkpoint --file=Context2 --term --tree $pid 2>&1 wait sleep 3 echo "# Restart^2" $cr_restart Context2 2>&1 & pid=$! wait echo "10 DONE" blcr-0.8.5/tests/dup.c0000664000000000000000000001674011056065765011460 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2003, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * 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 * * $Id: dup.c,v 1.15 2008/08/29 21:36:53 phargrov Exp $ * * Simple example for using crut */ #include #include #include #include #include #include #include #include #include #include "crut.h" #include "libcr.h" #define TEST_PREFIX "tstfile" #define TEST_FILE_MODE 0660 #define MAX_TEST_FILENAME 255 #define MAX_FD 8*1024 /* * describes a pair of dup'd file descriptors * * everything about 'em should be the same */ struct dup_fd { int fd1; int fd2; char *filename; }; extern cr_checkpoint_handle_t crut_cr_handle; static int is_cr_fd(int fd) { /* This is a horrible hack! */ return (fd == (int)crut_cr_handle); } /* * get_dup_status */ static int * get_dup_stats(void) { int *dup_stats; int tmp_fd; int i; CRUT_DEBUG("in get_dup_stats"); dup_stats = malloc(sizeof(*dup_stats) * MAX_FD); if (dup_stats == NULL) { perror("malloc"); goto out; } for (i=MAX_FD-1; i>=0; --i) { tmp_fd = dup(i); if (tmp_fd < 0) { dup_stats[i] = errno; } else { CRUT_DEBUG("Closing %d (dup of %d)", tmp_fd, i); close(tmp_fd); dup_stats[i] = 0; } } return dup_stats; out: return NULL; } /* * The whole stat structure ought to match... */ static int check_stat_all(int fd1, int fd2) { struct stat stat1; struct stat stat2; int retval; retval = fstat(fd1, &stat1); if (retval < 0) { perror("fstat"); goto out; } retval = fstat(fd2, &stat2); if (retval < 0) { perror("fstat"); goto out; } retval = statcmp(&stat1, &stat2, ST_DEV | ST_INO | ST_NLINK | ST_UID | ST_GID | ST_RDEV | ST_SIZE | ST_BLKSIZE | ST_BLOCKS); /* * return < 0 on mismatch */ if (retval) { CRUT_FAIL("stat structures did not match"); retval = -retval; } out: return retval; } static int check_flags(int fd1, int fd2) { int flags1; int flags2; int retval; flags1 = fcntl(fd1, F_GETFL); if (flags1 < 0) { perror("fcntl"); retval = flags1; goto out; } flags2 = fcntl(fd2, F_GETFL); if (flags2 < 0) { perror("fcntl"); retval = flags2; goto out; } retval = 0; if (flags1 != flags2) { CRUT_FAIL("flags did not match %d != %d", flags1, flags2); retval = -1; } out: return retval; } static int check_offset(int fd1, int fd2) { int offset1; int offset2; int retval; offset1 = lseek(fd1, 0, SEEK_CUR); if (offset1 < 0) { perror("fcntl"); retval = offset1; goto out; } offset2 = lseek(fd2, 0, SEEK_CUR); if (offset2 < 0) { perror("fcntl"); retval = offset2; goto out; } if (offset1 != offset2) { CRUT_FAIL("offset did not match %d != %d", offset1, offset2); retval = -1; } retval = 0; out: return retval; } static int dup_setup(void **testdata) { struct dup_fd *dupfds; int retval = -1; *testdata = NULL; dupfds = malloc(sizeof(*dupfds)); if (dupfds == NULL) { perror("malloc"); goto out; } dupfds->filename = crut_aprintf("%s.%d", TEST_PREFIX, 0); (void)unlink(dupfds->filename); dupfds->fd1 = open(dupfds->filename, O_RDWR | O_CREAT | O_EXCL, TEST_FILE_MODE); if (dupfds->fd1 < 0) { perror("open"); retval = dupfds->fd1; goto out_free; } dupfds->fd2 = dup2(dupfds->fd1, 100); if (dupfds->fd2 < 0) { perror("dup2"); goto out_unlink; } *testdata = dupfds; retval = 0; return retval; out_unlink: if (unlink(dupfds->filename) < 0) { perror("unlink"); } out_free: free(dupfds); out: return retval; } /* * Tries to dup every available fd (even closed) to make sure nothing * succeeds unexpectedly (if cr_rstrt_req.c forgets to close something from * cr_restart), or * fails unexpectedly (if cr_rstrt_req.c forgot to open something). */ static int dup_spurious_setup(void **testdata) { int *dup_stats; dup_stats = get_dup_stats(); if (dup_stats == NULL) { return -1; } *testdata = dup_stats; return 0; } static int dup_precheckpoint(void *p) { return 0; } static int dup_spurious_check(void *p) { int *old_dup_stats = (int *)p; int *new_dup_stats; int retval=-1; int i; new_dup_stats = get_dup_stats(); for (i=0; ifd1, dupfds->fd2); if (retval < 0) { goto out; } retval = check_flags(dupfds->fd1, dupfds->fd2); if (retval < 0) { goto out; } retval = check_offset(dupfds->fd1, dupfds->fd2); if (retval < 0) { goto out; } retval = 0; out: CRUT_DEBUG("retval = %d", retval); return retval; } static int dup_teardown(void *p) { struct dup_fd *dupfds = (struct dup_fd *)p; if (unlink(dupfds->filename) < 0) { perror("unlink"); } free(p); return 0; } static int dup_spurious_teardown(void *p) { free(p); return 0; } int main(int argc, char *argv[]) { int ret; struct crut_operations dup_test_ops = { test_scope:CR_SCOPE_PROC, test_name:"dup_simple", test_description:"Tests whether a dup'd file works after restart.", test_setup:dup_setup, test_precheckpoint:dup_precheckpoint, test_continue:dup_continue, test_restart:dup_restart, test_teardown:dup_teardown, }; struct crut_operations dup_spurious_test_ops = { test_scope:CR_SCOPE_PROC, test_name:"dup_spurious", test_description:"Makes sure you can't dup things that you shouldn't.", test_setup:dup_spurious_setup, test_precheckpoint:dup_spurious_check, test_continue:dup_spurious_check, test_restart:dup_spurious_check, test_teardown:dup_spurious_teardown, }; /* add the basic tests */ crut_add_test(&dup_test_ops); crut_add_test(&dup_spurious_test_ops); ret = crut_main(argc, argv); return ret; } blcr-0.8.5/tests/reloc_dir.sh0000664000000000000000000000105411015417120012767 00000000000000#!/bin/sh set -e . ${cr_testsdir:-`dirname $0`}/shellinit context=`pwd`/Context1 # TMPDIR=`cd ${TMPDIR:-/tmp} && $cr_pwd` MY_TMPDIR1=`mktemp -d ${TMPDIR}/blcr_reloc.XXXXXX` MY_TMPDIR2=`mktemp -d ${TMPDIR}/blcr_reloc.XXXXXX` trap "\rm -rf ${MY_TMPDIR1} ${MY_TMPDIR2} $context 2>/dev/null" 0 cp -f ${cr_testsdir}/reloc_aux ${MY_TMPDIR1}/reloc_exe ${cr_run} ${MY_TMPDIR1}/reloc_exe ${MY_TMPDIR1} "$context --clobber" # Move the cwd mv -f ${MY_TMPDIR1}/reloc_dir ${MY_TMPDIR2}/ ${cr_restart} --relocate ${MY_TMPDIR1}/reloc_dir=${MY_TMPDIR2}/reloc_dir $context blcr-0.8.5/tests/hooks.c0000664000000000000000000002167511114414150011773 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2003, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * 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 * * $Id: hooks.c,v 1.6 2008/11/30 04:36:56 phargrov Exp $ * * Simple example for using crut */ #include #include #include #include #include #include #include "libcr.h" #include "crut.h" #include "crut_util.h" volatile int my_pid; static int my_barrier_before; static int my_barrier_after; typedef enum { TEST_WHEN_CONT, TEST_WHEN_RSTRT } test_when_t; struct testdata { cr_hook_event_t event; test_when_t when; pthread_t thread; }; static void * do_thread_stuff(void *p) { int *thread_ret; my_pid = getpid(); thread_ret = malloc(sizeof(int)); if (thread_ret == NULL) { goto out_nomem; } CRUT_DEBUG("thread_ret = %p", thread_ret); crut_barrier(&my_barrier_before); crut_wait(CRUT_EVENT_CONTINUE); /* Also wakes on _RESTART */ crut_barrier(&my_barrier_after); *thread_ret = (uintptr_t)p; return thread_ret; out_nomem: return NULL; } static int my_callback(void *arg) { return 0; } static pthread_mutex_t my_lock = PTHREAD_MUTEX_INITIALIZER; static int my_event = -1; static void my_hook(cr_hook_event_t event) { cr_hook_event_t old; if ((getpid() != my_pid) && ((event == CR_HOOK_CONT_NO_CALLBACKS) || (event == CR_HOOK_RSTRT_NO_CALLBACKS))) { CRUT_DEBUG("Ignoring event from \"extra\" thread (e.g. LinuxTheads manager)"); return; } pthread_mutex_lock(&my_lock); old = my_event; my_event = event; pthread_mutex_unlock(&my_lock); if (old != -1) { CRUT_FAIL("More than one event seen"); exit(1); } } static int check_event(cr_hook_event_t want) { cr_hook_event_t got; int retval = 0; pthread_mutex_lock(&my_lock); got = my_event; pthread_mutex_unlock(&my_lock); if (got != want) { CRUT_FAIL("Expected my_event==%d, but got %d", want, got); retval = -1; } else { CRUT_DEBUG("Got expected my_event==%d", want); } return retval; } static struct testdata * hooks_setup_common(cr_hook_event_t event, test_when_t when, int threads) { struct testdata *td; td = malloc(sizeof(*td)); if (td) { cr_register_hook(event, my_hook); td->event = event; td->when = when; } if (threads) { my_barrier_before = 1+threads; } my_barrier_after = 1+threads; my_pid = getpid(); return td; } static int hooks_setup_nocb(void **testdata, cr_hook_event_t event, test_when_t when) { struct testdata *td; int retval; pthread_t *test_thread = malloc(sizeof(pthread_t)); td = hooks_setup_common(event, when, 1); if (!td) { retval = -1; goto out_nomem; } retval = crut_pthread_create(&td->thread, NULL, do_thread_stuff, NULL); if (retval) { perror("pthread_create"); retval = -1; goto out_nothread; } crut_barrier(&my_barrier_before); *testdata = td; return 0; if (pthread_cancel(*test_thread)) { perror("pthread_cancel"); } out_nothread: free(test_thread); out_nomem: *testdata = NULL; return retval; } static int hooks_teardown_nocb(void *p) { struct testdata *td = p; int retval; int join_ret; void *pthread_ret; int *thread_ret; retval = 0; join_ret = pthread_join(td->thread, &pthread_ret); if (join_ret) { /* what else can we do? */ perror("pthread_join"); retval = join_ret; } thread_ret = (int *) pthread_ret; /* check return value from thread */ if (thread_ret != NULL) { CRUT_DEBUG("Thread return *(%p)=%d.", thread_ret, *thread_ret); if (*thread_ret < 0) { CRUT_FAIL("Thread failed (return %d)", *thread_ret); } free(pthread_ret); } else { CRUT_FAIL("Thread failed (returned NULL)"); } free(p); return retval; } static int hooks_setup_cont_nocb(void **testdata) { return hooks_setup_nocb(testdata, CR_HOOK_CONT_NO_CALLBACKS, TEST_WHEN_CONT); } static int hooks_setup_rstrt_nocb(void **testdata) { return hooks_setup_nocb(testdata, CR_HOOK_RSTRT_NO_CALLBACKS, TEST_WHEN_RSTRT); } static int hooks_setup_cont_sig(void **testdata) { *testdata = hooks_setup_common(CR_HOOK_CONT_SIGNAL_CONTEXT, TEST_WHEN_CONT, 0); return testdata ? 0 : -1; } static int hooks_setup_rstrt_sig(void **testdata) { *testdata = hooks_setup_common(CR_HOOK_RSTRT_SIGNAL_CONTEXT, TEST_WHEN_RSTRT, 0); return testdata ? 0 : -1; } static int hooks_setup_cont_thr(void **testdata) { cr_register_callback(my_callback, NULL, CR_THREAD_CONTEXT); *testdata = hooks_setup_common(CR_HOOK_CONT_THREAD_CONTEXT, TEST_WHEN_CONT, 0); return testdata ? 0 : -1; } static int hooks_setup_rstrt_thr(void **testdata) { cr_register_callback(my_callback, NULL, CR_THREAD_CONTEXT); *testdata = hooks_setup_common(CR_HOOK_RSTRT_THREAD_CONTEXT, TEST_WHEN_RSTRT, 0); return testdata ? 0 : -1; } static int hooks_precheckpoint(void *p) { CRUT_DEBUG("Preparing to checkpoint."); return check_event(-1); } static int hooks_continue(void *p) { struct testdata *td = p; CRUT_DEBUG("Continuing after checkpoint."); crut_barrier(&my_barrier_after); return check_event((td->when == TEST_WHEN_CONT) ? td->event : -1); } static int hooks_restart(void *p) { struct testdata *td = p; CRUT_DEBUG("Restarting from checkpoint."); crut_barrier(&my_barrier_after); return check_event((td->when == TEST_WHEN_RSTRT) ? td->event : -1); } int main(int argc, char *argv[]) { int ret; struct crut_operations cont_nocb_test_ops = { test_scope:CR_SCOPE_PROC, test_name:"hooks_cont_nocb", test_description:"Simple test of cr_regsiter_hook(CR_HOOK_CONT_NO_CALLBACKS).", test_setup:hooks_setup_cont_nocb, test_precheckpoint:hooks_precheckpoint, test_continue:hooks_continue, test_restart:hooks_restart, test_teardown:hooks_teardown_nocb, }; struct crut_operations rstrt_nocb_test_ops = { test_scope:CR_SCOPE_PROC, test_name:"hooks_rstrt_nocb", test_description:"Simple test of cr_regsiter_hook(CR_HOOK_RSTRT_NO_CALLBACKS).", test_setup:hooks_setup_rstrt_nocb, test_precheckpoint:hooks_precheckpoint, test_continue:hooks_continue, test_restart:hooks_restart, test_teardown:hooks_teardown_nocb, }; struct crut_operations cont_sig_test_ops = { test_scope:CR_SCOPE_PROC, test_name:"hooks_cont_sig", test_description:"Simple test of cr_regsiter_hook(CR_HOOK_CONT_SIGNAL_CONTEXT).", test_setup:hooks_setup_cont_sig, test_precheckpoint:hooks_precheckpoint, test_continue:hooks_continue, test_restart:hooks_restart, test_teardown:NULL, }; struct crut_operations rstrt_sig_test_ops = { test_scope:CR_SCOPE_PROC, test_name:"hooks_rstrt_sig", test_description:"Simple test of cr_regsiter_hook(CR_HOOK_RSTRT_SIGNAL_CONTEXT).", test_setup:hooks_setup_rstrt_sig, test_precheckpoint:hooks_precheckpoint, test_continue:hooks_continue, test_restart:hooks_restart, test_teardown:NULL, }; struct crut_operations cont_thr_test_ops = { test_scope:CR_SCOPE_PROC, test_name:"hooks_cont_thr", test_description:"Simple test of cr_regsiter_hook(CR_HOOK_CONT_THREAD_CONTEXT).", test_setup:hooks_setup_cont_thr, test_precheckpoint:hooks_precheckpoint, test_continue:hooks_continue, test_restart:hooks_restart, test_teardown:NULL, }; struct crut_operations rstrt_thr_test_ops = { test_scope:CR_SCOPE_PROC, test_name:"hooks_rstrt_thr", test_description:"Simple test of cr_regsiter_hook(CR_HOOK_RSTRT_THREAD_CONTEXT).", test_setup:hooks_setup_rstrt_thr, test_precheckpoint:hooks_precheckpoint, test_continue:hooks_continue, test_restart:hooks_restart, test_teardown:NULL, }; /* add the tests */ crut_add_test(&cont_sig_test_ops); crut_add_test(&cont_thr_test_ops); crut_add_test(&cont_nocb_test_ops); crut_add_test(&rstrt_sig_test_ops); crut_add_test(&rstrt_thr_test_ops); crut_add_test(&rstrt_nocb_test_ops); ret = crut_main(argc, argv); return ret; } blcr-0.8.5/tests/reloc_fifo.sh0000664000000000000000000000106711015417120013140 00000000000000#!/bin/sh set -e . ${cr_testsdir:-`dirname $0`}/shellinit context=`pwd`/Context1 # TMPDIR=`cd ${TMPDIR:-/tmp} && $cr_pwd` MY_TMPDIR1=`mktemp -d ${TMPDIR}/blcr_reloc.XXXXXX` MY_TMPDIR2=`mktemp -d ${TMPDIR}/blcr_reloc.XXXXXX` trap "\rm -rf ${MY_TMPDIR1} ${MY_TMPDIR2} $context 2>/dev/null" 0 cp -f ${cr_testsdir}/reloc_aux ${MY_TMPDIR1}/reloc_exe ${cr_run} ${MY_TMPDIR1}/reloc_exe ${MY_TMPDIR1} "$context --clobber" # Move the open() fifo mv -f ${MY_TMPDIR1}/reloc_fifo ${MY_TMPDIR2}/ ${cr_restart} --relocate ${MY_TMPDIR1}/reloc_fifo=${MY_TMPDIR2}/reloc_fifo $context blcr-0.8.5/tests/ruby_test.sh0000664000000000000000000000234711015415407013061 00000000000000#!/bin/sh # First check that we *have* ruby ruby -e '' || exit 77 . ${cr_testsdir:-`dirname $0`}/shellinit \rm -f Context[123] .Context[123].tmp 2>/dev/null bash <<-'__EOF__' exec 2>/dev/null # Drop job control message(s) from the outer script echo '#ST_ALARM:120' $cr_run ruby -e ' include Process STDOUT.sync=true $chkpt_cmd = ENV['\''cr_checkpoint'\''] $rstrt_cmd = ENV['\''cr_restart'\''] def checkpoint(file,pid) system "#{$chkpt_cmd} --file=#{file} --kill --tree #{pid}" waitpid(pid) if pid != $$ sleep 1 end def restart(file) pid = fork { exec "#{$rstrt_cmd} #{file}" } sleep 3 return pid end pid = fork { 0.upto(15) {|n| print "#{n} Hello\n"; sleep 1} } sleep 3 print "# Checkpoint original child\n" checkpoint("Context1",pid) print "# Restart 1\n" pid = restart "Context1" print "# Checkpoint restarted child\n" checkpoint("Context2",pid) print "# Restart^2\n" pid = restart "Context2" print "# Checkpoint self\n" checkpoint("Context3",$$) waitpid pid print "16 DONE\n" exit 0' 2>&1 exec 2>&1 sleep 3 echo "# Restart interpreter" $cr_restart Context3 __EOF__ \rm -f Context[123] .Context[123].tmp 2>/dev/null blcr-0.8.5/tests/crut.h0000664000000000000000000000421611120345066011630 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2003, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * 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 * * $Id: crut.h,v 1.10 2008/12/12 02:19:34 phargrov Exp $ * * Header for BLCR unit test functions */ #include "blcr_common.h" /* For internal bits */ #include "crut_util.h" /* * limits */ #define CRUT_MAX_TESTS 255 #define CRUT_TESTNAME_MAX 80 #define CRUT_TESTDESC_MAX 255 /* * constants for crut_wait() */ #define CRUT_EVENT_SETUP 10 #define CRUT_EVENT_PRECHECKPOINT 20 #define CRUT_EVENT_CONTINUE 30 #define CRUT_EVENT_RESTART 40 #define CRUT_EVENT_TEARDOWN 50 #define CRUT_EVENT_NEVER 1000 __BEGIN_DECLS typedef int crut_event_t; struct crut_operations { cr_scope_t test_scope; char test_name[CRUT_TESTNAME_MAX+1]; char test_description[CRUT_TESTDESC_MAX+1]; int (*test_setup)(void **); int (*test_teardown)(void *); int (*test_precheckpoint)(void *); int (*test_continue)(void *); int (*test_restart)(void *); }; extern int crut_main(int argc, char * const *argv); extern void crut_add_test(struct crut_operations *test_ops); extern int crut_wait(crut_event_t event); extern int crut_poll(crut_event_t event); __END_DECLS blcr-0.8.5/tests/Makefile.am0000664000000000000000000002575111616320155012547 00000000000000# Special target (run before tests) ensures the kernel modules are loaded check_module: @(/sbin/lsmod | grep '^blcr ' > /dev/null 2>&1) || \ (echo '#############################################################'; \ echo '#### BLCR modules are not loaded. Cannot run the tests! ####'; \ echo '#### You must insmod/modprobe the following modules as ####'; \ echo '#### root (in order) before you can run "make check": ####'; \ echo '#### blcr_imports blcr ####'; \ echo '#### "make insmod" will automate this if run as a user ####'; \ echo '#### with sudo(8) rights. ####'; \ echo '#############################################################'; \ false) # Files we clean at various times CONTEXTS = context.* .context.*.tmp Context[123] .Context[123].tmp TEST_TEMPS = tst* # Special target (run before tests) ensures no temp file conflicts clean_temps: rm -Rf $(CONTEXTS) $(TEST_TEMPS) # Special target (run before tests) ensures utils are up-to-date (if built) if CR_INSTALLED_UTIL util_dir = $(bindir) else util_dir = $(TOP_BUILDDIR)/bin endif if CR_BUILD_UTIL build_util: @$(MAKE) $(AM_MAKEFLAGS) --no-print-directory -C $(TOP_BUILDDIR) util symlinks else build_util: @: # Empty endif # "SIMPLE" tests, which just return success or failure. # These tests get listed in the SIMPLE_TESTS variable. if CR_ENABLE_SHARED # These test the actual cr_run utility or dlopen(), and thus require shared libs: SIMPLE_scripts_shared = cr_run cr_targ cr_targ2 cr_omit dlopen endif SIMPLE_progs = atomics bug2524 SIMPLE_scripts = $(SIMPLE_scripts_shared) \ bug2003 run_on save_exe save_priv save_share save_all \ reloc_exe reloc_file reloc_fifo reloc_dir reloc_all \ clobber SIMPLE_TESTS = $(SIMPLE_progs) $(SIMPLE_scripts) # "SEQ" tests are ones that check for certain events happening in # proper sequence, by using a wrapper to parse output. # These tests get listed in the SEQ_TESTS variable. SEQ_progs = stage0001 stage0002 stage0003 stage0004 \ critical_sections replace_cb \ failed_cb failed_cb2 pid_in_use cs_enter_leave cs_enter_leave2 \ cr_tryenter_cs stopped edeadlk pid_restore # XXX: cb_exit has moved to "bonus" list for now. See bug 2244. # XXX: ptrace has moved to "bonus" list for now. See bug 2455. SEQ_scripts = SEQ_TESTS = $(SEQ_progs) $(SEQ_scripts) # C/R unit tests ("CRUT") # These are tests that use the crut.c infractructure and the crut_wrapper # script. CRUT_progs = \ simple simple_pthread cwd dup filedescriptors pipe named_fifo \ cloexec get_info orphan overlap child mmaps hugetlbfs readdir dev_null \ cr_signal linked_fifo sigpending dpipe forward hooks math sigaltstack \ prctl lam nscd # hugetlbfs2 moved to "bonus" list due to leak of MAP_PRIVATE pages in some kernels CRUT_TESTS = $(CRUT_progs) # These are like SIMPLE_TESTS, SEQ_TESTS and CRUT_TESTS, but for # maintainer-only tests (the "bonus" tests). if CR_ENABLE_SHARED SEQ_scripts2_shared = \ ash_test bash_test csh_test ksh_test zsh_test \ perl_test python_test tcl_test expect_test ruby_test \ guile_test clisp_test rep_test emacslisp_test \ php_test gst_test gcj_test gij_test jre_test \ ocaml_test sml_test mosml_test endif if CR_HAVE_CXX SEQ_testcxx = testcxx testcxx_SOURCES = testcxx.cc endif SIMPLE_progs2 = atomics_stress SIMPLE_scripts2 = SEQ_progs2 = cb_exit ptrace $(SEQ_testcxx) SEQ_scripts2 = $(SEQ_scripts2_shared) CRUT_progs2 = hugetlbfs2 SIMPLE_TESTS2 = $(SIMPLE_progs2) $(SIMPLE_scripts2) SEQ_TESTS2 = $(SEQ_progs2) $(SEQ_scripts2) CRUT_TESTS2 = $(CRUT_progs2) # Need extra ldflags when an object references no symbols in a lib libcr_ldflags = -u cr_link_me libcr_run_ldflags = -u cr_run_link_me libcr_omit_ldflags = -u cr_omit_link_me if CR_INSTALLED_LIBCR # Use the installed library and headers libcr_L = -L$(libdir) libcr_includes = -I$(includedir) else libcr_L = -L$(top_builddir)/libcr libcr_includes = -I$(top_srcdir)/include -I$(top_builddir)/include LIBCR = $(top_builddir)/libcr/libcr.la \ $(top_builddir)/libcr/libcr_run.la \ $(top_builddir)/libcr/libcr_omit.la $(tester_progs) $(check_progs2): $(LIBCR) endif # The library/ies that (nearly?) every test needs: libcr_ldadd = $(libcr_L) -lcr libcr_run_ldadd = $(libcr_L) -lcr_run libcr_omit_ldadd = $(libcr_L) -lcr_omit # Gather reusable code into libtest.a libtest_a_SOURCES = crut.c crut_util.c crut_util_pth.c crut_util_libcr.c libtest_ldadd = libtest.a # Generic flags here... LDADD = $(libtest_ldadd) $(libcr_ldadd) -lpthread @CR_CLIENT_LDADD@ INCLUDES = $(libcr_includes) AM_CFLAGS = -Wall # Test-specific flags here... stage0001_LDADD = $(libtest_ldadd) $(libcr_ldadd) @CR_CLIENT_LDADD@ # NO PTHREADS FOR THIS TEST atomics_CFLAGS = $(CFLAGS) -I$(top_srcdir)/libcr/arch/@CR_LIBARCH@ atomics_LDADD = @CR_CLIENT_LDADD@ # No libs required atomics_stress_CFLAGS = $(CFLAGS) -I$(top_srcdir)/libcr/arch/@CR_LIBARCH@ atomics_stress_LDADD = $(libtest_ldadd) -lpthread @CR_CLIENT_LDADD@ # Only need crut_util.o and pthreads ptrace_LDFLAGS = $(libcr_ldflags) # In static builds need help to ensure libcr is linked (no refs) # The wrappers wrapper_progs = seq_wrapper crut_wrapper seq_wrapper_LDADD = $(libtest_ldadd) # Must not be a lt-exec # Rules to "build" a shell script # We "install" to avoid worrying about the permissions in/on $srcdir # The .sh suffix not meant denote any specific shell all_scripts = $(SIMPLE_scripts) $(SEQ_scripts) $(helper_scripts) \ $(SIMPLE_scripts2) $(SEQ_scripts2) $(helper_scripts2) all_scripts_src = $(patsubst %,%.sh,$(all_scripts)) $(all_scripts): shellinit $(all_scripts) : % : %.sh $(INSTALL_SCRIPT) $< $@ # Rule to wrap the SEQ tests with the seq_wrapper SEQ_RUN = $(patsubst %,%.st,$(SEQ_TESTS)) SEQ_RUN2 = $(patsubst %,%.st,$(SEQ_TESTS2)) $(SEQ_RUN) $(SEQ_RUN2) : %.st : % seq_wrapper @rm -f $@ @$(LN_S) -f seq_wrapper $@ # Rule to wrap the CRUT tests with the crut_wrapper # We use a 1-line script, not a symlink, in the build directory # to allow crut_wrapper to be a libtool wrapper itself. CRUT_RUN = $(patsubst %,%.ct,$(CRUT_TESTS)) CRUT_RUN2 = $(patsubst %,%.ct,$(CRUT_TESTS2)) $(CRUT_RUN) $(CRUT_RUN2) : %.ct : % crut_wrapper @rm -f $@ @(echo '#!/bin/sh'; \ echo 'exec `dirname $$0`/crut_wrapper -q "$$@" $*' ) > $@ @chmod +x $@ # Script to run all the CRUT tests standalone rununittests: $(CRUT_TESTS) (echo '#!/bin/sh'; echo './crut_wrapper $$@ $(CRUT_TESTS)') > $@ chmod +x $@ # Rules to help w/ some dependencies in other directories: if CR_BUILD_LIBCR $(LIBCR): FORCE @$(MAKE) $(AM_MAKEFLAGS) --no-print-directory -C $(@D) endif # Prog(s) needed indirectly by test(s) cr_run: hello hello_LDADD = # NO LIBS HERE cr_targ cr_tagr2 cr_omit: pause bug2003: bug2003_aux save_exe save_priv save_share save_all: save_aux reloc_exe reloc_file reloc_fifo reloc_dir reloc_all: reloc_aux run_on: save_aux pause clobber: save_aux if CR_ENABLE_SHARED pause_LDADD = # NO LIBS HERE bug2003_aux_LDADD = # NO LIBS HERE save_aux_LDADD = $(libtest_ldadd) # NO LIBCR HERE - must not be a lt-exec reloc_aux_LDADD = $(libtest_ldadd) # NO LIBCR HERE - must not be a lt-exec dlopen_aux_LDADD = -ldl # NO LIBCR HERE helper_progs_shared = hello dlopen_aux dlopen: dlopen_aux else pause_LDADD = $(libcr_run_ldadd) @CR_CLIENT_LDADD@ pause_LDFLAGS = $(libcr_run_ldflags) bug2003_aux_LDADD = $(libcr_run_ldadd) @CR_CLIENT_LDADD@ bug2003_aux_LDFLAGS = $(libcr_run_ldflags) save_aux_LDADD = $(libcr_run_ldadd) $(libtest_ldadd) @CR_CLIENT_LDADD@ save_aux_LDFLAGS = $(libcr_run_ldflags) reloc_aux_LDADD = $(libcr_run_ldadd) $(libtest_ldadd) @CR_CLIENT_LDADD@ reloc_aux_LDFLAGS = $(libcr_run_ldflags) endif helper_progs = $(helper_progs_shared) bug2003_aux pause save_aux reloc_aux helper_progs2 = helper_scripts = helper_scripts2 = # Maintainer-only tests BONUS_TESTS = $(SIMPLE_TESTS2) $(SEQ_RUN2) $(CRUT_RUN2) bonus-tests: $(BONUS_TESTS) @$(MAKE) $(AM_MAKEFLAGS) --no-print-directory check TESTS="$(BONUS_TESTS)" bonus-check: $(BONUS_TESTS) @$(MAKE) $(AM_MAKEFLAGS) --no-print-directory check TESTS="$(TESTS) $(BONUS_TESTS)" # Create our own target for building (but NOT running) the tests build-tests: tests # Legacy target tests: $(TESTS) $(BONUS_TESTS) rununittests @echo '################################################################################' @echo 'HOW TO RUN THESE TESTS:' @echo @echo 'SIMPLE TESTS ($(SIMPLE_TESTS)):' @echo '--- use ./test' @echo 'UNIT TESTS ($(CRUT_TESTS)):' @echo '--- use ./.ct' @echo '--- or use ./rununittests to run them all' @echo 'SEQ TESTS ($(SEQ_TESTS)):' @echo '--- use ./.st' @echo '################################################################################' # Some tests use cr_run even w/o shared libs - mask that if CR_ENABLE_SHARED CR_RUN_INSTALLED=$(bindir)/cr_run else CR_RUN_INSTALLED=env endif # Depending whether we build the testsuite or not, the test programs and # scripts should be in either the testsexec_ or check_ prefix. # tester_progs = $(SIMPLE_progs) $(SEQ_progs) $(CRUT_progs) $(helper_progs) tester_scripts = $(SIMPLE_scripts) $(SEQ_scripts) $(helper_scripts) if CR_BUILD_TESTSUITE testsexecdir = $(libexecdir)/blcr-testsuite testsexec_PROGRAMS = $(tester_progs) $(wrapper_progs) testsexec_SCRIPTS = $(tester_scripts) AM_INSTALLCHECK_STD_OPTIONS_EXEMPT = $(testsexec_PROGRAMS) $(testsexec_SCRIPTS) install-exec-local: @$(mkinstalldirs) "$(DESTDIR)$(testsexecdir)" @cd "$(DESTDIR)$(testsexecdir)" && \ for file in $(SEQ_RUN); do rm -f $$file; $(LN_S) seq_wrapper $$file; done && \ for file in $(CRUT_RUN); do rm -f $$file; $(LN_S) crut_wrapper $$file; done && \ echo '# This file is required, but typically empty, in an installed testsuite' > shellinit && \ chmod 644 shellinit @sed -e 's,%bindir%,$(bindir),;' \ -e 's,%tests%,$(TESTS),;' \ -e 's,%cr_run%,$(CR_RUN_INSTALLED),;' \ -e 's,%cr_pwd%,@PWD_PROG@,;' \ $(srcdir)/RUN_ME.in >$(DESTDIR)$(testsexecdir)/RUN_ME @chmod +x $(DESTDIR)$(testsexecdir)/RUN_ME uninstall-local: @cd $(DESTDIR)$(testsexecdir) && rm -f RUN_ME $(SEQ_RUN) $(CRUT_RUN) else check_progs = $(tester_progs) check_scripts = $(tester_scripts) endif # Maintainer-only tests progs and scripts (always in check_ prefix) check_progs2 = $(SIMPLE_progs2) $(SEQ_progs2) $(CRUT_progs2) $(helper_progs2) check_scripts2 = $(SIMPLE_scripts2) $(SEQ_scripts2) $(helper_scripts2) # Environment variables visible to the test programs TESTS_ENVIRONMENT = top_srcdir="$(TOP_SRCDIR)" LIBCR_DISABLE_NSCD=1 # Automake magic here... check_LIBRARIES = libtest.a check_HEADERS = crut.h crut_util.h check_SCRIPTS = check_module clean_temps build_util $(check_scripts) $(check_scripts2) check_PROGRAMS = $(check_progs) $(check_progs2) $(wrapper_progs) TESTS = $(SIMPLE_TESTS) $(SEQ_RUN) $(CRUT_RUN) # Things to actually run EXTRA_DIST = license.txt CountingApp.java CountingApp.class RUN_ME.in $(all_scripts_src) MOSTLYCLEANFILES = core core.* $(CONTEXTS) CLEANFILES = $(SEQ_RUN) $(CRUT_RUN) $(SEQ_RUN2) $(CRUT_RUN2) $(all_scripts) \ rununittests RUN_ME clean-local: clean_temps echoval: FORCE @echo $($(VARNAME)) | sed 's/"/\\"/'g .PHONY: check_module clean_temps build_util tests build-tests echoval FORCE FORCE: # Preserve the empty line above! blcr-0.8.5/tests/cloexec.c0000664000000000000000000000706611056065765012313 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2004, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * 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 * * $Id: cloexec.c,v 1.7 2008/08/29 21:36:53 phargrov Exp $ * * Simple example for using crut */ #include #include #include #include #include #include #include #include "crut.h" #define TEST_FILE "tstfile.0" typedef struct test_data_t_ { int fd0; /* file w/ cloexec = 0 */ int fd1; /* file w/ cloexec = 1 */ } test_data_t; static int cloexec_setup(void **testdata) { int rc; test_data_t *p; CRUT_DEBUG("Initializing cloexec."); p = malloc(sizeof(*p)); if (p == NULL) { return -1; } CRUT_DEBUG("Open()ing and dup()ing '" TEST_FILE "'."); (void)unlink(TEST_FILE); p->fd0 = open(TEST_FILE, O_RDWR | O_CREAT | O_EXCL, 0600); p->fd1 = dup(p->fd0); if ((p->fd0 < 0) || (p->fd1 < 0)) { return -1; } CRUT_DEBUG("Setting and clearing CLOEXEC flags."); rc = fcntl(p->fd0, F_GETFD); if (rc < 0) { return -1; } rc = fcntl(p->fd0, F_SETFD, rc & ~FD_CLOEXEC); if (rc < 0) { return -1; } rc = fcntl(p->fd1, F_GETFD); if (rc < 0) { return -1; } rc = fcntl(p->fd1, F_SETFD, rc | FD_CLOEXEC); if (rc < 0) { return -1; } *testdata = p; return 0; } static int checkit(test_data_t *t) { int rc; rc = fcntl(t->fd0, F_GETFD); if (rc & FD_CLOEXEC) { return -1; } rc = fcntl(t->fd1, F_GETFD); if (!(rc & FD_CLOEXEC)) { return -1; } return 0; } static int cloexec_precheckpoint(void *p) { CRUT_DEBUG("Testing sanity before we checkpoint"); return checkit((test_data_t *)p); } static int cloexec_continue(void *p) { CRUT_DEBUG("Continuing after checkpoint."); return checkit((test_data_t *)p); } static int cloexec_restart(void *p) { CRUT_DEBUG("Restarting from checkpoint."); return checkit((test_data_t *)p); } static int cloexec_teardown(void *p) { test_data_t *t = (test_data_t *)p; (void)unlink(TEST_FILE); (void)close(t->fd0); (void)close(t->fd1); free(p); return 0; } int main(int argc, char *argv[]) { int ret; struct crut_operations cloexec_test_ops = { test_scope:CR_SCOPE_PROC, test_name:"cloexec", test_description:"Check for restore of close-on-exec flag.", test_setup:cloexec_setup, test_precheckpoint:cloexec_precheckpoint, test_continue:cloexec_continue, test_restart:cloexec_restart, test_teardown:cloexec_teardown, }; /* add the test(s) */ crut_add_test(&cloexec_test_ops); ret = crut_main(argc, argv); return ret; } blcr-0.8.5/tests/cr_targ2.sh0000664000000000000000000000071011010246535012533 00000000000000#!/bin/sh . ${cr_testsdir:-`dirname $0`}/shellinit # ${cr_run} --omit --run -- ${cr_testsdir}/pause >/dev/null 2>/dev/null & pid=$! sleep 1 \rm -f context.$pid 2>/dev/null trap "\rm -f context.$pid 2>/dev/null" 0 ${cr_checkpoint} --clobber --quiet $pid result=$? if test $result = 0; then : # OK else echo "Checkpoint unexpectedly failed with exit code $result" >&2 exit 1 fi exec 2>/dev/null # Drop job control message(s) kill $pid wait $pid exit 0 blcr-0.8.5/tests/named_fifo.c0000664000000000000000000004456111056065765012761 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2003, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * 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 * * $Id: named_fifo.c,v 1.24 2008/08/29 21:36:53 phargrov Exp $ * * tests of named fifos */ /* * NOTE: We rely on the Linux-specific (POSIX undefined) behavior for O_RDWR * pipes. Linux does not block while opening a named FIFO with O_RDWR */ #define _LARGEFILE64_SOURCE 1 /* For O_LARGEFILE */ #include #include #include #include #include #include #include #include #include "crut.h" #define MAX_FILENAME_LENGTH 255 #define FIFO_FILENAME "tstfifo" #define BUFLEN 256 #define PIPEDATA "Hello, world!\n" #define FIFO_MODE 0644 /* * 64-bit kernels are some what "free" with O_LARGEFILE since it is just a * no-op for sizeof(long) == 8 */ #if O_LARGEFILE #define FLAGS_TO_IGNORE O_LARGEFILE #else #define FLAGS_TO_IGNORE 0 #endif /* * name is somewhat of a misnomer, since this is really a pair... */ struct test_fifo_struct { char *filename; int rdwr_fd; /* open first to avoid blocking */ int client_fd; /* test most IO ops to this */ int flags; /* rd, wr, or rdwr */ struct stat stat; }; static int sigpiped = 0; void sigpipe_handler(int num) { sigpiped = 1; } struct test_fifo_struct * get_fifo_struct(const char *filename, int flags) { int ret=-1; struct test_fifo_struct *fifo; int tmp_fd; fifo = malloc(sizeof(*fifo)); if (fifo == NULL) { perror("malloc"); goto out; } fifo->filename = strdup(filename); if (fifo->filename == NULL) { perror("strdup"); goto out_free; } (void)unlink(fifo->filename); ret = mknod(fifo->filename, FIFO_MODE | S_IFIFO, 0); if (ret < 0) { perror("mknod"); goto out_free; } fifo->rdwr_fd = open(fifo->filename, O_RDWR); if (fifo->rdwr_fd < 0) { perror("open(rdwr_fd)"); goto out_unlink; } fifo->client_fd = open(fifo->filename, flags); if (fifo->client_fd < 0) { perror("open(client_fd)"); goto out_unlink; } ret = fcntl(fifo->client_fd, F_GETFL); if (ret < 0) { perror("fcntl"); goto out_unlink; } fifo->flags = ret & ~FLAGS_TO_IGNORE; /* Swap order to test the restart code */ tmp_fd = fifo->rdwr_fd; fifo->rdwr_fd = dup(fifo->rdwr_fd); if (fifo->rdwr_fd < 0) { perror("dup(rdwr_fd)"); goto out_unlink; } ret = close(tmp_fd); if (ret < 0) { perror("close(tmp_fd)"); goto out_unlink; } out: return fifo; out_unlink: (void)unlink(fifo->filename); out_free: free(fifo->filename); /* Note: NULL is OK by spec. */ free(fifo); return NULL; } /* * This should write a atomic amount of data. Small means that * the pipe does not block. * * Returns number of bytes written. */ static int write_atomic(int fd) { char buf[BUFLEN]; int retval; (void)strncpy(buf, PIPEDATA, sizeof(PIPEDATA)); CRUT_DEBUG("Writing to pipe"); retval = write(fd, buf, BUFLEN); if (sigpiped) { retval = -1; CRUT_FAIL("SIGPIPE on write"); } if (retval < 0) { perror("write_atomic"); } else if (retval != BUFLEN) { CRUT_FAIL("Wrote wrong length to pipe %d", fd); } else if(retval == BUFLEN) { retval = 0; } return retval; } /* * Logical complement of read atomic. * Checks to make sure that the buffer read back is the same as the one * written. * * Returns number of bytes read. * Returns < 0 if buffers don't compare, or other error. */ static int read_atomic(int fd) { int retval; int bytes_read; char buf[BUFLEN]; memset(buf, 0, BUFLEN); CRUT_DEBUG("Reading from pipe."); retval = read(fd, buf, BUFLEN); if (retval < 0) { CRUT_FAIL("Couldn't read from pipe."); CRUT_FAIL("buf='%s'", buf); goto out; } bytes_read = retval; CRUT_DEBUG("Comparing pipe data."); retval = strncmp(PIPEDATA, buf, sizeof(PIPEDATA)); if (retval < 0) { CRUT_FAIL("strncmp(%s, %s) failure.", PIPEDATA, buf); goto out; } out: return retval; } static int flags_check_fifo(struct test_fifo_struct *f) { int retval; retval = fcntl(f->client_fd, F_GETFL); if (retval < 0) { perror("fnctl(F_GETFL)"); } else if ((retval & ~FLAGS_TO_IGNORE) != f->flags) { CRUT_FAIL("Post-restart flags %d don't match original %d\n", retval, f->flags); retval = -1; } return retval; } static int stat_check_fifo(struct test_fifo_struct *f) { int retval; struct stat new_stat; retval = fstat(f->rdwr_fd, &new_stat); if (retval < 0) { perror("fstat"); goto out; } retval = statcmp(&new_stat, &(f->stat), ST_SIZE | ST_MODE | ST_NLINK); if (retval) { CRUT_FAIL("File attributes changed. %d mismatches", retval); CRUT_DEBUG("--- Old stats ---"); dump_stat(&(f->stat)); CRUT_DEBUG("--- Current stats ---"); dump_stat(&new_stat); retval = -1; } out: return retval; } static int ring_test_fifo(struct test_fifo_struct *f) { int retval; /* * loops some data through the pipes to make sure they still work */ switch((f->flags) & O_ACCMODE) { case O_RDONLY: retval = write_atomic(f->rdwr_fd); if (!retval) retval = read_atomic(f->client_fd); break; case O_WRONLY: case O_RDWR: retval = write_atomic(f->client_fd); if (!retval) read_atomic(f->rdwr_fd); break; default: retval = -1; } return retval; } static int named_fifo_generic_setup(void **testdata, int flags) { int retval=-1; struct test_fifo_struct *fifo; signal(SIGPIPE, sigpipe_handler); fifo = get_fifo_struct(FIFO_FILENAME, flags); if (fifo == NULL) { goto out; } *testdata = fifo; retval = 0; out: return retval; } static int named_fifo_read_setup(void **testdata) { int retval; retval = named_fifo_generic_setup(testdata, O_RDONLY); return retval; } static int named_fifo_write_setup(void **testdata) { int retval; retval = named_fifo_generic_setup(testdata, O_WRONLY); return retval; } static int named_fifo_rdwr_setup(void **testdata) { int retval; retval = named_fifo_generic_setup(testdata, O_RDWR); return retval; } static int named_fifo_read_nonblock_setup(void **testdata) { int retval; retval = named_fifo_generic_setup(testdata, O_RDONLY | O_NONBLOCK); return retval; } static int named_fifo_write_nonblock_setup(void **testdata) { int retval; retval = named_fifo_generic_setup(testdata, O_WRONLY | O_NONBLOCK); return retval; } static int named_fifo_rdwr_nonblock_setup(void **testdata) { int retval; retval = named_fifo_generic_setup(testdata, O_RDWR | O_NONBLOCK); return retval; } static int named_fifo_buffered_precheckpoint(void *p) { int retval; struct test_fifo_struct *f = p; switch((f->flags) & O_ACCMODE) { case O_RDONLY: /* reads from client_fd, so write to rdwr_fd */ retval = write_atomic(f->rdwr_fd); break; case O_WRONLY: case O_RDWR: /* writes to client_fd */ retval = write_atomic(f->client_fd); break; default: retval = -1; } if (retval < 0) goto out; retval = fstat(f->rdwr_fd, &f->stat); if (retval < 0) { perror("fstat"); } out: return retval; } static int named_fifo_precheckpoint(void *p) { struct test_fifo_struct *fifo = (struct test_fifo_struct *)p; int retval; retval = fstat(fifo->rdwr_fd, &fifo->stat); if (retval < 0) { perror("fstat"); } return retval; } static int named_fifo_precheckpoint_unlink(void *p) { struct test_fifo_struct *fifo = (struct test_fifo_struct *)p; int retval; retval = unlink(fifo->filename); if (retval) perror("unlink pre"); if (!retval) retval = named_fifo_precheckpoint(p); return retval; } /* * Unlinks the pipe after a checkpoint, to see if we can mkfifo in the * kernel correctly on restart. */ static int named_fifo_continue_unlink(void *p) { struct test_fifo_struct *fifo = (struct test_fifo_struct *)p; int retval; retval = unlink(fifo->filename); if (retval) { perror("unlink continue"); } return retval; } static int named_fifo_continue(void *p) { int retval; retval = 0; return retval; } /* * This should take care of everything... */ static int named_fifo_buffered_restart(void *p) { int retval; struct test_fifo_struct *f = p; /* Check that correct flags have been restored */ retval = flags_check_fifo(f); if (retval < 0) return retval; /* Check that stat()s are OK */ retval = stat_check_fifo(f); if (retval < 0) return retval; switch((f->flags) & O_ACCMODE) { case O_RDONLY: /* read from client_fd */ retval = read_atomic(f->client_fd); break; case O_WRONLY: case O_RDWR: /* wrote to client_fd, read from rdwr_fd */ retval = read_atomic(f->rdwr_fd); break; default: retval = -1; } /* if that worked, ring the pipe once just to check sanity. */ if (!retval) { retval = ring_test_fifo(f); } return retval; } static int named_fifo_restart(void *p) { struct test_fifo_struct *f = p; int retval; /* Check that correct flags have been restored */ retval = flags_check_fifo(f); if (retval < 0) { return retval; } /* Check that stat()s are OK */ retval = stat_check_fifo(f); if (retval < 0) return retval; /* if that worked, ring the pipe once just to check sanity. */ return ring_test_fifo(f); } static int named_fifo_teardown(void *p) { struct test_fifo_struct *fifo = (struct test_fifo_struct *)p; int retval; retval = unlink(fifo->filename); if (retval) perror("unlink teardown"); free(fifo->filename); free(fifo); return retval; } static int named_fifo_teardown_preunlink(void *p) { struct test_fifo_struct *fifo = (struct test_fifo_struct *)p; int retval; /* Unlink must fail, since fifo should have been renamed */ retval = !unlink(fifo->filename); if (retval) fprintf(stderr, "unlink succeeded unexpectedly\n"); free(fifo->filename); free(fifo); return retval; } int main(int argc, char *argv[]) { int ret; /* * cases for named fifos... * * rd, wr, rdwr - normal * rd, wr, rdwr - unlinked after checkpoint * rd, wr, rdwr - unlinked before checkpoint * rd, wr, rdwr - unlinked * rd, wr, rdwr - data in the pipe * rd, wr, rdwr - nonblocking * * Only care about the above, this tests most code paths, could form * arbitrarily silly combinations, though... */ struct crut_operations named_fifo_rw_ops = { test_scope:CR_SCOPE_PROC, test_name:"named_fifo_rw", test_description:"Tests basic IO on fifos", test_setup:named_fifo_rdwr_setup, test_precheckpoint:named_fifo_precheckpoint, test_continue:named_fifo_continue, test_restart:named_fifo_restart, test_teardown:named_fifo_teardown, }; struct crut_operations named_fifo_rw_unlink_ops = { test_scope:CR_SCOPE_PROC, test_name:"named_fifo_rw_unlink", test_description:"Tests whether we mknod FIFOs on restart", test_setup:named_fifo_rdwr_setup, test_precheckpoint:named_fifo_precheckpoint, test_continue:named_fifo_continue_unlink, test_restart:named_fifo_restart, test_teardown:named_fifo_teardown, }; struct crut_operations named_fifo_rw_preunlink_ops = { test_scope:CR_SCOPE_PROC, test_name:"named_fifo_rw_preunlink", test_description:"Tests whether we checkpoint unlinked FIFOs", test_setup:named_fifo_rdwr_setup, test_precheckpoint:named_fifo_precheckpoint_unlink, test_continue:named_fifo_continue, test_restart:named_fifo_restart, test_teardown:named_fifo_teardown_preunlink, }; struct crut_operations named_fifo_rw_buffered_ops = { test_scope:CR_SCOPE_PROC, test_name:"named_fifo_rw_buffered", test_description:"Makes sure that data in the FIFO is recovered after a checkpoint.", test_setup:named_fifo_rdwr_setup, test_precheckpoint:named_fifo_buffered_precheckpoint, test_continue:named_fifo_continue, test_restart:named_fifo_buffered_restart, test_teardown:named_fifo_teardown, }; struct crut_operations named_fifo_rw_nonblock_ops = { test_scope:CR_SCOPE_PROC, test_name:"named_fifo_rw_nonblock", test_description:"Makes sure that data in the FIFO is recovered after a checkpoint.", test_setup:named_fifo_rdwr_nonblock_setup, test_precheckpoint:named_fifo_buffered_precheckpoint, test_continue:named_fifo_continue, test_restart:named_fifo_buffered_restart, test_teardown:named_fifo_teardown, }; struct crut_operations named_fifo_read_ops = { test_scope:CR_SCOPE_PROC, test_name:"named_fifo_read", test_description:"Tests basic IO on fifos", test_setup:named_fifo_read_setup, test_precheckpoint:named_fifo_precheckpoint, test_continue:named_fifo_continue, test_restart:named_fifo_restart, test_teardown:named_fifo_teardown, }; struct crut_operations named_fifo_read_unlink_ops = { test_scope:CR_SCOPE_PROC, test_name:"named_fifo_read_unlink", test_description:"Tests whether we mknod FIFOs on restart", test_setup:named_fifo_read_setup, test_precheckpoint:named_fifo_precheckpoint, test_continue:named_fifo_continue_unlink, test_restart:named_fifo_restart, test_teardown:named_fifo_teardown, }; struct crut_operations named_fifo_read_preunlink_ops = { test_scope:CR_SCOPE_PROC, test_name:"named_fifo_read_preunlink", test_description:"Tests whether we checkpoint unlinked FIFOs", test_setup:named_fifo_rdwr_setup, test_precheckpoint:named_fifo_precheckpoint_unlink, test_continue:named_fifo_continue, test_restart:named_fifo_restart, test_teardown:named_fifo_teardown_preunlink, }; struct crut_operations named_fifo_read_buffered_ops = { test_scope:CR_SCOPE_PROC, test_name:"named_fifo_read_buffered", test_description:"Makes sure that data in the FIFO is recovered after a checkpoint.", test_setup:named_fifo_read_setup, test_precheckpoint:named_fifo_buffered_precheckpoint, test_continue:named_fifo_continue, test_restart:named_fifo_buffered_restart, test_teardown:named_fifo_teardown, }; struct crut_operations named_fifo_read_nonblock_ops = { test_scope:CR_SCOPE_PROC, test_name:"named_fifo_read_nonblock", test_description:"Makes sure that data in the FIFO is recovered after a checkpoint.", test_setup:named_fifo_read_nonblock_setup, test_precheckpoint:named_fifo_buffered_precheckpoint, test_continue:named_fifo_continue, test_restart:named_fifo_buffered_restart, test_teardown:named_fifo_teardown, }; struct crut_operations named_fifo_write_ops = { test_scope:CR_SCOPE_PROC, test_name:"named_fifo_write", test_description:"Tests basic IO on fifos", test_setup:named_fifo_write_setup, test_precheckpoint:named_fifo_precheckpoint, test_continue:named_fifo_continue, test_restart:named_fifo_restart, test_teardown:named_fifo_teardown, }; struct crut_operations named_fifo_write_unlink_ops = { test_scope:CR_SCOPE_PROC, test_name:"named_fifo_write_unlink", test_description:"Tests whether we mknod FIFOs on restart", test_setup:named_fifo_write_setup, test_precheckpoint:named_fifo_precheckpoint, test_continue:named_fifo_continue_unlink, test_restart:named_fifo_restart, test_teardown:named_fifo_teardown, }; struct crut_operations named_fifo_write_preunlink_ops = { test_scope:CR_SCOPE_PROC, test_name:"named_fifo_write_preunlink", test_description:"Tests whether we checkpoint unlinked FIFOs", test_setup:named_fifo_rdwr_setup, test_precheckpoint:named_fifo_precheckpoint_unlink, test_continue:named_fifo_continue, test_restart:named_fifo_restart, test_teardown:named_fifo_teardown_preunlink, }; struct crut_operations named_fifo_write_buffered_ops = { test_scope:CR_SCOPE_PROC, test_name:"named_fifo_write_buffered", test_description:"Makes sure that data in the FIFO is recovered after a checkpoint.", test_setup:named_fifo_write_setup, test_precheckpoint:named_fifo_buffered_precheckpoint, test_continue:named_fifo_continue, test_restart:named_fifo_buffered_restart, test_teardown:named_fifo_teardown, }; struct crut_operations named_fifo_write_nonblock_ops = { test_scope:CR_SCOPE_PROC, test_name:"named_fifo_write_nonblock", test_description:"Makes sure that data in the FIFO is recovered after a checkpoint.", test_setup:named_fifo_write_nonblock_setup, test_precheckpoint:named_fifo_buffered_precheckpoint, test_continue:named_fifo_continue, test_restart:named_fifo_buffered_restart, test_teardown:named_fifo_teardown, }; /* add the basic tests */ crut_add_test(&named_fifo_read_ops); crut_add_test(&named_fifo_write_ops); crut_add_test(&named_fifo_rw_ops); crut_add_test(&named_fifo_read_unlink_ops); crut_add_test(&named_fifo_write_unlink_ops); crut_add_test(&named_fifo_rw_unlink_ops); crut_add_test(&named_fifo_read_preunlink_ops); crut_add_test(&named_fifo_write_preunlink_ops); crut_add_test(&named_fifo_rw_preunlink_ops); crut_add_test(&named_fifo_read_buffered_ops); crut_add_test(&named_fifo_write_buffered_ops); crut_add_test(&named_fifo_rw_buffered_ops); crut_add_test(&named_fifo_read_nonblock_ops); crut_add_test(&named_fifo_write_nonblock_ops); crut_add_test(&named_fifo_rw_nonblock_ops); ret = crut_main(argc, argv); exit(ret); } blcr-0.8.5/tests/ksh_test.sh0000664000000000000000000000270711122064562012666 00000000000000#!/bin/sh # # Test of checkpoint/restart of a ksh script. # Note that the outer script is bash # Check for ksh ksh -c true || exit 77 # NOTE: Unlike most other shells test cases, this one uses the # --kill flag to cr_checkpoint. This is because # ksh tends to exit when one of its subshells is terminated. . ${cr_testsdir:-`dirname $0`}/shellinit \rm -f Context[123] .Context[123].tmp 2>/dev/null bash <<-'__OUTER__' exec 2>/dev/null # Drop job control message(s) from the outer script echo '#ST_ALARM:120' $cr_run ksh 2>&1 <<-'__INNER__' echo '#ST_IGNORE:^\[1\]' # Tell seq_wrapper to ignore job-control msgs echo '#ST_IGNORE:^Killed' # Tell seq_wrapper to ignore job-control msgs echo '#ST_IGNORE:^[[:space:]]*$' # ...and the whitespace lines that may accompany them. ksh -c 'for i in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15; do echo $i Hello; sleep 1; done' & pid=$! sleep 3 echo "# Checkpoint original child" $cr_checkpoint --file=Context1 --tree --kill $pid wait sleep 1 echo "# Restart 1" $cr_restart Context1 & pid=$! sleep 3 echo "# Checkpoint restarted child" $cr_checkpoint --file=Context2 --tree --kill $pid wait sleep 1 echo "# Restart^2" $cr_restart Context2 & pid=$! sleep 3 echo "# Checkpoint self" $cr_checkpoint --file=Context3 --kill --tree $$ wait echo "16 DONE" __INNER__ exec 2>&1 sleep 3 echo "# Restart shell" $cr_restart Context3 __OUTER__ \rm -f Context[123] .Context[123].tmp 2>/dev/null blcr-0.8.5/tests/lam.c0000664000000000000000000000472711116333011011416 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2003, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * 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 * * $Id: lam.c,v 1.2 2008/12/05 23:15:21 phargrov Exp $ * * Test exec from restart portion of signal callback, in presence of a * thread callback. This is the "pattern" of LAM/MPI's mpirun. */ #include #include #include #include "crut.h" static int thread_callback(void *arg) { (void)cr_checkpoint(CR_CHECKPOINT_READY); return 0; } static int signal_callback(void *arg) { int rc = cr_checkpoint(CR_CHECKPOINT_READY); if (rc > 0) { execl("/bin/true", "true", NULL); } return 0; } static int lam_setup(void **testdata) { CRUT_DEBUG("Initializing lam."); *testdata = NULL; cr_register_callback(signal_callback, NULL, CR_SIGNAL_CONTEXT); cr_register_callback(thread_callback, NULL, CR_THREAD_CONTEXT); return 0; } static int lam_precheckpoint(void *p) { return 0; } static int lam_continue(void *p) { return 0; } static int lam_restart(void *p) { return 0; } int main(int argc, char *argv[]) { int ret; struct crut_operations lam_test_ops = { test_scope:CR_SCOPE_PROC, test_name:"lam", test_description:"test to mimic behavior of lam's mpirun.", test_setup:lam_setup, test_precheckpoint:lam_precheckpoint, test_continue:lam_continue, test_restart:lam_restart, test_teardown:NULL, }; crut_add_test(&lam_test_ops); ret = crut_main(argc, argv); return ret; } blcr-0.8.5/tests/run_on.sh0000664000000000000000000000244411015453154012340 00000000000000#!/bin/sh set -e . ${cr_testsdir:-`dirname $0`}/shellinit context=Context1 code=42 trap "\rm -f $context tstmap1 tstmap2 2>/dev/null" 0 # run_one () { set +e ${cr_restart} $1 "exit $code" $2 result=$? if [ $result != $code ]; then echo "Test of $1 exited with $result when expecting $code" exit 1 fi set -e } # # Test group I: Bogus args # # Case I.1: bad arguments (args failure) run_one --run-on-fail-args --bad-argument # Case I.2: bad file (permanent failure) run_one --run-on-fail-perm /dev/null # # Test group II: Context from save_aux with 1 mmaped file: # \rm -f tstmap1 ${cr_run} -- ${cr_testsdir}/save_aux "--file $context --clobber" P # Case II.1: expect success ${cr_restart} $context # Case II.2: missing file (environmental failure) \mv -f tstmap1 tstmap2 run_one --run-on-fail-env $context # Case II.3: expect success to produce special value \mv -f tstmap2 tstmap1 run_one --run-on-success $context # # Test group III: Context from pause # \rm -f $context ${cr_run} -- ${cr_testsdir}/pause >/dev/null 2>/dev/null & pid=$! sleep 1 ${cr_checkpoint} --file $context --clobber --pid $pid # Case III.1: pid conflict because still running (temporary failure) run_one --run-on-fail-temp $context # Cleanup exec 2>/dev/null # Drop job control message(s) set +e kill $pid wait $pid exit 0 blcr-0.8.5/tests/dpipe.c0000664000000000000000000000605111056065765011763 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2007, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * 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 * * $Id: dpipe.c,v 1.3 2008/08/29 21:36:53 phargrov Exp $ * * Test of NON-empty dangling (external) pipes */ #include #include #include #include #include #include #include #include #include #include "crut.h" enum { MSG_CHILD_READY = 18, MSG_PARENT_READY, MSG_CHILD_DONE }; static void sigpipe(int signo) { fprintf(stderr, "%d exiting on SIGPIPE\n", getpid()); exit(-1); } static int dpipe_setup(void **p) { const char msg1[4] = { MSG_CHILD_READY, 'a', 'b', 'c' }; const char msg2[4] = { MSG_PARENT_READY, 'A', 'B', 'C' }; struct crut_pipes *pipes = malloc(sizeof(struct crut_pipes)); int retval; signal(SIGPIPE, &sigpipe); CRUT_DEBUG("Creating pipes and forking."); retval = crut_pipes_fork(pipes); if (!retval) { /* In the child */ crut_pipes_expect(pipes, MSG_PARENT_READY); crut_pipes_write(pipes, msg1, sizeof(msg1)); exit(MSG_CHILD_DONE); } crut_pipes_write(pipes, msg2, sizeof(msg2)); crut_pipes_expect(pipes, MSG_CHILD_READY); crut_waitpid_expect(pipes->child, MSG_CHILD_DONE); *p = pipes; return retval; } static int dpipe_precheckpoint(void *p) { CRUT_DEBUG("Getting ready to checkpoint"); return 0; } static int dpipe_continue(void *p) { CRUT_DEBUG("Continuing after checkpoint."); return 0; } static int dpipe_restart(void *p) { CRUT_DEBUG("Restarting from checkpoint."); return 0; } int main(int argc, char *argv[]) { int ret; struct crut_operations dpipe_test_ops = { test_scope:CR_SCOPE_PROC, test_name:"dpipe", test_description:"Tests checkpoint of non-empty dangling (external) pipes.", test_setup:dpipe_setup, test_precheckpoint:dpipe_precheckpoint, test_continue:dpipe_continue, test_restart:dpipe_restart, }; /* add the tests */ crut_add_test(&dpipe_test_ops); ret = crut_main(argc, argv); return ret; } blcr-0.8.5/tests/reloc_aux.c0000664000000000000000000001205411042543127012627 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2008, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * 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 * * $Id: reloc_aux.c,v 1.8 2008/07/26 06:38:15 phargrov Exp $ * * Simple program for testing --relocate */ #include #include #include #include #include #include #include #include #include #include #define FILENAME_FMT "%s/reloc_tmp" #define UFILENAME_FMT "%s/reloc_utmp" #define FIFONAME_FMT "%s/reloc_fifo" #define UFIFONAME_FMT "%s/reloc_ufifo" #define DIRNAME_FMT "%s/reloc_dir" #include "crut_util.h" /* For crut_find_cmd() */ static const char *chkpt_cmd; void checkpoint_self(const char *filename) { char *cmd = NULL; int ret; cmd = crut_aprintf("exec %s --file %s %d", chkpt_cmd, filename, (int)getpid()); ret = system(cmd); if (!WIFEXITED(ret) || WEXITSTATUS(ret)) { fprintf(stderr, "'%s' failed %d\n", cmd, ret); exit(1); } free(cmd); } static const char msg[] = "This is just fine."; static int prep_file(const char *name) { int fd = open(name, O_CREAT|O_RDWR|O_TRUNC, S_IREAD|S_IWRITE); if (fd < 0) { perror("open(file)"); exit(-1); } if (write(fd, msg, sizeof(msg)) < 0) { perror("write(file)"); exit(-1); } return fd; } static void check_file(int fd) { int rc; char buf[1024]; if (lseek(fd, 0, SEEK_SET) == (loff_t)(-1)) { perror("lseek(file)"); exit(-1); } rc = read(fd, buf, sizeof(msg)); if (rc != sizeof(msg)) { perror("read(file)"); exit(-1); } if (strcmp(msg, buf)) { fprintf(stderr, "Compare of file to original failed\n"); exit(-1); } close(fd); } static int prep_fifo(const char *name) { int fd; if (mknod(name, 0600 | S_IFIFO, 0)) { perror("mknod(fifo)"); exit(-1); } fd = open(name, O_RDWR); if (fd < 0) { perror("open(fifo)"); exit(-1); } return fd; } static void check_fifo(int fd) { int rc; char buf[1024]; rc = write(fd, msg, sizeof(msg)); if (rc != sizeof(msg)) { perror("write(fifo)"); exit(-1); } rc = read(fd, buf, sizeof(msg)); if (rc != sizeof(msg)) { perror("read(fifo)"); exit(-1); } if (strcmp(msg, buf)) { fprintf(stderr, "Data in fifo is incorrect\n"); exit(-1); } close(fd); } int main(int argc, const char *argv[]) { int file_fd = -1; int ufile_fd = -1; int fifo_fd = -1; int ufifo_fd = -1; char *filename; const char *dirname; const char *context; if (argc != 3) { fprintf(stderr, "%s expects exactly 2 arguments: DIR CONTEXTFILE\n", argv[0]); exit(-1); } chkpt_cmd = crut_find_cmd(argv[0], "cr_checkpoint"); dirname = argv[1]; context = argv[2]; /* Create and write a file */ filename = crut_aprintf(FILENAME_FMT, dirname); file_fd = prep_file(filename); free(filename); /* Create and write a filem, then unlink */ filename = crut_aprintf(UFILENAME_FMT, dirname); ufile_fd = prep_file(filename); if (unlink(filename)) { perror("unlink(file)"); exit(-1); } free(filename); /* mknod() and open() a FIFO */ filename = crut_aprintf(FIFONAME_FMT, dirname); fifo_fd = prep_fifo(filename); free(filename); /* mknod() and open() a FIFO, then unlink */ filename = crut_aprintf(UFIFONAME_FMT, dirname); ufifo_fd = prep_fifo(filename); if (unlink(filename)) { perror("unlink(fifo)"); exit(-1); } free(filename); /* MKDIR and CD to the working directory */ filename = crut_aprintf(DIRNAME_FMT, dirname); if (mkdir(filename, 0755)) { perror("mkdir()"); exit(-1); } if (chdir(filename)) { perror("chdir()"); exit(-1); } free(filename); /* Take the checkpoint */ checkpoint_self(context); /* Seek, read and compare open() files */ check_file(file_fd); check_file(ufile_fd); /* write, read and compare open() fifos */ check_fifo(fifo_fd); check_fifo(ufifo_fd); return 0; } blcr-0.8.5/tests/save_exe.sh0000664000000000000000000000045411011503203012621 00000000000000#!/bin/sh set -e . ${cr_testsdir:-`dirname $0`}/shellinit context=Context1 # cp -f ${cr_testsdir}/save_aux tstexe trap "\rm -f $context tstexe 2>/dev/null" 0 ${cr_run} ./tstexe "--file $context --clobber --save-exe" # Unlink and overwrite exec rm -f tstexe cp /dev/null tstexe ${cr_restart} $context blcr-0.8.5/tests/prctl.c0000664000000000000000000002013311642672611011776 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2003, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * 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 * * $Id: prctl.c,v 1.6.8.4 2011/10/04 21:07:21 phargrov Exp $ * * Simple tests of prctl() */ #include #include #include #include #include #include "crut.h" #include "crut_util.h" #include "blcr_config.h" #ifndef HAVE_PRCTL int main(void) { printf("No prctl() support was found at configure time - test skipped\n"); return 77; } #else #include enum { my_type_int_ptr, // 2nd arg is int for set, but addr for get my_type_int, // 2nd arg is int for set, and get is returned my_type_bool, // like type_int except set must be 0 or 1 my_type_comm // 2nd arg is buffer for string in and out }; struct test_elem { const char *name; int type; // Type for 2nd arg int read; // Value of 1st argument to read a value int write; // Value of 1st argument to write a value int arg2a; // First choice for 2nd argument int arg2b; // Second choice for 2nd argument union { // Actual value for 2nd argument int i; char *s; } value; }; char my_comm[32] = "testing\0"; struct test_elem test_table[] = { #if defined(PR_GET_PDEATHSIG) /* Early 2.6.x kernels could DIE HARD if we set this one non-zero */ {"PR_GET_PDEATHSIG", my_type_int_ptr, PR_GET_PDEATHSIG, PR_SET_PDEATHSIG, 0, 0, }, #endif #if defined(PR_GET_DUMPABLE) /* Can't write anything but 1, or checkpoint will fail */ {"PR_GET_DUMPABLE", my_type_bool, PR_GET_DUMPABLE, PR_SET_DUMPABLE, 1, 1, }, #endif #if defined(PR_GET_UNALIGN) {"PR_GET_UNALIGN", my_type_int_ptr, PR_GET_UNALIGN, PR_SET_UNALIGN, 0, PR_UNALIGN_NOPRINT, }, #endif #if defined(PR_GET_KEEPCAPS) {"PR_GET_KEEPCAPS", my_type_bool, PR_GET_KEEPCAPS, PR_SET_KEEPCAPS, 0, 1, }, #endif #if defined(PR_GET_FPEMU) {"PR_GET_FPEMU", my_type_int_ptr, PR_GET_FPEMU, PR_SET_FPEMU, 0, 1, }, #endif #if defined(PR_GET_FPEXC) {"PR_GET_FPEXC", my_type_int_ptr, PR_GET_FPEXC, PR_SET_FPEXC, PR_FP_EXC_DISABLED, PR_FP_EXC_PRECISE, }, #endif #if defined(PR_GET_TIMING) {"PR_GET_TIMING", my_type_int, PR_GET_TIMING, PR_SET_TIMING, PR_TIMING_STATISTICAL, PR_TIMING_TIMESTAMP, }, #endif #if defined(PR_GET_NAME) {"PR_GET_NAME", my_type_comm, PR_GET_NAME, PR_SET_NAME, }, #endif #if defined(PR_GET_ENDIAN) && 0 /* Not safe to change this one */ {"PR_GET_ENDIAN", my_type_int_ptr, PR_GET_ENDIAN, PR_SET_ENDIAN, X, X, }, #endif #if defined(PR_GET_SECCOMP) && 0 /* Not safe to change this one */ {"PR_GET_SECCOMP", my_type_int, PR_GET_SECCOMP, PR_SET_SECCOMP, X, X, }, #endif #if defined(PR_GET_TSC) {"PR_GET_TSC", my_type_int_ptr, PR_GET_TSC, PR_SET_TSC, 1, 0, }, #endif #if defined(PR_GET_TIMERSLACK) /* NOTE: don't use 0, as it is translated to the default value */ {"PR_GET_TIMERSLACK", my_type_int, PR_GET_TIMERSLACK, PR_SET_TIMERSLACK, 50000, 100000, }, #endif }; void prctl_init(void) { int i; for (i=0; i < sizeof(test_table)/sizeof(struct test_elem); ++i) { struct test_elem *elem = test_table + i; int result; switch (elem->type) { case my_type_int_ptr: { int tmp, val; elem->value.i = -1; result = prctl(elem->read, (unsigned long)&tmp); if (result < 0) break; CRUT_DEBUG("Read %s=%d", elem->name, tmp); val = (tmp == elem->arg2a) ? elem->arg2b : elem->arg2a; result = prctl(elem->write, val); if (result < 0) break; result = prctl(elem->read, (unsigned long)&val); /* Read back */ if (result < 0) break; CRUT_DEBUG("Wrote %s=%d", elem->name, val); elem->value.i = val; break; } case my_type_bool: case my_type_int: { int val; elem->value.i = -1; result = prctl(elem->read, 0UL); if (result < 0) break; if ((elem->type == my_type_bool) && (result > 0)) result = 1; CRUT_DEBUG("Read %s=%d", elem->name, result); val = (result == elem->arg2a) ? elem->arg2b : elem->arg2a; result = prctl(elem->write, val); if (result < 0) break; val = prctl(elem->read, 0UL); /* Read back again */ if (val < 0) break; if ((elem->type == my_type_bool) && (val > 0)) val = 1; CRUT_DEBUG("Wrote %s=%d", elem->name, val); elem->value.i = val; break; } case my_type_comm: { char tmp[32]; elem->value.s = NULL; result = prctl(elem->read, tmp); if (result < 0) break; CRUT_DEBUG("Read %s='%s'", elem->name, tmp); result = prctl(elem->write, my_comm); if (result < 0) break; CRUT_DEBUG("Wrote %s='%s'", elem->name, my_comm); elem->value.s = my_comm; break; } default: result = -EINVAL; CRUT_FAIL("Bad type in test_table entry %s", elem->name); } } } int prctl_check(void) { int fail = 0; int i; for (i=0; i < sizeof(test_table)/sizeof(struct test_elem); ++i) { struct test_elem *elem = test_table + i; int result = 0; switch (elem->type) { case my_type_int_ptr: { int tmp; if (elem->value.i == -1) break; result = prctl(elem->read, (unsigned long)&tmp); if (result < 0) break; if (tmp != elem->value.i) { CRUT_FAIL("Param %s changed from %d to %d\n", elem->name, elem->value.i, tmp); result = -1; } break; } case my_type_bool: case my_type_int: { if (elem->value.i == -1) break; result = prctl(elem->read, 0UL); if ((elem->type == my_type_bool) && (result > 0)) result = 1; if (result != elem->value.i) { CRUT_FAIL("Param %s changed from %d to %d\n", elem->name, elem->value.i, result); result = -1; } break; } case my_type_comm: { char tmp[32]; if (elem->value.s == NULL) break; result = prctl(elem->read, tmp); if (result < 0) break; if (strcmp(tmp, elem->value.s)) { CRUT_FAIL("Param %s changed from '%s' to '%s'\n", elem->name, elem->value.s, tmp); result = -1; } break; } default: result = -EINVAL; CRUT_FAIL("Bad type in test_table entry %s", elem->name); exit(-1); } if (result < 0) fail++; } return fail ? -1 : 0; } static int prctl_setup(void **testdata) { CRUT_DEBUG("Initializing prctl."); prctl_init(); *testdata = NULL; return 0; } static int prctl_precheckpoint(void *p) { int retval; CRUT_DEBUG("Testing sanity before we checkpoint"); retval = prctl_check(); return retval; } static int prctl_continue(void *p) { int retval; CRUT_DEBUG("Continuing after checkpoint."); retval = prctl_check(); return retval; } static int prctl_restart(void *p) { int retval; CRUT_DEBUG("Restarting from checkpoint."); retval = prctl_check(); return retval; } int main(int argc, char *argv[]) { int ret; struct crut_operations prctl_test_ops = { test_scope:CR_SCOPE_PROC, test_name:"prctl_rw", test_description:"Simple test or prctl.", test_setup:prctl_setup, test_precheckpoint:prctl_precheckpoint, test_continue:prctl_continue, test_restart:prctl_restart, test_teardown:NULL, }; /* add the basic tests */ crut_add_test(&prctl_test_ops); ret = crut_main(argc, argv); return ret; } #endif blcr-0.8.5/tests/expect_test.sh0000664000000000000000000000327511015415407013371 00000000000000#!/bin/sh # # Test of checkpoint/restart of an expect script. # Note that the outer shell script is bash # Check for expect expect -c exit || exit 77 . ${cr_testsdir:-`dirname $0`}/shellinit \rm -f Context[123] .Context[123].tmp 2>/dev/null bash <<-'__OUTER__' exec 2>/dev/null # Drop job control message(s) from the outer script echo '#ST_ALARM:120' echo '#ST_IGNORE:^child killed: hangup' $cr_run expect 2>&1 <<-'__INNER__' set chkpt_cmd $env(cr_checkpoint) set rstrt_cmd $env(cr_restart) proc waitfor {pid} { while { ! [ catch { wait ; exec kill -s 0 $pid } msg ] } { sleep 1 } } proc checkpoint {file child} { global chkpt_cmd system "$chkpt_cmd --file=$file --tree --signal 1 $child" if { $child != [ pid ] } { waitfor $child } sleep 1 } proc restart {file} { global rstrt_cmd set child [ exec -- $rstrt_cmd $file & ] sleep 3 return $child } proc echo {msg} { puts $msg; flush stdout } flush stderr flush stdout set child [ fork ] if { $child == 0 } { for { set i 0 } { $i < 16 } { incr i } { puts "$i Hello" flush stdout sleep 1 } exec kill -s 1 [ pid ] ;# Work around a fork+exit bug (blcr bug 2030) exit } sleep 3 echo "# Checkpoint original child" checkpoint "Context1" $child echo "# Restart 1" set child [ restart "Context1" ] echo "# Checkpoint restarted child" checkpoint "Context2" $child echo "# Restart^2" set child [ restart "Context2" ] echo "# Checkpoint self" checkpoint "Context3" [ pid ] waitfor $child echo "16 DONE" __INNER__ exec 2>&1 sleep 3 echo "# Restart interpreter" $cr_restart Context3 __OUTER__ \rm -f Context[123] .Context[123].tmp 2>/dev/null blcr-0.8.5/tests/crut_util.h0000664000000000000000000001504411156265612012675 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2003, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * 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 * * $Id: crut_util.h,v 1.22.4.2 2009/03/12 20:07:38 phargrov Exp $ * * Header file for BLCR utility functions */ #ifndef _CRUT_UTIL_H #define _CRUT_UTIL_H #include "libcr.h" #include "stdio.h" __BEGIN_DECLS /* * Debug/vebose output * VERBOSE: Overall test progress * FAIL: When a test fails * DEBUG: When you want to see the gory details... */ extern unsigned int crut_trace_mask; extern char *crut_program_name; extern void crut_print_trace(const char *file, int line, const char *func, const char *fmt, ...) __attribute__((format (printf, 4, 5))); # define CRUT_FAIL(args...) \ CRUT_TRACE(CRUT_TRACETYPE_FAIL, args) # define CRUT_VERBOSE(args...) \ CRUT_TRACE(CRUT_TRACETYPE_VERBOSE, args) # define CRUT_DEBUG(args...) \ CRUT_TRACE(CRUT_TRACETYPE_DEBUG, args) # define CRUT_TRACETYPE_FAIL 0x00000001 # define CRUT_TRACETYPE_VERBOSE 0x00000002 # define CRUT_TRACETYPE_DEBUG 0x00000004 # define CRUT_TRACE_DEFAULT (CRUT_TRACETYPE_FAIL) # define CRUT_TRACE(type, args...) \ if (crut_trace_mask & (type)) { \ crut_print_trace(__FILE__, __LINE__, __FUNCTION__, args); \ } /* * Compare stat entries */ #include #include #define ST_DEV 0x00000001 /* device */ #define ST_INO 0x00000002 /* inode */ #define ST_MODE 0x00000004 /* protection */ #define ST_NLINK 0x00000008 /* number of hard links */ #define ST_UID 0x00000010 /* user ID of owner */ #define ST_GID 0x00000020 /* group ID of owner */ #define ST_RDEV 0x00000040 /* device type (if inode device) */ #define ST_SIZE 0x00000080 /* total size, in bytes */ #define ST_BLKSIZE 0x00000100 /* blocksize for filesystem I/O */ #define ST_BLOCKS 0x00000200 /* number of blocks allocated */ #define ST_ATIME 0x00000400 /* time of last access */ #define ST_MTIME 0x00000800 /* time of last modification */ #define ST_CTIME 0x00001000 /* time of last change */ extern int statcmp(struct stat *s1, struct stat *s2, unsigned long type); extern void dump_stat(struct stat *s); /* * Generate test pattern */ extern void pattern_fill(char *s, int length, int seed); extern char *pattern_get_data(int length, int seed); extern int pattern_compare(char *buf, int length, int seed); /* * Synchronize threads */ extern void crut_barrier(int *counter); /* * IPC for multi-process tests */ struct crut_pipes { int parent, child; /* Pids */ int inpipe, outpipe; /* FDs */ }; extern int crut_pipes_fork(struct crut_pipes *pipes); extern int crut_pipes_getchar(struct crut_pipes *pipes); extern void crut_pipes_expect(struct crut_pipes *pipes, unsigned char expect); extern void crut_pipes_putchar(struct crut_pipes *pipes, unsigned char c); extern void crut_pipes_write(struct crut_pipes *pipes, const char *s, size_t len); extern int crut_pipes_close(struct crut_pipes *pipes); extern void crut_waitpid_expect(int child, unsigned char expect); extern void crut_waitpid_expect_signal(int child, unsigned char expect); extern char *crut_find_testsdir(const char *argv0); extern char *crut_find_cmd(const char *argv0, const char *prog); /* * Tools for progress output to stderr * * crut_progress_start() performs initialization: * 'startval' is the initial value of the "counter", which might have any unit * such as seconds, milliseconds or iterations * 'length' is the number of units until the end of the test. In other words, * the (startval+length) is 100% * 'steps' is the maximum number of times to print the percentage. The output * will be printed fewer times if (length/steps) would be less than 1. * crut_progress_step() performs output and boundary check: * 'currval' is tested against startval+length, the return is 0 when currval * has reached the end. * Ex1: Run a loop for 'Interval' seconds, printing 10%, 20% ... 100% * crut_progress_start(time(NULL), Interval, 10); * do { something; } while (crut_progress_step(time(NULL))); * Ex2: Run a for(i=0; i<=MAX; ++i) loop, printing 5%, 10% ... 100% * crut_progress_start(0, MAX, 20); * for (i=0; crut_progress_step(i); ++i) { something; } */ extern void crut_progress_start(long startval, long length, int steps); extern int crut_progress_step(long currval); /* * Functions for use of pthreads */ extern int crut_is_linuxthreads(void); extern int crut_pthread_create(pthread_t *thread, pthread_attr_t *attr, void *(*start_routine)(void *), void *arg); /* * Simple wrappers for request/poll */ extern int crut_checkpoint_request(cr_checkpoint_handle_t *handle_p, const char *filename); extern int crut_checkpoint_wait(cr_checkpoint_handle_t *handle_p, int fd); extern int crut_checkpoint_block(const char *filename); /* Remove trailing newline if present */ extern char *crut_chomp(char *line); /* Like glibc's getline(), but not assuming has are using glibc */ extern int crut_getline(char **line_p, size_t *len_p, FILE *stream); /* Prints to a string and handles allocation automatically */ extern char *crut_aprintf(const char *fmt, ...); /* Appends to a string and handles reallocation automatically */ extern char *crut_sappendf(char *s, const char *fmt, ...); /* basename() that returns new storage rather than modifying the argument */ extern char *crut_basename(const char *s); /* If we are going to use setpgrp() we may need to worry about SIGTTOU */ extern void crut_block_sigttou(void); __END_DECLS #endif /* _CRUT_UTIL_H */ blcr-0.8.5/tests/bug2003_aux.c0000664000000000000000000000370010630113672012603 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2007, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * 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 * * $Id: bug2003_aux.c,v 1.1 2007/06/01 22:03:38 phargrov Exp $ * * Intentionally screw w/ sa_restorer. */ #include #include #include #include #include "blcr_common.h" /* For CR_SIGNUM */ int main(void) { /* corrupt the sa_restorer!! * This approximates what guile does when it saves/restores * sa_sigaction and sa_flags w/o preserving sa_restorer. */ struct sigaction sa; sigset_t mask; (void)sigaction(CR_SIGNUM, NULL, &sa); /* Ignore any failure */ if (sa.sa_restorer) { sa.sa_restorer = (void *)&abort; (void)sigaction(CR_SIGNUM, &sa, NULL); /* Ignore any failure */ } else { /* Don't mess w/ NULL */ } /* Wait upto 30 seconds for the checkpoint */ (void)sigemptyset(&mask); (void)alarm(30); (void)sigsuspend(&mask); (void)alarm(0); return 0; } blcr-0.8.5/tests/save_all.sh0000664000000000000000000000055611011503203012613 00000000000000#!/bin/sh set -e . ${cr_testsdir:-`dirname $0`}/shellinit context=Context1 # cp -f ${cr_testsdir}/save_aux tstexe trap "\rm -f $context tstexe tstmap[12] 2>/dev/null" 0 rm -f tstmap[12] ${cr_run} ./tstexe "--file $context --clobber --save-all" S P # Unlink and overwrite exec; unlink mmap()ed files rm -f tstexe tstmap[12] cp /dev/null tstexe ${cr_restart} $context blcr-0.8.5/tests/jre_test.sh0000664000000000000000000000263311043777121012663 00000000000000#!/bin/sh # Test JRE from Sun or a work-alike. # # NOTE: Sun's java uses signal handlers to remove the shared memory file # /tmp/hsperfdata_/ on termination, thus preventing restart. # We have two options. One is the '-Xrs' option to disable the signal # handlers, and the other is to send SIGKILL. # Currently we use -Xrs, which is silently ignored by both IBM's java # and by gij. Thus Sun's, IBM's and the gcj JREs all work the same. # # Tested against the following RPMs: # java-1_5_0-sun-1.5.0_10-0.1 # ibm-java2-i386-sdk-5.0-5.0 # java-1.4.2-gcj-compat # java-sablevm # # First check that we *have* java (java -version || java -help) >/dev/null 2>&1 || exit 77 . ${cr_testsdir:-`dirname $0`}/shellinit top_srcdir=${top_srcdir:-..} filelist="Context[12] .Context[12].tmp" \rm -f $filelist 2>/dev/null trap "\rm -f $filelist 2>/dev/null" 0 exec 2>/dev/null # To drop job control messages echo '#ST_ALARM:120' echo '#ST_IGNORE:^Warning: .*Ignoring\.$' echo '#ST_IGNORE:^Warning: -Xrs option not implemented' $cr_run java -cp $top_srcdir/tests -Xrs CountingApp 2>&1 & pid=$! sleep 3 echo "# Checkpoint 1" $cr_checkpoint --file=Context1 --term $pid 2>&1 wait sleep 1 echo "# Restart 1" $cr_restart Context1 2>&1 & pid=$! sleep 3 echo "# Checkpoint restarted child" $cr_checkpoint --file=Context2 --term --tree $pid 2>&1 wait sleep 1 echo "# Restart^2" $cr_restart Context2 2>&1 & pid=$! wait echo "10 DONE" blcr-0.8.5/tests/reloc_all.sh0000664000000000000000000000112711046023553012771 00000000000000#!/bin/sh set -e . ${cr_testsdir:-`dirname $0`}/shellinit context=`pwd`/Context1 # TMPDIR=`cd ${TMPDIR:-/tmp} && $cr_pwd` MY_TMPDIR1=`mktemp -d ${TMPDIR}/blcr_reloc.XXXXXX` MY_TMPDIR2=`mktemp -d ${TMPDIR}/blcr_reloc.XXXXXX` trap "\rm -rf ${MY_TMPDIR1} ${MY_TMPDIR2} $context 2>/dev/null" 0 cp -f ${cr_testsdir}/reloc_aux ${MY_TMPDIR1}/reloc_exe ${cr_run} ${MY_TMPDIR1}/reloc_exe ${MY_TMPDIR1} "$context --clobber" # Move the entire directory contents mv -f ${MY_TMPDIR1}/reloc_* ${MY_TMPDIR2}/ \rm -rf ${MY_TMPDIR1} ${cr_restart} --relocate /foo=/bar --relocate ${MY_TMPDIR1}=${MY_TMPDIR2} $context blcr-0.8.5/tests/atomics.c0000664000000000000000000000514411057637561012323 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2007, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * 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 * * $Id: atomics.c,v 1.3 2008/09/04 01:52:49 phargrov Exp $ * * Simple serial tests of the atomic operations used inside libcr */ #include #include "blcr_config.h" #include "cr_atomic.h" #define CHECK(cond) \ do { if (!(cond)) { ++failed; printf("Test (" #cond ") FAILED at line %d\n", __LINE__); } } while (0) int main(int argc, char *argv[]) { cri_atomic_t X = 0; int failed = 0; /* Is the initial value 0? */ CHECK(cri_atomic_read(&X) == 0); /* Write 1 */ cri_atomic_write(&X, 1); CHECK(cri_atomic_read(&X) == 1); /* Increment 1->2 */ cri_atomic_inc(&X); CHECK(cri_atomic_read(&X) == 2); /* Decrement 2->1, expecting "false" result */ CHECK(cri_atomic_dec_and_test(&X) == 0); CHECK(cri_atomic_read(&X) == 1); /* Decrement 1->0, expecting "true" result */ CHECK(cri_atomic_dec_and_test(&X) != 0); CHECK(cri_atomic_read(&X) == 0); /* Compare-and-swap 0->4, expecting "true" result */ CHECK(cri_cmp_swap(&X, 0, 4) != 0); CHECK(cri_atomic_read(&X) == 4); /* Try compare-and-swap 0->5 when value is actually 4, expecting "false" result */ CHECK(cri_cmp_swap(&X, 0, 5) == 0); CHECK(cri_atomic_read(&X) == 4); /* Should *not* have changed */ /* Compare-and-swap 4->5, expecting "true" result */ CHECK(cri_cmp_swap(&X, 4, 5) != 0); CHECK(cri_atomic_read(&X) == 5); /* Compare-and-swap 5->5, expecting "true" result */ CHECK(cri_cmp_swap(&X, 5, 5) != 0); CHECK(cri_atomic_read(&X) == 5); return !!failed; } blcr-0.8.5/tests/stage0004.c0000664000000000000000000002103411145431253012253 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2008, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * 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 * * $Id: stage0004.c,v 1.1.34.1 2009/02/14 02:55:39 phargrov Exp $ */ const char description[] = "Description of stage0004:\n" "\n" "This test tries several calls to libcr functions without their prerequisites\n"; #include #include #include #include "libcr.h" int my_callback(void *arg) { return 0; } int main(void) { pid_t my_pid; cr_callback_id_t cb_id; cr_client_id_t my_id; void *ptr; int rc; setlinebuf(stdout); my_pid = getpid(); printf("000 Process started with pid %d\n", my_pid); /* First several calls that are invalid w/o a call to cr_init() */ my_id = 0; /* FAKE IT */ rc = cr_status(); if ((rc < 0) && (errno == CR_ENOINIT)) { printf("001 cr_status() failed w/ errno=CR_ENOINIT as expected\n"); } else if (rc >= 0) { printf("XXX cr_status() unexpectedly suceeded\n"); exit(-1); } else { printf("XXX cr_status() failed w/ errno=%d(%s)\n", errno, cr_strerror(errno)); exit(-1); } rc = cr_enter_cs(my_id); if ((rc < 0) && (errno == CR_ENOINIT)) { printf("002 cr_enter_cs() failed w/ errno=CR_ENOINIT as expected\n"); } else if (rc >= 0) { printf("XXX cr_enter_cs() unexpectedly suceeded\n"); exit(-1); } else { printf("XXX cr_enter_cs() failed w/ errno=%d(%s)\n", errno, cr_strerror(errno)); exit(-1); } rc = cr_leave_cs(my_id); if ((rc < 0) && (errno == CR_ENOINIT)) { printf("003 cr_leave_cs() failed w/ errno=CR_ENOINIT as expected\n"); } else if (rc >= 0) { printf("XXX cr_leave_cs() unexpectedly suceeded\n"); exit(-1); } else { printf("XXX cr_leave_cs() failed w/ errno=%d(%s)\n", errno, cr_strerror(errno)); exit(-1); } rc = cr_tryenter_cs(my_id); if ((rc < 0) && (errno == CR_ENOINIT)) { printf("004 cr_tryenter_cs() failed w/ errno=CR_ENOINIT as expected\n"); } else if (rc >= 0) { printf("XXX cr_tryenter_cs() unexpectedly suceeded\n"); exit(-1); } else { printf("XXX cr_tryenter_cs() failed w/ errno=%d(%s)\n", errno, cr_strerror(errno)); exit(-1); } cb_id = cr_register_callback(my_callback, NULL, CR_SIGNAL_CONTEXT); if ((rc < 0) && (errno == CR_ENOINIT)) { printf("005 cr_register_callback() failed w/ errno=CR_ENOINIT as expected\n"); } else if (rc >= 0) { printf("XXX cr_register_callback() unexpectedly suceeded\n"); exit(-1); } else { printf("XXX cr_register_callback() failed w/ errno=%d(%s)\n", errno, cr_strerror(errno)); exit(-1); } rc = cr_replace_callback(0 /*?*/, my_callback, NULL, CR_SIGNAL_CONTEXT); if ((rc < 0) && (errno == CR_ENOINIT)) { printf("006 cr_replace_callback() failed w/ errno=CR_ENOINIT as expected\n"); } else if (rc >= 0) { printf("XXX cr_replace_callback() unexpectedly suceeded\n"); exit(-1); } else { printf("XXX cr_replace_callback() failed w/ errno=%d(%s)\n", errno, cr_strerror(errno)); exit(-1); } rc = cr_inc_persist(); if ((rc < 0) && (errno == CR_ENOINIT)) { printf("007 cr_inc_persist() failed w/ errno=CR_ENOINIT as expected\n"); } else if (rc >= 0) { printf("XXX cr_inc_persist() unexpectedly suceeded\n"); exit(-1); } else { printf("XXX cr_inc_persist() failed w/ errno=%d(%s)\n", errno, cr_strerror(errno)); exit(-1); } rc = cr_dec_persist(); if ((rc < 0) && (errno == CR_ENOINIT)) { printf("008 cr_dec_persist() failed w/ errno=CR_ENOINIT as expected\n"); } else if (rc >= 0) { printf("XXX cr_dec_persist() unexpectedly suceeded\n"); exit(-1); } else { printf("XXX cr_dec_persist() failed w/ errno=%d(%s)\n", errno, cr_strerror(errno)); exit(-1); } ptr = (void*)cr_register_hook(0, NULL); if ((ptr == (void*)CR_HOOK_FN_ERROR) && (errno == CR_ENOINIT)) { printf("009 cr_register_hook() failed w/ errno=CR_ENOINIT as expected\n"); } else if (ptr != (void*)CR_HOOK_FN_ERROR) { printf("XXX cr_register_hook() unexpectedly suceeded\n"); exit(-1); } else { printf("XXX cr_register_hook() failed w/ errno=%d(%s)\n", errno, cr_strerror(errno)); exit(-1); } my_id = cr_init(); if (my_id >= 0) { printf("010 cr_init() succeeded\n"); } else { printf("XXX cr_init() failed, returning %d\n", my_id); exit(-1); } /* Now some that are invalid outside of callbacks */ rc = cr_checkpoint(0); if (rc == -CR_ENOTCB) { printf("011 cr_checkpoint() failed returned -CR_ENOTCB as expected\n"); } else { printf("XXX cr_checkpoint() unexpectedly returned %d\n", rc); exit(-1); } rc = cr_replace_self(my_callback, NULL, CR_SIGNAL_CONTEXT); if ((rc < 0) && (errno == CR_ENOTCB)) { printf("012 cr_replace_self() failed returned -CR_ENOTCB as expected\n"); } else if (rc >= 0) { printf("XXX cr_replace_self() unexpectedly suceeded\n"); exit(-1); } else { printf("XXX cr_replace_self() unexpectedly returned %d\n", rc); exit(-1); } ptr = (void *)cr_get_checkpoint_info(); if (ptr == NULL) { printf("013 cr_get_checkpoint_info() failed returned -CR_ENOTCB as expected\n"); } else { printf("XXX cr_get_checkpoint_info() unexpectedly returned non-NULL\n"); exit(-1); } ptr = (void *)cr_get_restart_info(); if (ptr == NULL) { printf("014 cr_get_restart_info() failed returned -CR_ENOTCB as expected\n"); } else { printf("XXX cr_get_restart_info() unexpectedly returned non-NULL\n"); exit(-1); } rc = cr_forward_checkpoint(CR_SCOPE_PROC, my_pid); if ((rc < 0) && (errno == CR_ENOTCB)) { printf("015 cr_forward_checkpoint() failed returned -CR_ENOTCB as expected\n"); } else if (rc >= 0) { printf("XXX cr_forward_checkpoint() unexpectedly suceeded\n"); exit(-1); } else { printf("XXX cr_forward_checkpoint() unexpectedly returned %d\n", rc); exit(-1); } /* Argument checks */ rc = cr_dec_persist(); if ((rc < 0) && (errno == ERANGE)) { printf("016 cr_dec_persist() failed w/ errno=ERANGE as expected\n"); } else if (rc >= 0) { printf("XXX cr_dec_persist() unexpectedly suceeded\n"); exit(-1); } else { printf("XXX cr_dec_persist() failed w/ errno=%d(%s)\n", errno, cr_strerror(errno)); exit(-1); } /* NOTE: testing cr_inc_persists() is impractical */ ptr = (void *)cr_register_hook(0, CR_HOOK_FN_ERROR); if ((ptr == (void*)CR_HOOK_FN_ERROR) && (errno == EINVAL)) { printf("017 cr_register_hook(0,CR_HOOK_FN_ERROR) failed w/ errno=EINVAL as expected\n"); } else if (ptr != (void*)CR_HOOK_FN_ERROR) { printf("XXX cr_register_hook(0,CR_HOOK_FN_ERROR) unexpectedly suceeded\n"); exit(-1); } else { printf("XXX cr_register_hook(0,CR_HOOK_FN_ERROR) failed w/ errno=%d(%s)\n", errno, cr_strerror(errno)); exit(-1); } ptr = (void *)cr_register_hook(-1, NULL); if ((ptr == (void*)CR_HOOK_FN_ERROR) && (errno == EINVAL)) { printf("018 cr_register_hook(-1,NULL) failed w/ errno=EINVAL as expected\n"); } else if (ptr != (void*)CR_HOOK_FN_ERROR) { printf("XXX cr_register_hook(-1,NULL) unexpectedly suceeded\n"); exit(-1); } else { printf("XXX cr_register_hook(-1,NULL) failed w/ errno=%d(%s)\n", errno, cr_strerror(errno)); exit(-1); } ptr = (void *)cr_register_hook(CR_NUM_HOOKS, NULL); if ((ptr == (void*)CR_HOOK_FN_ERROR) && (errno == EINVAL)) { printf("019 cr_register_hook(CR_NUM_HOOKS,-1) failed w/ errno=EINVAL as expected\n"); } else if (ptr != (void*)CR_HOOK_FN_ERROR) { printf("XXX cr_register_hook(CR_NUM_HOOKS,-1) unexpectedly suceeded\n"); exit(-1); } else { printf("XXX cr_register_hook(CR_NUM_HOOKS,-1) failed w/ errno=%d(%s)\n", errno, cr_strerror(errno)); exit(-1); } printf("020 DONE\n"); return 0; } blcr-0.8.5/tests/clobber.sh0000664000000000000000000000372711011503203012440 00000000000000#!/bin/sh # Test for the atomicity flags to cr_checkpoint set -e . ${cr_testsdir:-`dirname $0`}/shellinit context=Context1 backup=Context2 stamp1=tststamp1 stamp2=tststamp2 trap "\rm -f $context $backup $stamp1 $stamp2 2>/dev/null" 0 # stamp_it () { if [ -e $1 ]; then touch -r $1 $2 else touch $2 fi sleep 1 # ensure files have different ctimes } test_proc () { stamp_it $context $stamp1 set +e ${cr_run} -- ${cr_testsdir}/save_aux "--file $context $1" 2>/dev/null result=$? set -e if [ $result != $2 ]; then echo "Test of '$1' exited with $result when expecting $2" exit 1 fi if [ $2 = 0 -a \! $context -nt $stamp1 ]; then echo "context unexpectedly appears exchanged" exit 1 fi } test_init () { stamp_it $context $stamp1 set +e ${cr_checkpoint} --file $context $1 1 2>/dev/null result=$? set -e if [ $result = 0 ]; then echo "checkpoint of '$1 1' unexpectedly succeeded" exit 1 fi if [ \! -e $context ]; then echo "checkpoint of '$1 1' unexpectedly removed context file" exit 1 fi if [ $context -nt $stamp1 ]; then echo "checkpoint of '$1 1' unexpectedly changed context file" exit 1 fi } # \rm -f $context $backup test_proc --noclobber 0 # Expect pass, no conflicting file test_proc --noclobber 1 # Expect fail since file exsits test_proc --clobber 0 # Expect pass & replacing test_init --atomic test_proc --atomic 0 # Expect pass & replace test_init --backup=$backup if [ -e $backup ]; then echo "backup file created unexpectedly" exit 1 fi # each one should clobber the previous \rm -f $stamp2 for i in 1 2 3; do test_proc --backup=$backup 0 if [ \! -e $backup ]; then echo "backup file unexpectedly missing" exit 1 fi if [ $backup -nt $context ]; then echo "backup file and context appear exchanged" exit 1 fi if [ -e $stamp2 -a \! $backup -nt $stamp2 ]; then echo "backup file unexpectedly appears too old at $i" exit 1 fi touch -r $backup $stamp2 done blcr-0.8.5/tests/Makefile.in0000664000000000000000000020744012102070010012534 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ 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@ @CR_BUILD_TESTSUITE_TRUE@testsexec_PROGRAMS = $(am__EXEEXT_6) \ @CR_BUILD_TESTSUITE_TRUE@ $(am__EXEEXT_14) check_PROGRAMS = $(am__EXEEXT_7) $(am__EXEEXT_13) $(am__EXEEXT_14) TESTS = $(am__EXEEXT_15) $(SEQ_RUN) $(CRUT_RUN) subdir = tests DIST_COMMON = $(check_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/shellinit.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/blcr_config.h CONFIG_CLEAN_FILES = shellinit CONFIG_CLEAN_VPATH_FILES = ARFLAGS = cru libtest_a_AR = $(AR) $(ARFLAGS) libtest_a_LIBADD = am_libtest_a_OBJECTS = crut.$(OBJEXT) crut_util.$(OBJEXT) \ crut_util_pth.$(OBJEXT) crut_util_libcr.$(OBJEXT) libtest_a_OBJECTS = $(am_libtest_a_OBJECTS) am__EXEEXT_1 = atomics$(EXEEXT) bug2524$(EXEEXT) am__EXEEXT_2 = stage0001$(EXEEXT) stage0002$(EXEEXT) \ stage0003$(EXEEXT) stage0004$(EXEEXT) \ critical_sections$(EXEEXT) replace_cb$(EXEEXT) \ failed_cb$(EXEEXT) failed_cb2$(EXEEXT) pid_in_use$(EXEEXT) \ cs_enter_leave$(EXEEXT) cs_enter_leave2$(EXEEXT) \ cr_tryenter_cs$(EXEEXT) stopped$(EXEEXT) edeadlk$(EXEEXT) \ pid_restore$(EXEEXT) am__EXEEXT_3 = simple$(EXEEXT) simple_pthread$(EXEEXT) cwd$(EXEEXT) \ dup$(EXEEXT) filedescriptors$(EXEEXT) pipe$(EXEEXT) \ named_fifo$(EXEEXT) cloexec$(EXEEXT) get_info$(EXEEXT) \ orphan$(EXEEXT) overlap$(EXEEXT) child$(EXEEXT) mmaps$(EXEEXT) \ hugetlbfs$(EXEEXT) readdir$(EXEEXT) dev_null$(EXEEXT) \ cr_signal$(EXEEXT) linked_fifo$(EXEEXT) sigpending$(EXEEXT) \ dpipe$(EXEEXT) forward$(EXEEXT) hooks$(EXEEXT) math$(EXEEXT) \ sigaltstack$(EXEEXT) prctl$(EXEEXT) lam$(EXEEXT) nscd$(EXEEXT) @CR_ENABLE_SHARED_TRUE@am__EXEEXT_4 = hello$(EXEEXT) \ @CR_ENABLE_SHARED_TRUE@ dlopen_aux$(EXEEXT) am__EXEEXT_5 = $(am__EXEEXT_4) bug2003_aux$(EXEEXT) pause$(EXEEXT) \ save_aux$(EXEEXT) reloc_aux$(EXEEXT) am__EXEEXT_6 = $(am__EXEEXT_1) $(am__EXEEXT_2) $(am__EXEEXT_3) \ $(am__EXEEXT_5) @CR_BUILD_TESTSUITE_FALSE@am__EXEEXT_7 = $(am__EXEEXT_6) am__EXEEXT_8 = atomics_stress$(EXEEXT) @CR_HAVE_CXX_TRUE@am__EXEEXT_9 = testcxx$(EXEEXT) am__EXEEXT_10 = cb_exit$(EXEEXT) ptrace$(EXEEXT) $(am__EXEEXT_9) am__EXEEXT_11 = hugetlbfs2$(EXEEXT) am__EXEEXT_12 = am__EXEEXT_13 = $(am__EXEEXT_8) $(am__EXEEXT_10) $(am__EXEEXT_11) \ $(am__EXEEXT_12) am__EXEEXT_14 = seq_wrapper$(EXEEXT) crut_wrapper$(EXEEXT) am__installdirs = "$(DESTDIR)$(testsexecdir)" \ "$(DESTDIR)$(testsexecdir)" PROGRAMS = $(testsexec_PROGRAMS) atomics_SOURCES = atomics.c atomics_OBJECTS = atomics-atomics.$(OBJEXT) atomics_DEPENDENCIES = atomics_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(atomics_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ atomics_stress_SOURCES = atomics_stress.c atomics_stress_OBJECTS = atomics_stress-atomics_stress.$(OBJEXT) atomics_stress_DEPENDENCIES = $(libtest_ldadd) atomics_stress_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(atomics_stress_CFLAGS) \ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ bug2003_aux_SOURCES = bug2003_aux.c bug2003_aux_OBJECTS = bug2003_aux.$(OBJEXT) am__DEPENDENCIES_1 = am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) @CR_ENABLE_SHARED_FALSE@bug2003_aux_DEPENDENCIES = \ @CR_ENABLE_SHARED_FALSE@ $(am__DEPENDENCIES_2) bug2003_aux_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(bug2003_aux_LDFLAGS) $(LDFLAGS) -o $@ bug2524_SOURCES = bug2524.c bug2524_OBJECTS = bug2524.$(OBJEXT) bug2524_LDADD = $(LDADD) bug2524_DEPENDENCIES = $(libtest_ldadd) $(am__DEPENDENCIES_2) cb_exit_SOURCES = cb_exit.c cb_exit_OBJECTS = cb_exit.$(OBJEXT) cb_exit_LDADD = $(LDADD) cb_exit_DEPENDENCIES = $(libtest_ldadd) $(am__DEPENDENCIES_2) child_SOURCES = child.c child_OBJECTS = child.$(OBJEXT) child_LDADD = $(LDADD) child_DEPENDENCIES = $(libtest_ldadd) $(am__DEPENDENCIES_2) cloexec_SOURCES = cloexec.c cloexec_OBJECTS = cloexec.$(OBJEXT) cloexec_LDADD = $(LDADD) cloexec_DEPENDENCIES = $(libtest_ldadd) $(am__DEPENDENCIES_2) cr_signal_SOURCES = cr_signal.c cr_signal_OBJECTS = cr_signal.$(OBJEXT) cr_signal_LDADD = $(LDADD) cr_signal_DEPENDENCIES = $(libtest_ldadd) $(am__DEPENDENCIES_2) cr_tryenter_cs_SOURCES = cr_tryenter_cs.c cr_tryenter_cs_OBJECTS = cr_tryenter_cs.$(OBJEXT) cr_tryenter_cs_LDADD = $(LDADD) cr_tryenter_cs_DEPENDENCIES = $(libtest_ldadd) $(am__DEPENDENCIES_2) critical_sections_SOURCES = critical_sections.c critical_sections_OBJECTS = critical_sections.$(OBJEXT) critical_sections_LDADD = $(LDADD) critical_sections_DEPENDENCIES = $(libtest_ldadd) \ $(am__DEPENDENCIES_2) crut_wrapper_SOURCES = crut_wrapper.c crut_wrapper_OBJECTS = crut_wrapper.$(OBJEXT) crut_wrapper_LDADD = $(LDADD) crut_wrapper_DEPENDENCIES = $(libtest_ldadd) $(am__DEPENDENCIES_2) cs_enter_leave_SOURCES = cs_enter_leave.c cs_enter_leave_OBJECTS = cs_enter_leave.$(OBJEXT) cs_enter_leave_LDADD = $(LDADD) cs_enter_leave_DEPENDENCIES = $(libtest_ldadd) $(am__DEPENDENCIES_2) cs_enter_leave2_SOURCES = cs_enter_leave2.c cs_enter_leave2_OBJECTS = cs_enter_leave2.$(OBJEXT) cs_enter_leave2_LDADD = $(LDADD) cs_enter_leave2_DEPENDENCIES = $(libtest_ldadd) $(am__DEPENDENCIES_2) cwd_SOURCES = cwd.c cwd_OBJECTS = cwd.$(OBJEXT) cwd_LDADD = $(LDADD) cwd_DEPENDENCIES = $(libtest_ldadd) $(am__DEPENDENCIES_2) dev_null_SOURCES = dev_null.c dev_null_OBJECTS = dev_null.$(OBJEXT) dev_null_LDADD = $(LDADD) dev_null_DEPENDENCIES = $(libtest_ldadd) $(am__DEPENDENCIES_2) dlopen_aux_SOURCES = dlopen_aux.c dlopen_aux_OBJECTS = dlopen_aux.$(OBJEXT) dlopen_aux_DEPENDENCIES = dpipe_SOURCES = dpipe.c dpipe_OBJECTS = dpipe.$(OBJEXT) dpipe_LDADD = $(LDADD) dpipe_DEPENDENCIES = $(libtest_ldadd) $(am__DEPENDENCIES_2) dup_SOURCES = dup.c dup_OBJECTS = dup.$(OBJEXT) dup_LDADD = $(LDADD) dup_DEPENDENCIES = $(libtest_ldadd) $(am__DEPENDENCIES_2) edeadlk_SOURCES = edeadlk.c edeadlk_OBJECTS = edeadlk.$(OBJEXT) edeadlk_LDADD = $(LDADD) edeadlk_DEPENDENCIES = $(libtest_ldadd) $(am__DEPENDENCIES_2) failed_cb_SOURCES = failed_cb.c failed_cb_OBJECTS = failed_cb.$(OBJEXT) failed_cb_LDADD = $(LDADD) failed_cb_DEPENDENCIES = $(libtest_ldadd) $(am__DEPENDENCIES_2) failed_cb2_SOURCES = failed_cb2.c failed_cb2_OBJECTS = failed_cb2.$(OBJEXT) failed_cb2_LDADD = $(LDADD) failed_cb2_DEPENDENCIES = $(libtest_ldadd) $(am__DEPENDENCIES_2) filedescriptors_SOURCES = filedescriptors.c filedescriptors_OBJECTS = filedescriptors.$(OBJEXT) filedescriptors_LDADD = $(LDADD) filedescriptors_DEPENDENCIES = $(libtest_ldadd) $(am__DEPENDENCIES_2) forward_SOURCES = forward.c forward_OBJECTS = forward.$(OBJEXT) forward_LDADD = $(LDADD) forward_DEPENDENCIES = $(libtest_ldadd) $(am__DEPENDENCIES_2) get_info_SOURCES = get_info.c get_info_OBJECTS = get_info.$(OBJEXT) get_info_LDADD = $(LDADD) get_info_DEPENDENCIES = $(libtest_ldadd) $(am__DEPENDENCIES_2) hello_SOURCES = hello.c hello_OBJECTS = hello.$(OBJEXT) hello_DEPENDENCIES = hooks_SOURCES = hooks.c hooks_OBJECTS = hooks.$(OBJEXT) hooks_LDADD = $(LDADD) hooks_DEPENDENCIES = $(libtest_ldadd) $(am__DEPENDENCIES_2) hugetlbfs_SOURCES = hugetlbfs.c hugetlbfs_OBJECTS = hugetlbfs.$(OBJEXT) hugetlbfs_LDADD = $(LDADD) hugetlbfs_DEPENDENCIES = $(libtest_ldadd) $(am__DEPENDENCIES_2) hugetlbfs2_SOURCES = hugetlbfs2.c hugetlbfs2_OBJECTS = hugetlbfs2.$(OBJEXT) hugetlbfs2_LDADD = $(LDADD) hugetlbfs2_DEPENDENCIES = $(libtest_ldadd) $(am__DEPENDENCIES_2) lam_SOURCES = lam.c lam_OBJECTS = lam.$(OBJEXT) lam_LDADD = $(LDADD) lam_DEPENDENCIES = $(libtest_ldadd) $(am__DEPENDENCIES_2) linked_fifo_SOURCES = linked_fifo.c linked_fifo_OBJECTS = linked_fifo.$(OBJEXT) linked_fifo_LDADD = $(LDADD) linked_fifo_DEPENDENCIES = $(libtest_ldadd) $(am__DEPENDENCIES_2) math_SOURCES = math.c math_OBJECTS = math.$(OBJEXT) math_LDADD = $(LDADD) math_DEPENDENCIES = $(libtest_ldadd) $(am__DEPENDENCIES_2) mmaps_SOURCES = mmaps.c mmaps_OBJECTS = mmaps.$(OBJEXT) mmaps_LDADD = $(LDADD) mmaps_DEPENDENCIES = $(libtest_ldadd) $(am__DEPENDENCIES_2) named_fifo_SOURCES = named_fifo.c named_fifo_OBJECTS = named_fifo.$(OBJEXT) named_fifo_LDADD = $(LDADD) named_fifo_DEPENDENCIES = $(libtest_ldadd) $(am__DEPENDENCIES_2) nscd_SOURCES = nscd.c nscd_OBJECTS = nscd.$(OBJEXT) nscd_LDADD = $(LDADD) nscd_DEPENDENCIES = $(libtest_ldadd) $(am__DEPENDENCIES_2) orphan_SOURCES = orphan.c orphan_OBJECTS = orphan.$(OBJEXT) orphan_LDADD = $(LDADD) orphan_DEPENDENCIES = $(libtest_ldadd) $(am__DEPENDENCIES_2) overlap_SOURCES = overlap.c overlap_OBJECTS = overlap.$(OBJEXT) overlap_LDADD = $(LDADD) overlap_DEPENDENCIES = $(libtest_ldadd) $(am__DEPENDENCIES_2) pause_SOURCES = pause.c pause_OBJECTS = pause.$(OBJEXT) @CR_ENABLE_SHARED_FALSE@pause_DEPENDENCIES = $(am__DEPENDENCIES_2) pause_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(pause_LDFLAGS) \ $(LDFLAGS) -o $@ pid_in_use_SOURCES = pid_in_use.c pid_in_use_OBJECTS = pid_in_use.$(OBJEXT) pid_in_use_LDADD = $(LDADD) pid_in_use_DEPENDENCIES = $(libtest_ldadd) $(am__DEPENDENCIES_2) pid_restore_SOURCES = pid_restore.c pid_restore_OBJECTS = pid_restore.$(OBJEXT) pid_restore_LDADD = $(LDADD) pid_restore_DEPENDENCIES = $(libtest_ldadd) $(am__DEPENDENCIES_2) pipe_SOURCES = pipe.c pipe_OBJECTS = pipe.$(OBJEXT) pipe_LDADD = $(LDADD) pipe_DEPENDENCIES = $(libtest_ldadd) $(am__DEPENDENCIES_2) prctl_SOURCES = prctl.c prctl_OBJECTS = prctl.$(OBJEXT) prctl_LDADD = $(LDADD) prctl_DEPENDENCIES = $(libtest_ldadd) $(am__DEPENDENCIES_2) ptrace_SOURCES = ptrace.c ptrace_OBJECTS = ptrace.$(OBJEXT) ptrace_LDADD = $(LDADD) ptrace_DEPENDENCIES = $(libtest_ldadd) $(am__DEPENDENCIES_2) ptrace_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(ptrace_LDFLAGS) \ $(LDFLAGS) -o $@ readdir_SOURCES = readdir.c readdir_OBJECTS = readdir.$(OBJEXT) readdir_LDADD = $(LDADD) readdir_DEPENDENCIES = $(libtest_ldadd) $(am__DEPENDENCIES_2) reloc_aux_SOURCES = reloc_aux.c reloc_aux_OBJECTS = reloc_aux.$(OBJEXT) @CR_ENABLE_SHARED_FALSE@reloc_aux_DEPENDENCIES = \ @CR_ENABLE_SHARED_FALSE@ $(am__DEPENDENCIES_2) $(libtest_ldadd) @CR_ENABLE_SHARED_TRUE@reloc_aux_DEPENDENCIES = $(libtest_ldadd) reloc_aux_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(reloc_aux_LDFLAGS) $(LDFLAGS) -o $@ replace_cb_SOURCES = replace_cb.c replace_cb_OBJECTS = replace_cb.$(OBJEXT) replace_cb_LDADD = $(LDADD) replace_cb_DEPENDENCIES = $(libtest_ldadd) $(am__DEPENDENCIES_2) save_aux_SOURCES = save_aux.c save_aux_OBJECTS = save_aux.$(OBJEXT) @CR_ENABLE_SHARED_FALSE@save_aux_DEPENDENCIES = $(am__DEPENDENCIES_2) \ @CR_ENABLE_SHARED_FALSE@ $(libtest_ldadd) @CR_ENABLE_SHARED_TRUE@save_aux_DEPENDENCIES = $(libtest_ldadd) save_aux_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(save_aux_LDFLAGS) \ $(LDFLAGS) -o $@ seq_wrapper_SOURCES = seq_wrapper.c seq_wrapper_OBJECTS = seq_wrapper.$(OBJEXT) seq_wrapper_DEPENDENCIES = $(libtest_ldadd) sigaltstack_SOURCES = sigaltstack.c sigaltstack_OBJECTS = sigaltstack.$(OBJEXT) sigaltstack_LDADD = $(LDADD) sigaltstack_DEPENDENCIES = $(libtest_ldadd) $(am__DEPENDENCIES_2) sigpending_SOURCES = sigpending.c sigpending_OBJECTS = sigpending.$(OBJEXT) sigpending_LDADD = $(LDADD) sigpending_DEPENDENCIES = $(libtest_ldadd) $(am__DEPENDENCIES_2) simple_SOURCES = simple.c simple_OBJECTS = simple.$(OBJEXT) simple_LDADD = $(LDADD) simple_DEPENDENCIES = $(libtest_ldadd) $(am__DEPENDENCIES_2) simple_pthread_SOURCES = simple_pthread.c simple_pthread_OBJECTS = simple_pthread.$(OBJEXT) simple_pthread_LDADD = $(LDADD) simple_pthread_DEPENDENCIES = $(libtest_ldadd) $(am__DEPENDENCIES_2) stage0001_SOURCES = stage0001.c stage0001_OBJECTS = stage0001.$(OBJEXT) stage0001_DEPENDENCIES = $(libtest_ldadd) $(am__DEPENDENCIES_2) stage0002_SOURCES = stage0002.c stage0002_OBJECTS = stage0002.$(OBJEXT) stage0002_LDADD = $(LDADD) stage0002_DEPENDENCIES = $(libtest_ldadd) $(am__DEPENDENCIES_2) stage0003_SOURCES = stage0003.c stage0003_OBJECTS = stage0003.$(OBJEXT) stage0003_LDADD = $(LDADD) stage0003_DEPENDENCIES = $(libtest_ldadd) $(am__DEPENDENCIES_2) stage0004_SOURCES = stage0004.c stage0004_OBJECTS = stage0004.$(OBJEXT) stage0004_LDADD = $(LDADD) stage0004_DEPENDENCIES = $(libtest_ldadd) $(am__DEPENDENCIES_2) stopped_SOURCES = stopped.c stopped_OBJECTS = stopped.$(OBJEXT) stopped_LDADD = $(LDADD) stopped_DEPENDENCIES = $(libtest_ldadd) $(am__DEPENDENCIES_2) am__testcxx_SOURCES_DIST = testcxx.cc @CR_HAVE_CXX_TRUE@am_testcxx_OBJECTS = testcxx.$(OBJEXT) testcxx_OBJECTS = $(am_testcxx_OBJECTS) testcxx_LDADD = $(LDADD) testcxx_DEPENDENCIES = $(libtest_ldadd) $(am__DEPENDENCIES_2) 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' SCRIPTS = $(testsexec_SCRIPTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/./config/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libtest_a_SOURCES) atomics.c atomics_stress.c \ bug2003_aux.c bug2524.c cb_exit.c child.c cloexec.c \ cr_signal.c cr_tryenter_cs.c critical_sections.c \ crut_wrapper.c cs_enter_leave.c cs_enter_leave2.c cwd.c \ dev_null.c dlopen_aux.c dpipe.c dup.c edeadlk.c failed_cb.c \ failed_cb2.c filedescriptors.c forward.c get_info.c hello.c \ hooks.c hugetlbfs.c hugetlbfs2.c lam.c linked_fifo.c math.c \ mmaps.c named_fifo.c nscd.c orphan.c overlap.c pause.c \ pid_in_use.c pid_restore.c pipe.c prctl.c ptrace.c readdir.c \ reloc_aux.c replace_cb.c save_aux.c seq_wrapper.c \ sigaltstack.c sigpending.c simple.c simple_pthread.c \ stage0001.c stage0002.c stage0003.c stage0004.c stopped.c \ $(testcxx_SOURCES) DIST_SOURCES = $(libtest_a_SOURCES) atomics.c atomics_stress.c \ bug2003_aux.c bug2524.c cb_exit.c child.c cloexec.c \ cr_signal.c cr_tryenter_cs.c critical_sections.c \ crut_wrapper.c cs_enter_leave.c cs_enter_leave2.c cwd.c \ dev_null.c dlopen_aux.c dpipe.c dup.c edeadlk.c failed_cb.c \ failed_cb2.c filedescriptors.c forward.c get_info.c hello.c \ hooks.c hugetlbfs.c hugetlbfs2.c lam.c linked_fifo.c math.c \ mmaps.c named_fifo.c nscd.c orphan.c overlap.c pause.c \ pid_in_use.c pid_restore.c pipe.c prctl.c ptrace.c readdir.c \ reloc_aux.c replace_cb.c save_aux.c seq_wrapper.c \ sigaltstack.c sigpending.c simple.c simple_pthread.c \ stage0001.c stage0002.c stage0003.c stage0004.c stopped.c \ $(am__testcxx_SOURCES_DIST) ETAGS = etags CTAGS = ctags am__tty_colors = \ red=; grn=; lgn=; blu=; std= am__EXEEXT_15 = $(am__EXEEXT_1) $(SIMPLE_scripts) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CONFIGURE_ARGS = @CONFIGURE_ARGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CR_ARCH = @CR_ARCH@ CR_CLIENT_LDADD = @CR_CLIENT_LDADD@ CR_CPU = @CR_CPU@ CR_FTB_INCLUDES = @CR_FTB_INCLUDES@ CR_FTB_LDADD = @CR_FTB_LDADD@ CR_FTB_LDFLAGS = @CR_FTB_LDFLAGS@ CR_KARCH = @CR_KARCH@ CR_KERNEL = @CR_KERNEL@ CR_KERNEL_BASE = @CR_KERNEL_BASE@ CR_LIBARCH = @CR_LIBARCH@ CR_LIBCR_CFLAGS = @CR_LIBCR_CFLAGS@ CR_MODULE_DIR = @CR_MODULE_DIR@ CR_MODULE_MAJOR = @CR_MODULE_MAJOR@ CR_MODULE_MINOR = @CR_MODULE_MINOR@ CR_MODULE_PATCH = @CR_MODULE_PATCH@ CR_MODULE_VERSION = @CR_MODULE_VERSION@ CR_NDEBUG = @CR_NDEBUG@ CR_RELEASE_MAJOR = @CR_RELEASE_MAJOR@ CR_RELEASE_MINOR = @CR_RELEASE_MINOR@ CR_RELEASE_PATCH = @CR_RELEASE_PATCH@ CR_RELEASE_VERSION = @CR_RELEASE_VERSION@ CR_SIGNUM = @CR_SIGNUM@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GMAKE_ELSE = @GMAKE_ELSE@ GMAKE_ENDIF = @GMAKE_ENDIF@ GMAKE_IFEQ = @GMAKE_IFEQ@ GMAKE_IFNEQ = @GMAKE_IFNEQ@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KBUILD_MAK = @KBUILD_MAK@ KBUILD_MAKE_ARGS = @KBUILD_MAKE_ARGS@ KCC = @KCC@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBCR_MAJOR = @LIBCR_MAJOR@ LIBCR_MINOR = @LIBCR_MINOR@ LIBCR_PATCH = @LIBCR_PATCH@ LIBCR_VERSION = @LIBCR_VERSION@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_AGE = @LIBTOOL_AGE@ LIBTOOL_INTERFACE = @LIBTOOL_INTERFACE@ LIBTOOL_REVISION = @LIBTOOL_REVISION@ LINUX_OBJ = @LINUX_OBJ@ LINUX_SRC = @LINUX_SRC@ LINUX_SYMTAB_CMD = @LINUX_SYMTAB_CMD@ LINUX_SYMTAB_CONF = @LINUX_SYMTAB_CONF@ LINUX_SYMTAB_FILE = @LINUX_SYMTAB_FILE@ LINUX_VER = @LINUX_VER@ LINUX_VERSION_H = @LINUX_VERSION_H@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKE = @MAKE@ MAKEINFO = @MAKEINFO@ 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_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PWD_PROG = @PWD_PROG@ RANLIB = @RANLIB@ RPMBUILD = @RPMBUILD@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TOP_BUILDDIR = @TOP_BUILDDIR@ TOP_SRCDIR = @TOP_SRCDIR@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ 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@ lt_ECHO = @lt_ECHO@ 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@ # Files we clean at various times CONTEXTS = context.* .context.*.tmp Context[123] .Context[123].tmp TEST_TEMPS = tst* @CR_INSTALLED_UTIL_FALSE@util_dir = $(TOP_BUILDDIR)/bin # Special target (run before tests) ensures utils are up-to-date (if built) @CR_INSTALLED_UTIL_TRUE@util_dir = $(bindir) # "SIMPLE" tests, which just return success or failure. # These tests get listed in the SIMPLE_TESTS variable. # These test the actual cr_run utility or dlopen(), and thus require shared libs: @CR_ENABLE_SHARED_TRUE@SIMPLE_scripts_shared = cr_run cr_targ cr_targ2 cr_omit dlopen SIMPLE_progs = atomics bug2524 SIMPLE_scripts = $(SIMPLE_scripts_shared) \ bug2003 run_on save_exe save_priv save_share save_all \ reloc_exe reloc_file reloc_fifo reloc_dir reloc_all \ clobber SIMPLE_TESTS = $(SIMPLE_progs) $(SIMPLE_scripts) # "SEQ" tests are ones that check for certain events happening in # proper sequence, by using a wrapper to parse output. # These tests get listed in the SEQ_TESTS variable. SEQ_progs = stage0001 stage0002 stage0003 stage0004 \ critical_sections replace_cb \ failed_cb failed_cb2 pid_in_use cs_enter_leave cs_enter_leave2 \ cr_tryenter_cs stopped edeadlk pid_restore # XXX: cb_exit has moved to "bonus" list for now. See bug 2244. # XXX: ptrace has moved to "bonus" list for now. See bug 2455. SEQ_scripts = SEQ_TESTS = $(SEQ_progs) $(SEQ_scripts) # C/R unit tests ("CRUT") # These are tests that use the crut.c infractructure and the crut_wrapper # script. CRUT_progs = \ simple simple_pthread cwd dup filedescriptors pipe named_fifo \ cloexec get_info orphan overlap child mmaps hugetlbfs readdir dev_null \ cr_signal linked_fifo sigpending dpipe forward hooks math sigaltstack \ prctl lam nscd # hugetlbfs2 moved to "bonus" list due to leak of MAP_PRIVATE pages in some kernels CRUT_TESTS = $(CRUT_progs) # These are like SIMPLE_TESTS, SEQ_TESTS and CRUT_TESTS, but for # maintainer-only tests (the "bonus" tests). @CR_ENABLE_SHARED_TRUE@SEQ_scripts2_shared = \ @CR_ENABLE_SHARED_TRUE@ ash_test bash_test csh_test ksh_test zsh_test \ @CR_ENABLE_SHARED_TRUE@ perl_test python_test tcl_test expect_test ruby_test \ @CR_ENABLE_SHARED_TRUE@ guile_test clisp_test rep_test emacslisp_test \ @CR_ENABLE_SHARED_TRUE@ php_test gst_test gcj_test gij_test jre_test \ @CR_ENABLE_SHARED_TRUE@ ocaml_test sml_test mosml_test @CR_HAVE_CXX_TRUE@SEQ_testcxx = testcxx @CR_HAVE_CXX_TRUE@testcxx_SOURCES = testcxx.cc SIMPLE_progs2 = atomics_stress SIMPLE_scripts2 = SEQ_progs2 = cb_exit ptrace $(SEQ_testcxx) SEQ_scripts2 = $(SEQ_scripts2_shared) CRUT_progs2 = hugetlbfs2 SIMPLE_TESTS2 = $(SIMPLE_progs2) $(SIMPLE_scripts2) SEQ_TESTS2 = $(SEQ_progs2) $(SEQ_scripts2) CRUT_TESTS2 = $(CRUT_progs2) # Need extra ldflags when an object references no symbols in a lib libcr_ldflags = -u cr_link_me libcr_run_ldflags = -u cr_run_link_me libcr_omit_ldflags = -u cr_omit_link_me @CR_INSTALLED_LIBCR_FALSE@libcr_L = -L$(top_builddir)/libcr # Use the installed library and headers @CR_INSTALLED_LIBCR_TRUE@libcr_L = -L$(libdir) @CR_INSTALLED_LIBCR_FALSE@libcr_includes = -I$(top_srcdir)/include -I$(top_builddir)/include @CR_INSTALLED_LIBCR_TRUE@libcr_includes = -I$(includedir) @CR_INSTALLED_LIBCR_FALSE@LIBCR = $(top_builddir)/libcr/libcr.la \ @CR_INSTALLED_LIBCR_FALSE@ $(top_builddir)/libcr/libcr_run.la \ @CR_INSTALLED_LIBCR_FALSE@ $(top_builddir)/libcr/libcr_omit.la # The library/ies that (nearly?) every test needs: libcr_ldadd = $(libcr_L) -lcr libcr_run_ldadd = $(libcr_L) -lcr_run libcr_omit_ldadd = $(libcr_L) -lcr_omit # Gather reusable code into libtest.a libtest_a_SOURCES = crut.c crut_util.c crut_util_pth.c crut_util_libcr.c libtest_ldadd = libtest.a # Generic flags here... LDADD = $(libtest_ldadd) $(libcr_ldadd) -lpthread @CR_CLIENT_LDADD@ INCLUDES = $(libcr_includes) AM_CFLAGS = -Wall # Test-specific flags here... stage0001_LDADD = $(libtest_ldadd) $(libcr_ldadd) @CR_CLIENT_LDADD@ # NO PTHREADS FOR THIS TEST atomics_CFLAGS = $(CFLAGS) -I$(top_srcdir)/libcr/arch/@CR_LIBARCH@ atomics_LDADD = @CR_CLIENT_LDADD@ # No libs required atomics_stress_CFLAGS = $(CFLAGS) -I$(top_srcdir)/libcr/arch/@CR_LIBARCH@ atomics_stress_LDADD = $(libtest_ldadd) -lpthread @CR_CLIENT_LDADD@ # Only need crut_util.o and pthreads ptrace_LDFLAGS = $(libcr_ldflags) # In static builds need help to ensure libcr is linked (no refs) # The wrappers wrapper_progs = seq_wrapper crut_wrapper seq_wrapper_LDADD = $(libtest_ldadd) # Must not be a lt-exec # Rules to "build" a shell script # We "install" to avoid worrying about the permissions in/on $srcdir # The .sh suffix not meant denote any specific shell all_scripts = $(SIMPLE_scripts) $(SEQ_scripts) $(helper_scripts) \ $(SIMPLE_scripts2) $(SEQ_scripts2) $(helper_scripts2) all_scripts_src = $(patsubst %,%.sh,$(all_scripts)) # Rule to wrap the SEQ tests with the seq_wrapper SEQ_RUN = $(patsubst %,%.st,$(SEQ_TESTS)) SEQ_RUN2 = $(patsubst %,%.st,$(SEQ_TESTS2)) # Rule to wrap the CRUT tests with the crut_wrapper # We use a 1-line script, not a symlink, in the build directory # to allow crut_wrapper to be a libtool wrapper itself. CRUT_RUN = $(patsubst %,%.ct,$(CRUT_TESTS)) CRUT_RUN2 = $(patsubst %,%.ct,$(CRUT_TESTS2)) hello_LDADD = # NO LIBS HERE @CR_ENABLE_SHARED_FALSE@pause_LDADD = $(libcr_run_ldadd) @CR_CLIENT_LDADD@ @CR_ENABLE_SHARED_TRUE@pause_LDADD = # NO LIBS HERE @CR_ENABLE_SHARED_FALSE@bug2003_aux_LDADD = $(libcr_run_ldadd) @CR_CLIENT_LDADD@ @CR_ENABLE_SHARED_TRUE@bug2003_aux_LDADD = # NO LIBS HERE @CR_ENABLE_SHARED_FALSE@save_aux_LDADD = $(libcr_run_ldadd) $(libtest_ldadd) @CR_CLIENT_LDADD@ @CR_ENABLE_SHARED_TRUE@save_aux_LDADD = $(libtest_ldadd) # NO LIBCR HERE - must not be a lt-exec @CR_ENABLE_SHARED_FALSE@reloc_aux_LDADD = $(libcr_run_ldadd) $(libtest_ldadd) @CR_CLIENT_LDADD@ @CR_ENABLE_SHARED_TRUE@reloc_aux_LDADD = $(libtest_ldadd) # NO LIBCR HERE - must not be a lt-exec @CR_ENABLE_SHARED_TRUE@dlopen_aux_LDADD = -ldl # NO LIBCR HERE @CR_ENABLE_SHARED_TRUE@helper_progs_shared = hello dlopen_aux @CR_ENABLE_SHARED_FALSE@pause_LDFLAGS = $(libcr_run_ldflags) @CR_ENABLE_SHARED_FALSE@bug2003_aux_LDFLAGS = $(libcr_run_ldflags) @CR_ENABLE_SHARED_FALSE@save_aux_LDFLAGS = $(libcr_run_ldflags) @CR_ENABLE_SHARED_FALSE@reloc_aux_LDFLAGS = $(libcr_run_ldflags) helper_progs = $(helper_progs_shared) bug2003_aux pause save_aux reloc_aux helper_progs2 = helper_scripts = helper_scripts2 = # Maintainer-only tests BONUS_TESTS = $(SIMPLE_TESTS2) $(SEQ_RUN2) $(CRUT_RUN2) @CR_ENABLE_SHARED_FALSE@CR_RUN_INSTALLED = env # Some tests use cr_run even w/o shared libs - mask that @CR_ENABLE_SHARED_TRUE@CR_RUN_INSTALLED = $(bindir)/cr_run # Depending whether we build the testsuite or not, the test programs and # scripts should be in either the testsexec_ or check_ prefix. # tester_progs = $(SIMPLE_progs) $(SEQ_progs) $(CRUT_progs) $(helper_progs) tester_scripts = $(SIMPLE_scripts) $(SEQ_scripts) $(helper_scripts) @CR_BUILD_TESTSUITE_TRUE@testsexecdir = $(libexecdir)/blcr-testsuite @CR_BUILD_TESTSUITE_TRUE@testsexec_SCRIPTS = $(tester_scripts) @CR_BUILD_TESTSUITE_TRUE@AM_INSTALLCHECK_STD_OPTIONS_EXEMPT = $(testsexec_PROGRAMS) $(testsexec_SCRIPTS) @CR_BUILD_TESTSUITE_FALSE@check_progs = $(tester_progs) @CR_BUILD_TESTSUITE_FALSE@check_scripts = $(tester_scripts) # Maintainer-only tests progs and scripts (always in check_ prefix) check_progs2 = $(SIMPLE_progs2) $(SEQ_progs2) $(CRUT_progs2) $(helper_progs2) check_scripts2 = $(SIMPLE_scripts2) $(SEQ_scripts2) $(helper_scripts2) # Environment variables visible to the test programs TESTS_ENVIRONMENT = top_srcdir="$(TOP_SRCDIR)" LIBCR_DISABLE_NSCD=1 # Automake magic here... check_LIBRARIES = libtest.a check_HEADERS = crut.h crut_util.h check_SCRIPTS = check_module clean_temps build_util $(check_scripts) $(check_scripts2) EXTRA_DIST = license.txt CountingApp.java CountingApp.class RUN_ME.in $(all_scripts_src) MOSTLYCLEANFILES = core core.* $(CONTEXTS) CLEANFILES = $(SEQ_RUN) $(CRUT_RUN) $(SEQ_RUN2) $(CRUT_RUN2) $(all_scripts) \ rununittests RUN_ME all: all-am .SUFFIXES: .SUFFIXES: .c .cc .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tests/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign tests/Makefile .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): shellinit: $(top_builddir)/config.status $(srcdir)/shellinit.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ clean-checkLIBRARIES: -test -z "$(check_LIBRARIES)" || rm -f $(check_LIBRARIES) libtest.a: $(libtest_a_OBJECTS) $(libtest_a_DEPENDENCIES) -rm -f libtest.a $(libtest_a_AR) libtest.a $(libtest_a_OBJECTS) $(libtest_a_LIBADD) $(RANLIB) libtest.a 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 install-testsexecPROGRAMS: $(testsexec_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(testsexecdir)" || $(MKDIR_P) "$(DESTDIR)$(testsexecdir)" @list='$(testsexec_PROGRAMS)'; test -n "$(testsexecdir)" || list=; \ 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)$(testsexecdir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(testsexecdir)$$dir" || exit $$?; \ } \ ; done uninstall-testsexecPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(testsexec_PROGRAMS)'; test -n "$(testsexecdir)" || 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)$(testsexecdir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(testsexecdir)" && rm -f $$files clean-testsexecPROGRAMS: @list='$(testsexec_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 installcheck-testsexecPROGRAMS: $(testsexec_PROGRAMS) bad=0; pid=$$$$; list="$(testsexec_PROGRAMS)"; for p in $$list; do \ case ' $(AM_INSTALLCHECK_STD_OPTIONS_EXEMPT) ' in \ *" $$p "* | *" $(srcdir)/$$p "*) continue;; \ esac; \ f=`echo "$$p" | \ sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ for opt in --help --version; do \ if "$(DESTDIR)$(testsexecdir)/$$f" $$opt >c$${pid}_.out \ 2>c$${pid}_.err &2; bad=1; fi; \ done; \ done; rm -f c$${pid}_.???; exit $$bad atomics$(EXEEXT): $(atomics_OBJECTS) $(atomics_DEPENDENCIES) @rm -f atomics$(EXEEXT) $(atomics_LINK) $(atomics_OBJECTS) $(atomics_LDADD) $(LIBS) atomics_stress$(EXEEXT): $(atomics_stress_OBJECTS) $(atomics_stress_DEPENDENCIES) @rm -f atomics_stress$(EXEEXT) $(atomics_stress_LINK) $(atomics_stress_OBJECTS) $(atomics_stress_LDADD) $(LIBS) bug2003_aux$(EXEEXT): $(bug2003_aux_OBJECTS) $(bug2003_aux_DEPENDENCIES) @rm -f bug2003_aux$(EXEEXT) $(bug2003_aux_LINK) $(bug2003_aux_OBJECTS) $(bug2003_aux_LDADD) $(LIBS) bug2524$(EXEEXT): $(bug2524_OBJECTS) $(bug2524_DEPENDENCIES) @rm -f bug2524$(EXEEXT) $(LINK) $(bug2524_OBJECTS) $(bug2524_LDADD) $(LIBS) cb_exit$(EXEEXT): $(cb_exit_OBJECTS) $(cb_exit_DEPENDENCIES) @rm -f cb_exit$(EXEEXT) $(LINK) $(cb_exit_OBJECTS) $(cb_exit_LDADD) $(LIBS) child$(EXEEXT): $(child_OBJECTS) $(child_DEPENDENCIES) @rm -f child$(EXEEXT) $(LINK) $(child_OBJECTS) $(child_LDADD) $(LIBS) cloexec$(EXEEXT): $(cloexec_OBJECTS) $(cloexec_DEPENDENCIES) @rm -f cloexec$(EXEEXT) $(LINK) $(cloexec_OBJECTS) $(cloexec_LDADD) $(LIBS) cr_signal$(EXEEXT): $(cr_signal_OBJECTS) $(cr_signal_DEPENDENCIES) @rm -f cr_signal$(EXEEXT) $(LINK) $(cr_signal_OBJECTS) $(cr_signal_LDADD) $(LIBS) cr_tryenter_cs$(EXEEXT): $(cr_tryenter_cs_OBJECTS) $(cr_tryenter_cs_DEPENDENCIES) @rm -f cr_tryenter_cs$(EXEEXT) $(LINK) $(cr_tryenter_cs_OBJECTS) $(cr_tryenter_cs_LDADD) $(LIBS) critical_sections$(EXEEXT): $(critical_sections_OBJECTS) $(critical_sections_DEPENDENCIES) @rm -f critical_sections$(EXEEXT) $(LINK) $(critical_sections_OBJECTS) $(critical_sections_LDADD) $(LIBS) crut_wrapper$(EXEEXT): $(crut_wrapper_OBJECTS) $(crut_wrapper_DEPENDENCIES) @rm -f crut_wrapper$(EXEEXT) $(LINK) $(crut_wrapper_OBJECTS) $(crut_wrapper_LDADD) $(LIBS) cs_enter_leave$(EXEEXT): $(cs_enter_leave_OBJECTS) $(cs_enter_leave_DEPENDENCIES) @rm -f cs_enter_leave$(EXEEXT) $(LINK) $(cs_enter_leave_OBJECTS) $(cs_enter_leave_LDADD) $(LIBS) cs_enter_leave2$(EXEEXT): $(cs_enter_leave2_OBJECTS) $(cs_enter_leave2_DEPENDENCIES) @rm -f cs_enter_leave2$(EXEEXT) $(LINK) $(cs_enter_leave2_OBJECTS) $(cs_enter_leave2_LDADD) $(LIBS) cwd$(EXEEXT): $(cwd_OBJECTS) $(cwd_DEPENDENCIES) @rm -f cwd$(EXEEXT) $(LINK) $(cwd_OBJECTS) $(cwd_LDADD) $(LIBS) dev_null$(EXEEXT): $(dev_null_OBJECTS) $(dev_null_DEPENDENCIES) @rm -f dev_null$(EXEEXT) $(LINK) $(dev_null_OBJECTS) $(dev_null_LDADD) $(LIBS) dlopen_aux$(EXEEXT): $(dlopen_aux_OBJECTS) $(dlopen_aux_DEPENDENCIES) @rm -f dlopen_aux$(EXEEXT) $(LINK) $(dlopen_aux_OBJECTS) $(dlopen_aux_LDADD) $(LIBS) dpipe$(EXEEXT): $(dpipe_OBJECTS) $(dpipe_DEPENDENCIES) @rm -f dpipe$(EXEEXT) $(LINK) $(dpipe_OBJECTS) $(dpipe_LDADD) $(LIBS) dup$(EXEEXT): $(dup_OBJECTS) $(dup_DEPENDENCIES) @rm -f dup$(EXEEXT) $(LINK) $(dup_OBJECTS) $(dup_LDADD) $(LIBS) edeadlk$(EXEEXT): $(edeadlk_OBJECTS) $(edeadlk_DEPENDENCIES) @rm -f edeadlk$(EXEEXT) $(LINK) $(edeadlk_OBJECTS) $(edeadlk_LDADD) $(LIBS) failed_cb$(EXEEXT): $(failed_cb_OBJECTS) $(failed_cb_DEPENDENCIES) @rm -f failed_cb$(EXEEXT) $(LINK) $(failed_cb_OBJECTS) $(failed_cb_LDADD) $(LIBS) failed_cb2$(EXEEXT): $(failed_cb2_OBJECTS) $(failed_cb2_DEPENDENCIES) @rm -f failed_cb2$(EXEEXT) $(LINK) $(failed_cb2_OBJECTS) $(failed_cb2_LDADD) $(LIBS) filedescriptors$(EXEEXT): $(filedescriptors_OBJECTS) $(filedescriptors_DEPENDENCIES) @rm -f filedescriptors$(EXEEXT) $(LINK) $(filedescriptors_OBJECTS) $(filedescriptors_LDADD) $(LIBS) forward$(EXEEXT): $(forward_OBJECTS) $(forward_DEPENDENCIES) @rm -f forward$(EXEEXT) $(LINK) $(forward_OBJECTS) $(forward_LDADD) $(LIBS) get_info$(EXEEXT): $(get_info_OBJECTS) $(get_info_DEPENDENCIES) @rm -f get_info$(EXEEXT) $(LINK) $(get_info_OBJECTS) $(get_info_LDADD) $(LIBS) hello$(EXEEXT): $(hello_OBJECTS) $(hello_DEPENDENCIES) @rm -f hello$(EXEEXT) $(LINK) $(hello_OBJECTS) $(hello_LDADD) $(LIBS) hooks$(EXEEXT): $(hooks_OBJECTS) $(hooks_DEPENDENCIES) @rm -f hooks$(EXEEXT) $(LINK) $(hooks_OBJECTS) $(hooks_LDADD) $(LIBS) hugetlbfs$(EXEEXT): $(hugetlbfs_OBJECTS) $(hugetlbfs_DEPENDENCIES) @rm -f hugetlbfs$(EXEEXT) $(LINK) $(hugetlbfs_OBJECTS) $(hugetlbfs_LDADD) $(LIBS) hugetlbfs2$(EXEEXT): $(hugetlbfs2_OBJECTS) $(hugetlbfs2_DEPENDENCIES) @rm -f hugetlbfs2$(EXEEXT) $(LINK) $(hugetlbfs2_OBJECTS) $(hugetlbfs2_LDADD) $(LIBS) lam$(EXEEXT): $(lam_OBJECTS) $(lam_DEPENDENCIES) @rm -f lam$(EXEEXT) $(LINK) $(lam_OBJECTS) $(lam_LDADD) $(LIBS) linked_fifo$(EXEEXT): $(linked_fifo_OBJECTS) $(linked_fifo_DEPENDENCIES) @rm -f linked_fifo$(EXEEXT) $(LINK) $(linked_fifo_OBJECTS) $(linked_fifo_LDADD) $(LIBS) math$(EXEEXT): $(math_OBJECTS) $(math_DEPENDENCIES) @rm -f math$(EXEEXT) $(LINK) $(math_OBJECTS) $(math_LDADD) $(LIBS) mmaps$(EXEEXT): $(mmaps_OBJECTS) $(mmaps_DEPENDENCIES) @rm -f mmaps$(EXEEXT) $(LINK) $(mmaps_OBJECTS) $(mmaps_LDADD) $(LIBS) named_fifo$(EXEEXT): $(named_fifo_OBJECTS) $(named_fifo_DEPENDENCIES) @rm -f named_fifo$(EXEEXT) $(LINK) $(named_fifo_OBJECTS) $(named_fifo_LDADD) $(LIBS) nscd$(EXEEXT): $(nscd_OBJECTS) $(nscd_DEPENDENCIES) @rm -f nscd$(EXEEXT) $(LINK) $(nscd_OBJECTS) $(nscd_LDADD) $(LIBS) orphan$(EXEEXT): $(orphan_OBJECTS) $(orphan_DEPENDENCIES) @rm -f orphan$(EXEEXT) $(LINK) $(orphan_OBJECTS) $(orphan_LDADD) $(LIBS) overlap$(EXEEXT): $(overlap_OBJECTS) $(overlap_DEPENDENCIES) @rm -f overlap$(EXEEXT) $(LINK) $(overlap_OBJECTS) $(overlap_LDADD) $(LIBS) pause$(EXEEXT): $(pause_OBJECTS) $(pause_DEPENDENCIES) @rm -f pause$(EXEEXT) $(pause_LINK) $(pause_OBJECTS) $(pause_LDADD) $(LIBS) pid_in_use$(EXEEXT): $(pid_in_use_OBJECTS) $(pid_in_use_DEPENDENCIES) @rm -f pid_in_use$(EXEEXT) $(LINK) $(pid_in_use_OBJECTS) $(pid_in_use_LDADD) $(LIBS) pid_restore$(EXEEXT): $(pid_restore_OBJECTS) $(pid_restore_DEPENDENCIES) @rm -f pid_restore$(EXEEXT) $(LINK) $(pid_restore_OBJECTS) $(pid_restore_LDADD) $(LIBS) pipe$(EXEEXT): $(pipe_OBJECTS) $(pipe_DEPENDENCIES) @rm -f pipe$(EXEEXT) $(LINK) $(pipe_OBJECTS) $(pipe_LDADD) $(LIBS) prctl$(EXEEXT): $(prctl_OBJECTS) $(prctl_DEPENDENCIES) @rm -f prctl$(EXEEXT) $(LINK) $(prctl_OBJECTS) $(prctl_LDADD) $(LIBS) ptrace$(EXEEXT): $(ptrace_OBJECTS) $(ptrace_DEPENDENCIES) @rm -f ptrace$(EXEEXT) $(ptrace_LINK) $(ptrace_OBJECTS) $(ptrace_LDADD) $(LIBS) readdir$(EXEEXT): $(readdir_OBJECTS) $(readdir_DEPENDENCIES) @rm -f readdir$(EXEEXT) $(LINK) $(readdir_OBJECTS) $(readdir_LDADD) $(LIBS) reloc_aux$(EXEEXT): $(reloc_aux_OBJECTS) $(reloc_aux_DEPENDENCIES) @rm -f reloc_aux$(EXEEXT) $(reloc_aux_LINK) $(reloc_aux_OBJECTS) $(reloc_aux_LDADD) $(LIBS) replace_cb$(EXEEXT): $(replace_cb_OBJECTS) $(replace_cb_DEPENDENCIES) @rm -f replace_cb$(EXEEXT) $(LINK) $(replace_cb_OBJECTS) $(replace_cb_LDADD) $(LIBS) save_aux$(EXEEXT): $(save_aux_OBJECTS) $(save_aux_DEPENDENCIES) @rm -f save_aux$(EXEEXT) $(save_aux_LINK) $(save_aux_OBJECTS) $(save_aux_LDADD) $(LIBS) seq_wrapper$(EXEEXT): $(seq_wrapper_OBJECTS) $(seq_wrapper_DEPENDENCIES) @rm -f seq_wrapper$(EXEEXT) $(LINK) $(seq_wrapper_OBJECTS) $(seq_wrapper_LDADD) $(LIBS) sigaltstack$(EXEEXT): $(sigaltstack_OBJECTS) $(sigaltstack_DEPENDENCIES) @rm -f sigaltstack$(EXEEXT) $(LINK) $(sigaltstack_OBJECTS) $(sigaltstack_LDADD) $(LIBS) sigpending$(EXEEXT): $(sigpending_OBJECTS) $(sigpending_DEPENDENCIES) @rm -f sigpending$(EXEEXT) $(LINK) $(sigpending_OBJECTS) $(sigpending_LDADD) $(LIBS) simple$(EXEEXT): $(simple_OBJECTS) $(simple_DEPENDENCIES) @rm -f simple$(EXEEXT) $(LINK) $(simple_OBJECTS) $(simple_LDADD) $(LIBS) simple_pthread$(EXEEXT): $(simple_pthread_OBJECTS) $(simple_pthread_DEPENDENCIES) @rm -f simple_pthread$(EXEEXT) $(LINK) $(simple_pthread_OBJECTS) $(simple_pthread_LDADD) $(LIBS) stage0001$(EXEEXT): $(stage0001_OBJECTS) $(stage0001_DEPENDENCIES) @rm -f stage0001$(EXEEXT) $(LINK) $(stage0001_OBJECTS) $(stage0001_LDADD) $(LIBS) stage0002$(EXEEXT): $(stage0002_OBJECTS) $(stage0002_DEPENDENCIES) @rm -f stage0002$(EXEEXT) $(LINK) $(stage0002_OBJECTS) $(stage0002_LDADD) $(LIBS) stage0003$(EXEEXT): $(stage0003_OBJECTS) $(stage0003_DEPENDENCIES) @rm -f stage0003$(EXEEXT) $(LINK) $(stage0003_OBJECTS) $(stage0003_LDADD) $(LIBS) stage0004$(EXEEXT): $(stage0004_OBJECTS) $(stage0004_DEPENDENCIES) @rm -f stage0004$(EXEEXT) $(LINK) $(stage0004_OBJECTS) $(stage0004_LDADD) $(LIBS) stopped$(EXEEXT): $(stopped_OBJECTS) $(stopped_DEPENDENCIES) @rm -f stopped$(EXEEXT) $(LINK) $(stopped_OBJECTS) $(stopped_LDADD) $(LIBS) testcxx$(EXEEXT): $(testcxx_OBJECTS) $(testcxx_DEPENDENCIES) @rm -f testcxx$(EXEEXT) $(CXXLINK) $(testcxx_OBJECTS) $(testcxx_LDADD) $(LIBS) install-testsexecSCRIPTS: $(testsexec_SCRIPTS) @$(NORMAL_INSTALL) test -z "$(testsexecdir)" || $(MKDIR_P) "$(DESTDIR)$(testsexecdir)" @list='$(testsexec_SCRIPTS)'; test -n "$(testsexecdir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n' \ -e 'h;s|.*|.|' \ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) { files[d] = files[d] " " $$1; \ if (++n[d] == $(am__install_max)) { \ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ else { print "f", d "/" $$4, $$1 } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(testsexecdir)$$dir'"; \ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(testsexecdir)$$dir" || exit $$?; \ } \ ; done uninstall-testsexecSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(testsexec_SCRIPTS)'; test -n "$(testsexecdir)" || exit 0; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(testsexecdir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(testsexecdir)" && rm -f $$files installcheck-testsexecSCRIPTS: $(testsexec_SCRIPTS) bad=0; pid=$$$$; list="$(testsexec_SCRIPTS)"; for p in $$list; do \ case ' $(AM_INSTALLCHECK_STD_OPTIONS_EXEMPT) ' in \ *" $$p "* | *" $(srcdir)/$$p "*) continue;; \ esac; \ f=`echo "$$p" | sed 's,^.*/,,;$(transform)'`; \ for opt in --help --version; do \ if "$(DESTDIR)$(testsexecdir)/$$f" $$opt >c$${pid}_.out \ 2>c$${pid}_.err &2; bad=1; fi; \ done; \ done; rm -f c$${pid}_.???; exit $$bad mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atomics-atomics.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atomics_stress-atomics_stress.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bug2003_aux.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bug2524.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cb_exit.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/child.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cloexec.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cr_signal.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cr_tryenter_cs.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/critical_sections.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/crut.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/crut_util.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/crut_util_libcr.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/crut_util_pth.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/crut_wrapper.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cs_enter_leave.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cs_enter_leave2.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cwd.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dev_null.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dlopen_aux.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dpipe.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dup.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/edeadlk.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/failed_cb.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/failed_cb2.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/filedescriptors.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/forward.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_info.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hello.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hooks.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hugetlbfs.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hugetlbfs2.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lam.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/linked_fifo.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/math.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmaps.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/named_fifo.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nscd.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orphan.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/overlap.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pause.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pid_in_use.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pid_restore.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pipe.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prctl.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ptrace.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/readdir.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/reloc_aux.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/replace_cb.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/save_aux.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/seq_wrapper.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sigaltstack.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sigpending.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/simple.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/simple_pthread.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stage0001.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stage0002.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stage0003.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stage0004.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stopped.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testcxx.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< atomics-atomics.o: atomics.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(atomics_CFLAGS) $(CFLAGS) -MT atomics-atomics.o -MD -MP -MF $(DEPDIR)/atomics-atomics.Tpo -c -o atomics-atomics.o `test -f 'atomics.c' || echo '$(srcdir)/'`atomics.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/atomics-atomics.Tpo $(DEPDIR)/atomics-atomics.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='atomics.c' object='atomics-atomics.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(atomics_CFLAGS) $(CFLAGS) -c -o atomics-atomics.o `test -f 'atomics.c' || echo '$(srcdir)/'`atomics.c atomics-atomics.obj: atomics.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(atomics_CFLAGS) $(CFLAGS) -MT atomics-atomics.obj -MD -MP -MF $(DEPDIR)/atomics-atomics.Tpo -c -o atomics-atomics.obj `if test -f 'atomics.c'; then $(CYGPATH_W) 'atomics.c'; else $(CYGPATH_W) '$(srcdir)/atomics.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/atomics-atomics.Tpo $(DEPDIR)/atomics-atomics.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='atomics.c' object='atomics-atomics.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(atomics_CFLAGS) $(CFLAGS) -c -o atomics-atomics.obj `if test -f 'atomics.c'; then $(CYGPATH_W) 'atomics.c'; else $(CYGPATH_W) '$(srcdir)/atomics.c'; fi` atomics_stress-atomics_stress.o: atomics_stress.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(atomics_stress_CFLAGS) $(CFLAGS) -MT atomics_stress-atomics_stress.o -MD -MP -MF $(DEPDIR)/atomics_stress-atomics_stress.Tpo -c -o atomics_stress-atomics_stress.o `test -f 'atomics_stress.c' || echo '$(srcdir)/'`atomics_stress.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/atomics_stress-atomics_stress.Tpo $(DEPDIR)/atomics_stress-atomics_stress.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='atomics_stress.c' object='atomics_stress-atomics_stress.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(atomics_stress_CFLAGS) $(CFLAGS) -c -o atomics_stress-atomics_stress.o `test -f 'atomics_stress.c' || echo '$(srcdir)/'`atomics_stress.c atomics_stress-atomics_stress.obj: atomics_stress.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(atomics_stress_CFLAGS) $(CFLAGS) -MT atomics_stress-atomics_stress.obj -MD -MP -MF $(DEPDIR)/atomics_stress-atomics_stress.Tpo -c -o atomics_stress-atomics_stress.obj `if test -f 'atomics_stress.c'; then $(CYGPATH_W) 'atomics_stress.c'; else $(CYGPATH_W) '$(srcdir)/atomics_stress.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/atomics_stress-atomics_stress.Tpo $(DEPDIR)/atomics_stress-atomics_stress.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='atomics_stress.c' object='atomics_stress-atomics_stress.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(atomics_stress_CFLAGS) $(CFLAGS) -c -o atomics_stress-atomics_stress.obj `if test -f 'atomics_stress.c'; then $(CYGPATH_W) 'atomics_stress.c'; else $(CYGPATH_W) '$(srcdir)/atomics_stress.c'; fi` .cc.o: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .cc.obj: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cc.lo: @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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 CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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" 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; 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 \ echo "$$grn$$dashes"; \ else \ echo "$$red$$dashes"; \ fi; \ echo "$$banner"; \ test -z "$$skipped" || echo "$$skipped"; \ test -z "$$report" || echo "$$report"; \ echo "$$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_LIBRARIES) $(check_PROGRAMS) \ $(check_SCRIPTS) $(check_HEADERS) $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-am all-am: Makefile $(PROGRAMS) $(SCRIPTS) installdirs: for dir in "$(DESTDIR)$(testsexecdir)" "$(DESTDIR)$(testsexecdir)"; 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." @CR_BUILD_TESTSUITE_FALSE@uninstall-local: @CR_BUILD_TESTSUITE_FALSE@install-exec-local: clean: clean-am clean-am: clean-checkLIBRARIES clean-checkPROGRAMS clean-generic \ clean-libtool clean-local clean-testsexecPROGRAMS \ 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-exec-local install-testsexecPROGRAMS \ install-testsexecSCRIPTS 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: installcheck-testsexecPROGRAMS \ installcheck-testsexecSCRIPTS 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-local uninstall-testsexecPROGRAMS \ uninstall-testsexecSCRIPTS .MAKE: check-am install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-TESTS check-am clean \ clean-checkLIBRARIES clean-checkPROGRAMS clean-generic \ clean-libtool clean-local clean-testsexecPROGRAMS ctags \ 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-exec-local install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip install-testsexecPROGRAMS \ install-testsexecSCRIPTS installcheck installcheck-am \ installcheck-testsexecPROGRAMS installcheck-testsexecSCRIPTS \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \ uninstall-am uninstall-local uninstall-testsexecPROGRAMS \ uninstall-testsexecSCRIPTS # Special target (run before tests) ensures the kernel modules are loaded check_module: @(/sbin/lsmod | grep '^blcr ' > /dev/null 2>&1) || \ (echo '#############################################################'; \ echo '#### BLCR modules are not loaded. Cannot run the tests! ####'; \ echo '#### You must insmod/modprobe the following modules as ####'; \ echo '#### root (in order) before you can run "make check": ####'; \ echo '#### blcr_imports blcr ####'; \ echo '#### "make insmod" will automate this if run as a user ####'; \ echo '#### with sudo(8) rights. ####'; \ echo '#############################################################'; \ false) # Special target (run before tests) ensures no temp file conflicts clean_temps: rm -Rf $(CONTEXTS) $(TEST_TEMPS) @CR_BUILD_UTIL_TRUE@build_util: @CR_BUILD_UTIL_TRUE@ @$(MAKE) $(AM_MAKEFLAGS) --no-print-directory -C $(TOP_BUILDDIR) util symlinks @CR_BUILD_UTIL_FALSE@build_util: @CR_BUILD_UTIL_FALSE@ @: # Empty @CR_INSTALLED_LIBCR_FALSE@$(tester_progs) $(check_progs2): $(LIBCR) $(all_scripts): shellinit $(all_scripts) : % : %.sh $(INSTALL_SCRIPT) $< $@ $(SEQ_RUN) $(SEQ_RUN2) : %.st : % seq_wrapper @rm -f $@ @$(LN_S) -f seq_wrapper $@ $(CRUT_RUN) $(CRUT_RUN2) : %.ct : % crut_wrapper @rm -f $@ @(echo '#!/bin/sh'; \ echo 'exec `dirname $$0`/crut_wrapper -q "$$@" $*' ) > $@ @chmod +x $@ # Script to run all the CRUT tests standalone rununittests: $(CRUT_TESTS) (echo '#!/bin/sh'; echo './crut_wrapper $$@ $(CRUT_TESTS)') > $@ chmod +x $@ # Rules to help w/ some dependencies in other directories: @CR_BUILD_LIBCR_TRUE@$(LIBCR): FORCE @CR_BUILD_LIBCR_TRUE@ @$(MAKE) $(AM_MAKEFLAGS) --no-print-directory -C $(@D) # Prog(s) needed indirectly by test(s) cr_run: hello cr_targ cr_tagr2 cr_omit: pause bug2003: bug2003_aux save_exe save_priv save_share save_all: save_aux reloc_exe reloc_file reloc_fifo reloc_dir reloc_all: reloc_aux run_on: save_aux pause clobber: save_aux @CR_ENABLE_SHARED_TRUE@dlopen: dlopen_aux bonus-tests: $(BONUS_TESTS) @$(MAKE) $(AM_MAKEFLAGS) --no-print-directory check TESTS="$(BONUS_TESTS)" bonus-check: $(BONUS_TESTS) @$(MAKE) $(AM_MAKEFLAGS) --no-print-directory check TESTS="$(TESTS) $(BONUS_TESTS)" # Create our own target for building (but NOT running) the tests build-tests: tests # Legacy target tests: $(TESTS) $(BONUS_TESTS) rununittests @echo '################################################################################' @echo 'HOW TO RUN THESE TESTS:' @echo @echo 'SIMPLE TESTS ($(SIMPLE_TESTS)):' @echo '--- use ./test' @echo 'UNIT TESTS ($(CRUT_TESTS)):' @echo '--- use ./.ct' @echo '--- or use ./rununittests to run them all' @echo 'SEQ TESTS ($(SEQ_TESTS)):' @echo '--- use ./.st' @echo '################################################################################' @CR_BUILD_TESTSUITE_TRUE@install-exec-local: @CR_BUILD_TESTSUITE_TRUE@ @$(mkinstalldirs) "$(DESTDIR)$(testsexecdir)" @CR_BUILD_TESTSUITE_TRUE@ @cd "$(DESTDIR)$(testsexecdir)" && \ @CR_BUILD_TESTSUITE_TRUE@ for file in $(SEQ_RUN); do rm -f $$file; $(LN_S) seq_wrapper $$file; done && \ @CR_BUILD_TESTSUITE_TRUE@ for file in $(CRUT_RUN); do rm -f $$file; $(LN_S) crut_wrapper $$file; done && \ @CR_BUILD_TESTSUITE_TRUE@ echo '# This file is required, but typically empty, in an installed testsuite' > shellinit && \ @CR_BUILD_TESTSUITE_TRUE@ chmod 644 shellinit @CR_BUILD_TESTSUITE_TRUE@ @sed -e 's,%bindir%,$(bindir),;' \ @CR_BUILD_TESTSUITE_TRUE@ -e 's,%tests%,$(TESTS),;' \ @CR_BUILD_TESTSUITE_TRUE@ -e 's,%cr_run%,$(CR_RUN_INSTALLED),;' \ @CR_BUILD_TESTSUITE_TRUE@ -e 's,%cr_pwd%,@PWD_PROG@,;' \ @CR_BUILD_TESTSUITE_TRUE@ $(srcdir)/RUN_ME.in >$(DESTDIR)$(testsexecdir)/RUN_ME @CR_BUILD_TESTSUITE_TRUE@ @chmod +x $(DESTDIR)$(testsexecdir)/RUN_ME @CR_BUILD_TESTSUITE_TRUE@uninstall-local: @CR_BUILD_TESTSUITE_TRUE@ @cd $(DESTDIR)$(testsexecdir) && rm -f RUN_ME $(SEQ_RUN) $(CRUT_RUN) clean-local: clean_temps echoval: FORCE @echo $($(VARNAME)) | sed 's/"/\\"/'g .PHONY: check_module clean_temps build_util tests build-tests echoval FORCE FORCE: # Preserve the empty line above! # 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: blcr-0.8.5/tests/ocaml_test.sh0000664000000000000000000000322511015415407013167 00000000000000#!/bin/sh # # Test of checkpoint/restart of an ocaml script. # Note that the outer shell script is bash # First ensure we have ocaml ocaml -help >/dev/null || exit 77 . ${cr_testsdir:-`dirname $0`}/shellinit \rm -f Context[123] .Context[123].tmp 2>/dev/null bash <<-'__OUTER__' exec 2>/dev/null # Drop job control message(s) from the outer script echo '#ST_ALARM:120' $cr_run ocaml /proc/self/fd/0 2>&1 <<'__INNER__' #load "unix.cma";; let chkpt_cmd = Unix.getenv "cr_checkpoint";; let rstrt_cmd = Unix.getenv "cr_restart";; let self = Unix.getpid ();; let checkpoint f p = let cmd = (chkpt_cmd ^ " --file=" ^ f ^ " --tree --term " ^ (string_of_int p)) in ignore (Unix.system cmd); if p != self then ignore (Unix.waitpid [] p); Unix.sleep 1;; let restart f = let pid = Unix.fork () in ( if pid == 0 then ignore (Unix.execv rstrt_cmd [| rstrt_cmd; f |]); Unix.sleep 3; pid);; let child = Unix.fork ();; if child == 0 then ( for i = 0 to 15 do print_endline ((string_of_int i) ^ " Hello"); Unix.sleep 1; done; exit 0 ) else Unix.sleep 3;; print_endline "# Checkpoint original child";; checkpoint "Context1" child;; print_endline "# Restart 1";; let pid = restart "Context1";; print_endline "# Checkpoint restarted child";; checkpoint "Context2" pid;; print_endline "# Restart^2";; let pid = restart "Context2";; print_endline "# Checkpoint self";; checkpoint "Context3" self;; Unix.waitpid [] pid;; print_endline "16 DONE";; __INNER__ exec 2>&1 sleep 3 echo "# Restart interpreter" $cr_restart Context3 __OUTER__ \rm -f Context[123] .Context[123].tmp 2>/dev/null blcr-0.8.5/tests/cr_run.sh0000664000000000000000000000015111005167617012326 00000000000000#!/bin/sh . ${cr_testsdir:-`dirname $0`}/shellinit ${cr_run} ${cr_testsdir}/hello >/dev/null 2>/dev/null blcr-0.8.5/tests/replace_cb.c0000664000000000000000000001673611042543127012740 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2008, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * 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 * * $Id: replace_cb.c,v 1.9 2008/07/26 06:38:15 phargrov Exp $ */ #include #include #include #include #include "crut_util.h" static int cb0(void* arg); static int cb1(void* arg); static int cb2(void* arg); static int cb3(void* arg); static int cb4(void* arg); static int cb5(void* arg); int count = 0; static void out(const char* s) { write(1, s, strlen(s)); } static int cb0(void* arg) { int ret; out(arg); out(" (in cb0)\n"); ret = cr_replace_self(cb2, "003 self/THREAD from CHECKPOINT section", CR_THREAD_CONTEXT); if (ret) { printf("XXX cr_replace_self() in cb0 returned %d w/ errno=%d(%s)\n", ret, errno, cr_strerror(errno)); } ret = cr_replace_self(cb2, "XXX wrong flags from cb0", CR_SIGNAL_CONTEXT); if (!ret) { printf("XXX cr_replace_self() in cb0 suceeded unexpectedly\n"); } else if (errno != EINVAL) { printf("XXX cr_replace_self() in cb0 returned %d w/ errno=%d(%s)\n", ret, errno, cr_strerror(errno)); } return 0; } static int cb1(void* arg) { int ret; out(arg); out(" (in cb1)\n"); ret = cr_replace_self(cb3, "004 self/SIGNAL from CHECKPOINT section", CR_SIGNAL_CONTEXT); if (ret) { printf("XXX cr_replace_self() in cb1 returned %d w/ errno=%d(%s)\n", ret, errno, cr_strerror(errno)); } ret = cr_replace_self(cb3, "XXX wrong flags from cb2", CR_THREAD_CONTEXT); if (!ret) { printf("XXX cr_replace_self() in cb1 suceeded unexpectedly\n"); } else if (errno != EINVAL) { printf("XXX cr_replace_self() in cb1 returned %d w/ errno=%d(%s)\n", ret, errno, cr_strerror(errno)); } return 0; } static int cb2(void* arg) { int ret; out(arg); out(" (in cb2)\n"); ret = cr_replace_self(cb4, "XXX self/THREAD not overwritten by CONTINUE", CR_THREAD_CONTEXT); if (ret) { printf("XXX cr_replace_self() cb2/pre returned %d w/ errno=%d(%s)\n", ret, errno, cr_strerror(errno)); } ret = cr_checkpoint(0); if (ret) { printf("XXX cr_checkpoint() unexpectedy returned %d in cb2\n", ret); } ret = cr_replace_self(cb4, "005 self/THREAD from CONTINUE section", CR_THREAD_CONTEXT); if (ret) { printf("XXX cr_replace_self() cb2/post returned %d w/ errno=%d(%s)\n", ret, errno, cr_strerror(errno)); } return 0; } static int cb3(void* arg) { int ret; out(arg); out(" (in cb3)\n"); ret = cr_replace_self(cb5, "XXX self/SIGNAL not overwritten by CONTINUE", CR_SIGNAL_CONTEXT); if (ret) { printf("XXX cr_replace_self() cb3/pre returned %d w/ errno=%d(%s)\n", ret, errno, cr_strerror(errno)); } cr_checkpoint(0); if (ret) { printf("XXX cr_checkpoint() unexpectedy returned %d in cb3\n", ret); } ret = cr_replace_self(cb5, "006 self/SIGNAL from CONTINUE section", CR_SIGNAL_CONTEXT); if (ret) { printf("XXX cr_replace_self() cb3/post returned %d w/ errno=%d(%s)\n", ret, errno, cr_strerror(errno)); } return 0; } static int cb4(void* arg) { out(arg); out(" (in cb4)\n"); return 0; } static int cb5(void* arg) { out(arg); out(" (in cb5)\n"); return 0; } int main(void) { pid_t my_pid; cr_callback_id_t id0; cr_callback_id_t id1; cr_client_id_t my_id; char *filename; int ret; setlinebuf(stdout); my_pid = getpid(); filename = crut_aprintf("context.%d", my_pid); printf("000 Process started with pid %d\n", my_pid); printf("#ST_ALARM:120\n"); fflush(stdout); my_id = cr_init(); id0 = cr_register_callback(cb0, "001 register THREAD from main", CR_THREAD_CONTEXT); id1 = cr_register_callback(cb1, "002 register SIGNAL from main", CR_SIGNAL_CONTEXT); ret = crut_checkpoint_block(filename); if (ret < 0) { printf("XXX crut_checkpoint_block() #1 returned %d w/ errno=%d(%s)\n", ret, errno, cr_strerror(errno)); } ret = crut_checkpoint_block(filename); if (ret < 0) { printf("XXX crut_checkpoint_block() #2 returned %d w/ errno=%d(%s)\n", ret, errno, cr_strerror(errno)); } ret = crut_checkpoint_block(filename); if (ret < 0) { printf("XXX crut_checkpoint_block() #3 returned %d w/ errno=%d(%s)\n", ret, errno, cr_strerror(errno)); } cr_enter_cs(my_id); // These two should succeed ret = cr_replace_callback(id0, cb4, "007 replace THREAD from main", CR_THREAD_CONTEXT); if (ret) { printf("XXX cr_replace_callback() #2 returned %d w/ errno=%d(%s)\n", ret, errno, cr_strerror(errno)); } ret = cr_replace_callback(id1, cb5, "008 replace SIGNAL from main", CR_SIGNAL_CONTEXT); if (ret) { printf("XXX cr_replace_callback() #1 returned %d w/ errno=%d(%s)\n", ret, errno, cr_strerror(errno)); } // Next two should fail due to wrong context in flags ret = cr_replace_callback(id0, cb4, "XXX THREAD->SIGNAL from main", CR_SIGNAL_CONTEXT); if (!ret) { printf("XXX cr_replace_callback() #3 suceeded unexpectedly\n"); } else if (errno != EINVAL) { printf("XXX cr_replace_callback() #3 returned %d w/ errno=%d(%s)\n", ret, errno, cr_strerror(errno)); } ret = cr_replace_callback(id1, cb5, "XXX SIGNAL->THREAD from main", CR_THREAD_CONTEXT); if (!ret) { printf("XXX cr_replace_callback() #4 suceeded unexpectedly\n"); } else if (errno != EINVAL) { printf("XXX cr_replace_callback() #4 returned %d w/ errno=%d(%s)\n", ret, errno, cr_strerror(errno)); } // Next two should fail due to invalid id // -1 can't be valid since that is the error return from register ret = cr_replace_callback(-1, cb4, NULL, CR_SIGNAL_CONTEXT); if (!ret) { printf("XXX cr_replace_callback() #5 suceeded unexpectedly\n"); } else if (errno != EINVAL) { printf("XXX cr_replace_callback() #5 returned %d w/ errno=%d(%s)\n", ret, errno, cr_strerror(errno)); } ret = cr_replace_callback(-1, cb5, NULL, CR_THREAD_CONTEXT); if (!ret) { printf("XXX cr_replace_callback() #6 suceeded unexpectedly\n"); } else if (errno != EINVAL) { printf("XXX cr_replace_callback() #6 returned %d w/ errno=%d(%s)\n", ret, errno, cr_strerror(errno)); } // cr_leave_cs(my_id); ret = crut_checkpoint_block(filename); if (ret < 0) { printf("XXX crut_checkpoint_block() #4 returned %d w/ errno=%d(%s)\n", ret, errno, cr_strerror(errno)); } (void)unlink(filename); // may fail silently out("009 DONE\n"); return 0; } blcr-0.8.5/tests/tcl_test.sh0000664000000000000000000000311511015415407012654 00000000000000#!/bin/sh # # Test of checkpoint/restart of a tcl script. # Note that the outer shell script is bash # Check for tclsh (echo exit 0 | tclsh) || exit 77 . ${cr_testsdir:-`dirname $0`}/shellinit \rm -f Context[123] .Context[123].tmp 2>/dev/null bash <<-'__OUTER__' exec 2>/dev/null # Drop job control message(s) from the outer script echo '#ST_ALARM:120' $cr_run tclsh 2>&1 <<-'__INNER__' set chkpt_cmd $env(cr_checkpoint) set rstrt_cmd $env(cr_restart) proc waitfor {pid} { while { ! [ catch { exec kill -s 0 $pid } msg ] } { after 1000 } } proc checkpoint {file child} { global chkpt_cmd exec -- $chkpt_cmd "--file=$file" --tree --term $child if { $child != [ pid ] } { waitfor $child } after 1000 } proc restart {file} { global rstrt_cmd set child [ exec -- $rstrt_cmd $file & ] after 3000 return $child } proc echo {msg} { puts $msg; flush stdout } flush stderr flush stdout set cmd {for {set i 0} {$i<16} {incr i} {\ puts "$i Hello";\ flush stdout;\ after 1000}} set child [ exec [info nameofexecutable] << "$cmd" & ] after 3000 echo "# Checkpoint original child" checkpoint "Context1" $child echo "# Restart 1" set $child [ restart "Context1" ] echo "# Checkpoint restarted child" checkpoint "Context2" $child echo "# Restart^2" set $child [ restart "Context2" ] echo "# Checkpoint self" checkpoint "Context3" [ pid ] waitfor $child echo "16 DONE" __INNER__ exec 2>&1 sleep 3 echo "# Restart interpreter" $cr_restart Context3 __OUTER__ \rm -f Context[123] .Context[123].tmp 2>/dev/null blcr-0.8.5/tests/CountingApp.class0000664000000000000000000000111110643334361013754 00000000000000Êþº¾-* CountingAppjava/lang/Objectmain([Ljava/lang/String;)VCodejava/lang/SystemoutLjava/io/PrintStream; java/io/PrintStreamprint(I)V   Helloprintln(Ljava/lang/String;)V  java/lang/Threadsleep(J)V  LineNumberTable Exceptionsjava/lang/InterruptedException"()V $% & SourceFileCountingApp.java  Q%< ¢² ¶² ¶è…¸„§ÿá±    !#$%*·'±()blcr-0.8.5/tests/rep_test.sh0000664000000000000000000000206111005167617012665 00000000000000#!/bin/sh # First check that we *have* rep rep -q || exit 77 . ${cr_testsdir:-`dirname $0`}/shellinit \rm -f Context[123] .Context[123].tmp 2>/dev/null exec 2>/dev/null # To drop job control messages echo '#ST_ALARM:120' $cr_run rep --batch --load /proc/self/fd/0 <<-EOF 2>&1 & (defun greet (n) (flush-file (format standard-output "%d Hello\n" n)) (sleep-for 1) (if (< n 9) (greet (+ n 1)))) (greet 0) (flush-file (format standard-output "# Checkpoint self\n")) (system (format nil "%s --file=Context3 --term --tree %d" (getenv "cr_checkpoint") (process-id))) (format standard-output "11 DONE\n") EOF pid=$! sleep 3 echo "# Checkpoint original child" $cr_checkpoint --file=Context1 --term $pid 2>&1 wait sleep 1 echo "# Restart 1" $cr_restart Context1 2>&1 & pid=$! sleep 3 echo "# Checkpoint restarted child" $cr_checkpoint --file=Context2 --term --tree $pid 2>&1 wait sleep 1 echo "# Restart^2" $cr_restart Context2 2>&1 & pid=$! wait echo "10 Restart interpreter" $cr_restart Context3 2>&1 \rm -f Context[123] .Context[123].tmp 2>/dev/null blcr-0.8.5/tests/critical_sections.c0000664000000000000000000001111011042543127014337 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2008, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * 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 * * $Id: critical_sections.c,v 1.5 2008/07/26 06:38:15 phargrov Exp $ */ const char description[] = "Description of tests/CriticalSections/cr_test:\n" "\n" "This test verifies the behavior of critical sections in libcr:\n" " + cr_enter_cs()\n" " + Enters a critical section which excludes checkpoints, inclusive\n" " of thread-context callbacks.\n" " + cr_leave_cs()\n" " Leaves a critical section, invoking a checkpoint if one is pending.\n" " + cr_status()\n" " Must reflect the status of the thread-context callback as well.\n" "\n" "In a successful run, expect lines of output in SORTED order.\n" ; #include #include #include #include #include #include #include "crut_util.h" static pthread_mutex_t my_lock = PTHREAD_MUTEX_INITIALIZER; static pthread_cond_t my_cond = PTHREAD_COND_INITIALIZER; static volatile int thread_ran = 0; static int my_callback(void* arg) { int rc; printf("004 enter callback\n"); rc = cr_checkpoint(CR_CHECKPOINT_READY); if (rc) { printf("XXX resuming unexpectedly in callback\n"); exit(-1); } else { printf("005 continuing correctly in callback\n"); } pthread_mutex_lock(&my_lock); thread_ran = 1; pthread_cond_signal(&my_cond); pthread_mutex_unlock(&my_lock); return 0; } int main(void) { pid_t my_pid; cr_callback_id_t cb_id; cr_client_id_t my_id; cr_checkpoint_handle_t my_handle; char *filename = NULL; struct stat s; int rc, fd; setlinebuf(stdout); my_pid = getpid(); filename = crut_aprintf("context.%d", my_pid); printf("000 Process started with pid %d\n", my_pid); printf("#ST_ALARM:120\n"); my_id = cr_init(); if (my_id < 0) { printf("XXX cr_init() failed\n"); exit(-1); } else { printf("001 cr_init() succeeded\n"); } cb_id = cr_register_callback(my_callback, NULL, CR_THREAD_CONTEXT); if (cb_id < 0) { printf("XXX cr_register_callback() unexpectedly returned %d\n", cb_id); exit(-1); } cr_enter_cs(my_id); rc = cr_status(); if (rc != CR_STATE_IDLE) { printf("XXX cr_status() unexpectedly returned %d\n", rc); exit(-1); } else { printf("002 cr_status() correctly returned IDLE\n"); } fd = crut_checkpoint_request(&my_handle, filename); if (fd < 0) { printf("XXX crut_checkpoint_request() unexpectedly returned %d\n", rc); exit(-1); } else { printf("003 crut_checkpoint_request() correctly returned 0\n"); } sleep(1); if (thread_ran) { printf("XXX thread ran unexpectedly in critical section\n"); exit(-1); } /* Wait for request to be pending */ while (cr_status() != CR_STATE_PENDING) { sched_yield(); } cr_leave_cs(my_id); // should allow checkpoint to start pthread_mutex_lock(&my_lock); while (!thread_ran) pthread_cond_wait(&my_cond, &my_lock); pthread_mutex_unlock(&my_lock); rc = crut_checkpoint_wait(&my_handle, fd); if (rc < 0) { printf("XXX crut_checkpoint_wait() unexpectedly returned %d errno=%d(%s)\n", rc, errno, cr_strerror(errno)); exit(-1); } rc = stat(filename, &s); if (rc) { printf("XXX stat() unexpectedly returned %d\n", rc); exit(-1); } else { printf("006 stat(context.%d) correctly returned 0\n", my_pid); } if (s.st_size == 0) { printf("XXX context file unexpectedly empty\n"); exit(-1); } else { printf("007 context.%d is non-empty\n", my_pid); } (void)unlink(filename); // might fail silently printf("008 DONE\n"); return 0; } blcr-0.8.5/tests/stage0001.c0000664000000000000000000001660112064133250012251 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2008, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * 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 * * $Id: stage0001.c,v 1.8.12.1 2012/12/18 18:32:08 phargrov Exp $ */ const char description[] = "Description of tests/Stage0001/cr_test:\n" "\n" "This test verifies the basic 'Stage I' functionality of both libcr and the\n" "blcr.o kernel module. This basic functionality includes the following:\n" " + cr_init()\n" " Sets up libcr\n" " + cr_register_callback()\n" " Registers a signal context callback.\n" " + cr_enter_cs()\n" " Enters a critical section which excludes checkpoints.\n" " + cr_leave_cs()\n" " Leaves a critical section, invoking a checkpoint if one is pending.\n" " + cr_status()\n" " Indicates if checkpoint is idle, pending or active.\n" " + cr_request_checkpoint()\n" " Can requests a checkpoint be taken of the invoking process.\n" " + cr_poll_checkpoint()\n" " Reaps a checkpoint request.\n" " + cr_checkpoint()\n" " Invoked by callback(s) when the checkpoint may be taken.\n" "\n" "To test the functionality this test does the following:\n" " - Calls cr_init().\n" " - Register a callback.\n" " - Enter a critical section.\n" " - Request a checkpoint (it will be defered).\n" " - Verify that a checkpoint is pending.\n" " - Leave the critical section (checkpoint will run now).\n" " - Verify that callback is run.\n" " - Verify that cr_checkpoint() returns the CONTINUE case.\n" " - Request a second checkpoint which runs immediately.\n" " - Verify that the callback is run again.\n" " - Verify that cr_checkpoint() returns the CONTINUE case.\n" " - Verify that a 'context.' file exists.\n" " - Verify that 'context.' is non-empty.\n" " - Request a third checkpoint which aborts with TEMPFAIL.\n" "\n" "In a successful run, expect lines of output in SORTED order.\n" ; #include #include #include #include #include "crut_util.h" static int my_callback(void* arg) { static int count = 0; int rc; switch(count++) { case 0: printf("005 enter callback\n"); rc = cr_checkpoint(0); if (rc) { printf("XXX resuming unexpectedly in callback. (rc=%d)\n", rc); exit(-1); } else { printf("006 continuing correctly in callback\n"); } break; case 1: printf("008 enter callback again\n"); rc = cr_checkpoint(0); if (rc) { printf("XXX resuming unexpectedly in callback\n"); exit(-1); } else { printf("009 continuing correctly in callback again\n"); } break; case 2: printf("012 enter callback again: testing cancellation\n"); rc = cr_checkpoint(CR_CHECKPOINT_TEMP_FAILURE); if (rc >= 0) { printf("XXX resuming unexpectedly in callback\n"); exit(-1); } else if (rc != -CR_ETEMPFAIL) { printf("XXX checkpoint TEMP cancellation failed: %d (%s)\n", rc, cr_strerror(-rc)); exit(-1); } else { printf("013 checkpoint cancelled successfully with TEMP fail\n"); } break; default: printf("XXX entered callback unexpectedly: count=%d\n", count); } return 0; } int main(void) { pid_t my_pid; cr_callback_id_t cb_id; cr_client_id_t my_id; cr_checkpoint_handle_t my_handle; char *filename; int rc, fd; struct stat s; setlinebuf(stdout); my_pid = getpid(); filename = crut_aprintf("context.%d", my_pid); printf("000 Process started with pid %d\n", my_pid); printf("#ST_ALARM:120\n"); my_id = cr_init(); if (my_id < 0) { printf("XXX cr_init() failed, returning %d\n", my_id); exit(-1); } else { printf("001 cr_init() succeeded\n"); } cb_id = cr_register_callback(my_callback, NULL, CR_SIGNAL_CONTEXT); if (cb_id < 0) { printf("XXX cr_register_callback() unexpectedly returned %d\n", cb_id); exit(-1); } else { printf("002 cr_register_callback() correctly returned %d\n", cb_id); } cr_enter_cs(my_id); rc = cr_status(); if (rc != CR_STATE_IDLE) { printf("XXX cr_status() unexpectedly returned %d\n", rc); exit(-1); } else { printf("003 cr_status() correctly returned 0x%x\n", rc); } /* Request a checkpoint of ourself - should be blocked by critical section */ fd = crut_checkpoint_request(&my_handle, filename); if (fd < 0) { printf("XXX crut_checkpoint_request() unexpectedly returned 0x%x\n", fd); exit(-1); } rc = cr_status(); if (rc != CR_STATE_PENDING) { /* NOTE: only work because there are not threads */ printf("XXX cr_status() unexpectedly returned 0x%x\n", rc); exit(-1); } else { printf("004 cr_status() correctly returned 0x%x\n", rc); } cr_leave_cs(my_id); // should cause checkpoint NOW rc = cr_status(); if (rc != CR_STATE_IDLE) { printf("XXX cr_status() unexpectedly returned 0x%x\n", rc); exit(-1); } else { printf("007 cr_status() correctly returned 0x%x\n", rc); } /* Reap the checkpoint request */ rc = crut_checkpoint_wait(&my_handle, fd); if (rc < 0) { printf("XXX crut_checkpoint_wait() #1 unexpectedly returned 0x%x\n", rc); exit(-1); } /* Request a checkpoint of ourself - should happen NOW */ fd = crut_checkpoint_request(&my_handle, filename); if (fd < 0) { printf("XXX crut_checkpoint_request() unexpectedly returned 0x%x\n", fd); exit(-1); } rc = stat(filename, &s); if (rc) { printf("XXX stat() unexpectedly returned %d\n", rc); exit(-1); } else { printf("010 stat(context.%d) correctly returned 0\n", my_pid); } if (s.st_size == 0) { printf("XXX context file unexpectedly empty\n"); exit(-1); } else { printf("011 context.%d is non-empty\n", my_pid); } /* Reap the checkpoint request */ rc = crut_checkpoint_wait(&my_handle, fd); if (rc < 0) { printf("XXX crut_checkpoint_wait() #2 unexpectedly returned 0x%x\n", rc); exit(-1); } (void)unlink(filename); // might fail silently /* * Do another checkpoint, but this time abort it with TEMPFAIL */ fd = crut_checkpoint_request(&my_handle, filename); if (fd < 0) { printf("XXX crut_checkpoint_request() unexpectedly returned 0x%x\n", fd); exit(-1); } rc = crut_checkpoint_wait(&my_handle, fd); if (rc != CR_POLL_CHKPT_ERR_POST) { printf("XXX crut_checkpoint_wait() #3 unexpectedly returned 0x%x\n", rc); exit(-1); } if (errno != CR_ETEMPFAIL) { printf("XXX crut_checkpoint_wait() #3 unexpectedly got errno=%d(%s)\n", errno, cr_strerror(errno)); exit(-1); } printf("014 DONE\n"); (void)unlink(filename); // might fail silently return 0; } blcr-0.8.5/tests/sml_test.sh0000664000000000000000000000537211015415407012674 00000000000000#!/bin/sh # # Test of checkpoint/restart of an sml script. # Note that the outer shell script is bash # First ensure we have sml sml -h >/dev/null || exit 77 . ${cr_testsdir:-`dirname $0`}/shellinit \rm -f Context[123] .Context[123].tmp 2>/dev/null bash <<-'__OUTER__' exec 2>/dev/null # Drop job control message(s) from the outer script echo '#ST_ALARM:120' echo '#ST_IGNORE:^Standard ML of New Jersey' echo '#ST_IGNORE:\[library .* is stable\]' echo '#ST_IGNORE:\[autoloading.*\]' $cr_run sml 2>&1 <<'__INNER__' (* Quiet most internal messages *) Control.Print.out := {say=fn _=>(), flush=fn()=>()}; SMLofNJ.Internals.GC.messages false; (* Lots of functions to build up *) val pidToInt = (SysWord.toInt o Posix.Process.pidToWord); fun waitpid (i:int) = (Posix.Process.waitpid ((Posix.Process.W_CHILD o Posix.Process.wordToPid o SysWord.fromInt) i, [])); val sleep = (ignore o Posix.Process.sleep o Time.fromSeconds o Int.toLarge); fun fork () = (case (Posix.Process.fork ()) of NONE => 0 | SOME pid => (pidToInt pid)); fun exit (i:int) = ignore(OS.Process.exit (if (i = 0) then OS.Process.success else OS.Process.failure)); fun spawn (cmd:string list) = let val child = fork(); in if (child = 0) then ( Posix.Process.exec ((List.hd cmd), cmd); exit 1; (* not reached *) 0 ) else child end fun println (s:string) = print(s ^ "\n"); val itoa = Int.toString; val self = pidToInt(Posix.ProcEnv.getpid()); local fun getenv (key:string) = (case Posix.ProcEnv.getenv(key) of NONE => "UNDEF" | SOME value => value); val chkptCmd = getenv "cr_checkpoint"; val rstrtCmd = getenv "cr_restart" in fun checkpoint (file:string, pid:int) = ( spawn [chkptCmd, ("--file=" ^ file), "--term", "--tree", (itoa pid)]; if (pid <> self) then ignore(waitpid pid) else (); sleep 1 ); fun restart (file:string) = ((spawn [rstrtCmd, file]) before (sleep 5)) end; (* Fire up a child who counts for us *) val pid = fork(); if (pid = 0) then ( let fun say i = (println ((itoa i) ^ " Hello"); sleep 1); fun hello 0 = say 0 | hello i = (hello(i - 1); say i) in hello 15; exit 0 end ) else sleep 3; (* Checkpoint and restart repeatedly *) println "# Checkpoint original child"; checkpoint("Context1", pid); println "# Restart 1"; val pid = restart("Context1"); println "# Checkpoint restarted child"; checkpoint("Context2", pid); println "# Restart^2"; val pid = restart("Context2"); println "# Checkpoint self"; checkpoint("Context3", self); waitpid pid; println "16 DONE"; exit 0 __INNER__ exec 2>&1 sleep 3 echo "# Restart interpreter" $cr_restart Context3 __OUTER__ \rm -f Context[123] .Context[123].tmp 2>/dev/null blcr-0.8.5/tests/stage0002.c0000664000000000000000000001120311152061145012243 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2003, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * 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 * * $Id: stage0002.c,v 1.13.8.1 2009/02/27 22:00:05 phargrov Exp $ */ const char description[] = "Description of tests/Stage0002/cr_test:\n" "\n" "This test verifies the basic 'Stage II' functionality of both libcr and the\n" "blcr.o kernel module. In addition to 'Stage I', this includes the following:\n" " + cr_register_callback()\n" " Registers an thread context callback.\n" " + cr_{enter,leave}_cs(CR_ID_CALLBACK) does not block in callbacks.\n" " + Externally initiated checkpoint (runs cr_checkpoint utility).\n" " + Ability to fork() and waitpid() from the thread-context callback.\n" ; #include #include #include #include #include #include #include #include #include "libcr.h" #include "crut_util.h" static volatile int flag = 0; enum { MSG_GRANDCHILD_READY = 86, MSG_PARENT_DONE, MSG_EXIT_VAL, }; static int my_thread_callback(void *arg) { pid_t child; cr_enter_cs(CR_ID_CALLBACK); printf("002 thread-context callback running in pid %d\n", (int)getpid()); child = fork(); if (child > 0) { waitpid(child, NULL, 0); } else if (child == 0) { printf("003 in fork()ed child pid=%d\n", (int)getpid()); sleep(1); exit(0); } else { printf("XXX thread-context callback failed to fork()\n"); exit(-1); } printf("004 thread-context callback complete\n"); cr_leave_cs(CR_ID_CALLBACK); return 0; } static int my_signal_callback(void *arg) { flag = 1; return 0; } static int child_main(struct crut_pipes *pipes) { pid_t child; int rc; (void)cr_init(); (void)cr_register_callback(my_signal_callback, NULL, CR_SIGNAL_CONTEXT); (void)cr_register_callback(my_thread_callback, NULL, CR_THREAD_CONTEXT); printf("000 First process started with pid %d\n", getpid()); printf("#ST_ALARM:120\n"); child = fork(); if (child < 0) { printf("XXX First process failed to fork\n"); exit(-1); } if (!child) { int pid = getpid(); printf("001 Second process started with pid %d\n", pid); crut_pipes_putchar(pipes, MSG_GRANDCHILD_READY); crut_pipes_expect(pipes, MSG_PARENT_DONE); printf("005 Exiting from pid %d\n", pid); } else { do { rc = waitpid(child, NULL, 0); } while ((rc < 0) && (errno == EINTR)); if (flag) { printf("006 verified that signal-context callback ran\n"); } printf("007 Exiting from pid %d\n", getpid()); } return MSG_EXIT_VAL; } int main(int argc, char **argv) { struct crut_pipes pipes; char *buf = NULL; pid_t child; struct stat s; int rc; setlinebuf(stdout); child = crut_pipes_fork(&pipes); if (child == 0) { return child_main(&pipes); } else if (child < 0) { printf("XXX main failed to fork()\n"); exit(-1); } crut_pipes_expect(&pipes, MSG_GRANDCHILD_READY); buf = crut_aprintf("exec %s -f context.%d --quiet %d", crut_find_cmd(argv[0], "cr_checkpoint"), child, child); rc = system(buf); if (rc) { printf("XXX got %d from system(%s)\n", rc, buf); exit(-1); } free(buf); crut_pipes_putchar(&pipes, MSG_PARENT_DONE); crut_waitpid_expect(child, MSG_EXIT_VAL); buf = crut_aprintf("context.%d", child); rc = stat(buf, &s); if (rc < 0) { printf("XXX failed to stat() %s\n", buf); exit(-1); } else if (s.st_size == 0) { printf("XXX failed to stat() %s\n", buf); exit(-1); } else { printf("008 %s has size %lu\n", buf, (unsigned long)s.st_size); } (void)unlink(buf); // might fail silently free(buf); printf("009 DONE\n"); return 0; } blcr-0.8.5/tests/gij_test.sh0000664000000000000000000000143411005167617012653 00000000000000#!/bin/sh # Test gij (the Java bytecode interpreter from the GNU Compiler Collection) # First check that we *have* gij gij --version >/dev/null || exit 77 . ${cr_testsdir:-`dirname $0`}/shellinit CLASSPATH=${top_srcdir:-..}/tests export CLASSPATH filelist="Context[12] .Context[12].tmp" \rm -f $filelist 2>/dev/null trap "\rm -f $filelist 2>/dev/null" 0 exec 2>/dev/null # To drop job control messages echo '#ST_ALARM:120' $cr_run gij CountingApp 2>&1 & pid=$! sleep 3 echo "# Checkpoint 1" $cr_checkpoint --file=Context1 --term $pid 2>&1 wait sleep 3 echo "# Restart 1" $cr_restart Context1 2>&1 & pid=$! sleep 3 echo "# Checkpoint restarted child" $cr_checkpoint --file=Context2 --term --tree $pid 2>&1 wait sleep 3 echo "# Restart^2" $cr_restart Context2 2>&1 & pid=$! wait echo "10 DONE" blcr-0.8.5/tests/gst_test.sh0000664000000000000000000000332711043762246012703 00000000000000#!/bin/bash # # Test of checkpoint/restart of GNU Smalltalk (gst) # Note that the outer script is bash (no good w/ dash) # Check for gst (gst -v >/dev/null) || exit 77 . ${cr_testsdir:-`dirname $0`}/shellinit filelist="gst.im Context[12] .Context[12].tmp" \rm -f $tmpfiles 2>/dev/null trap "\rm -f $filelist 2>/dev/null" 0 exec 2>/dev/null # Drop job control message(s) echo '#ST_ALARM:120' $cr_run gst -Q <<-'__EOF__' 2>&1 "First we need some things from libc" DLD addLibrary: 'libc'! SystemDictionary defineCFunc: 'getpid' withSelectorArgs: 'getpid' returning: #int args: #()! SystemDictionary defineCFunc: 'getppid' withSelectorArgs: 'getppid' returning: #int args: #()! | sema checkpoint | sema := (Semaphore new). checkpoint := "Block/closure used as a function" [ :file :pid | | s cmd | s := WriteStream on: (String new). s nextPutAll: (Smalltalk getenv: 'cr_checkpoint'), ' --file=', file, ' --tree --kill ', pid printString. cmd := s contents. stdout display: '# ', cmd; nl; flush. Smalltalk system: cmd. ]. "Create a smalltalk thread (not a process) to count for us" [ 0 to: 9 do: [ :i | stdout display: i printString, ' Hello'; nl; flush. (Delay forSeconds:1) wait. ]. sema signal. ] fork. (Delay forSeconds:3) wait. checkpoint value: 'Context1' value: (Smalltalk getpid). (Delay forSeconds:3) wait. checkpoint value: 'Context2' value: (Smalltalk getppid). sema wait. stdout display: '10 Goodbye'; nl; flush. ! __EOF__ sleep 1; echo "# Restart 1" $cr_restart Context1 2>&1 sleep 1; echo "# Restart^2" exec 2>&1 # No more job-control obituaries to supress $cr_restart Context2 echo "11 DONE" blcr-0.8.5/tests/edeadlk.c0000664000000000000000000001542411042543127012243 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2007, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * 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 * * $Id: edeadlk.c,v 1.3 2008/07/26 06:38:15 phargrov Exp $ */ /* Tests implementation of CR_CHKPT_PROHIBIT_SELF flag */ #define _LARGEFILE64_SOURCE 1 #include #include #include #include #include #include "crut_util.h" #ifndef O_LARGEFILE #define O_LARGEFILE 0 #endif enum { MSG_CHILD_READY, MSG_REGISTER_REQUEST, MSG_REGISTER_REPLY, MSG_RESULT_QUERY, MSG_PARENT_DONE, BAD_EXIT_VAL, }; static volatile int cb_result = 0; static int my_callback(void *arg) { struct crut_pipes *pipes = arg; int rc; rc = cr_forward_checkpoint(CR_SCOPE_PROC, pipes->parent); cb_result = (rc < 0) ? errno : rc; return 0; } static void child_main(struct crut_pipes *pipes) { cr_callback_id_t cb_id; cr_client_id_t my_id; int mypid = getpid(); my_id = cr_init(); if (my_id < 0) { printf("XXX child %d cr_init() failed, returning %d\n", mypid, my_id); exit(-1); } crut_pipes_putchar(pipes, MSG_CHILD_READY); crut_pipes_expect(pipes, MSG_REGISTER_REQUEST); cb_id = cr_register_callback(my_callback, pipes, CR_SIGNAL_CONTEXT); if (cb_id < 0) { printf("XXX cr_register_callback() unexpectedly returned %d\n", cb_id); exit(-1); } crut_pipes_putchar(pipes, MSG_REGISTER_REPLY); while (1) { crut_pipes_expect(pipes, MSG_RESULT_QUERY); crut_pipes_putchar(pipes, cb_result); } exit (BAD_EXIT_VAL); } static int checkpoint_to_file(const char *filename, pid_t target, int flags) { int ret; cr_checkpoint_handle_t cr_handle; cr_checkpoint_args_t cr_args; /* open the context file */ ret = open(filename, O_WRONLY | O_CREAT | O_TRUNC | O_LARGEFILE, 0600); if (ret < 0) { perror("open"); goto out; } cr_initialize_checkpoint_args_t(&cr_args); cr_args.cr_fd = ret; cr_args.cr_scope = CR_SCOPE_PROC; cr_args.cr_flags = flags; cr_args.cr_target = target; /* issue the request */ ret = cr_request_checkpoint(&cr_args, &cr_handle); if (ret < 0) { ret = errno; goto out; } /* wait for the request to complete */ do { ret = cr_poll_checkpoint(&cr_handle, NULL); if (ret < 0) { if (ret == CR_POLL_CHKPT_ERR_POST && errno == CR_ERESTARTED) { /* restarting -- not an error */ ret = 0; } else if (errno == EINTR) { /* retry */ ; } else { perror("cr_poll_checkpoint"); goto out; } } else if (ret == 0) { fprintf(stderr, "cr_poll_checkpoint returned unexpected 0\n"); exit(1); } } while (ret < 0); ret = 0; close(cr_args.cr_fd); out: return ret; } int main(void) { int rc, child; struct crut_pipes pipes; int self = getpid(); char *filename = crut_aprintf("context.%d", self); setlinebuf(stdout); printf("#ST_ALARM:60\n"); printf("000 test started w/ pid %d\n", self); child = crut_pipes_fork(&pipes); if (!child) { child_main(&pipes); exit(1); } crut_pipes_expect(&pipes, MSG_CHILD_READY); printf("001 child started w/ pid %d\n", child); /* First basic tests of normal checkpoints */ rc = checkpoint_to_file(filename, self, 0); if (rc == 0) { printf("002 basic self checkpoint passed\n"); } else { printf("XXX basic self checkpoint FAILED errno=%d (%s)\n", rc, cr_strerror(rc)); } rc = checkpoint_to_file(filename, child, 0); if (rc == 0) { printf("003 basic child checkpoint passed\n"); } else { printf("XXX basic child checkpoint FAILED errno=%d (%s)\n", rc, cr_strerror(rc)); } /* Next try w/ CR_CHKPT_PROHIBIT_SELF */ rc = checkpoint_to_file(filename, self, CR_CHKPT_PROHIBIT_SELF); if (rc == EDEADLK) { printf("004 PROHIBIT_SELF self checkpoint failed in the expected way\n"); } else { printf("XXX PROHIBIT_SELF self checkpoint did not fail in the expected way, errno=%d (%s)\n", rc, cr_strerror(rc)); } rc = checkpoint_to_file(filename, child, CR_CHKPT_PROHIBIT_SELF); if (rc == 0) { printf("005 PROHIBIT_SELF child checkpoint passed\n"); } else { printf("XXX PROHIBIT_SELF child checkpoint FAILED errno=%d (%s)\n", rc, cr_strerror(rc)); } /* Ask child to register a callback that forwards back to us */ crut_pipes_putchar(&pipes, MSG_REGISTER_REQUEST); crut_pipes_expect(&pipes, MSG_REGISTER_REPLY); printf("006 child has registered forwarding callback\n"); /* Now try w/ and w/o CR_CHKPT_PROHIBIT_SELF */ rc = checkpoint_to_file(filename, child, 0); if (rc == 0) { printf("007 child+fwd checkpoint passed\n"); } else { printf("XXX child+fwd checkpoint FAILED errno=%d (%s)\n", rc, cr_strerror(rc)); } crut_pipes_putchar(&pipes, MSG_RESULT_QUERY); rc = crut_pipes_getchar(&pipes); if (rc == 0) { printf("008 child+fwd cr_forward_checkpoint(parent) passed\n"); } else { printf("XXX child+fwd cr_forward_checkpoint(parent) FAILED errno=%d (mod 128)\n", rc); } rc = checkpoint_to_file(filename, child, CR_CHKPT_PROHIBIT_SELF); if (rc == 0) { printf("009 PROHIBIT_SELF child+fwd checkpoint passed\n"); } else { printf("XXX PROHIBIT_SELF child+fwd checkpoint FAILED errno=%d (%s)\n", rc, cr_strerror(rc)); } crut_pipes_putchar(&pipes, MSG_RESULT_QUERY); rc = crut_pipes_getchar(&pipes); if ((char)rc == (char)EDEADLK) { printf("010 PROHIBIT_SELF child+fwd cr_forward_checkpoint(parent) failed in the expected way\n"); } else { printf("XXX child+fwd cr_forward_checkpoint(parent) did not fail in the expected way, errno=%d (mod 128)\n", rc); } crut_pipes_putchar(&pipes, MSG_PARENT_DONE); crut_waitpid_expect(pipes.child, MSG_PARENT_DONE); printf("011 DONE\n"); (void)unlink(filename); return 0; } blcr-0.8.5/tests/emacslisp_test.sh0000664000000000000000000000252711005167617014066 00000000000000#!/bin/sh # First check that we *have* emacs emacs -nw -batch 2>/dev/null || exit 77 . ${cr_testsdir:-`dirname $0`}/shellinit \rm -f Context[123] .Context[123].tmp 2>/dev/null exec 2>/dev/null # To drop job control messages echo '#ST_ALARM:120' $cr_run emacs -nw -q -batch \ -eval '(defun greet (n) (princ (format "%d Hello\n" n)) (sleep-for 1) (if (< n 9) (greet (+ n 1))))' \ -eval '(defun getpid-ascii () ;; You would think emacslisp would implement getpid() (car (split-string ;; Extract 1st whitespace-delimited field of /proc/sef/stat (with-temp-buffer (insert-file-contents-literally "/proc/self/stat") (buffer-string)))))' \ -eval '(progn (greet 0) (princ "# Checkpointing self\n") (call-process (getenv "cr_checkpoint") nil nil nil "--file=Context3" "--term" "--tree" (getpid-ascii)) (princ "10 DONE\n"))' \ -kill & pid=$! sleep 3 echo "# Checkpoint original child" $cr_checkpoint --file=Context1 --term $pid 2>&1 wait sleep 1 echo "# Restart 1" $cr_restart Context1 2>&1 & pid=$! sleep 3 echo "# Checkpoint restarted child" $cr_checkpoint --file=Context2 --term --tree $pid 2>&1 wait sleep 1 echo "# Restart^2" $cr_restart Context2 2>&1 & wait echo "# Restart interpreter" # Note entire emacs output still might be bufferd sleep 2 $cr_restart Context3 2>&1 \rm -f Context[123] .Context[123].tmp 2>/dev/null blcr-0.8.5/tests/hello.c0000664000000000000000000000011710560240125011742 00000000000000#include int main(void) { printf("Hello, World!\n"); return 0; } blcr-0.8.5/tests/failed_cb.c0000664000000000000000000002105711042543127012541 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2008, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * 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 * * $Id: failed_cb.c,v 1.12 2008/07/26 06:38:15 phargrov Exp $ */ /* NOTE: if adding tests here, also add to failed_cb2.c. */ const char description[] = "Description of tests/FailedCB/cr_test:\n" "\n" " Verifies that when a callback invokes cr_checkpoint() with a non-zero\n" " argument, additional callbacks will be skipped.\n" "\n" "In a successful run, expect lines of output in SORTED order.\n" ; #include #include #include #include "crut_util.h" static char *filename; static int callback0(void* arg) { printf("XXX enter 'other' callback unexpectedly\n"); return 0; } static int callback1(void* arg) { static int count = 0; int rc; switch (count) { case 0: printf("007 enter callback1 (TEMP)\n"); rc = cr_checkpoint(CR_CHECKPOINT_TEMP_FAILURE); if (rc >= 0) { printf("XXX resuming unexpectedly in callback1\n"); exit(-1); } else if (rc != -CR_ETEMPFAIL) { printf("XXX callback1: checkpoint TEMP cancellation failed: %d (%s)\n", rc, cr_strerror(-rc)); exit(-1); } else { printf("008 checkpoint cancelled successfully with TEMP fail\n"); } break; case 1: printf("013 enter callback1 (OMIT)\n"); rc = cr_checkpoint(CR_CHECKPOINT_OMIT); if (rc >= 0) { printf("XXX resuming unexpectedly in callback_TEMP (rc=%d)\n", rc); exit(-1); } else if (rc != -CR_EOMITTED) { printf("XXX callback1: checkpoint OMIT cancellation failed: %d (%s)\n", rc, cr_strerror(-rc)); exit(-1); } else { printf("014 checkpoint cancelled successfully with OMIT\n"); } break; case 2: printf("019 enter callback1 (TEMP_CODE)\n"); rc = cr_checkpoint(CR_CHECKPOINT_TEMP_FAILURE_CODE(911)); if (rc >= 0) { printf("XXX resuming unexpectedly in callback_TEMP_CODE (rc=%d)\n", rc); exit(-1); } else if (rc != -911) { printf("XXX callback1: checkpoint TEMP_CODE cancellation failed: %d (%s)\n", rc, cr_strerror(-rc)); exit(-1); } else { printf("020 checkpoint cancelled successfully with TEMP_CODE\n"); } break; default: (void)unlink(filename); /* ICK */ printf("025 enter callback1 (PERM)\n"); printf("026 DONE\n"); (void)cr_checkpoint(CR_CHECKPOINT_PERM_FAILURE); printf("XXX cr_checkpoint(CR_CHECKPOINT_PERM_FAILURE) returned unexpectedly\n"); exit(-1); } ++count; return 0; } static int callback2(void* arg) { static int count = 0; int rc; switch (count) { case 0: printf("006 in callback2 (TEMP)\n"); rc = cr_checkpoint(0); if (rc >= 0) { printf("XXX resuming unexpectedly in callback2\n"); exit(-1); } else if (rc != -CR_ETEMPFAIL) { printf("XXX callback2: checkpoint TEMP cancellation failed: %d (%s)\n", rc, cr_strerror(-rc)); exit(-1); } else { printf("009 checkpoint cancelled successfully with TEMP fail\n"); } break; case 1: printf("012 in callback2 (OMIT)\n"); rc = cr_checkpoint(0); if (rc >= 0) { printf("XXX resuming unexpectedly in callback2\n"); exit(-1); } else if (rc != -CR_EOMITTED) { printf("XXX callback2: checkpoint OMIT %d (%s)\n", rc, cr_strerror(-rc)); exit(-1); } else { printf("015 checkpoint cancelled successfully with OMIT\n"); } break; case 2: printf("018 in callback2 (TEMP_CODE)\n"); rc = cr_checkpoint(0); if (rc >= 0) { printf("XXX resuming unexpectedly in callback2\n"); exit(-1); } else if (rc != -911) { printf("XXX callback2: checkpoint TEMP_CODE %d (%s)\n", rc, cr_strerror(-rc)); exit(-1); } else { printf("021 checkpoint cancelled successfully with TEMP_CODE\n"); } break; default: printf("024 in callback0 (PERM)\n"); (void)cr_checkpoint(0); printf("XXX unexpected return from final checkpoint\n"); } ++count; return 0; } int main(void) { pid_t my_pid; cr_callback_id_t cb_id; cr_client_id_t my_id; int rc; setlinebuf(stdout); my_pid = getpid(); filename = crut_aprintf("context.%d", my_pid); printf("000 Process started with pid %d\n", my_pid); printf("#ST_ALARM:120\n"); printf("#ST_SIGNAL:9\n"); my_id = cr_init(); if (my_id < 0) { printf("XXX cr_init() failed, returning %d\n", my_id); exit(-1); } else { printf("001 cr_init() succeeded\n"); } cb_id = cr_register_callback(callback0, NULL, CR_SIGNAL_CONTEXT); if (cb_id < 0) { printf("XXX cr_register_callback() unexpectedly returned %d\n", cb_id); exit(-1); } else { printf("002 cr_register_callback() correctly returned %x\n", cb_id); } cb_id = cr_register_callback(callback1, NULL, CR_SIGNAL_CONTEXT); if (cb_id < 0) { printf("XXX cr_register_callback() unexpectedly returned %d\n", cb_id); exit(-1); } else { printf("003 cr_register_callback() correctly returned %x\n", cb_id); } cb_id = cr_register_callback(callback2, NULL, CR_SIGNAL_CONTEXT); if (cb_id < 0) { printf("XXX cr_register_callback() unexpectedly returned %d\n", cb_id); exit(-1); } else { printf("004 cr_register_callback() correctly returned %x\n", cb_id); } rc = cr_status(); if (rc != CR_STATE_IDLE) { printf("XXX cr_status() unexpectedly returned %d\n", rc); exit(-1); } else { printf("005 cr_status() correctly returned 0x%x\n", rc); } /* First pass... TEMP */ rc = crut_checkpoint_block(filename); if (rc != CR_POLL_CHKPT_ERR_POST) { printf("XXX crut_checkpoint_block() unexpectedly returned %d\n", rc); exit(-1); } if (errno != CR_ETEMPFAIL) { printf("XXX crut_checkpoint_block() returned unexpected errno=%d(%s)\n", errno, cr_strerror(errno)); exit(-1); } printf("010 cr_poll_checkpoint() correctly returned w/ errno=CR_ETEMPFAIL\n"); rc = cr_status(); if (rc != CR_STATE_IDLE) { printf("XXX cr_status() unexpectedly returned 0x%x\n", rc); exit(-1); } else { printf("011 cr_status() correctly returned 0x%x\n", rc); } /* Second pass... OMIT */ rc = crut_checkpoint_block(filename); if (rc != CR_POLL_CHKPT_ERR_POST) { printf("XXX crut_checkpoint_block() unexpectedly returned %d\n", rc); exit(-1); } if (errno != ESRCH) { printf("XXX crut_checkpoint_block() returned unexpected errno=%d(%s)\n", errno, cr_strerror(errno)); exit(-1); } printf("016 cr_poll_checkpoint() correctly returned w/ errno=ESRCH\n"); rc = cr_status(); if (rc != CR_STATE_IDLE) { printf("XXX cr_status() unexpectedly returned 0x%x\n", rc); exit(-1); } else { printf("017 cr_status() correctly returned 0x%x\n", rc); } /* Third pass... TEMP_CODE */ rc = crut_checkpoint_block(filename); if (rc != CR_POLL_CHKPT_ERR_POST) { printf("XXX crut_checkpoint_block() unexpectedly returned %d\n", rc); exit(-1); } if (errno != 911) { printf("XXX crut_checkpoint_block() returned unexpected errno=%d(%s)\n", errno, cr_strerror(errno)); exit(-1); } printf("022 cr_poll_checkpoint() correctly returned user-specified errno=911\n"); rc = cr_status(); if (rc != CR_STATE_IDLE) { printf("XXX cr_status() unexpectedly returned 0x%x\n", rc); exit(-1); } else { printf("023 cr_status() correctly returned 0x%x\n", rc); } /* Final/fatal pass... PERM */ (void)crut_checkpoint_block(filename); printf("XXX crut_checkpoint_block() returned unexpectedly\n"); return -1; } blcr-0.8.5/tests/pipe.c0000664000000000000000000005514011642201643011606 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2003, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * 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 * * $Id: pipe.c,v 1.15.8.4 2011/10/03 00:36:51 phargrov Exp $ * * Simple tests of pipe save and restore. */ #include #include #include #include #include #include #include #include #include #include #include "blcr_config.h" #include "crut.h" #include "crut_util.h" /* should we try to run the pipe resize test? We only try if the kernel * has the pipe_fcntl() call, and if we pulled the right definitions. */ #if defined(F_SETPIPE_SZ) && defined(F_GETPIPE_SZ) #define TEST_PIPE_FCNTL 1 #elif defined(HAVE_PIPE_FCNTL) && HAVE_PIPE_FCNTL #if !defined(F_SETPIPE_SZ) && defined(CR_F_SETPIPE_SZ) #define F_SETPIPE_SZ CR_F_SETPIPE_SZ #endif #if !defined(F_GETPIPE_SZ) && defined(CR_F_GETPIPE_SZ) #define F_GETPIPE_SZ CR_F_GETPIPE_SZ #endif #if defined(F_SETPIPE_SZ) && defined(F_GETPIPE_SZ) #define TEST_PIPE_FCNTL 1 #else #warning "Found pipe_fcntl in kernel, but could not find F_SETPIPE_SZ." #define TEST_PIPE_FCNTL 0 #endif #else #define TEST_PIPE_FCNTL 0 #endif #define PIPE_LARGE_MIN 1048576 #define LARGE_BUF_SIZE 4*PIPE_BUF #define SMALL_BUF_SIZE 256 #define PIPEDATA "Hello world!\n\0" #define PIPES_MAX 8 #define TEST_BLOCKING 0 #define TEST_NONBLOCKING 1 #define TEST_SETSIZE 2 #if TEST_PIPE_FCNTL #define SETPIPE_SZ_SIZE 1048576L int have_pipe_fcntl = 1; long test_pipe_size; #endif int barrier = -1; int sigpiped = 0; struct pipe_struct { int pipe_fd; struct stat pipe_stat; int pipe_flags; int pipe_mate_fd; }; struct pipe_struct pipe_array[PIPES_MAX]; static void * do_pipe_block_io(void *p); void sigpipe_handler(int num) { sigpiped = 1; } static int update_pipe_struct(struct pipe_struct *p) { int retval; retval = fstat(p->pipe_fd, &p->pipe_stat); if (retval < 0) { perror("fstat"); goto out; } retval = fcntl(p->pipe_fd, F_GETFL); if (retval < 0) { perror("fcntl"); goto out; } else { p->pipe_flags = retval; } out: return retval; } #if 0 /* unused */ /* * finds a pipe struct corresponding to fd * * returns NULL if no corresponding pipe_struct was found */ static struct pipe_struct * find_pipe_struct_mate(int fd) { int i; struct pipe_struct *mate = NULL; for (i=0; ipipe_fd == fd) break; } return mate; } #endif /* * this should probably be protected by some kind of lock... * * For now, don't mess with this unless there are no other threads around. */ static int init_pipe_struct_pair(struct pipe_struct *read_pipe, struct pipe_struct *write_pipe) { int retval; int pipefds[2]; retval = pipe(pipefds); if (retval < 0) { perror("Unable to create a new pipe!"); goto out; } read_pipe->pipe_fd = pipefds[0]; read_pipe->pipe_mate_fd = pipefds[1]; write_pipe->pipe_fd = pipefds[1]; write_pipe->pipe_mate_fd = pipefds[0]; retval = update_pipe_struct(read_pipe); if (retval < 0) { goto out; } retval = update_pipe_struct(write_pipe); out: return retval; } /* * initializes num_pairs pairs of pipe_structs (each pair has one reader, * one writer) */ static int init_pipe_struct_array(int num_pairs) { int i; int retval = -1; if (num_pairs*2 > PIPES_MAX) { CRUT_FAIL("Too many threads %d, increase PIPES_MAX", num_pairs); retval = -1; goto out; } for (i = 0; i<2*num_pairs; i+=2) { retval = init_pipe_struct_pair(&pipe_array[i], &pipe_array[i+1]); if (retval < 0) { CRUT_FAIL("Error initializing pipe."); goto out; } } out: return retval; } /* * NOTE: Assumes pipe_array has been initialized. */ static pthread_t * init_pipe_block_threads(int num_threads) { pthread_t *thread_vec; int retval; int i; thread_vec = malloc(sizeof(pthread_t) * num_threads); if (thread_vec == NULL) { perror("malloc"); goto out; } barrier = num_threads + 1; for (i=0; i=0; --i) { if (pthread_cancel(thread_vec[i])) { perror("pthread_cancel"); } } //out_free: free(thread_vec); out: return NULL; } static int pipe_one_setup(void **p) { int retval; signal(SIGPIPE, sigpipe_handler); CRUT_DEBUG("Creating pipe."); retval = init_pipe_struct_pair(&pipe_array[0], &pipe_array[1]); if (retval < 0) { CRUT_FAIL("Error initializing pipe."); goto out; } *p = NULL; out: return retval; } static int pipe_teardown(void *p) { int retval = 0; return retval; } static void __attribute__ ((__unused__)) dump_pipe_struct_stat(struct pipe_struct *p, const char *name) { struct stat *s = &p->pipe_stat; CRUT_DEBUG("%s.dev_t\t%llu", name, (unsigned long long)s->st_dev); /* device */ CRUT_DEBUG("%s.ino_t\t%lu", name, (unsigned long)s->st_ino); /* inode */ CRUT_DEBUG("%s.mode_t\t%u", name, (unsigned)s->st_mode); /* protection */ CRUT_DEBUG("%s.nlink_t\t%u", name, (unsigned)s->st_nlink); /* number of hard links */ CRUT_DEBUG("%s.uid_t\t%u", name, (unsigned)s->st_uid); /* user ID of owner */ CRUT_DEBUG("%s.gid_t\t%u", name, (unsigned)s->st_gid); /* group ID of owner */ CRUT_DEBUG("%s.dev_t\t%llu", name, (unsigned long long)s->st_rdev); /* device type (if inode device) */ CRUT_DEBUG("%s.off_t\t%ld", name, (long)s->st_size); /* total size, in bytes */ CRUT_DEBUG("%s.blksize_t\t%ld", name, (long)s->st_blksize); /* blocksize for filesystem I/O */ CRUT_DEBUG("%s.blkcnt_t\t%ld", name, (long)s->st_blocks); /* number of blocks allocated */ CRUT_DEBUG("%s.time_t\t%ld", name, (long)s->st_atime); /* time of last access */ CRUT_DEBUG("%s.time_t\t%ld", name, (long)s->st_mtime); /* time of last modification */ CRUT_DEBUG("%s.time_t\t%ld", name, (long)s->st_ctime); /* time of last change */ } static int write_pipe_small(struct pipe_struct *p) { char buf[SMALL_BUF_SIZE]; int retval; strncpy(buf, PIPEDATA, sizeof(PIPEDATA)); CRUT_DEBUG("Writing to pipe"); retval = write(p->pipe_fd, buf, SMALL_BUF_SIZE); if (sigpiped) { CRUT_FAIL("SIGPIPE on write"); exit(1); } if (retval < 0) { CRUT_FAIL("Couldn't write to pipe %d", p->pipe_fd); } if (retval != SMALL_BUF_SIZE) { CRUT_FAIL("Wrote wrong length to pipe %d", p->pipe_fd); } else if(retval == SMALL_BUF_SIZE) { retval = 0; } return retval; } static int pipes_pre(int test_to_run) { int retval; if (test_to_run == TEST_NONBLOCKING) { CRUT_DEBUG("Setting nonblocking flag"); fcntl(pipe_array[0].pipe_fd, F_SETFL, O_NONBLOCK); } #if TEST_PIPE_FCNTL if (test_to_run == TEST_SETSIZE) { long pipe_size = 0; pipe_size = fcntl(pipe_array[0].pipe_fd, F_GETPIPE_SZ, 0); CRUT_DEBUG("before: F_GETPIPE_SZ = %ld", pipe_size); if (pipe_size < 0) { /* disable test if this first call failed */ have_pipe_fcntl = 0; return 0; } CRUT_DEBUG("Resizing the pipe buffer"); fcntl(pipe_array[0].pipe_fd, F_SETPIPE_SZ, SETPIPE_SZ_SIZE); /* Use queried size, even if the F_SETPIPE_SZ had failed */ test_pipe_size = fcntl(pipe_array[0].pipe_fd, F_GETPIPE_SZ, 0); CRUT_DEBUG("after: F_GETPIPE_SZ = %ld", test_pipe_size); } #endif retval = write_pipe_small(&pipe_array[1]); //out: return retval; } static int read_pipe_small(struct pipe_struct *old_read_pipe) { char buf[SMALL_BUF_SIZE]; int retval; struct pipe_struct new_read_pipe_s; memcpy(&new_read_pipe_s, old_read_pipe, sizeof(new_read_pipe_s)); update_pipe_struct(&new_read_pipe_s); /* check the stat structure */ retval = statcmp(&old_read_pipe->pipe_stat, &new_read_pipe_s.pipe_stat, ST_MODE | ST_NLINK); if (retval) { CRUT_DEBUG("File attributes changed. %d mismatches", retval); CRUT_DEBUG("--- Old stats %p ---", &(old_read_pipe->pipe_stat)); dump_stat(&(old_read_pipe->pipe_stat)); CRUT_DEBUG("--- Current stats ---"); dump_stat(&new_read_pipe_s.pipe_stat); retval = -1; goto out; } memset(buf, 0, SMALL_BUF_SIZE); CRUT_DEBUG("Reading from pipe."); retval = read(new_read_pipe_s.pipe_fd, buf, SMALL_BUF_SIZE); if (retval < 0) { CRUT_FAIL("Couldn't read from pipe."); CRUT_FAIL("buf='%s'", buf); goto out; } CRUT_DEBUG("Comparing pipe data."); retval = strncmp(PIPEDATA, buf, sizeof(PIPEDATA)); if (retval < 0) { CRUT_FAIL("strncmp(%s, %s) failure.", PIPEDATA, buf); goto out; } out: return retval; } static int write_long(int fd, void *buf, int size) { int retval; int bytes_written = 0; if (size == 0) { CRUT_DEBUG("WARNING: write_long asked for 0 bytes"); retval = 0; goto out; } /* size_t had better be small enough to write atomically */ if (sizeof(size) > PIPE_BUF) { CRUT_FAIL("PIPE_BUF too small to hold an integer???"); retval = -1; goto out; } retval = write(fd, &size, sizeof(size)); if (retval < 0) { perror("write"); goto out; } while(bytes_written != size) { retval = write(fd, ((char *)buf)+bytes_written, size - bytes_written); if (retval < 0) { perror("write"); retval = bytes_written; goto out; } bytes_written += retval; } retval = bytes_written; out: return retval; } static int write_finished(int fd) { int retval; int zero = 0; retval = write(fd, &zero, sizeof(zero)); if (retval < 0) { perror("write"); } return retval; } static int read_long(int fd, void *buf, int bufsize) { int retval; int bytes_read = 0; int size; if (bufsize == 0) { CRUT_DEBUG("WARNING: caller asked for 0 bytes"); retval = 0; goto out; } /* size_t had better be small enough to read atomically */ if (sizeof(size) > PIPE_BUF) { CRUT_FAIL("PIPE_BUF too small to hold an integer???"); retval = -1; goto out; } retval = read(fd, &size, sizeof(size)); if (retval < 0) { perror("read"); goto out; } /* check for EOT */ if (size == 0) { CRUT_DEBUG("write finished..."); retval = 0; goto out; } if (bufsize < size) { CRUT_FAIL("read buffer too small to hold destination message."); retval = -1; goto out; } while(bytes_read != size) { retval = read(fd, ((char *)buf) + bytes_read, size - bytes_read); if (retval < 0) { perror("read"); retval = bytes_read; goto out; } bytes_read += retval; } retval = bytes_read; out: return retval; } static int read_pipe_large(int fd) { int retval; int bytes_read; int bufsize = LARGE_BUF_SIZE; char buf[bufsize]; bytes_read = 0; do { retval = read_long(fd, buf, bufsize); bytes_read += retval; if (retval != 0 && retval != bufsize) { CRUT_FAIL( "read_long returned wrong number of bytes (%d) from pipe!", retval); retval = -1; goto out; } } while (retval > 0); crut_wait(CRUT_EVENT_CONTINUE); crut_barrier(&barrier); do { retval = read_long(fd, buf, bufsize); bytes_read += retval; if (retval != 0 && retval != bufsize) { CRUT_FAIL( "read_long returned wrong number of bytes (%d) from pipe!", retval); retval = -1; goto out; } } while (retval > 0); retval = bytes_read; out: return retval; } static int write_pipe_large(int fd) { int bytes_written; int retval = -1; int bufsize = LARGE_BUF_SIZE; char *buf; buf = pattern_get_data(bufsize, 0); if (buf == NULL) { perror("pattern_get_data"); goto out; } bytes_written = 0; while (!crut_poll(CRUT_EVENT_CONTINUE) || bytes_written < PIPE_LARGE_MIN) { retval = write_long(fd, buf, bufsize); bytes_written += retval; if (retval != bufsize) { CRUT_FAIL( "write_long wrote only %d bytes (expected %d) to pipe!", retval, bufsize); retval = -1; goto out; } } retval = write_finished(fd); if (retval < 0) { perror("write"); goto out; } crut_barrier(&barrier); while (!crut_poll(CRUT_EVENT_TEARDOWN) || bytes_written < PIPE_LARGE_MIN) { retval = write_long(fd, buf, bufsize); bytes_written += retval; if (retval != bufsize) { CRUT_FAIL( "write_long wrote only %d bytes (expected %d) to pipe!", retval, bufsize); retval = -1; goto out; } } retval = write_finished(fd); if (retval < 0) { perror("write"); goto out; } retval = bytes_written; out: return retval; } /* * our threads for pipe_block sit here and do this for a while */ static void * do_pipe_block_io(void *p) { int retval; int *thread_ret; struct pipe_struct *testpipe = (struct pipe_struct *) p; int total = 0; thread_ret = malloc(sizeof(*thread_ret)); if (thread_ret == NULL) { goto out_nomem; } CRUT_DEBUG("crut_wait(precheckpoint)"); retval = crut_wait(CRUT_EVENT_PRECHECKPOINT); if (retval < 0) { goto out; } switch (testpipe->pipe_flags & O_ACCMODE) { case O_RDONLY: retval = read_pipe_large(testpipe->pipe_fd); if (retval < 0) { perror("read"); goto out; } CRUT_DEBUG("reader: returning %d", retval); total = retval; break; case O_WRONLY: retval = write_pipe_large(testpipe->pipe_fd); if (retval < 0) { perror("write"); goto out; } total = retval; CRUT_DEBUG("writer: returning %d", retval); break; default: CRUT_FAIL("Bad flags on pipe."); retval = -1; break; } out: *thread_ret = retval; pthread_exit(thread_ret); /* never reached */ return NULL; out_nomem: pthread_exit(NULL); /* never reached */ return NULL; } static int pipe_test(void) { return read_pipe_small(&pipe_array[0]); } static int pipe_block_generic_setup(void **testdata, int num_threads) { int retval; pthread_t *test_threads; signal(SIGPIPE, sigpipe_handler); retval = init_pipe_struct_array(num_threads/2); if (retval < 0) { test_threads = NULL; goto out; } test_threads = init_pipe_block_threads(num_threads); if (test_threads == NULL) { /* Note. We don't bother to clean up pipe_array in this case. */ retval = -1; goto out; } out: *testdata = test_threads; return retval; } static int pipe_block_setup(void **testdata) { return pipe_block_generic_setup(testdata, 2); } static int pipe_block_many_setup(void **testdata) { return pipe_block_generic_setup(testdata, PIPES_MAX); } static int pipe_block_generic_precheckpoint(void *p) { int retval = 0; CRUT_DEBUG("Getting ready to checkpoint"); return retval; } static int pipe_block_generic_continue(void *p) { int retval = 0; CRUT_DEBUG("Continuing after checkpoint."); crut_barrier(&barrier); return retval; } static int pipe_block_generic_restart(void *p) { int retval = 0; CRUT_DEBUG("Restarting from checkpoint."); crut_barrier(&barrier); return retval; } static int pipe_block_generic_teardown(void *p, int num_threads) { int retval; int join_ret; pthread_t *threads = (pthread_t *) p; int thread_ret[num_threads]; void *result; int i; retval = 0; for (i = 0; i < num_threads; ++i) { CRUT_DEBUG("waiting for %d...", i); join_ret = pthread_join(threads[i], &result); if (join_ret) { /* what else can we do? */ perror("pthread_join"); retval = join_ret; } /* check return value from thread */ if (result != NULL) { thread_ret[i] = *(int *) result; free(result); CRUT_DEBUG("Thread %d. return *(%p)=%d.", i, result, thread_ret[i]); if (thread_ret[i] < 0) { CRUT_FAIL("Thread %d failed (return %d)", i, thread_ret[i]); retval = thread_ret[i]; } } else { CRUT_FAIL("Thread %d suffered a fatal error (returned NULL)", i); } } if (retval < 0) { goto out; } /* now make sure the byte counts match */ for (i = 0; i < num_threads; i += 2) { if (thread_ret[i] != thread_ret[i + 1]) { CRUT_FAIL("Byte transfer mismatch! Reader reported %d, but writer reported %d", thread_ret[i], thread_ret[i + 1]); retval = -1; } } out: free(p); CRUT_DEBUG("returning %d", retval); return retval; } static int pipe_block_teardown(void *p) { return pipe_block_generic_teardown(p, 2); } static int pipe_block_many_teardown(void *p) { return pipe_block_generic_teardown(p, PIPES_MAX); } static int pipe_rw_pre(void *p) { return pipes_pre(TEST_BLOCKING); } static int pipe_rw_restart(void *p) { return pipe_test(); } #if TEST_PIPE_FCNTL static int pipe_setsize_pre(void *p) { return pipes_pre(TEST_SETSIZE); } static int pipe_setsize_restart(void *p) { long pipe_size; if (!have_pipe_fcntl) return 0; /* Nothing to test */ CRUT_DEBUG("Checking value of F_GETPIPE_SZ."); pipe_size = fcntl(pipe_array[0].pipe_fd, F_GETPIPE_SZ, 0); if (pipe_size != test_pipe_size) { CRUT_FAIL("F_GETPIPE_SZ returned %ld instead of %ld", pipe_size, test_pipe_size); } return pipe_test(); } #endif static int pipe_nonblock_pre(void *p) { return pipes_pre(TEST_NONBLOCKING); } static int pipe_nonblock_restart(void *p) { return pipe_test(); } static int pipe_many_setup(void **p) { int retval; signal(SIGPIPE, sigpipe_handler); CRUT_DEBUG("Creating pipes"); retval = init_pipe_struct_array(PIPES_MAX/2); if (retval < 0) { *p = NULL; goto out; } *p=NULL; out: return retval; } static int pipe_many_pre(void *p) { int retval = 0; int i; for (i=1; i2 threads)", test_setup:pipe_block_many_setup, test_precheckpoint:pipe_block_generic_precheckpoint, test_continue:pipe_block_generic_continue, test_restart:pipe_block_generic_restart, test_teardown:pipe_block_many_teardown, }; /* add the basic tests */ crut_add_test(&pipe_test_ops); #if TEST_PIPE_FCNTL /* add the basic tests */ crut_add_test(&pipe_setpipe_sz_ops); #endif /* add the non-blocking pipe test */ crut_add_test(&pipe_nonblock_ops); /* add the many pipe test */ crut_add_test(&pipe_many_ops); /* add the blocking pipe test */ crut_add_test(&pipe_block_ops); /* add the many-thread pipe test */ crut_add_test(&pipe_block_many_ops); ret = crut_main(argc, argv); return ret; } blcr-0.8.5/tests/save_aux.c0000664000000000000000000000757611042543127012476 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2007, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * 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 * * $Id: save_aux.c,v 1.8 2008/07/26 06:38:15 phargrov Exp $ * * Simple program to generate mmaps() as requred for testing --save-* options */ #include #include #include #include #include #include #include #include #include #include #include "crut_util.h" static const char *chkpt_cmd; void checkpoint_self(const char *chkpt_args) { char *cmd = NULL; int ret; cmd = crut_aprintf("exec %s %s %d", chkpt_cmd, chkpt_args, (int)getpid()); ret = system(cmd); if (!WIFEXITED(ret) || WEXITSTATUS(ret)) { fprintf(stderr, "'%s' failed %d (%d)\n", cmd, ret, WEXITSTATUS(ret)); exit(1); } free(cmd); } void validate(volatile char **addr, int count, int pagesize) { int i; for (i=0; i #include #include #include #include #include #include "crut_util.h" #define LIMIT 30 static volatile int dummy = 0; static volatile int counter = 0; static volatile int done = 0; static int my_callback(void *arg) { printf("%d enter callback\n", 3*counter+1); (void)cr_checkpoint(CR_CHECKPOINT_READY); printf("%d leave callback\n", 3*counter+2); return 0; } static void *thread_main(void *arg) { cr_client_id_t my_id; cr_callback_id_t cb_id; my_id = cr_init(); if (my_id < 0) { printf("XXX cr_init() failed\n"); exit(-1); } cb_id = cr_register_callback(my_callback, NULL, CR_SIGNAL_CONTEXT); if (cb_id < 0) { printf("XXX cr_register_callback() unexpectedly returned %d\n", cb_id); exit(-1); } fprintf(stderr, "cs_enter_leave2:"); crut_progress_start(time(NULL), LIMIT, 10); do { int prev = dummy; printf("%d issue request %d\n", 3*counter, counter); crut_checkpoint_block(NULL); ++counter; while (dummy == prev) sched_yield(); // Avoid overflowing stack with nested signal frames } while (crut_progress_step(time(NULL))); done = 1 | dummy; return NULL; } int main(void) { pthread_t th; int join_ret; void *join_val; cr_client_id_t my_id; setlinebuf(stdout); printf("#ST_ALARM:%d\n", 2*LIMIT); my_id = cr_init(); if (my_id < 0) { printf("XXX cr_init() failed\n"); exit(-1); } if (crut_pthread_create(&th, NULL, &thread_main, NULL) != 0) { printf("XXX pthread_create() unexpectedly failed\n"); exit(-1); } do { cr_enter_cs(my_id); dummy = dummy ^ counter; cr_leave_cs(my_id); } while (!done); join_ret = pthread_join(th, &join_val); if (join_ret || join_val) { printf("XXX pthread_join() unexpectedly failed\n"); exit(-1); } printf("%d DONE\n", 3*counter); return 0; } blcr-0.8.5/tests/testcxx.cc0000664000000000000000000000722111145421410012505 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2009, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * 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 * * $Id: testcxx.cc,v 1.2.2.2 2009/02/14 01:48:56 phargrov Exp $ */ const char description[] = "This test just verifies we can compile and link a C++ program\n"; // Run these all past C++ (even though some are redundant) #include "crut.h" #include "crut_util.h" #include "libcr.h" #include #include #include #include using namespace std; int misc_stuff(void) { // Misc stuff to test for regression of past known problems struct cr_rstrt_relocate *s; s = (struct cr_rstrt_relocate *)malloc(CR_RSTRT_RELOCATE_SIZE(CR_MAX_RSTRT_RELOC)); return 0; } static int my_callback(void* arg) { int rc; cout << "003 in callback before calling cr_checkpoint()" << endl; rc = cr_checkpoint(0); if (!rc) { cout << "004 in callback continuing after calling cr_checkpoint()" << endl; } else { cout << "XXX cr_checkpoint(0) unexpectedly returned " << rc << endl; } return 0; } int main(void) { cr_callback_id_t cb_id; cr_client_id_t my_id; pid_t my_pid; char *filename; int rc; struct stat s; rc = misc_stuff(); my_pid = getpid(); filename = crut_aprintf("context.%d", my_pid); (void)unlink(filename); // might fail silently cout << "000 Process started with pid " << my_pid << endl; cout << "#ST_ALARM:120" << endl; my_id = cr_init(); if (my_id < 0) { cout << "XXX cr_init() failed, returning " << my_id << endl; exit(-1); } else { cout << "001 cr_init() succeeded" << endl; } cb_id = cr_register_callback(my_callback, NULL, CR_SIGNAL_CONTEXT); if (cb_id < 0) { cout << "XXX cr_register_callback() unexpectedly returned " << cb_id << endl; exit(-1); } else { cout << "002 cr_register_callback() correctly returned " << cb_id << endl; } // Request a blocking checkpoint of ourself rc = crut_checkpoint_block(filename); if (rc < 0) { cout << "XXX crut_checkpoint_block() unexpectedly returned " << rc << " (errno: " << cr_strerror(errno) << ")" << endl; exit(-1); } // Did we at least create the file? rc = stat(filename, &s); if (rc) { cout << "XXX stat() unexpectedly returned " << rc << endl; exit(-1); } else { cout << "005 stat(" << filename << ") correctly returned 0" << endl; } // Is the file non-empty if (s.st_size == 0) { cout << "XXX context file unexpectedly empty" << endl; exit(-1); } else { cout << "006 " << filename << " is non-empty" << endl; } (void)unlink(filename); // might fail silently cout << "007 DONE" << endl; return 0; } blcr-0.8.5/tests/math.c0000664000000000000000000000601211114634726011602 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2003, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * 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 * * $Id: math.c,v 1.3 2008/12/01 01:11:50 phargrov Exp $ * * Simple example for using crut */ #include #include #include #include #include #include #include #include #include "crut.h" /* Peform some simple math in callback to ensure used_math() will * be non-zero when the checkpoint is taken on an i386 or x86_64. */ static double dummy = 1.23; static int math_callback(void *arg) { dummy *= (unsigned long)arg; #if defined(__i386__) || defined(__x86_64__) { double r, q = dummy; __asm__ __volatile__ ("fldl %0" : : "m"(dummy)); (void)cr_checkpoint(CR_CHECKPOINT_READY); __asm__ __volatile__ ("fstpl %0" : "=m"(r)); if (r != q) { CRUT_FAIL("FP restore failure %g != %g\n", r, q); return -1; } } #endif return 0; } static int math_setup(void **testdata) { CRUT_DEBUG("Initializing math."); *testdata = NULL; cr_register_callback(math_callback, (void *)(unsigned long)getppid(), CR_SIGNAL_CONTEXT); cr_register_callback(math_callback, (void *)(unsigned long)getpid(), CR_THREAD_CONTEXT); return 0; } static int math_precheckpoint(void *p) { CRUT_DEBUG("Testing sanity before we checkpoint"); return (dummy > 0.0); } static int math_continue(void *p) { CRUT_DEBUG("Continuing after checkpoint."); return (dummy > 0.0); } static int math_restart(void *p) { CRUT_DEBUG("Restarting from checkpoint."); return (dummy > 0.0); } int main(int argc, char *argv[]) { int ret; struct crut_operations math_test_ops = { test_scope:CR_SCOPE_PROC, test_name:"math", test_description:"Simple test using the FPU.", test_setup:math_setup, test_precheckpoint:math_precheckpoint, test_continue:math_continue, test_restart:math_restart, test_teardown:NULL, }; /* add the basic tests */ crut_add_test(&math_test_ops); ret = crut_main(argc, argv); return ret; } blcr-0.8.5/tests/zsh_test.sh0000664000000000000000000000202611015415407012676 00000000000000#!/bin/sh # # Test of checkpoint/restart of a zsh script. # Note that the outer script is bash # Check for zsh zsh -c true || exit 77 . ${cr_testsdir:-`dirname $0`}/shellinit \rm -f Context[123] .Context[123].tmp 2>/dev/null bash <<-'__OUTER__' exec 2>/dev/null # Drop job control message(s) from the outer script echo '#ST_ALARM:120' $cr_run zsh 2>&1 <<-'__INNER__' zsh -c 'for ((i=0; $i<=15; ++i)); do echo $i Hello; sleep 1; done' & pid=$! sleep 3 echo "# Checkpoint original child" $cr_checkpoint --file=Context1 --tree --term $pid wait sleep 1 echo "# Restart 1" $cr_restart Context1 & pid=$! sleep 3 echo "# Checkpoint restarted child" $cr_checkpoint --file=Context2 --tree --term $pid wait sleep 1 echo "# Restart^2" $cr_restart Context2 & pid=$! sleep 3 echo "# Checkpoint self" $cr_checkpoint --file=Context3 --term --tree $$ wait echo "16 DONE" __INNER__ exec 2>&1 sleep 3 echo "# Restart shell" $cr_restart Context3 __OUTER__ \rm -f Context[123] .Context[123].tmp 2>/dev/null blcr-0.8.5/tests/reloc_file.sh0000664000000000000000000000106411015417120013131 00000000000000#!/bin/sh set -e . ${cr_testsdir:-`dirname $0`}/shellinit context=`pwd`/Context1 # TMPDIR=`cd ${TMPDIR:-/tmp} && $cr_pwd` MY_TMPDIR1=`mktemp -d ${TMPDIR}/blcr_reloc.XXXXXX` MY_TMPDIR2=`mktemp -d ${TMPDIR}/blcr_reloc.XXXXXX` trap "\rm -rf ${MY_TMPDIR1} ${MY_TMPDIR2} $context 2>/dev/null" 0 cp -f ${cr_testsdir}/reloc_aux ${MY_TMPDIR1}/reloc_exe ${cr_run} ${MY_TMPDIR1}/reloc_exe ${MY_TMPDIR1} "$context --clobber" # Move the open() file mv -f ${MY_TMPDIR1}/reloc_tmp ${MY_TMPDIR2}/ ${cr_restart} --relocate ${MY_TMPDIR1}/reloc_tmp=${MY_TMPDIR2}/reloc_tmp $context blcr-0.8.5/tests/CountingApp.java0000664000000000000000000000065210643236634013605 00000000000000/** * The CountingApp class implements an application that * simply prints "X Hello" to standard output for X * from 0 to 9, pausing 1 second between each line. */ class CountingApp { public static void main(String[] args) throws InterruptedException { for (int i = 0; i < 10; ++i) { System.out.print(i); System.out.println(" Hello"); Thread.sleep(1000); } } } blcr-0.8.5/tests/save_priv.sh0000664000000000000000000000055711011503203013024 00000000000000#!/bin/sh set -e . ${cr_testsdir:-`dirname $0`}/shellinit context=Context1 # cp -f ${cr_testsdir}/save_aux tstexe trap "\rm -f $context tstexe tstmap[12] 2>/dev/null" 0 rm -f tstmap[12] ${cr_run} ./tstexe "--file $context --clobber --save-private" P # Unlink and overwrite exec; unlink mmap()ed file rm -f tstexe tstmap[12] cp /dev/null tstexe ${cr_restart} $context blcr-0.8.5/tests/dlopen.sh0000664000000000000000000000054111014417411012310 00000000000000#!/bin/sh # Checks that dlopen("libcr.so") work. # Includes attempts to trigger bug 2263 (in its orginally reported form) . ${cr_testsdir:-`dirname $0`}/shellinit env LD_LIBRARY_PATH=${cr_libpath}${LD_LIBRARY_PATH} ${cr_testsdir}/dlopen_aux || exit $? ${cr_run} ${cr_testsdir}/dlopen_aux || exit $? ${cr_run} --omit ${cr_testsdir}/dlopen_aux || exit $? blcr-0.8.5/tests/failed_cb2.c0000664000000000000000000002267311147140444012631 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2008, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * 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 * * $Id: failed_cb2.c,v 1.7.12.1 2009/02/19 02:17:08 phargrov Exp $ */ const char description[] = "Description of failed_cb2:\n" "\n" " Verifies that when a callback invokes cr_checkpoint() with a non-zero\n" " argument, additional callbacks will be skipped.\n" " Differs from failed_cb by using THREAD_CONTEXT instead of SIGNAL, and\n" " by changes required by that difference.\n" "\n" "In a successful run, expect lines of output in SORTED order.\n" ; #include #include #include #include #include #include "crut_util.h" static char *filename = NULL; /* As requester of a checkpoint completed IN ERROR, we can see * completion before the thread callbacks finish. * This is our interlock. */ static pthread_mutex_t my_lock = PTHREAD_MUTEX_INITIALIZER; static int thread_ran = 0; static int my_checkpoint(void) { int retval; thread_ran = 0; retval = crut_checkpoint_block(filename); /* There is a small race between end of the callbacks * and the return to the IDLE state. */ while (cr_status() == CR_STATE_PENDING) { pthread_mutex_lock(&my_lock); sched_yield(); pthread_mutex_unlock(&my_lock); } return retval; } static int callback0(void* arg) { printf("XXX enter 'other' callback unexpectedly\n"); return 0; } static int callback1(void* arg) { static int count = 0; int rc; switch (count) { case 0: printf("007 enter callback1 (TEMP)\n"); rc = cr_checkpoint(CR_CHECKPOINT_TEMP_FAILURE); if (rc >= 0) { printf("XXX resuming unexpectedly in callback1\n"); exit(-1); } else if (rc != -CR_ETEMPFAIL) { printf("XXX callback1: checkpoint TEMP cancellation failed: %d (%s)\n", rc, cr_strerror(-rc)); exit(-1); } else { printf("008 checkpoint cancelled successfully with TEMP fail\n"); } break; case 1: printf("013 enter callback1 (OMIT)\n"); rc = cr_checkpoint(CR_CHECKPOINT_OMIT); if (rc >= 0) { printf("XXX resuming unexpectedly in callback_TEMP (rc=%d)\n", rc); exit(-1); } else if (rc != -CR_EOMITTED) { printf("XXX callback1: checkpoint OMIT cancellation failed: %d (%s)\n", rc, cr_strerror(-rc)); exit(-1); } else { printf("014 checkpoint cancelled successfully with OMIT\n"); } break; case 2: printf("019 enter callback1 (TEMP_CODE)\n"); rc = cr_checkpoint(CR_CHECKPOINT_TEMP_FAILURE_CODE(911)); if (rc >= 0) { printf("XXX resuming unexpectedly in callback_TEMP_CODE (rc=%d)\n", rc); exit(-1); } else if (rc != -911) { printf("XXX callback1: checkpoint TEMP_CODE cancellation failed: %d (%s)\n", rc, cr_strerror(-rc)); exit(-1); } else { printf("020 checkpoint cancelled successfully with TEMP_CODE\n"); } break; default: (void)unlink(filename); /* ICK */ printf("025 enter callback1 (PERM)\n"); printf("026 DONE\n"); (void)cr_checkpoint(CR_CHECKPOINT_PERM_FAILURE); printf("XXX cr_checkpoint(CR_CHECKPOINT_PERM_FAILURE) returned unexpectedly\n"); exit(-1); } ++count; return 0; } static int callback2(void* arg) { static int count = 0; int rc; pthread_mutex_lock(&my_lock); switch (count) { case 0: printf("006 in callback2 (TEMP)\n"); rc = cr_checkpoint(0); if (rc >= 0) { printf("XXX resuming unexpectedly in callback2\n"); exit(-1); } else if (rc != -CR_ETEMPFAIL) { printf("XXX callback2: checkpoint TEMP cancellation failed: %d (%s)\n", rc, cr_strerror(-rc)); exit(-1); } else { printf("009 checkpoint cancelled successfully with TEMP fail\n"); } break; case 1: printf("012 in callback2 (OMIT)\n"); rc = cr_checkpoint(0); if (rc >= 0) { printf("XXX resuming unexpectedly in callback2\n"); exit(-1); } else if (rc != -CR_EOMITTED) { printf("XXX callback2: checkpoint OMIT %d (%s)\n", rc, cr_strerror(-rc)); exit(-1); } else { printf("015 checkpoint cancelled successfully with OMIT\n"); } break; case 2: printf("018 in callback2 (TEMP_CODE)\n"); rc = cr_checkpoint(0); if (rc >= 0) { printf("XXX resuming unexpectedly in callback2\n"); exit(-1); } else if (rc != -911) { printf("XXX callback2: checkpoint TEMP_CODE %d (%s)\n", rc, cr_strerror(-rc)); exit(-1); } else { printf("021 checkpoint cancelled successfully with TEMP_CODE\n"); } break; default: printf("024 in callback0 (PERM)\n"); (void)cr_checkpoint(0); printf("XXX unexpected return from final checkpoint\n"); } ++count; thread_ran = 1; pthread_mutex_unlock(&my_lock); return 0; } int main(void) { pid_t my_pid; cr_callback_id_t cb_id; cr_client_id_t my_id; int rc; setlinebuf(stdout); my_pid = getpid(); filename = crut_aprintf("context.%d", my_pid); printf("000 Process started with pid %d\n", my_pid); if (crut_is_linuxthreads()) { fprintf(stderr, "Skipping threaded 'failed_cb2' test due to LinuxThreads issues\n"); printf("001 DONE\n"); return 77; } printf("#ST_ALARM:120\n"); printf("#ST_SIGNAL:9\n"); my_id = cr_init(); if (my_id < 0) { printf("XXX cr_init() failed, returning %d\n", my_id); exit(-1); } else { printf("001 cr_init() succeeded\n"); } cb_id = cr_register_callback(callback0, NULL, CR_THREAD_CONTEXT); if (cb_id < 0) { printf("XXX cr_register_callback() unexpectedly returned %d\n", cb_id); exit(-1); } else { printf("002 cr_register_callback() correctly returned %x\n", cb_id); } cb_id = cr_register_callback(callback1, NULL, CR_THREAD_CONTEXT); if (cb_id < 0) { printf("XXX cr_register_callback() unexpectedly returned %d\n", cb_id); exit(-1); } else { printf("003 cr_register_callback() correctly returned %x\n", cb_id); } cb_id = cr_register_callback(callback2, NULL, CR_THREAD_CONTEXT); if (cb_id < 0) { printf("XXX cr_register_callback() unexpectedly returned %d\n", cb_id); exit(-1); } else { printf("004 cr_register_callback() correctly returned %x\n", cb_id); } rc = cr_status(); if (rc != CR_STATE_IDLE) { printf("XXX cr_status() unexpectedly returned %d\n", rc); exit(-1); } else { printf("005 cr_status() correctly returned 0x%x\n", rc); } /* First pass... TEMP */ rc = my_checkpoint(); if (rc != CR_POLL_CHKPT_ERR_POST) { printf("XXX crut_checkpoint_block() unexpectedly returned %d\n", rc); exit(-1); } if (errno != CR_ETEMPFAIL) { printf("XXX crut_checkpoint_block() returned unexpected errno=%d(%s)\n", errno, cr_strerror(errno)); exit(-1); } printf("010 cr_poll_checkpoint() correctly returned w/ errno=CR_ETEMPFAIL\n"); rc = cr_status(); if (rc != CR_STATE_IDLE) { printf("XXX cr_status() unexpectedly returned 0x%x\n", rc); exit(-1); } else { printf("011 cr_status() correctly returned 0x%x\n", rc); } /* Second pass... OMIT */ rc = my_checkpoint(); if (rc != CR_POLL_CHKPT_ERR_POST) { printf("XXX crut_checkpoint_block() unexpectedly returned %d\n", rc); exit(-1); } if (errno != ESRCH) { printf("XXX crut_checkpoint_block() returned unexpected errno=%d(%s)\n", errno, cr_strerror(errno)); exit(-1); } printf("016 cr_poll_checkpoint() correctly returned w/ errno=ESRCH\n"); rc = cr_status(); if (rc != CR_STATE_IDLE) { printf("XXX cr_status() unexpectedly returned 0x%x\n", rc); exit(-1); } else { printf("017 cr_status() correctly returned 0x%x\n", rc); } /* Third pass... TEMP_CODE */ rc = my_checkpoint(); if (rc != CR_POLL_CHKPT_ERR_POST) { printf("XXX crut_checkpoint_block() unexpectedly returned %d\n", rc); exit(-1); } if (errno != 911) { printf("XXX crut_checkpoint_block() returned unexpected errno=%d(%s)\n", errno, cr_strerror(errno)); exit(-1); } printf("022 cr_poll_checkpoint() correctly returned user-specified errno=911\n"); rc = cr_status(); if (rc != CR_STATE_IDLE) { printf("XXX cr_status() unexpectedly returned 0x%x\n", rc); exit(-1); } else { printf("023 cr_status() correctly returned 0x%x\n", rc); } /* Final/fatal pass... PERM */ (void)my_checkpoint(); printf("XXX crut_checkpoint_block() returned unexpectedly\n"); return -1; } blcr-0.8.5/tests/cs_enter_leave.c0000664000000000000000000000605411125133373013627 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2008, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * 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 * * $Id: cs_enter_leave.c,v 1.13 2008/12/26 10:50:35 phargrov Exp $ */ #include #include #include #include #include #include #include "crut_util.h" #define LIMIT 30 static volatile int dummy = 0; static volatile int counter = 0; static volatile int done = 0; static int my_callback(void *arg) { printf("%d enter callback\n", 3*counter+1); (void)cr_checkpoint(CR_CHECKPOINT_READY); printf("%d leave callback\n", 3*counter+2); return 0; } static void *thread_main(void *arg) { cr_client_id_t my_id; my_id = cr_init(); if (my_id < 0) { printf("XXX cr_init() failed\n"); exit(-1); } fprintf(stderr, "cs_enter_leave:"); crut_progress_start(time(NULL), LIMIT, 10); do { int prev = dummy; printf("%d issue request %d\n", 3*counter, counter); crut_checkpoint_block(NULL); ++counter; while (dummy == prev) sched_yield(); // Avoid overflowing stack with nested signal frames } while (crut_progress_step(time(NULL))); done = 1 | dummy; return NULL; } int main(void) { pthread_t th; int join_ret; void *join_val; cr_callback_id_t cb_id; cr_client_id_t my_id; setlinebuf(stdout); printf("#ST_ALARM:%d\n", 2*LIMIT); my_id = cr_init(); if (my_id < 0) { printf("XXX cr_init() failed\n"); exit(-1); } cb_id = cr_register_callback(my_callback, NULL, CR_THREAD_CONTEXT); if (cb_id < 0) { printf("XXX cr_register_callback() unexpectedly returned %d\n", cb_id); exit(-1); } if (crut_pthread_create(&th, NULL, &thread_main, NULL) != 0) { printf("XXX pthread_create() unexpectedly failed\n"); exit(-1); } do { cr_enter_cs(my_id); dummy = dummy ^ counter; cr_leave_cs(my_id); } while (!done); join_ret = pthread_join(th, &join_val); if (join_ret || join_val) { printf("XXX pthread_join() unexpectedly failed\n"); exit(-1); } printf("%d DONE\n", 3*counter); return 0; } blcr-0.8.5/tests/csh_test.sh0000664000000000000000000000271011043752776012665 00000000000000#!/bin/sh # # Test of checkpoint/restart of a csh script. # Note that "outermost" shell is bash # First make certain we *have* a csh # Exit code 77 tells automake "test skipped" csh -c true || exit 77 . ${cr_testsdir:-`dirname $0`}/shellinit \rm -f Context[123] .Context[123].tmp 2>/dev/null bash <<-'__OUTER__' exec 2>/dev/null # Drop job control message(s) from the outer script echo '#ST_ALARM:120' $cr_run csh 2>&1 <<-'__INNER__' echo '#ST_IGNORE:^\[1\]' # Tell seq_wrapper to ignore job-control msgs echo '#ST_IGNORE:^[[:space:]]*$' # ...and the whitespace lines that may accompany them. csh <<'__EOF__' & foreach i (0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15) echo $i Hello sleep 1 end '__EOF__' set pid=$! sleep 3 echo "# Checkpoint $pid" $cr_checkpoint --file=Context1 --tree --term $pid sleep 2 echo "# Restart $pid" $cr_restart Context1 & set pid=$! sleep 4 echo "# Checkpoint cr_restart of $pid" $cr_checkpoint --file=Context2 --tree --term $pid sleep 2 echo "# Restart cr_restart of $pid" $cr_restart Context2 & set pid=$! sleep 4 echo "# Checkpoint self" $cr_checkpoint --file=Context3 --tree --term $$ # Work around a tcsh bug (BLCR bug 2028) that prevents using wait while { kill -0 $pid >& /dev/null } sleep 1 end echo "16 DONE" __INNER__ exec 2>&1 sleep 3 echo "# Restart of shell" $cr_restart Context3 __OUTER__ \rm -f Context[123] .Context[123].tmp 2>/dev/null blcr-0.8.5/tests/RUN_ME.in0000664000000000000000000000544411616320155012065 00000000000000#!/bin/sh ## ## This script sets up the envirnoment as needed. ## So, run this script instead of running these tests directly. ## ## To run a subset of tests, pass them as script arguments. ## ## This script creates temporary files in a subdirectory of ## $TMPDIR (defaulting to /tmp if $TMPDIR is unset). ## # The bulk of this file is based on the "check-TESTS" target # in a Makefile.in generated by automake, which carries the # following two notices: # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005 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. # End of legal notices if (/sbin/lsmod | grep '^blcr ' > /dev/null 2>&1); then true else echo '#############################################################' echo '#### BLCR modules are not loaded. Cannot run the tests! ####' echo '#### You must insmod/modprobe the following modules as ####' echo '#### root (in order) before you can run the test suite. ####' echo '#### blcr_imports blcr_vmadump blcr ####' echo '#############################################################' exit 1 fi # init_dir=`pwd` cr_testsdir=`dirname $0` case "$cr_testsdir" in /*) ;; *) cr_testsdir="$init_dir/$cr_testsdir";; esac export cr_testsdir tmp_dir=`mktemp -d "${TMPDIR:-/tmp}/blcrtests.XXXXXXXXXX"` || exit 1 cd $tmp_dir # export LIBCR_DISABLE_NSCD=1 top_srcdir="INVALID"; export top_srcdir cr_checkpoint="%bindir%/cr_checkpoint"; export cr_checkpoint cr_restart="%bindir%/cr_restart"; export cr_restart cr_run="%cr_run%"; export cr_run cr_pwd="%cr_pwd%"; export cr_pwd count=0; FAIL=0; PASS=0; SKIP=0; if test $# -eq 0; then list="%tests%" else list="$*" fi # for tst in $list; do $cr_testsdir/$tst case $? in 0) result=PASS; count=`expr $count + 1`;; 77) result=SKIP;; *) result=FAIL; count=`expr $count + 1`;; esac echo "${result}: $tst" eval "$result=\`expr \$$result + 1\`" done if test $FAIL -eq 0; then banner="All $count tests passed" else banner="$FAIL of $count tests failed" fi dashes="$banner" if test $SKIP -ne 0; then skipped="($SKIP tests were not run)" if test `echo "$banner"|wc -c` -lt `echo "$skipped"|wc -c`; then dashes="$skipped" fi fi dashes=`echo "$dashes" | sed s/./=/g` echo "$dashes" echo "$banner" if test "$SKIP" -ne 0; then echo "$skipped" fi echo "$dashes" cd $init_dir sleep 2 # avoid NFS "issues" rm -Rf $tmp_dir test $FAIL -eq 0 exit $? blcr-0.8.5/tests/pause.c0000664000000000000000000000012610754656447012003 00000000000000#include int main(void) { alarm(120); while (1) pause(); return 1; } blcr-0.8.5/tests/bash_test.sh0000664000000000000000000000302411015415407013006 00000000000000#!/bin/sh # # Test of checkpoint/restart of a bash script. # The two inner-most shells here are the actual tested code. # The first nested shell checkpoints and restarts the # inner-most and then finally checkpoints itself. # Outer-most shell is just to discard the stderr generated # when its child dies from a self-inflicted SIGTERM. # # In addition to checkpointing and restarting bash, this # test also tests checkpoint/restart of the cr_restart # and cr_checkpoint executables. The cr_restart command is # tested both as "root" of a checkpoint (in Context2) # and as child of the shell (in Context3). The cr_checkpoint # command (for Context3) checkpoints itself. # . ${cr_testsdir:-`dirname $0`}/shellinit \rm -f Context[123] .Context[123].tmp 2>/dev/null bash <<-'__OUTER__' exec 2>/dev/null # Drop job-control messages echo '#ST_ALARM:120' $cr_run bash <<-'__INNER__' bash -c 'for ((i=0; $i<=15; ++i)); do echo $i Hello; sleep 1; done' & pid=$! sleep 3 echo "# Checkpoint original child" $cr_checkpoint --file=Context1 --tree --term $pid wait sleep 1 echo "# Restart 1" $cr_restart Context1 & pid=$! sleep 3 echo "# Checkpoint restarted child" $cr_checkpoint --file=Context2 --tree --term $pid wait sleep 1 echo "# Restart^2" $cr_restart Context2 & pid=$! sleep 3 echo "# Checkpoint self" $cr_checkpoint --file=Context3 --term --tree $$ wait echo "16 DONE" __INNER__ exec 2>&1 sleep 3 echo "# Restart shell" $cr_restart Context3 __OUTER__ \rm -f Context[123] .Context[123].tmp 2>/dev/null blcr-0.8.5/tests/perl_test.sh0000664000000000000000000000272111015415407013036 00000000000000#!/bin/sh # # Test of checkpoint/restart of a perl script. # Note that the outer shell script is bash . ${cr_testsdir:-`dirname $0`}/shellinit \rm -f Context[123] .Context[123].tmp 2>/dev/null bash <<-'__OUTER__' exec 2>/dev/null # Drop job control message(s) from the outer script echo '#ST_ALARM:120' $cr_run perl 2>&1 <<-'__INNER__' my $chkpt_cmd=$ENV{'cr_checkpoint'}; my $rstrt_cmd=$ENV{'cr_restart'}; sub checkpoint($$) { my ($file, $pid) = @_; my $cmd = "$chkpt_cmd --file=$file --tree --term $pid"; #print "# $cmd\n"; system("$cmd"); if ($pid != $$) { waitpid($pid, 0); } sleep 1; } sub restart($) { my ($file) = @_; my $cmd = "$rstrt_cmd $file"; #print "# $cmd\n"; defined(my $pid = fork()) || die; if (!$pid) { exec($cmd); exit(1); } sleep 3; $pid; } $|=1; defined(my $pid = fork()) || die; if (!$pid) { foreach $i (0..15) { print "$i Hello\n"; sleep 1;}; exit 0; } sleep 3; print "# Checkpoint original child\n"; checkpoint('Context1',$pid); print "# Restart 1\n"; $pid = restart('Context1'); print "# Checkpoint restarted child\n"; checkpoint('Context2',$pid); print "# Restart^2\n"; $pid = restart('Context2'); print "# Checkpoint self\n"; checkpoint('Context3',$$); waitpid($pid, 0); print "16 DONE\n"; __INNER__ exec 2>&1 sleep 3 echo "# Restart interpreter" $cr_restart Context3 __OUTER__ \rm -f Context[123] .Context[123].tmp 2>/dev/null blcr-0.8.5/tests/crut_util.c0000664000000000000000000003633412071211375012667 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2008, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * 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 * * $Id: crut_util.c,v 1.31.6.2 2013/01/03 05:11:25 phargrov Exp $ * * Utility functions for BLCR tests (excluding threaded portions) */ #define _GNU_SOURCE /* For strndup() */ #include #include #include #include #include #include #include #include #include #include #include #include "crut_util.h" /* * Tracing/debugging output */ unsigned int crut_trace_mask = CRUT_TRACE_DEFAULT; char *crut_program_name = "a.out"; /* Silly default */ void crut_print_trace(const char *file, int line, const char *func, const char * fmt, ...) { va_list args; char buf[4096]; va_start(args, fmt); vsnprintf(buf, sizeof(buf), fmt, args); va_end(args); fprintf(stderr, "%s[%d]: file \"%s\", line %d, in %s: %s\n", crut_program_name, (int)getpid(), file, line, func, buf); fflush(stderr); } /* * statcmp * * Compares two struct stats. */ int statcmp(struct stat *s1, struct stat *s2, unsigned long type) { int retval = 0; if (type & ST_DEV) { retval += s1->st_dev != s2->st_dev; } if (type & ST_INO) { retval += s1->st_ino != s2->st_ino; } if (type & ST_MODE) { retval += s1->st_mode != s2->st_mode; } if (type & ST_NLINK) { retval += s1->st_nlink != s2->st_nlink; } if (type & ST_UID) { retval += s1->st_uid != s2->st_uid; } if (type & ST_GID) { retval += s1->st_gid != s2->st_gid; } if (type & ST_RDEV) { retval += s1->st_rdev != s2->st_rdev; } if (type & ST_SIZE) { retval += s1->st_size != s2->st_size; } if (type & ST_BLKSIZE) { retval += s1->st_blksize != s2->st_blksize; } if (type & ST_BLOCKS) { retval += s1->st_blocks != s2->st_blocks; } if (type & ST_ATIME) { retval += s1->st_atime != s2->st_atime; } if (type & ST_MTIME) { retval += s1->st_mtime != s2->st_mtime; } if (type & ST_CTIME) { retval += s1->st_ctime != s2->st_ctime; } return retval; } void dump_stat(struct stat *s) { CRUT_DEBUG("dev\t%llu", (unsigned long long)s->st_dev); /* device */ CRUT_DEBUG("ino\t%lu", (unsigned long)s->st_ino); /* inode */ CRUT_DEBUG("mode\t%u", (unsigned)s->st_mode); /* protection */ CRUT_DEBUG("nlink\t%u", (unsigned)s->st_nlink); /* number of hard links */ CRUT_DEBUG("uid\t%u", (unsigned)s->st_uid); /* user ID of owner */ CRUT_DEBUG("gid\t%u", (unsigned)s->st_gid); /* group ID of owner */ CRUT_DEBUG("rdev\t%llu", (unsigned long long)s->st_rdev); /* device type (if inode device) */ CRUT_DEBUG("size\t%ld", (long)s->st_size); /* total size, in bytes */ CRUT_DEBUG("blksize\t%ld", (long)s->st_blksize); /* blocksize for filesystem I/O */ CRUT_DEBUG("blocks\t%ld", (long)s->st_blocks); /* number of blocks allocated */ CRUT_DEBUG("atime\t%ld", (long)s->st_atime); /* time of last access */ CRUT_DEBUG("mtime\t%ld", (long)s->st_mtime); /* time of last modification */ CRUT_DEBUG("ctime\t%ld", (long)s->st_ctime); /* time of last change */ } /* * pattern_fill * * Fill a blob of memory with a test pattern * * This is meant to mimic read on a fake test file. Would be * the same thing as * lseek(f, seed) * read(f, buf, length) */ void pattern_fill(char *s, int length, int seed) { int i=0; while (iparent = getpid(); CRUT_DEBUG("Creating pipes."); retval = pipe(fds1); if (retval < 0) { CRUT_FAIL("Error initializing pipes."); goto out; } retval = pipe(fds2); if (retval < 0) { CRUT_FAIL("Error initializing pipes."); goto out; } CRUT_DEBUG("Forking child."); retval = fork(); if (retval < 0) { CRUT_FAIL("Error forking child."); exit(errno ? errno : -1); } else if (!retval) { /* In the child */ pipes->child = getpid(); pipes->inpipe = fds1[0]; (void)close(fds1[1]); pipes->outpipe = fds2[1]; (void)close(fds2[0]); } else { /* In the parent */ pipes->child = retval; CRUT_DEBUG("Forked child %d", retval); pipes->inpipe = fds2[0]; (void)close(fds2[1]); pipes->outpipe = fds1[1]; (void)close(fds1[0]); } out: return retval; } /* Read 1 character from our peer. * Returns -1 on EOF, aborts on other errors. */ int crut_pipes_getchar(struct crut_pipes *pipes) { char c; int retval; do { retval = read(pipes->inpipe, &c, 1); } while ((retval < 0) && (errno == EINTR)); if (retval == 0) { retval = -1; /* EOF */ } else if (retval != 1) { CRUT_FAIL("retval=%d errno=%d (%s)", retval, errno, strerror(errno)); exit(-1); } else { retval = c; } return retval; } /* Read 1 character from our peer, checking for a specific value. * Aborts on EOF and other errors. * Does exit(char_read) on mismatch (to enable matching of wait() status). */ void crut_pipes_expect(struct crut_pipes *pipes, unsigned char expect) { int retval = crut_pipes_getchar(pipes); if (retval != (int)expect) { CRUT_DEBUG("recv unexpected value %d", retval); exit(retval); } CRUT_DEBUG("recv expected value %d", (int)expect); } /* Write 1 character to our peer. * Aborts on EOF and other errors (but SIGPIPE handler may also run on EOF). */ void crut_pipes_putchar(struct crut_pipes *pipes, unsigned char c) { int retval; do { retval = write(pipes->outpipe, &c, 1); } while ((retval < 0) && (errno == EINTR)); if (retval != 1) { CRUT_DEBUG("retval=%d errno=%d (%s)", retval, errno, strerror(errno)); exit(-1); } } /* Write len characters to our peer. * Aborts on EOF and other errors (but SIGPIPE handler may also run on EOF). */ void crut_pipes_write(struct crut_pipes *pipes, const char *s, size_t len) { int retval; while (len) { do { retval = write(pipes->outpipe, s, len); } while ((retval < 0) && (errno == EINTR)); if (retval < 1) { CRUT_DEBUG("retval=%d errno=%d (%s)", retval, errno, strerror(errno)); exit(-1); } len -= retval; s += retval; } } /* Close our pipes */ int crut_pipes_close(struct crut_pipes *pipes) { int retval = close(pipes->inpipe); if (retval >= 0) { retval = close(pipes->outpipe); } return retval; } /* Wait for the child, expecting a specific exit code. */ void crut_waitpid_expect(int child, unsigned char expect) { int rc, status; CRUT_DEBUG("waitpid(%d)", child); do { rc = waitpid(child, &status, 0); } while ((rc < 0) && (errno == EINTR)); /* retry on non-fatal signals */ if (rc < 0) { CRUT_FAIL("Failed to waitpid(%d) errno=%d (%s)", child, errno, strerror(errno)); exit(-1); } if ((rc != child) || !WIFEXITED(status) || (WEXITSTATUS(status) != expect)) { CRUT_FAIL("Error running child %d, waitpid returned %d, errno=%d, status=%d/%d (expecting rc=%d and status=%d/0)", child, rc, errno, status>>8, status&0xff, child, expect); exit(-1); } CRUT_DEBUG("Child %d exited with expected status %d", child, (int)expect); } /* Wait for the child, expecting a specific signal. */ void crut_waitpid_expect_signal(int child, unsigned char expect) { int rc, status; CRUT_DEBUG("waitpid(%d)", child); do { rc = waitpid(child, &status, 0); } while ((rc < 0) && (errno == EINTR)); /* retry on non-fatal signals */ if (rc < 0) { CRUT_FAIL("Failed to waitpid(%d) errno=%d (%s)", child, errno, strerror(errno)); exit(-1); } if ((rc != child) || !WIFSIGNALED(status) || (WTERMSIG(status) != expect)) { CRUT_FAIL("Error running child %d, waitpid returned %d, errno=%d, status=%d/%d (expecting rc=%d and status=0/%d)", child, rc, errno, status>>8, status&0xff, child, expect); exit(-1); } CRUT_DEBUG("Child %d exited with expected signal %d", child, (int)expect); } /* Look for the tests dir */ char *crut_find_testsdir(const char *argv0) { char *dalloc, *dir; char *base; char *result; size_t dirlen; base = crut_basename(argv0); dir = dirname(dalloc = strdup(argv0)); if (!strncmp("lt-", base, 3) && !strcmp(dir, ".")) { /* ARGV0=basename $PATH=testsdir/.libs:ORIG_PATH */ const char *p = getenv("PATH"); const char *q = strchr(p, ':'); free(dalloc); dir = dalloc = q ? strndup(p, q-p) : strdup(p); } /* Strip trailing "/.libs" from dir if present */ dirlen = strlen(dir); if ((dirlen > 5) && !strcmp("/.libs", dir + (dirlen - 6))) { /* ARGV0=testsdir/.libs/basename */ dir[dirlen - 6] = '\0'; } result = strdup(dir); free(base); free(dalloc); if (0 == access(result, R_OK)) return result; free(result); return NULL; } /* Look for the indicated cr_* command */ char *crut_find_cmd(const char *argv0, const char *prog) { char *dir; char *result; /* When run from Makefile or RUN_ME, fullpath is in environment */ if (NULL != (result = getenv(prog))) { if (0 == access(result, X_OK)) return strdup(result); } /* When run manually, try to use argv0 to locate the tests directory */ dir = crut_find_testsdir(argv0); if (dir) { result = crut_aprintf("%s/../bin/%s", dir, prog); free(dir); if (0 == access(result, X_OK)) return result; free(result); } /* All else has failed, let $PATH deal with it */ return strdup(prog); } /* For progress output */ static double crut_progress_mult, crut_progress_width, crut_progress_next; static long crut_progress_lo, crut_progress_hi; /* Convert positive integer to string. * Returns count of digits actually written. */ static int my_itoa(int val, int digits, char *buf) { int i; char *p = buf + digits - 1; /* Work right-aligned in buf */ for (i = 0; val && (i < digits); i++, p--) { div_t d = div(val, 10); *p = '0' + d.rem; val = d.quot; } /* Move to be left-aligned in buf */ memmove(buf, p+1, i); return i; } void crut_progress_start(long startval, long length, int steps) { crut_progress_lo = startval; crut_progress_hi = startval + length; crut_progress_width = (double)length / steps; if (crut_progress_width < 1.) crut_progress_width = 1.; crut_progress_next = crut_progress_lo + crut_progress_width; if (crut_progress_next > crut_progress_hi) crut_progress_next = crut_progress_hi; crut_progress_mult = 100.0 / (double)length; fflush(stderr); } int crut_progress_step(long currval) { if (currval >= crut_progress_next) { char buf[5]; int val = (crut_progress_mult * (double)(currval - crut_progress_lo)); int len = my_itoa(val, sizeof(buf)-2, buf+1); buf[0] = ' '; buf[len+1] = '%'; write(STDERR_FILENO, buf, len+2); do { crut_progress_next += crut_progress_width; } while (currval >= crut_progress_next); if (crut_progress_next > crut_progress_hi) crut_progress_next = crut_progress_hi; } if (currval >= crut_progress_hi) { write(STDERR_FILENO, "\n", 1); return 0; } else { return 1; } } /* Remove trailing newline if present */ char *crut_chomp(char *line) { char *p = line + strlen(line) - 1; if (*p == '\n') *p = '\0'; return line; } /* Like glibc's getline(), but not assuming has are using glibc */ int crut_getline(char **line_p, size_t *len_p, FILE *stream) { char *line = *line_p; size_t len = *len_p; size_t have; int retval = 0; if (!line) { len = 32; line = malloc(len); } if (!fgets(line, len, stream)) { retval = -1; goto out; } have = strlen(line); while ((have == (len-1)) && (line[have-1] != '\n')) { line = realloc(line, len*2); if (!fgets(line+have, len+1, stream)) { retval = -1; goto out; } len *= 2; have = strlen(line); } out: *len_p = len; *line_p = line; return retval; } static char *crut_vsappendf(char *s, const char *fmt, va_list args) { int old_len, add_len; /* Only one pass permitted per va_start() */ va_list args2; va_copy(args2, args); /* compute length of thing to append */ add_len = vsnprintf(NULL, 0, fmt, args); /* grow the string, including space for '\0': */ if (s) { old_len = strlen(s); s = realloc(s, old_len + add_len + 1); } else { old_len = 0; s = malloc(add_len + 1); } /* append */ vsnprintf((s + old_len), (old_len + add_len + 1), fmt, args2); return s; } /* Works like sprintf, but appends to first argument w/ realloc() to grow it */ char *crut_sappendf(char *s, const char *fmt, ...) { va_list args; va_start(args, fmt); s = crut_vsappendf(s, fmt, args); va_end(args); return s; } /* Works like sprintf, but allocates the string */ char *crut_aprintf(const char *fmt, ...) { va_list args; char *s; va_start(args, fmt); s = crut_vsappendf(NULL, fmt, args); va_end(args); return s; } /* Like basename(), but doesn't modify input. * Caller should free() the result */ char *crut_basename(const char *s) { char *tmp = strdup(s); char *retval = strdup(basename(tmp)); free(tmp); return retval; } /* If we are changing our process group then block or ignore * SIGTTOU to ensure our output doesn't foul up. * NOTE: this is not the most polite way to deal with this */ void crut_block_sigttou(void) { sigset_t mask; sigemptyset(&mask); sigaddset(&mask, SIGTTOU); sigprocmask(SIG_BLOCK, &mask, NULL); } blcr-0.8.5/tests/pid_in_use.c0000664000000000000000000001656211114414150012765 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2003, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * 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 * * $Id: pid_in_use.c,v 1.18 2008/11/30 04:36:56 phargrov Exp $ */ const char description[] = "Description of tests/pid_in_use:\n" "\n" "This test verifies the correct behavior when restarting from a context\n" "corresponding to a still running task (the requester itself in this case).\n" "In a successful run, expect lines of output in SORTED order.\n" ; #include #include #include #include #include #include #include #include #include "libcr.h" #include "crut_util.h" static int is_lt = 0; static pid_t my_pid = 0; static const char *chkpt_cmd = NULL; static const char *rstrt_cmd = NULL; static const char *filename = NULL; enum { MSG_CHILD_READY, MSG_CHILD_CHKPT, MSG_CHILD_DONE, MSG_PARENT_DONE, }; #define EXIT_PARENT 42 static int child_cb(void *arg) { struct crut_pipes *pipes = arg; crut_pipes_putchar(pipes, MSG_CHILD_CHKPT); return 0; } static volatile int restarting = 0; static int parent_cb1(void *arg) { int rc = cr_checkpoint(CR_CHECKPOINT_READY); restarting = (rc > 0); return 0; } static int parent_cb2(void *arg) { struct crut_pipes *pipes = arg; crut_pipes_expect(pipes, MSG_CHILD_CHKPT); sleep(2); /* Cause a delay to encourage placing our child first in the checkpoint */ return parent_cb1(NULL); } static void *thread_main(void *arg) { (void)pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL); while(1) { pthread_testcancel(); sleep(5); } return NULL; } static void do_checkpoint(int count, const char *scope) { char *cmd; int rc; cmd = crut_aprintf("exec %s --file %s %s %d", chkpt_cmd, filename, scope, my_pid); rc = system(cmd); if ((rc < 0) || !WIFEXITED(rc) || WEXITSTATUS(rc)) { if (restarting) exit(EXIT_PARENT); printf("XXX system(%s) failed (%d)\n", cmd, rc); exit(-1); } else { printf("%03d cr_checkpoint %s OK\n", count, scope); } free(cmd); } static void do_restart_inner(int count, const char *descr, const char *args, int pass, int skip) { char *cmd; int rc; if (skip) { printf("%03d restart %s w/ args='%s' SKIPPED due to LinuxThreads issues\n", count, descr, args); return; } cmd = crut_aprintf("exec %s %s --quiet %s", rstrt_cmd, args, filename); rc = system(cmd); if ((rc < 0) || !WIFEXITED(rc)) { printf("XXX system(%s) failed (%d)\n", cmd, rc); exit(-1); } free(cmd); rc = WEXITSTATUS(rc); if (rc != (pass ? EXIT_PARENT : EBUSY)) { printf("XXX restart %s returned unexpected status %d (%s)\n", descr, rc, strerror(rc)); exit(-1); } else { printf("%03d restart %s w/ args='%s' %s as expected\n", count, descr, args, pass ? "succeeded" : "failed"); } } static void do_restart(int count, const char *descr) { do_restart_inner(count++, descr, "", 0, 0); do_restart_inner(count++, descr, "--no-restore-pid", 1, is_lt); do_restart_inner(count++, descr, "--no-restore-pid --restore-pgid", 0, is_lt); do_restart_inner(count++, descr, "--no-restore-pid --restore-sid", 0, is_lt); } int main(int argc, char * const argv[]) { struct crut_pipes pipes; pthread_t th; cr_client_id_t my_id; cr_callback_id_t parent_cbid; void *th_result; int rc; setlinebuf(stdout); /* Intialize our globals */ is_lt = crut_is_linuxthreads(); my_pid = getpid(); filename = crut_aprintf("context.%d", my_pid); chkpt_cmd = crut_find_cmd(argv[0], "cr_checkpoint"); rstrt_cmd = crut_find_cmd(argv[0], "cr_restart"); printf("000 Process started with pid %d\n", my_pid); printf("#ST_ALARM:120\n"); if (is_lt) { fprintf(stderr, "Skipping portions of 'pid_in_use' test due to LinuxThreads issues\n"); } my_id = cr_init(); if (my_id < 0) { printf("XXX cr_init() failed, returning %d\n", my_id); exit(-1); } else { printf("001 cr_init() succeeded\n"); } parent_cbid = cr_register_callback(parent_cb1, NULL, CR_SIGNAL_CONTEXT); if (parent_cbid < 0) { printf("XXX cr_register_callbask() failed, returning %d\n", parent_cbid); exit(-1); } /* * TEST 1: Just a single-threaded process */ do_checkpoint(2, "--pid"); do_restart(3, "single process"); (void)unlink(filename); // might fail silently /* * TEST 2a: A pthreaded process */ if (crut_pthread_create(&th, NULL, &thread_main, NULL) != 0) { printf("XXX pthread_create() failed\n"); exit(-1); } do_checkpoint(7, "--pid"); do_restart(8, "pthreaded process"); /* * TEST 2b: A pthreaded process, with only a partial conflict */ rc = pthread_cancel(th); if (rc) { printf("XXX pthread_cancel() returned %d\n", rc); exit(-1); } rc = pthread_join(th, &th_result); if (rc) { printf("XXX pthread_join() returned %d\n", rc); exit(-1); } if (th_result != PTHREAD_CANCELED) { printf("XXX pthread_join() returned unexpected value\n"); exit(-1); } printf("012 pthread_cancel/join of thread complete\n"); do_restart(13, "pthreaded/partial"); (void)unlink(filename); // might fail silently /* * TEST 3a: A process tree */ rc = crut_pipes_fork(&pipes); if (!rc) { /* In the child */ my_id = cr_init(); (void)cr_register_callback(child_cb, &pipes, CR_SIGNAL_CONTEXT); crut_pipes_putchar(&pipes, MSG_CHILD_READY); crut_pipes_expect(&pipes, MSG_PARENT_DONE); crut_pipes_putchar(&pipes, MSG_CHILD_DONE); exit(0); } else if (rc < 0) { printf("XXX fork() failed\n"); exit(-1); } rc = cr_replace_callback(parent_cbid, parent_cb2, &pipes, CR_SIGNAL_CONTEXT); if (rc < 0) { printf("XXX cr_replace_callback() failed, rc=%d, errno=%d (%s)\n", rc, errno, cr_strerror(errno)); } crut_pipes_expect(&pipes, MSG_CHILD_READY); printf("017 child started with pid %d\n", pipes.child); do_checkpoint(18, "--tree"); do_restart(19, "process tree"); /* * TEST 3b: A process tree with only a partial conflict */ alarm(30); crut_pipes_putchar(&pipes, MSG_PARENT_DONE); crut_pipes_expect(&pipes, MSG_CHILD_DONE); crut_waitpid_expect(pipes.child, 0); alarm(0); printf("023 child with pid %d terminated\n", pipes.child); do_restart(24, "tree/partial"); (void)unlink(filename); // might fail silently printf("028 DONE\n"); return 0; } blcr-0.8.5/tests/crut_util_libcr.c0000664000000000000000000000736011125133373014037 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2008, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * 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 * * $Id: crut_util_libcr.c,v 1.5 2008/12/26 10:50:35 phargrov Exp $ * * Utility functions for BLCR tests (libcr-dependent portions) */ #define _LARGEFILE64_SOURCE 1 /* For O_LARGEFILE */ #include #include #include #include #include #include #include #include "crut_util.h" /* checkpoint request/poll wrappers for simpler code */ int crut_checkpoint_request(cr_checkpoint_handle_t *handle_p, const char *filename) { int rc; cr_checkpoint_args_t my_args; if (filename) { /* remove existing context file, if any */ (void)unlink(filename); /* open the context file */ rc = open(filename, O_WRONLY | O_CREAT | O_TRUNC | O_LARGEFILE, 0600); } else { /* NULL -> /dev/null */ rc = open("/dev/null", O_WRONLY | O_LARGEFILE); } if (rc < 0) { perror("open"); return rc; } cr_initialize_checkpoint_args_t(&my_args); my_args.cr_fd = rc; /* still holds the return from open() */ my_args.cr_scope = CR_SCOPE_PROC; /* issue the request */ rc = cr_request_checkpoint(&my_args, handle_p); if (rc < 0) { (void)close(my_args.cr_fd); if (filename) (void)unlink(filename); perror("cr_request_checkpoint"); return rc; } return my_args.cr_fd; } int crut_checkpoint_wait(cr_checkpoint_handle_t *handle_p, int fd) { int rc, save_err; do { rc = cr_poll_checkpoint(handle_p, NULL); if (rc < 0) { if ((rc == CR_POLL_CHKPT_ERR_POST) && (errno == CR_ERESTARTED)) { /* restarting -- not an error */ rc = 1; /* Signify RESTART to caller */ } else if (errno == EINTR) { /* poll was interrupted by a signal -- retry */ continue; } else { /* return the error to caller */ break; } } else if (rc == 0) { fprintf(stderr, "cr_poll_checkpoint returned unexpected 0\n"); rc = -1; goto out; } else { rc = 0; /* Signify CONTINUE to caller */ } } while (rc < 0); save_err = errno; #if 0 // Nothing in the testsuite needs this, but your APP might want it. (void)fsync(fd); #endif (void)close(fd); errno = save_err; out: return rc; } int crut_checkpoint_block(const char *filename) { cr_checkpoint_handle_t my_handle; int ret, fd, save_err; fd = crut_checkpoint_request(&my_handle, filename); if (fd < 0) return fd; ret = crut_checkpoint_wait(&my_handle, fd); save_err = errno; (void)close(fd); errno = save_err; return ret; } blcr-0.8.5/tests/filedescriptors.c0000664000000000000000000005560711056065765014076 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2003, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * 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 * * $Id: filedescriptors.c,v 1.23 2008/08/29 21:36:53 phargrov Exp $ * * Simple example for using crut */ /* * >KEYS: < open() * >WHAT: < Does a read on a file opened with oflag = O_WRONLY return -1? * < Does a write on a file opened with oflag = O_RDONLY return -1? * >HOW: < Open a file with O_WRONLY, test for -1 to pass * < Open a file with O_RDONLY, test for -1 to pass * >BUGS: < DUMMY functions used in BSD * >AUTHOR:< PERENNIAL */ /* * seek tests: * * writes pattern to a file * seek backwards * checkpoint * assert fd->offset == lseek() * read * check pattern * * fill a file with zeros * seek to start * checkpoint * assert fd->offset == lseek() * write pattern * read * check pattern */ #define _LARGEFILE64_SOURCE 1 /* For O_LARGEFILE */ #include #include #include #include #include #include #include #include #include #include "crut.h" #define DEFAULT_TEST_DATA_LENGTH 8192 #define MAX_TEST_FILENAME 255 #define MAX_TEST_FILES 32 #define TEST_PREFIX "tstfile" #define TEST_FILE_MODE 0660 #define TEST_FILE_MODE_RO 0440 #define BUF_SIZE 4096 struct fd_struct { int fd; int flags; off_t offset; struct stat stat; int unlinked; char filename[MAX_TEST_FILENAME+1]; }; int test_flags[] = { #ifdef O_DIRECT O_DIRECT, #endif #ifdef O_LARGEFILE O_LARGEFILE, #endif O_SYNC, O_NONBLOCK, O_NDELAY, O_APPEND, }; /* * Linux 2.4 does not save these flags. So we assume that they're not going * to be saved, and test for them later when you talk to fcntl. */ #define FLAGS_NOT_RESTORED (O_CREAT | O_EXCL | O_NOCTTY | O_TRUNC) /* * 64-bit kernels are some what "free" with O_LARGEFILE since it is just a * no-op for sizeof(long) == 8 */ #if O_LARGEFILE #define FLAGS_TO_IGNORE O_LARGEFILE #else #define FLAGS_TO_IGNORE 0 #endif /* * write_pattern * * write a test pattern to this file descriptor * * note: * write_pattern(f, len1); * write_pattern(f, len2); * * should produce the same output as * write_pattern(f, len1+len2); */ static int write_pattern(int fd, int length) { int retval = -1; off_t seed; char *buf; seed = lseek(fd, 0, SEEK_CUR); if (seed < 0) { goto out; } buf = pattern_get_data(length, seed); if (buf == NULL) { goto out; } retval = write(fd, buf, length); if (retval < 0) { perror("write"); } free(buf); out: return retval; } /* * check_pattern * * checks that length bytes in fd match our test pattern */ static int check_pattern(int fd, int length) { int retval = -1; int seed; char *buf; seed = lseek(fd, 0, SEEK_CUR); if (seed < 0) { perror("lseek"); goto out; } buf = malloc(length); if (buf == NULL) { perror("malloc"); goto out; } retval = read(fd, buf, length); if (retval < 0) { perror("read"); goto out_free; } retval = pattern_compare(buf, length, seed); if (retval < 0) { CRUT_FAIL("File failed to match expected contents at recovery."); } out_free: free(buf); out: return retval; } static int check_flags(struct fd_struct *f) { int retval = -1; int flags; /* check the flags */ flags = fcntl(f->fd, F_GETFL); if (flags < 0) { perror("fcntl"); return flags; } flags &= ~FLAGS_TO_IGNORE; if (flags != f->flags) { CRUT_FAIL("Flag 0%o from fcntl does not match saved value of 0%o", flags, f->flags); } else { retval = 0; } /* * Linux 2.4 does not save certain flags. So we assume that they're not * going to be saved, and test for them. * * All sorts of things will break if this ever happens... */ if (flags & (FLAGS_NOT_RESTORED)) { CRUT_FAIL("Kernel flag behavior changed!!!"); retval = -1; } return retval; } /* * make sure the file pointer was correctly positioned */ static int check_offset(struct fd_struct *f) { int retval = -1; int offset; offset = lseek(f->fd, 0, SEEK_CUR); if (offset != f->offset) { CRUT_FAIL("File pointer positioned incorrectly at recovery."); } else if (offset < 0) { perror("lseek"); } else { retval = 0; } return retval; } /* * check_stat_simple * checks basic stats on a regular file... */ static int check_stat_simple(struct fd_struct *f) { int retval = -1; struct stat new_stat; /* compare the stat structs */ retval = fstat(f->fd, &new_stat); if (retval < 0) { perror("fstat"); } else { retval = statcmp(&new_stat, &(f->stat), ST_SIZE | ST_MODE | ST_NLINK); if (retval) { CRUT_FAIL("File attributes changed. %d mismatches", retval); CRUT_DEBUG("--- Old stats %p ---", &(f->stat)); dump_stat(&(f->stat)); CRUT_DEBUG("--- Current stats ---"); dump_stat(&new_stat); retval = -1; } } return retval; } static int create_temp_file(const char *filename, int length) { int fd; int retval = -1; (void)unlink(filename); fd = open(filename, O_WRONLY | O_CREAT, TEST_FILE_MODE); if (fd < 0) { perror("create_temp_file(open)"); retval = fd; } else { retval = write_pattern(fd, length); (void)close(fd); } return retval; } /* * fills out the fields in an fd_struct... */ static int update_fd_struct(struct fd_struct *f) { int retval; f->offset = lseek(f->fd, 0, SEEK_CUR); if (f->offset < 0) { retval = -1; perror("lseek"); goto out; } f->flags = fcntl(f->fd, F_GETFL); if (f->flags < 0) { retval = -1; perror("fcntl"); goto out; } f->flags &= ~FLAGS_TO_IGNORE; retval = fstat(f->fd, &f->stat); if (retval < 0) { perror("fstat"); } out: return retval; } /* * open up a file */ static struct fd_struct * open_fd_struct(char *filename, int flags, int do_unlink) { struct fd_struct *f; int retval; f = malloc(sizeof(*f)); if (f==NULL) { perror("malloc"); goto out; } memset(f, 0, sizeof(*f)); strncpy(f->filename, filename, MAX_TEST_FILENAME); f->filename[MAX_TEST_FILENAME] = '\0'; if ((flags & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL)) { (void)unlink(f->filename); } f->fd = open(f->filename, flags, TEST_FILE_MODE); if (f->fd < 0) { perror("open"); retval = f->fd; goto out_free; } retval = update_fd_struct(f); if (retval < 0) { goto out_free; } f->unlinked = do_unlink; if (do_unlink) { retval = unlink(filename); if (retval < 0) { perror("unlink"); goto out_free; } } out: return f; out_free: free(f); return NULL; } /* * close a file */ static int close_fd_struct(struct fd_struct *f) { int retval; retval = close(f->fd); if (retval < 0) { perror("close"); } free(f); return retval; } /* * flex our muscles, do some basic things to an open file. * read, write, lseek, stat */ static int check_fd_struct_rdwr(struct fd_struct *f) { int retval; /* check the flags */ retval = check_flags(f); if (retval < 0) { goto out; } CRUT_DEBUG("check_flags:return = %d", retval); /* make sure the file pointer was correctly positioned */ retval = check_offset(f); if (retval < 0) { goto out; } CRUT_DEBUG("check_offset:return = %d", retval); /* compare the stat structs */ retval = check_stat_simple(f); if (retval < 0) { goto out; } CRUT_DEBUG("check_stat_simple:return = %d", retval); /* write some stuff to the file. */ retval = write_pattern(f->fd, DEFAULT_TEST_DATA_LENGTH); if (retval < 0) { goto out; } CRUT_DEBUG("write_pattern:return = %d", retval); /* seek back to beginning */ retval = lseek(f->fd, 0, SEEK_SET); if (retval < 0) { perror("lseek"); goto out; } /* match the file contents to expected */ retval = check_pattern(f->fd, 2*DEFAULT_TEST_DATA_LENGTH); if (retval < 0) { goto out; } /* truncate back to original length */ retval = ftruncate(f->fd, DEFAULT_TEST_DATA_LENGTH); if (retval < 0) { goto out; } out: return retval; } static int _fd_read_setup(void **testdata, int do_unlink) { int length = DEFAULT_TEST_DATA_LENGTH; int retval; struct fd_struct *f = NULL; char *filename = crut_aprintf("%s.%d", TEST_PREFIX, 0); retval = create_temp_file(filename, length); if (retval < 0) { goto out; } f = open_fd_struct(filename, O_RDONLY, do_unlink); if (f == NULL) { retval = -1; goto out; } retval = lseek(f->fd, 1, SEEK_CUR); if (retval < 0) { perror("lseek"); goto out; } retval = fchmod(f->fd, TEST_FILE_MODE_RO); if (retval < 0) { perror("fchmod"); goto out; } out: *testdata = f; return 0; } static int fd_read_setup(void **testdata) { return _fd_read_setup(testdata, 0); } static int fd_read_unlinked_setup(void **testdata) { return _fd_read_setup(testdata, 1); } /* * We create a new file for writing. After restart, we'll write to it. */ static int _fd_write_setup(void **testdata, int do_unlink) { struct fd_struct *f; char *filename; filename = crut_aprintf("%s.%d", TEST_PREFIX, 0); f = open_fd_struct(filename, O_WRONLY | O_CREAT | O_EXCL, do_unlink); free(filename); *testdata = f; if (f == NULL) { return -1; } else { return 0; } } static int fd_write_setup(void **testdata) { return _fd_write_setup(testdata, 0); } static int fd_write_unlinked_setup(void **testdata) { return _fd_write_setup(testdata, 1); } /* * We create a new file opened for read-write. We're going to write * some data into it now. At restart we write some more data in, * then read it all back. */ static int _fd_rdwr_setup(void **testdata, int do_unlink) { int retval = -1; struct fd_struct *f; char *filename; filename = crut_aprintf("%s.%d", TEST_PREFIX, 0); f = open_fd_struct(filename, O_RDWR | O_CREAT | O_EXCL, do_unlink); if (f == NULL) { goto out; } /* write some stuff to the file. */ retval = write_pattern(f->fd, DEFAULT_TEST_DATA_LENGTH); if (retval < 0) { CRUT_FAIL("Unable to write test pattern to file opened O_RDWR"); goto out_close_unlink; } out: *testdata = f; free(filename); return retval; out_close_unlink: close_fd_struct(f); if (!do_unlink && (unlink(filename) < 0)) { perror("unlink"); } free(filename); return retval; } static int fd_rdwr_setup(void **testdata) { return _fd_rdwr_setup(testdata, 0); } static int fd_rdwr_unlinked_setup(void **testdata) { return _fd_rdwr_setup(testdata, 1); } /* * Test open files w/ a bunch of different modes. */ static int _fd_flags_setup(void **testdata, int do_unlink) { int i; int retval = -1; int num_tests = sizeof(test_flags)/sizeof(int); int length = DEFAULT_TEST_DATA_LENGTH; char *filename; struct fd_struct **fds; /* get us some space and init... */ fds = malloc(num_tests*sizeof(struct fd_struct)); if (fds == NULL) { goto out; } for (i=0; iunlinked = do_unlink; if (do_unlink) { retval = unlink(filename); if (retval < 0) { perror("unlink"); goto out_close; } } *testdata = fds; return 0; out_close: /* close anything we opened */ for (i=0; iflags = fds[i]->flags | O_RDWR; } return retval; } static int fd_generic_continue(void *p) { int retval; CRUT_DEBUG("Continuing after checkpoint."); retval = update_fd_struct((struct fd_struct *)p); return retval; } static int fd_read_restart(void *p) { int retval; struct fd_struct *f = (struct fd_struct *)p; CRUT_DEBUG("Restarting from checkpoint."); /* check the flags */ retval = check_flags(f); if (retval < 0) { goto out; } /* make sure the file pointer was correctly positioned */ retval = check_offset(f); if (retval < 0) { goto out; } /* compare the stat structs */ retval = check_stat_simple(f); if (retval < 0) { goto out; } /* match the file contents to expected */ retval = check_pattern(f->fd, DEFAULT_TEST_DATA_LENGTH); if (retval < 0) { goto out; } /* make sure we can't write to one of these things. */ retval = write(f->fd, f, sizeof(*f)); if (retval >= 0) { perror("write"); CRUT_FAIL("Unexpectedly able to write to a read-only file!"); } else if (errno != EBADF) { CRUT_FAIL("Write failed, but for the wrong reason!"); perror("write"); } else { retval = 0; } out: return retval; } static int fd_write_restart(void *p) { int retval; struct fd_struct *f = (struct fd_struct *)p; struct fd_struct *readf; char buf[BUF_SIZE]; /* check the flags */ retval = check_flags(f); if (retval < 0) { goto out; } CRUT_DEBUG("check_flags:return = %d", retval); /* make sure the file pointer was correctly positioned */ retval = check_offset(f); if (retval < 0) { goto out; } CRUT_DEBUG("check_offset:return = %d", retval); /* compare the stat structs */ retval = check_stat_simple(f); if (retval < 0) { goto out; } CRUT_DEBUG("check_stat_simple:return = %d", retval); /* write some stuff to the file. */ retval = write_pattern(f->fd, DEFAULT_TEST_DATA_LENGTH); if (retval < 0) { goto out; } CRUT_DEBUG("write_pattern:return = %d", retval); /* try to read from a file opened O_WRONLY. Better fail */ retval = read(f->fd, buf, sizeof(*f)); if (retval >= 0) { perror("read"); CRUT_FAIL("Unexpectedly able to read from a write-only file!"); } else if (errno != EBADF) { CRUT_FAIL("Read failed, but for the wrong reason!"); perror("read"); } else { retval = 0; } /* skip reopen for the unlinked case */ if (f->unlinked) goto out; /* reopen to check file contents */ readf = open_fd_struct(f->filename, O_RDONLY, 0); if (readf == NULL) { retval = -1; goto out; } p = readf; /* match the file contents to expected */ retval = check_pattern(readf->fd, DEFAULT_TEST_DATA_LENGTH); if (retval < 0) { goto out; } out: return retval; } static int fd_rdwr_restart(void *p) { int retval; struct fd_struct *f = (struct fd_struct *)p; /* check the flags */ retval = check_flags(f); if (retval < 0) { goto out; } CRUT_DEBUG("check_flags:return = %d", retval); /* make sure the file pointer was correctly positioned */ retval = check_offset(f); if (retval < 0) { goto out; } CRUT_DEBUG("check_offset:return = %d", retval); /* compare the stat structs */ retval = check_stat_simple(f); if (retval < 0) { goto out; } CRUT_DEBUG("check_stat_simple:return = %d", retval); /* write some stuff to the file. */ retval = write_pattern(f->fd, DEFAULT_TEST_DATA_LENGTH); if (retval < 0) { goto out; } CRUT_DEBUG("write_pattern:return = %d", retval); /* seek back to beginning */ retval = lseek(f->fd, 0, SEEK_SET); if (retval < 0) { perror("lseek"); goto out; } /* match the file contents to expected */ retval = check_pattern(f->fd, 2*DEFAULT_TEST_DATA_LENGTH); if (retval < 0) { goto out; } out: return retval; } static int fd_flags_restart(void *p) { struct fd_struct **fds = (struct fd_struct **)p; int num_tests = sizeof(test_flags)/sizeof(int); int i; int retval = 0; for (i=0; ifd, test_flags[i]); break; } } return retval; } static int fd_generic_teardown(void *p) { int retval; struct fd_struct *f = (struct fd_struct *)p; retval = unlink(f->filename); if (f->unlinked) { if ((retval >= 0) || (errno != ENOENT)) { perror("duplicate unlink"); retval = -1; } else { retval = 0; } } else if (retval < 0) { perror("unlink"); } free(p); return retval; } static int fd_flags_teardown(void *p) { int retval; struct fd_struct **f = (struct fd_struct **)p; retval = unlink(f[0]->filename); if (f[0]->unlinked) { if ((retval >= 0) || (errno != ENOENT)) { perror("duplicate unlink"); retval = -1; } else { retval = 0; } } else if (retval < 0) { perror("unlink"); } free(p); return retval; } int main(int argc, char *argv[]) { int ret; struct crut_operations fd_read_test_ops = { test_scope:CR_SCOPE_PROC, test_name:"fd_read", test_description:"Test that fd's open for read work.", test_setup:fd_read_setup, test_precheckpoint:fd_generic_precheckpoint, test_continue:fd_generic_continue, test_restart:fd_read_restart, test_teardown:fd_generic_teardown, }; struct crut_operations fd_write_test_ops = { test_scope:CR_SCOPE_PROC, test_name:"fd_write", test_description:"Test fd's open for writing.", test_setup:fd_write_setup, test_precheckpoint:fd_generic_precheckpoint, test_continue:fd_generic_continue, test_restart:fd_write_restart, test_teardown:fd_generic_teardown, }; struct crut_operations fd_rdwr_test_ops = { test_scope:CR_SCOPE_PROC, test_name:"fd_rdwr", test_description:"Test fd's open O_RDWR.", test_setup:fd_rdwr_setup, test_precheckpoint:fd_generic_precheckpoint, test_continue:fd_generic_continue, test_restart:fd_rdwr_restart, test_teardown:fd_generic_teardown, }; struct crut_operations fd_flags_test_ops = { test_scope:CR_SCOPE_PROC, test_name:"fd_flags", test_description:"Test flags on open files", test_setup:fd_flags_setup, test_precheckpoint:fd_flags_precheckpoint_continue, test_continue:fd_flags_precheckpoint_continue, test_restart:fd_flags_restart, test_teardown:fd_flags_teardown, }; struct crut_operations fd_read_unlinked_test_ops = { test_scope:CR_SCOPE_PROC, test_name:"fd_read_unlinked", test_description:"Test that fd's open for read work.", test_setup:fd_read_unlinked_setup, test_precheckpoint:fd_generic_precheckpoint, test_continue:fd_generic_continue, test_restart:fd_read_restart, test_teardown:fd_generic_teardown, }; struct crut_operations fd_write_unlinked_test_ops = { test_scope:CR_SCOPE_PROC, test_name:"fd_write_unlinked", test_description:"Test fd's open for writing.", test_setup:fd_write_unlinked_setup, test_precheckpoint:fd_generic_precheckpoint, test_continue:fd_generic_continue, test_restart:fd_write_restart, test_teardown:fd_generic_teardown, }; struct crut_operations fd_rdwr_unlinked_test_ops = { test_scope:CR_SCOPE_PROC, test_name:"fd_rdwr_unlinked", test_description:"Test fd's open O_RDWR.", test_setup:fd_rdwr_unlinked_setup, test_precheckpoint:fd_generic_precheckpoint, test_continue:fd_generic_continue, test_restart:fd_rdwr_restart, test_teardown:fd_generic_teardown, }; struct crut_operations fd_flags_unlinked_test_ops = { test_scope:CR_SCOPE_PROC, test_name:"fd_flags_unlinked", test_description:"Test flags on open files", test_setup:fd_flags_unlinked_setup, test_precheckpoint:fd_flags_precheckpoint_continue, test_continue:fd_flags_precheckpoint_continue, test_restart:fd_flags_restart, test_teardown:fd_flags_teardown, }; /* add the basic tests */ crut_add_test(&fd_read_test_ops); crut_add_test(&fd_write_test_ops); crut_add_test(&fd_rdwr_test_ops); crut_add_test(&fd_flags_test_ops); /* add the unlinked tests */ crut_add_test(&fd_read_unlinked_test_ops); crut_add_test(&fd_write_unlinked_test_ops); crut_add_test(&fd_rdwr_unlinked_test_ops); crut_add_test(&fd_flags_unlinked_test_ops); ret = crut_main(argc, argv); return ret; } blcr-0.8.5/tests/cr_signal.c0000664000000000000000000001660111056065765012625 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2007, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * 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 * * $Id: cr_signal.c,v 1.6 2008/08/29 21:36:53 phargrov Exp $ * * Check for interference w/ out signal handler */ #include #include #include #include #include #include #include #include #include "crut.h" // This test is disabled. // We don't currently do the right thing. #define TEST_SIGNAL_BLOCKED 0 #define MSG "Hello world!\n" struct testdata_t { char *msg; void *handler; }; static int common_setup(void **testdata, void *handler) { struct testdata_t *data; struct sigaction sa; data = malloc(sizeof(*data)); if (!data) { return -1; } data->msg = strdup(MSG); if (!data->msg) { return -1; } data->handler = handler; sa.sa_handler = handler; sa.sa_flags = 0; (void)sigaction(CR_SIGNUM, &sa, NULL); /* Ignore any failure */ *testdata = data; return 0; } volatile int flag = -1; static void catcher(int signo) { if (flag != 0) { CRUT_FAIL("Catcher ran unexpectedly"); exit(-1); } flag = 1; return; } static void empty_handler(int signo) { CRUT_DEBUG("Running empty handler"); } static int test1_setup(void **testdata) { /* Test1: catch the signal */ return common_setup(testdata, &catcher); } static int test2_setup(void **testdata) { /* Test2: ignore the signal */ return common_setup(testdata, SIG_IGN); } static int test3_setup(void **testdata) { /* Test3: reset to default */ return common_setup(testdata, SIG_DFL); } #if TEST_SIGNAL_BLOCKED static int test4_setup(void **testdata) { /* Test4: block it */ sigset_t mask; sigemptyset(&mask); sigaddset(&mask, CR_SIGNUM); sigprocmask(SIG_BLOCK, &mask, NULL); return common_setup(testdata, empty_handler); } #endif static int test5_setup(void **testdata) { /* Test5: corrupt the sa_restorer!! */ struct testdata_t *data; struct sigaction sa; data = malloc(sizeof(*data)); if (!data) { return -1; } data->msg = strdup(MSG); if (!data->msg) { return -1; } (void)sigaction(CR_SIGNUM, NULL, &sa); /* Ignore any failure */ data->handler = sa.sa_sigaction; if (sa.sa_restorer) { sa.sa_restorer = (void *)&abort; (void)sigaction(CR_SIGNUM, &sa, NULL); /* Ignore any failure */ } else { /* Don't mess w/ NULL */ } *testdata = data; return 0; } static int check_it(struct testdata_t *data) { sigset_t mask, old_mask; /* The sigismember() checks that follow avoid false-alarms when glibc thinks * that CR_SIGNUM is out of bounds, by thinking -1 is OK. */ if (data->handler == &catcher) { /* TEST1 */ flag = 0; CRUT_DEBUG("Raise signal to test"); raise(CR_SIGNUM); if (flag != 1) { CRUT_FAIL("Signal handler failed to run"); return -1; } } else if (data->handler == SIG_IGN) { /* TEST2 */ /* Check that signal actually *is* ignored (as opposed to blocked) */ CRUT_DEBUG("Raise signal to test"); raise(CR_SIGNUM); sigemptyset(&mask); sigpending(&mask); if (sigismember(&mask,CR_SIGNUM) == 1) { CRUT_FAIL("Failed to ignore the signal"); return -1; } } else if (data->handler == SIG_DFL) { /* TEST3 */ /* Not safe to raise */ } else if (data->handler == empty_handler) { /* TEST4 */ /* Check that signal actually *is* blocked (as opposed to ignored) */ CRUT_DEBUG("Checking signal mask"); sigemptyset(&mask); sigprocmask(SIG_BLOCK, &mask, &old_mask); if (sigismember(&old_mask,CR_SIGNUM) == 0) { CRUT_FAIL("Failed to mask the signal"); return -1; } CRUT_DEBUG("Raise signal to test"); raise(CR_SIGNUM); sigemptyset(&mask); sigpending(&mask); if (sigismember(&mask,CR_SIGNUM) == 0) { CRUT_FAIL("Failed to block the signal"); return -1; } /* Absorb the pending signal */ sigemptyset(&mask); sigaddset(&mask, CR_SIGNUM); sigprocmask(SIG_UNBLOCK, &mask, NULL); sigprocmask(SIG_BLOCK, &mask, NULL); } else { /* TEST5 */ /* Do nothing here */ } return strncmp(data->msg, MSG, sizeof(MSG)) ? -1 : 0; } static int common_precheckpoint(void *p) { CRUT_DEBUG("Testing sanity before we checkpoint"); return check_it(p); } static int common_continue(void *p) { CRUT_DEBUG("Continuing after checkpoint."); return check_it(p); } static int common_restart(void *p) { CRUT_DEBUG("Restarting from checkpoint."); return check_it(p); } static int common_teardown(void *p) { struct testdata_t *data = (struct testdata_t *)p; free(data->msg); return 0; } int main(int argc, char *argv[]) { int ret; struct crut_operations test1_ops = { test_scope:CR_SCOPE_PROC, test_name:"cr_signal_catch", test_description:"Signal catch test.", test_setup:test1_setup, test_precheckpoint:common_precheckpoint, test_continue:common_continue, test_restart:common_restart, test_teardown:common_teardown, }; struct crut_operations test2_ops = { test_scope:CR_SCOPE_PROC, test_name:"cr_signal_ignore", test_description:"SIG_IGN test.", test_setup:test2_setup, test_precheckpoint:common_precheckpoint, test_continue:common_continue, test_restart:common_restart, test_teardown:common_teardown, }; struct crut_operations test3_ops = { test_scope:CR_SCOPE_PROC, test_name:"cr_signal_default", test_description:"SIG_DFL test.", test_setup:test3_setup, test_precheckpoint:common_precheckpoint, test_continue:common_continue, test_restart:common_restart, test_teardown:common_teardown, }; #if TEST_SIGNAL_BLOCKED struct crut_operations test4_ops = { test_scope:CR_SCOPE_PROC, test_name:"cr_signal_block", test_description:"Signal blocking test.", test_setup:test4_setup, test_precheckpoint:common_precheckpoint, test_continue:common_continue, test_restart:common_restart, test_teardown:common_teardown, }; #endif struct crut_operations test5_ops = { test_scope:CR_SCOPE_PROC, test_name:"cr_signal_restorer", test_description:"Signal restorer test.", test_setup:test5_setup, test_precheckpoint:common_precheckpoint, test_continue:common_continue, test_restart:common_restart, test_teardown:common_teardown, }; /* add the tests */ crut_add_test(&test1_ops); crut_add_test(&test2_ops); crut_add_test(&test3_ops); #if TEST_SIGNAL_BLOCKED crut_add_test(&test4_ops); #endif crut_add_test(&test5_ops); ret = crut_main(argc, argv); return ret; } blcr-0.8.5/tests/php_test.sh0000664000000000000000000000161711043752776012704 00000000000000#!/bin/sh # # Test of checkpoint/restart of a php script. # Note that the outer script is bourne shell # Check for php (echo | php >/dev/null) || exit 77 . ${cr_testsdir:-`dirname $0`}/shellinit \rm -f Context[12] .Context[12].tmp 2>/dev/null echo '#ST_IGNORE:^X-[-a-zA-Z]+:' echo '#ST_IGNORE:^Content-type:' echo '#ST_IGNORE:^[[:space:]]*$' echo '#ST_ALARM:120' exec 2>/dev/null # Drop job control message(s) $cr_run php <<-'__EOF__' 2>&1 & __EOF__ sleep 3; echo "# Checkpoint original child" $cr_checkpoint --file=Context1 --tree --term $! 2>&1 wait; sleep 1; echo "# Restart 1" $cr_restart Context1 2>&1 & sleep 3; echo "# Checkpoint restarted child" $cr_checkpoint --file=Context2 --tree --term $! 2>&1 wait; sleep 1; echo "# Restart^2" exec 2>&1 $cr_restart Context2 echo "10 DONE" \rm -f Context[12] .Context[12].tmp 2>/dev/null blcr-0.8.5/tests/shellinit.in0000664000000000000000000000222111015417120013011 00000000000000# Common setup code to be sourced by shell scripts # Initializes: # cr_testsdir location of the tests # cr_libpath text to optionally prepend to LD_LIBRARY_PATH # cr_run path of the cr_run utility # cr_checkpoint path of the cr_checkpoint utility # cr_restart path of the cr_restart utility # cr_pwd PWD_PROG found by configure, or "pwd" for cr_testsdir in ${cr_testsdir} `dirname $0` .; do test -f ${cr_testsdir}/shellinit && break done test -f ${cr_testsdir}/shellinit || exit 1 export cr_testsdir # cr_bindir=${cr_testsdir}/../bin if expr "$cr_bindir" : / >/dev/null; then : # OK else cr_bindir="`pwd`/${cr_bindir}" fi # @CR_INSTALLED_LIBCR_TRUE@cr_libpath= @CR_INSTALLED_LIBCR_FALSE@cr_libpath=@TOP_BUILDDIR@/libcr/.libs: export cr_libpath # @CR_ENABLE_SHARED_TRUE@cr_run=${cr_run:-${cr_bindir}/cr_run} @CR_ENABLE_SHARED_FALSE@cr_run=env export cr_run # cr_checkpoint=${cr_checkpoint:-${cr_bindir}/cr_checkpoint} export cr_checkpoint # cr_restart=${cr_restart:-${cr_bindir}/cr_restart} export cr_restart # cr_pwd="@PWD_PROG@" if test ! -x "$cr_pwd" -o "`$cr_pwd 2>&1 > /dev/null`" != "" ; then cr_pwd=pwd fi export cr_pwd # unset cr_bindir blcr-0.8.5/tests/overlap.c0000664000000000000000000000646711056065765012345 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2007, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * 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 * * $Id: overlap.c,v 1.8 2008/08/29 21:36:53 phargrov Exp $ * * crut-based test to ensure that checkpoint requests are excluded while * checkpoints and restarts are running. */ #include #include #include #include #include #include #include #include #include #include "libcr.h" #include "crut.h" static char *cmd = NULL; static void do_it(const char *where) { int status = system(cmd); if (!WIFEXITED(status)) { CRUT_FAIL("Abnormal failure calling '%s' at %s time", cmd, where); exit(1); } else if (WEXITSTATUS(status) != EBUSY) { CRUT_FAIL("Unexpected exit code %d calling '%s' at %s time", WEXITSTATUS(status), cmd, where); exit(1); } else { CRUT_DEBUG("Correct result at %s time", where); } } static int my_callback(void* arg) { int rc; do_it("CHECKPOINT"); rc = cr_checkpoint(0); if (rc > 0) { do_it("RESTART"); } else if (!rc) { do_it("CONTINUE"); } return 0; } static int overlap_setup(void **testdata) { CRUT_DEBUG("Initializing overlap."); (void)cr_init(); (void)cr_register_callback(my_callback, NULL, CR_THREAD_CONTEXT); *testdata = NULL; return 0; } static int overlap_precheckpoint(void *p) { return 0; } static int overlap_continue(void *p) { CRUT_DEBUG("Continuing after checkpoint."); return 0; } static int overlap_restart(void *p) { CRUT_DEBUG("Restarting from checkpoint."); return 0; } static int overlap_teardown(void *p) { return 0; } int main(int argc, char * const argv[]) { int ret; struct crut_operations overlap_ops = { test_scope:CR_SCOPE_PROC, test_name:"overlap_chkpt", test_description:"test for checkpoint request overlapping checkpoint or restart.", test_setup:overlap_setup, test_precheckpoint:overlap_precheckpoint, test_continue:overlap_continue, test_restart:overlap_restart, test_teardown:overlap_teardown, }; int pid = getpid(); cmd = crut_aprintf("exec %s -f context.%d %d 2>/dev/null", crut_find_cmd(argv[0], "cr_checkpoint"), pid, pid); /* add the basic tests */ crut_add_test(&overlap_ops); ret = crut_main(argc, argv); return ret; } blcr-0.8.5/tests/linked_fifo.c0000664000000000000000000004747011056065765013145 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2003, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * 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 * * $Id: linked_fifo.c,v 1.9 2008/08/29 21:36:53 phargrov Exp $ * * tests of named fifos in which the two ends are through distinct hard links */ /* * NOTE: We rely on the Linux-specific (POSIX undefined) behavior for O_RDWR * pipes. Linux does not block while opening a named FIFO with O_RDWR */ #define _LARGEFILE64_SOURCE 1 /* For O_LARGEFILE */ #include #include #include #include #include #include #include #include #include "crut.h" #define MAX_FILENAME_LENGTH 255 #define FIFO_FILENAME "tstfifo" #define BUFLEN 256 #define PIPEDATA "Hello, world!\n" #define FIFO_MODE 0644 /* * 64-bit kernels are some what "free" with O_LARGEFILE since it is just a * no-op for sizeof(long) == 8 */ #if O_LARGEFILE #define FLAGS_TO_IGNORE O_LARGEFILE #else #define FLAGS_TO_IGNORE 0 #endif /* * name is somewhat of a misnomer, since this is really a pair... */ struct test_fifo_struct { char *filename; char *filename2; int rdwr_fd; /* open first to avoid blocking */ int client_fd; /* test most IO ops to this */ int flags; /* rd, wr, or rdwr */ struct stat stat; }; static int sigpiped = 0; void sigpipe_handler(int num) { sigpiped = 1; } struct test_fifo_struct * get_fifo_struct(const char *filename, int flags) { int ret=-1; struct test_fifo_struct *fifo; int tmp_fd; fifo = malloc(sizeof(*fifo)); if (fifo == NULL) { perror("malloc"); goto out; } fifo->filename = strdup(filename); if (fifo->filename == NULL) { perror("strdup"); goto out_free; } fifo->filename2 = malloc(strlen(filename) + 2); if (fifo->filename2 == NULL) { perror("malloc filename2"); goto out_free; } strcpy(fifo->filename2, fifo->filename); strcat(fifo->filename2, "2"); (void)unlink(fifo->filename); (void)unlink(fifo->filename2); ret = mknod(fifo->filename, FIFO_MODE | S_IFIFO, 0); if (ret < 0) { perror("mknod"); goto out_free; } ret = link(fifo->filename, fifo->filename2); if (ret) { perror("link"); goto out_unlink; } fifo->rdwr_fd = open(fifo->filename, O_RDWR); if (fifo->rdwr_fd < 0) { perror("open(rdwr_fd)"); goto out_unlink; } fifo->client_fd = open(fifo->filename2, flags); if (fifo->client_fd < 0) { perror("open(client_fd)"); goto out_unlink; } ret = fcntl(fifo->client_fd, F_GETFL); if (ret < 0) { perror("fcntl"); goto out_unlink; } fifo->flags = ret & ~FLAGS_TO_IGNORE; /* Swap order to test the restart code */ tmp_fd = fifo->rdwr_fd; fifo->rdwr_fd = dup(fifo->rdwr_fd); if (fifo->rdwr_fd < 0) { perror("dup(rdwr_fd)"); goto out_unlink; } ret = close(tmp_fd); if (ret < 0) { perror("close(tmp_fd)"); goto out_unlink; } out: return fifo; out_unlink: (void)unlink(fifo->filename); (void)unlink(fifo->filename2); out_free: free(fifo->filename); /* Note: NULL is OK by spec. */ free(fifo->filename2); /* Note: NULL is OK by spec. */ free(fifo); return NULL; } /* * This should write a atomic amount of data. Small means that * the pipe does not block. * * Returns number of bytes written. */ static int write_atomic(int fd) { char buf[BUFLEN]; int retval; (void)strncpy(buf, PIPEDATA, sizeof(PIPEDATA)); CRUT_DEBUG("Writing to pipe"); retval = write(fd, buf, BUFLEN); if (sigpiped) { retval = -1; CRUT_FAIL("SIGPIPE on write"); } if (retval < 0) { perror("write_atomic"); } else if (retval != BUFLEN) { CRUT_FAIL("Wrote wrong length to pipe %d", fd); } else if(retval == BUFLEN) { retval = 0; } return retval; } /* * Logical complement of read atomic. * Checks to make sure that the buffer read back is the same as the one * written. * * Returns number of bytes read. * Returns < 0 if buffers don't compare, or other error. */ static int read_atomic(int fd) { int retval; int bytes_read; char buf[BUFLEN]; memset(buf, 0, BUFLEN); CRUT_DEBUG("Reading from pipe."); retval = read(fd, buf, BUFLEN); if (retval < 0) { CRUT_FAIL("Couldn't read from pipe."); CRUT_FAIL("buf='%s'", buf); goto out; } bytes_read = retval; CRUT_DEBUG("Comparing pipe data."); retval = strncmp(PIPEDATA, buf, sizeof(PIPEDATA)); if (retval < 0) { CRUT_FAIL("strncmp(%s, %s) failure.", PIPEDATA, buf); goto out; } out: return retval; } static int flags_check_fifo(struct test_fifo_struct *f) { int retval; retval = fcntl(f->client_fd, F_GETFL); if (retval < 0) { perror("fnctl(F_GETFL)"); } else if ((retval & ~FLAGS_TO_IGNORE) != f->flags) { CRUT_FAIL("Post-restart flags %d don't match original %d\n", retval, f->flags); retval = -1; } return retval; } static int stat_check_fifo(struct test_fifo_struct *f) { struct stat s1, s2; int retval = 0; if ((fstat(f->rdwr_fd, &s1) < 0) || (fstat(f->client_fd, &s2) < 0)) { perror("fstat"); retval = -1; goto out; } else if (statcmp(&s1, &s2, ST_DEV | ST_INO | ST_NLINK)) { fprintf(stderr, "Post-restart fifos are not linked\n"); retval = -1; goto out; } retval = statcmp(&s1, &(f->stat), ST_SIZE | ST_MODE /* | ST_NLINK broken on NFS */); if (retval) { CRUT_FAIL("File attributes changed. %d mismatches", retval); CRUT_DEBUG("--- Old stats ---"); dump_stat(&(f->stat)); CRUT_DEBUG("--- Current stats ---"); dump_stat(&s1); retval = -1; } out: return retval; } static int ring_test_fifo(struct test_fifo_struct *f) { int retval; /* * loops some data through the pipes to make sure they still work */ switch((f->flags) & O_ACCMODE) { case O_RDONLY: retval = write_atomic(f->rdwr_fd); if (!retval) retval = read_atomic(f->client_fd); break; case O_WRONLY: case O_RDWR: retval = write_atomic(f->client_fd); if (!retval) read_atomic(f->rdwr_fd); break; default: retval = -1; } return retval; } static int linked_fifo_generic_setup(void **testdata, int flags) { int retval=-1; struct test_fifo_struct *fifo; signal(SIGPIPE, sigpipe_handler); fifo = get_fifo_struct(FIFO_FILENAME, flags); if (fifo == NULL) { goto out; } *testdata = fifo; retval = 0; out: return retval; } static int linked_fifo_read_setup(void **testdata) { int retval; retval = linked_fifo_generic_setup(testdata, O_RDONLY); return retval; } static int linked_fifo_write_setup(void **testdata) { int retval; retval = linked_fifo_generic_setup(testdata, O_WRONLY); return retval; } static int linked_fifo_rdwr_setup(void **testdata) { int retval; retval = linked_fifo_generic_setup(testdata, O_RDWR); return retval; } static int linked_fifo_read_nonblock_setup(void **testdata) { int retval; retval = linked_fifo_generic_setup(testdata, O_RDONLY | O_NONBLOCK); return retval; } static int linked_fifo_write_nonblock_setup(void **testdata) { int retval; retval = linked_fifo_generic_setup(testdata, O_WRONLY | O_NONBLOCK); return retval; } static int linked_fifo_rdwr_nonblock_setup(void **testdata) { int retval; retval = linked_fifo_generic_setup(testdata, O_RDWR | O_NONBLOCK); return retval; } static int linked_fifo_buffered_precheckpoint(void *p) { int retval; struct test_fifo_struct *f = p; switch((f->flags) & O_ACCMODE) { case O_RDONLY: /* reads from client_fd, so write to rdwr_fd */ retval = write_atomic(f->rdwr_fd); break; case O_WRONLY: case O_RDWR: /* writes to client_fd */ retval = write_atomic(f->client_fd); break; default: retval = -1; } if (retval < 0) goto out; retval = fstat(f->rdwr_fd, &f->stat); if (retval < 0) { perror("fstat"); } out: return retval; } static int linked_fifo_precheckpoint(void *p) { struct test_fifo_struct *fifo = (struct test_fifo_struct *)p; int retval; retval = fstat(fifo->rdwr_fd, &fifo->stat); if (retval < 0) { perror("fstat"); } return retval; } static int linked_fifo_precheckpoint_unlink(void *p) { struct test_fifo_struct *fifo = (struct test_fifo_struct *)p; int retval; retval = unlink(fifo->filename); if (retval) { perror("unlink pre"); goto out; } retval = unlink(fifo->filename2); if (retval) { perror("unlink2 pre"); goto out; } retval = linked_fifo_precheckpoint(p); out: return retval; } /* * Unlinks the pipe after a checkpoint, to see if we can mkfifo in the * kernel correctly on restart. */ static int linked_fifo_continue_unlink(void *p) { struct test_fifo_struct *fifo = (struct test_fifo_struct *)p; int retval; retval = unlink(fifo->filename); if (retval) { perror("unlink continue"); goto out; } retval = unlink(fifo->filename2); if (retval) { perror("unlink2 continue"); goto out; } out: return retval; } static int linked_fifo_continue(void *p) { int retval; retval = 0; return retval; } /* * This should take care of everything... */ static int linked_fifo_buffered_restart(void *p) { int retval; struct test_fifo_struct *f = p; /* Check that correct flags have been restored */ retval = flags_check_fifo(f); if (retval < 0) return retval; /* Check that they are still linked and that stat()s are OK*/ retval = stat_check_fifo(f); if (retval < 0) return retval; switch((f->flags) & O_ACCMODE) { case O_RDONLY: /* read from client_fd */ retval = read_atomic(f->client_fd); break; case O_WRONLY: case O_RDWR: /* wrote to client_fd, read from rdwr_fd */ retval = read_atomic(f->rdwr_fd); break; default: retval = -1; } /* if that worked, ring the pipe once just to check sanity. */ if (!retval) { retval = ring_test_fifo(f); } return retval; } static int linked_fifo_restart(void *p) { struct test_fifo_struct *f = p; int retval; /* Check that correct flags have been restored */ retval = flags_check_fifo(f); if (retval < 0) { return retval; } /* Check that they are still linked and that stat()s are OK*/ retval = stat_check_fifo(f); if (retval < 0) return retval; /* if that worked, ring the pipe once just to check sanity. */ return ring_test_fifo(f); } static int linked_fifo_teardown(void *p) { struct test_fifo_struct *fifo = (struct test_fifo_struct *)p; int retval; retval = unlink(fifo->filename); if (retval) { perror("unlink teardown"); goto out; } retval = unlink(fifo->filename2); if (retval) { perror("unlink2 teardown"); goto out; } out: free(fifo->filename); free(fifo->filename2); free(fifo); return retval; } static int linked_fifo_teardown_preunlink(void *p) { struct test_fifo_struct *fifo = (struct test_fifo_struct *)p; int retval; /* Unlink must fail, since fifo should have been renamed */ retval = !unlink(fifo->filename); if (retval) { fprintf(stderr, "unlink succeeded unexpectedly\n"); goto out; } retval = !unlink(fifo->filename2); if (retval) { fprintf(stderr, "unlink2 succeeded unexpectedly\n"); goto out; } out: free(fifo->filename); free(fifo->filename2); free(fifo); return retval; } int main(int argc, char *argv[]) { int ret; /* * cases for named fifos... * * rd, wr, rdwr - normal * rd, wr, rdwr - unlinked after checkpoint * rd, wr, rdwr - unlinked before checkpoint * rd, wr, rdwr - unlinked * rd, wr, rdwr - data in the pipe * rd, wr, rdwr - nonblocking * * Only care about the above, this tests most code paths, could form * arbitrarily silly combinations, though... */ struct crut_operations linked_fifo_rw_ops = { test_scope:CR_SCOPE_PROC, test_name:"linked_fifo_rw", test_description:"Tests basic IO on fifos", test_setup:linked_fifo_rdwr_setup, test_precheckpoint:linked_fifo_precheckpoint, test_continue:linked_fifo_continue, test_restart:linked_fifo_restart, test_teardown:linked_fifo_teardown, }; struct crut_operations linked_fifo_rw_unlink_ops = { test_scope:CR_SCOPE_PROC, test_name:"linked_fifo_rw_unlink", test_description:"Tests whether we mknod FIFOs on restart", test_setup:linked_fifo_rdwr_setup, test_precheckpoint:linked_fifo_precheckpoint, test_continue:linked_fifo_continue_unlink, test_restart:linked_fifo_restart, test_teardown:linked_fifo_teardown, }; struct crut_operations linked_fifo_rw_preunlink_ops = { test_scope:CR_SCOPE_PROC, test_name:"linked_fifo_rw_preunlink", test_description:"Tests whether we checkpoint unlinked FIFOs", test_setup:linked_fifo_rdwr_setup, test_precheckpoint:linked_fifo_precheckpoint_unlink, test_continue:linked_fifo_continue, test_restart:linked_fifo_restart, test_teardown:linked_fifo_teardown_preunlink, }; struct crut_operations linked_fifo_rw_buffered_ops = { test_scope:CR_SCOPE_PROC, test_name:"linked_fifo_rw_buffered", test_description:"Makes sure that data in the FIFO is recovered after a checkpoint.", test_setup:linked_fifo_rdwr_setup, test_precheckpoint:linked_fifo_buffered_precheckpoint, test_continue:linked_fifo_continue, test_restart:linked_fifo_buffered_restart, test_teardown:linked_fifo_teardown, }; struct crut_operations linked_fifo_rw_nonblock_ops = { test_scope:CR_SCOPE_PROC, test_name:"linked_fifo_rw_nonblock", test_description:"Makes sure that data in the FIFO is recovered after a checkpoint.", test_setup:linked_fifo_rdwr_nonblock_setup, test_precheckpoint:linked_fifo_buffered_precheckpoint, test_continue:linked_fifo_continue, test_restart:linked_fifo_buffered_restart, test_teardown:linked_fifo_teardown, }; struct crut_operations linked_fifo_read_ops = { test_scope:CR_SCOPE_PROC, test_name:"linked_fifo_read", test_description:"Tests basic IO on fifos", test_setup:linked_fifo_read_setup, test_precheckpoint:linked_fifo_precheckpoint, test_continue:linked_fifo_continue, test_restart:linked_fifo_restart, test_teardown:linked_fifo_teardown, }; struct crut_operations linked_fifo_read_unlink_ops = { test_scope:CR_SCOPE_PROC, test_name:"linked_fifo_read_unlink", test_description:"Tests whether we mknod FIFOs on restart", test_setup:linked_fifo_read_setup, test_precheckpoint:linked_fifo_precheckpoint, test_continue:linked_fifo_continue_unlink, test_restart:linked_fifo_restart, test_teardown:linked_fifo_teardown, }; struct crut_operations linked_fifo_read_preunlink_ops = { test_scope:CR_SCOPE_PROC, test_name:"linked_fifo_read_preunlink", test_description:"Tests whether we checkpoint unlinked FIFOs", test_setup:linked_fifo_rdwr_setup, test_precheckpoint:linked_fifo_precheckpoint_unlink, test_continue:linked_fifo_continue, test_restart:linked_fifo_restart, test_teardown:linked_fifo_teardown_preunlink, }; struct crut_operations linked_fifo_read_buffered_ops = { test_scope:CR_SCOPE_PROC, test_name:"linked_fifo_read_buffered", test_description:"Makes sure that data in the FIFO is recovered after a checkpoint.", test_setup:linked_fifo_read_setup, test_precheckpoint:linked_fifo_buffered_precheckpoint, test_continue:linked_fifo_continue, test_restart:linked_fifo_buffered_restart, test_teardown:linked_fifo_teardown, }; struct crut_operations linked_fifo_read_nonblock_ops = { test_scope:CR_SCOPE_PROC, test_name:"linked_fifo_read_nonblock", test_description:"Makes sure that data in the FIFO is recovered after a checkpoint.", test_setup:linked_fifo_read_nonblock_setup, test_precheckpoint:linked_fifo_buffered_precheckpoint, test_continue:linked_fifo_continue, test_restart:linked_fifo_buffered_restart, test_teardown:linked_fifo_teardown, }; struct crut_operations linked_fifo_write_ops = { test_scope:CR_SCOPE_PROC, test_name:"linked_fifo_write", test_description:"Tests basic IO on fifos", test_setup:linked_fifo_write_setup, test_precheckpoint:linked_fifo_precheckpoint, test_continue:linked_fifo_continue, test_restart:linked_fifo_restart, test_teardown:linked_fifo_teardown, }; struct crut_operations linked_fifo_write_unlink_ops = { test_scope:CR_SCOPE_PROC, test_name:"linked_fifo_write_unlink", test_description:"Tests whether we mknod FIFOs on restart", test_setup:linked_fifo_write_setup, test_precheckpoint:linked_fifo_precheckpoint, test_continue:linked_fifo_continue_unlink, test_restart:linked_fifo_restart, test_teardown:linked_fifo_teardown, }; struct crut_operations linked_fifo_write_preunlink_ops = { test_scope:CR_SCOPE_PROC, test_name:"linked_fifo_write_preunlink", test_description:"Tests whether we checkpoint unlinked FIFOs", test_setup:linked_fifo_rdwr_setup, test_precheckpoint:linked_fifo_precheckpoint_unlink, test_continue:linked_fifo_continue, test_restart:linked_fifo_restart, test_teardown:linked_fifo_teardown_preunlink, }; struct crut_operations linked_fifo_write_buffered_ops = { test_scope:CR_SCOPE_PROC, test_name:"linked_fifo_write_buffered", test_description:"Makes sure that data in the FIFO is recovered after a checkpoint.", test_setup:linked_fifo_write_setup, test_precheckpoint:linked_fifo_buffered_precheckpoint, test_continue:linked_fifo_continue, test_restart:linked_fifo_buffered_restart, test_teardown:linked_fifo_teardown, }; struct crut_operations linked_fifo_write_nonblock_ops = { test_scope:CR_SCOPE_PROC, test_name:"linked_fifo_write_nonblock", test_description:"Makes sure that data in the FIFO is recovered after a checkpoint.", test_setup:linked_fifo_write_nonblock_setup, test_precheckpoint:linked_fifo_buffered_precheckpoint, test_continue:linked_fifo_continue, test_restart:linked_fifo_buffered_restart, test_teardown:linked_fifo_teardown, }; /* add the basic tests */ crut_add_test(&linked_fifo_read_ops); crut_add_test(&linked_fifo_write_ops); crut_add_test(&linked_fifo_rw_ops); crut_add_test(&linked_fifo_read_unlink_ops); crut_add_test(&linked_fifo_write_unlink_ops); crut_add_test(&linked_fifo_rw_unlink_ops); crut_add_test(&linked_fifo_read_preunlink_ops); crut_add_test(&linked_fifo_write_preunlink_ops); crut_add_test(&linked_fifo_rw_preunlink_ops); crut_add_test(&linked_fifo_read_buffered_ops); crut_add_test(&linked_fifo_write_buffered_ops); crut_add_test(&linked_fifo_rw_buffered_ops); crut_add_test(&linked_fifo_read_nonblock_ops); crut_add_test(&linked_fifo_write_nonblock_ops); crut_add_test(&linked_fifo_rw_nonblock_ops); ret = crut_main(argc, argv); exit(ret); } blcr-0.8.5/tests/cwd.c0000664000000000000000000000703411056065765011441 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2003, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * 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 * * $Id: cwd.c,v 1.7 2008/08/29 21:36:53 phargrov Exp $ * * Simple example for using crut */ #ifndef _GNU_SOURCE #define _GNU_SOURCE // for get_current_dir_name() in unistd #endif #include #include #include #include #include #include #include #include #include "crut.h" #define TMP_DIR_NAME "tstdir" #define TMP_DIR_MODE 0755 char checkpoint_cwd[PATH_MAX+1]; static int cwd_setup(void **testdata) { int retval; (void)rmdir(TMP_DIR_NAME); retval = mkdir(TMP_DIR_NAME, TMP_DIR_MODE); if (retval < 0) { perror("mkdir"); goto out; } retval = chdir(TMP_DIR_NAME); if (retval < 0) { perror("mkdir"); goto out; } if (getcwd(checkpoint_cwd, sizeof(checkpoint_cwd)) == NULL) { perror("getcwd"); goto out_unlink; } retval = 0; *testdata = NULL; return retval; out_unlink: if (unlink(TMP_DIR_NAME) < 0) { perror("unlink"); retval = -1; } out: return retval; } static int cwd_precheckpoint(void *p) { return 0; } static int cwd_continue(void *p) { return 0; } static int cwd_restart(void *p) { int retval = -1; char new_cwd[PATH_MAX+1]; if (getcwd(new_cwd, PATH_MAX) == NULL) { perror("getcwd"); goto out; } if (strncmp(checkpoint_cwd, new_cwd, sizeof(checkpoint_cwd))) { CRUT_FAIL("Did not restore cwd %s", checkpoint_cwd); retval = -1; } else { retval = 0; } out: return retval; } static int cwd_teardown(void *p) { int retval; /* go back to where we started */ retval = chdir(".."); CRUT_DEBUG("cwd = %s", get_current_dir_name()); if (retval < 0) { perror("chdir"); goto out; } /* now kill the test directory */ retry: retval = rmdir(TMP_DIR_NAME); if (retval < 0) { CRUT_FAIL("rmdir(%s): %s", TMP_DIR_NAME, strerror(errno)); // XXX sync(); goto retry; goto out; } retval = 0; out: return retval; } int main(int argc, char *argv[]) { int ret; struct crut_operations cwd_test_ops = { test_scope:CR_SCOPE_PROC, test_name:"cwd_rw", test_description:"Simple example test.", test_setup:cwd_setup, test_precheckpoint:cwd_precheckpoint, test_continue:cwd_continue, test_restart:cwd_restart, test_teardown:cwd_teardown, }; /* add the basic tests */ crut_add_test(&cwd_test_ops); ret = crut_main(argc, argv); return ret; } blcr-0.8.5/tests/clisp_test.sh0000664000000000000000000000260311122070437013204 00000000000000#!/bin/sh # Some clisp versions complain w/ utf8 LANG=C export LANG # First check that we *have* clisp clisp -q -q -x '(quit)' || exit 77 # NOTE: Unlike most other script test cases, this one uses the # --kill flag to cr_checkpoint. This is because we've observed # a bug in signal handling in some clisp releases (BLCR bug 2470). . ${cr_testsdir:-`dirname $0`}/shellinit \rm -f Context[123] .Context[123].tmp 2>/dev/null exec 2>/dev/null # To drop job control messages echo '#ST_IGNORE:^Exiting on signal' echo '#ST_ALARM:120' $cr_run clisp -q -q -x ' (progn (defun greet (n) (format t "~D equals ~R~%" n n) (sleep 1) (if (< n 9) (greet (+ n 1)))) (greet 0) (format t "# Checkpointing self~%") (ext:execute (ext:getenv "cr_checkpoint") "--file=Context3" "--kill" "--tree" (write-to-string (funcall (or (find-symbol "PROGRAM-ID" :system) (find-symbol "PROCESS-ID" :system))))) (format t "11 DONE~%") (quit))' 2>&1 & pid=$! sleep 3 echo "# Checkpoint original child" $cr_checkpoint --file=Context1 --kill $pid 2>&1 wait sleep 1 echo "# Restart 1" $cr_restart Context1 2>&1 & pid=$! sleep 3 echo "# Checkpoint restarted child" $cr_checkpoint --file=Context2 --kill --tree $pid 2>&1 wait sleep 1 echo "# Restart^2" $cr_restart Context2 2>&1 & pid=$! wait echo "10 Restart interpreter" $cr_restart Context3 2>&1 \rm -f Context[123] .Context[123].tmp 2>/dev/null blcr-0.8.5/tests/bug2524.c0000664000000000000000000000607311152046650011745 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2009, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * 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 * * $Id: bug2524.c,v 1.1.2.3 2009/02/27 20:31:36 phargrov Exp $ * * Look for bug 2524 (ppc-specific reg save problem) */ #include #include #include #include #include #include #include "blcr_config.h" #if !(defined(__ppc64__) || defined(__powerpc64__) || defined(__ppc__) || defined(__powerpc__)) /* Test is ppc-specific (uses asm) */ int main(void) { return 77; // automake's "SKIP" code } #else void handler(int sig) { asm volatile ("li %r28,99"); } int test_it(void) { int i, q = 111; sigset_t mask; sigemptyset(&mask); sigprocmask(SIG_BLOCK, NULL, &mask); for (i=0; i<1000; ++i) { asm volatile ( // r28 = 0; sigsuspend(&mask); q = %r28 " li %%r28,0\n" " li %%r0,%3\n" " mr %%r3,%2\n" " li %%r4,%4\n" " sc\n" " mr %0,%%r28\n" : "=&r" (q) : "0" (q), "r" (&mask), "i" (__NR_rt_sigsuspend), "i" (_NSIG/8) : "cr0", "ctr", "memory", "r0", "r3", "r4", "r9", "r10","r11", "r12", "r28"); if (q) break; } return q; } int main(void) { struct sigaction sa; int rc; sa.sa_sigaction = (void*)handler; sa.sa_flags = SA_RESTART | SA_SIGINFO; sigemptyset(&sa.sa_mask); rc = sigaction(SIGUSR1, &sa, NULL); if (rc < 0) { perror("sigaction()"); exit(1); } rc = fork(); if (rc < 0) { perror("fork()"); exit(1); } else if (!rc) { while (!kill(getppid(), SIGUSR1)) {/*empty*/} } else if (test_it()) { #if !CR_HAVE_BUG2524 fputs("ERROR: Your kernel appears to be affected by a bug, seen in kernels 2.6.15 and older. Please reconfigure blcr with '--with-bug2524' to enable blcr's work around for this bug.\n", stderr); exit(1); #endif } else { #if CR_HAVE_BUG2524 fputs("INFO: Your kernel appears NOT to be affected by bug 2524, but BLCR has been configured to work around it anyway. You could safely reconfigure BLCR with '--without-bug2524' if you wish.\n", stderr); #endif } return 0; } #endif /* PPC */ blcr-0.8.5/tests/atomics_stress.c0000664000000000000000000002000311121361434013676 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2008, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * 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 * * $Id: atomics_stress.c,v 1.17 2008/12/15 04:54:52 phargrov Exp $ * * Simple serial tests of the atomic operations used inside libcr */ #include #include #include #include #include #include #include #include #include #include "blcr_config.h" #include "cr_atomic.h" #include "crut_util.h" #define CHECK(cond) \ do { if (!(cond)) { ++failed; printf("Test (" #cond ") FAILED at line %d\n", __LINE__); } } while (0) static int failed = 0; static volatile char in_signal = 'N'; static sigset_t alarm_mask, vtalarm_mask; static unsigned long iters = 2; static int nthreads = 4; static uint64_t duration = 10000000; /* 10s expressed in us */ static cri_atomic_t X = 0; static int child = 0; static const struct itimerval vtalarm_timer = { it_interval: { tv_sec: 0, tv_usec: 0}, it_value: { tv_sec: 0, tv_usec: 1}, /* As fast as possible */ }; static const struct itimerval alarm_timer = { it_interval: { tv_sec: 0, tv_usec: 100000}, it_value: { tv_sec: 0, tv_usec: 100000}, /* 10Hz */ }; static const struct itimerval zero_timer = { it_interval: { tv_sec: 0, tv_usec: 0}, it_value: { tv_sec: 0, tv_usec: 0}, }; /* (potentially) microsecond resolution timer */ static uint64_t tick(void) { struct timeval tv; gettimeofday(&tv, NULL); return ((uint64_t)tv.tv_sec) * 1000000 + (uint64_t)tv.tv_usec; } /* SIGCHLD is fatal for us, as it indicates a timeout */ static void grim(int signo) { /* a reaper */ int rc; while ((rc = waitpid(child, NULL, WNOHANG)) != 0) { if (rc == child) { static char msg[] = " TIMEOUT (in_signal=?)\n"; msg[20] = in_signal; write(STDERR_FILENO, msg, sizeof(msg) - 1); _exit(1); } else if (rc < 0) { perror("waitpid()"); /* Not strictly safe in a signal handler */ } } } /* * Print progress */ static uint64_t progress = 1; static void alarmist(int signo) { /* Show life occasionally, but stop when 100% is reached */ progress = progress && crut_progress_step(tick()); } /* * We perform an atomic no-op to test signal safety. */ static void vtalarmist(int signo) { unsigned int tmp; in_signal = 'Y'; do { tmp = cri_atomic_read(&X); } while (!cri_cmp_swap(&X, tmp, tmp)); in_signal = 'N'; (void)setitimer(ITIMER_VIRTUAL, &vtalarm_timer, NULL); } /* Each thread increments *arg ITERS times */ static void *test_inc(void) { unsigned long i; for (i = 0; i < iters; ++i) { cri_atomic_inc(&X); } return NULL; } /* Each thread decrements *arg ITERS times, returns final result */ static void *test_dec(void) { unsigned long i; int result = 0; for (i = 0; i < iters; ++i) { result = cri_atomic_dec_and_test(&X); } return (void *)(uintptr_t)result; } static void *wrap(void *arg) { void *retval; pthread_sigmask(SIG_UNBLOCK, &vtalarm_mask, NULL); (void)setitimer(ITIMER_VIRTUAL, &vtalarm_timer, NULL); retval = ((void *(*)(void))arg)(); pthread_sigmask(SIG_BLOCK, &vtalarm_mask, NULL); (void)setitimer(ITIMER_VIRTUAL, &zero_timer, NULL); return retval; } static void spawn_and_join(pthread_t *threads, void **join_vals, void * (*fn)(void)) { int i; pthread_sigmask(SIG_UNBLOCK, &alarm_mask, NULL); (void)setitimer(ITIMER_REAL, &alarm_timer, NULL); for (i = 0; i < nthreads; ++i) { int rc = crut_pthread_create(threads + i, NULL, wrap, (void *)fn); if (rc) { perror("pthread_create"); exit(1); } } for (i = 0; i < nthreads; ++i) { int rc = pthread_join(threads[i], join_vals + i); if (rc) { perror("pthread_join"); exit(1); } } (void)setitimer(ITIMER_REAL, &zero_timer, NULL); pthread_sigmask(SIG_BLOCK, &alarm_mask, NULL); } /* Repeat until at least 'duration' microseconds of aggregate running time is reached */ static void run_test(pthread_t *threads, void **join_vals, void * (*fn)(void), int alpha, int beta) { const int64_t epsilon = 250000; /* 0.25s = Smallest trustworthy interval to extrapolate from */ uint64_t t_final = duration + tick(); long next = 1000; do { uint64_t t1, t2; int64_t curr, remain; iters = (next < 1000000) ? next : 1000000; cri_atomic_write(&X, (unsigned int)(iters * alpha)); t1 = tick(); spawn_and_join(threads, join_vals, fn); t2 = tick(); if (cri_atomic_read(&X) != (unsigned int)(iters * beta)) { ++failed; printf("Test (cri_atomic_read(&X) == (unsigned int)(iters * %d)) failed\n", beta); break; } curr = t2 - t1; remain = t_final - t2; next = (curr < epsilon) ? (next * 2) : (remain * (double)iters / (double)curr); } while (next > 0); /* Stop on either convergence or on overflow */ } extern int main(int argc, char *argv[]) { struct sigaction sa; pthread_t *threads; void **join_vals; sync(); /* Try to push out I/O to get a "smoother" test run */ threads = calloc(nthreads, sizeof(pthread_t)); join_vals = calloc(nthreads, sizeof(void *)); if (!threads || !join_vals) { fputs("calloc failed\n", stderr); exit(1); } /* Setup a child to SIGCHLD us after 1 minute, in case we are hung */ sigemptyset(&sa.sa_mask); sa.sa_flags = 0; sa.sa_handler = &grim; (void)sigaction(SIGCHLD, &sa, NULL); /* Ignore any failure */ child = fork(); if (child < 0) { perror("fork()"); exit(1); } else if (!child) { /* I am the child - I exist to SIGCHLD my parent after 1 minute has elapsed */ sleep(60); _exit(0); } /* Setup progress markers */ fputs("atomics_stress:", stderr); crut_progress_start(tick(), 2 * duration, 10); /* Setup for a periodic timer to interrupt the tests threads, but not the main thread. * * We don't use an auto-renewing itimer, because if we get stuck in the * signal handler, we don't want any additional signals generated. */ sigemptyset(&vtalarm_mask); sigaddset(&vtalarm_mask, SIGVTALRM); sigprocmask(SIG_BLOCK, &vtalarm_mask, NULL); sa.sa_flags = 0; sa.sa_handler = &vtalarmist; (void)sigaction(SIGVTALRM, &sa, NULL); /* Ignore any failure */ /* Setup for a periodic timer to interrupt only the main thread */ sigemptyset(&alarm_mask); sigaddset(&alarm_mask, SIGALRM); sigprocmask(SIG_BLOCK, &alarm_mask, NULL); sigemptyset(&sa.sa_mask); sa.sa_flags = 0; sa.sa_handler = &alarmist; (void)sigaction(SIGALRM, &sa, NULL); /* Ignore any failure */ /* Is the initial value 0? */ CHECK(cri_atomic_read(&X) == 0); /* Increment test */ run_test(threads, join_vals, &test_inc, 0, nthreads); fputc(',', stderr); /* Decrement test */ run_test(threads, join_vals, &test_dec, nthreads, 0); /* Exactly one thread should have a non-zero join_val */ { int sum = 0; int i; for (i = 0; i < nthreads; ++i) { sum += (int)(uintptr_t)join_vals[i]; } CHECK(sum == 1); } if (progress) write(STDERR_FILENO, "\n", 1); return !!failed; } blcr-0.8.5/tests/sigpending.c0000664000000000000000000001264211056065765013014 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2007, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * 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 * * $Id: sigpending.c,v 1.3 2008/08/29 21:36:53 phargrov Exp $ * * Check for possible loss of pending signals across a restart. */ #include #include #include #include #include #include #include #include "crut.h" #define MY_SIGNAL SIGQUIT volatile int my_flag = -1; volatile int my_pid = -1; static int common_setup(void **testdata, int flags, void *handler) { struct sigaction sa; sigset_t mask, old_mask; my_pid = getpid(); sigemptyset(&mask); sigaddset(&mask, MY_SIGNAL); sigprocmask(SIG_BLOCK, &mask, &old_mask); if (flags & SA_SIGINFO) { sa.sa_handler = handler; } else { sa.sa_sigaction = handler; } sa.sa_flags = flags; (void)sigaction(MY_SIGNAL, &sa, NULL); /* Ignore any failure */ *testdata = (void *)(unsigned long)flags; return 0; } static void catcher_raise(int signo) { CRUT_DEBUG("In catcher"); if ((my_flag != 0) || (signo != MY_SIGNAL)) { CRUT_FAIL("Catcher ran unexpectedly (sig=%d flag=%d)", signo, my_flag); exit(-1); } my_flag = 1; return; } static int raise_setup(void **testdata) { int result = common_setup(testdata, 0, catcher_raise); raise(MY_SIGNAL); return result; } static void catcher_sigqueue(int signo, siginfo_t *siginfo, void *context) { CRUT_DEBUG("In catcher"); if ((my_flag != 0) || (signo != MY_SIGNAL)) { CRUT_FAIL("Catcher ran unexpectedly (sig=%d flag=%d)", signo, my_flag); exit(-1); } if (siginfo->si_value.sival_int != my_pid) { CRUT_FAIL("Failed to preserve queued siginfo (%d != %d)", siginfo->si_value.sival_int, my_pid); exit(-1); } my_flag = 1; return; } static int sigqueue_setup(void **testdata) { int result = common_setup(testdata, SA_SIGINFO, catcher_sigqueue); union sigval v; int rc; v.sival_int = my_pid; rc = sigqueue(my_pid, MY_SIGNAL, v); if (rc < 0) { CRUT_FAIL("sigqueue failed w/ errno=%d", errno); result = rc; } return result; } static int check_it(void *p, int unblock) { sigset_t mask, old_mask; //int flags = (int)(unsigned long)p; /* Check that signal actually *is* blocked (as opposed to ignored) */ CRUT_DEBUG("Checking signal mask"); sigemptyset(&mask); sigprocmask(SIG_BLOCK, &mask, &old_mask); if (sigismember(&old_mask,MY_SIGNAL) == 0) { CRUT_FAIL("Failed to mask the signal"); return -1; } /* Check that signal is (still) pending */ CRUT_DEBUG("Checking pending signals"); sigemptyset(&mask); sigpending(&mask); if (sigismember(&mask,MY_SIGNAL) == 0) { CRUT_FAIL("Failed to preserve the pending signal"); return -1; } /* Check on delivery */ if (unblock) { if (my_flag == 1) { CRUT_FAIL("Signal handler ran early"); return -1; } my_flag = 0; sched_yield(); CRUT_DEBUG("Unblock signal to test"); sigemptyset(&mask); sigaddset(&mask, MY_SIGNAL); sigprocmask(SIG_UNBLOCK, &mask, &old_mask); sched_yield(); if (my_flag != 1) { CRUT_FAIL("Signal handler failed or failed to run"); return -1; } my_flag = -1; } return 0; } static int common_precheckpoint(void *p) { CRUT_DEBUG("Testing sanity before we checkpoint"); return check_it(p, 0); } static int common_continue(void *p) { CRUT_DEBUG("Continuing after checkpoint."); return check_it(p, 1); } static int common_restart(void *p) { CRUT_DEBUG("Restarting from checkpoint."); return check_it(p, 1); } int main(int argc, char *argv[]) { int ret; struct crut_operations test1_ops = { test_scope:CR_SCOPE_PROC, test_name:"raise", test_description:"Ensure a raised signal is preserved across restart.", test_setup:raise_setup, test_precheckpoint:common_precheckpoint, test_continue:common_continue, test_restart:common_restart, test_teardown:NULL, }; struct crut_operations test2_ops = { test_scope:CR_SCOPE_PROC, test_name:"sigqueue", test_description:"Ensure a queued signal is preserved across restart.", test_setup:sigqueue_setup, test_precheckpoint:common_precheckpoint, test_continue:common_continue, test_restart:common_restart, test_teardown:NULL, }; /* add the tests */ crut_add_test(&test1_ops); crut_add_test(&test2_ops); ret = crut_main(argc, argv); return ret; } blcr-0.8.5/tests/sigaltstack.c0000664000000000000000000001007011113173264013153 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2003, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * 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 * * $Id: sigaltstack.c,v 1.1 2008/11/26 07:11:48 phargrov Exp $ * * CRUT test of sigaltstack() */ #include #include #include #include #include #include #include #include "crut.h" static int checkit(const char *where, stack_t *st) { stack_t tmp; int rc; rc = sigaltstack(NULL, &tmp); if (rc < 0) { CRUT_FAIL("%s: sigaltstack(get) failed.", where); return -1; } rc = 0; if (st->ss_size != tmp.ss_size) { CRUT_FAIL("%s: ss_size changed.", where); rc = -1; } if (st->ss_sp != tmp.ss_sp) { CRUT_FAIL("%s: ss_sp changed.", where); rc = -1; } if (st->ss_flags != tmp.ss_flags) { CRUT_FAIL("%s: ss_flags changed.", where); rc = -1; } return rc; } static int my_callback(void *stack2) { stack_t st; int rc; st.ss_flags = 0; st.ss_size = SIGSTKSZ; st.ss_sp = stack2; rc = sigaltstack(&st, NULL); if (rc < 0) { CRUT_FAIL("sigaltstack(set2) failed."); return -1; } cr_checkpoint(CR_CHECKPOINT_READY); return checkit("callback", &st); } static int sigaltstack_setup(void **testdata) { stack_t *st; void *stack1, *stack2; int rc; CRUT_DEBUG("Initializing sigaltstack."); stack1 = mmap (NULL, SIGSTKSZ, PROT_READ | PROT_WRITE | PROT_EXEC, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); if (stack1 == MAP_FAILED) { CRUT_FAIL("mmap(stack1) failed."); return -1; } stack2 = mmap (NULL, SIGSTKSZ, PROT_READ | PROT_WRITE | PROT_EXEC, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); if (stack2 == MAP_FAILED) { CRUT_FAIL("mmap(stack2) failed."); return -1; } cr_register_callback(my_callback, stack2, CR_THREAD_CONTEXT); st = malloc(sizeof(stack_t)); if (st == NULL) { CRUT_FAIL("malloc() failed."); return -1; } st->ss_flags = 0; st->ss_size = SIGSTKSZ; st->ss_sp = stack1; rc = sigaltstack(st, NULL); if (rc < 0) { CRUT_FAIL("sigaltstack(set) failed."); return -1; } *testdata = st; return 0; } static int sigaltstack_precheckpoint(void *p) { CRUT_DEBUG("Testing sanity before we checkpoint"); return checkit("precheckpoint", (stack_t *)p); } static int sigaltstack_continue(void *p) { CRUT_DEBUG("Continuing after checkpoint."); return checkit("continue", (stack_t *)p); } static int sigaltstack_restart(void *p) { CRUT_DEBUG("Restarting from checkpoint."); return checkit("restart", (stack_t *)p); } int main(int argc, char *argv[]) { int ret; struct crut_operations sigaltstack_test_ops = { test_scope:CR_SCOPE_PROC, test_name:"sigaltstack", test_description:"Test of sigaltstack.", test_setup:sigaltstack_setup, test_precheckpoint:sigaltstack_precheckpoint, test_continue:sigaltstack_continue, test_restart:sigaltstack_restart, test_teardown:NULL, }; /* add the basic tests */ crut_add_test(&sigaltstack_test_ops); ret = crut_main(argc, argv); return ret; } blcr-0.8.5/tests/bug2003.sh0000664000000000000000000000031011010246535012106 00000000000000#!/bin/sh set -e . ${cr_testsdir:-`dirname $0`}/shellinit # ${cr_run} ${cr_testsdir}/bug2003_aux & pid=$! sleep 2 ${cr_checkpoint} --clobber $pid sleep 2 ${cr_restart} context.$pid rm -f context.$pid blcr-0.8.5/tests/nscd.c0000664000000000000000000000431411616326412011600 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2009, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * 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 * * $Id: nscd.c,v 1.3.6.2 2011/08/03 20:18:18 eroman Exp $ * * Test to trigger NCSD problems if they exists */ #include #include #include #include #include #include #include #include "crut.h" static int nscd_check(void *p) { int rc = 0; /* Series of calls to trigger use of NSCD if possible */ (void) gethostbyname("www.google.com"); if (! getpwuid(0)) { CRUT_FAIL("Lookup of uid 0 failed"); rc = -1; } if (! getgrgid(0)) { CRUT_FAIL("Lookup of gid 0 failed"); rc = -1; } return rc; } static int nscd_setup(void **testdata) { *testdata = NULL; return nscd_check(NULL); } int main(int argc, char *argv[]) { struct crut_operations nscd_test_ops = { test_scope:CR_SCOPE_PROC, test_name:"nscd", test_description:"Test to trigger nscd problems if any.", test_setup:nscd_setup, test_precheckpoint:nscd_check, test_continue:nscd_check, test_restart:nscd_check, test_teardown:NULL, }; /* add the basic tests */ crut_add_test(&nscd_test_ops); return crut_main(argc, argv); } blcr-0.8.5/tests/mmaps.c0000664000000000000000000004442511056065765012006 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2003, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * 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 * * $Id: mmaps.c,v 1.15 2008/08/29 21:36:53 phargrov Exp $ * * Test of various mmap()s across a checkpoint */ #include #include #include #include #include #include #include #include #include #include #include #include "crut.h" #define FILENAME "tstfile" enum { MSG_PARENT_DONE = 17, MSG_CHILD_READY, MSG_PARENT_REQUEST, MSG_CHILD_GOOD, MSG_CHILD_BAD }; /* Note: per bug 2290 MSG1 must be at least as long as the others */ static const char MSG1[] = "MSG1: Hello world! This message must be the longest."; static const char MSG2[] = "MSG2: The quick brown fox jumps over the lazy dog."; static const char MSG3[] = "MSG3: All good things come to those who waitpid()."; static int pagesize = -1; enum { TEST_UNLINK = 1, TEST_WRITE_FD = 2 }; struct testcase { char * addr; size_t len; int prot; int flags; int fd; off_t offset; struct crut_pipes checker; int test_flags; }; static void sigpipe(int signo) { fprintf(stderr, "%d exiting on SIGPIPE\n", getpid()); exit(-1); } static void checker_child(struct testcase *t) { /* If shared mapping of a file, them map via a separate file descriptor */ if ((t->fd >= 0) && (t->flags & MAP_SHARED)) { int err, fd; err = fcntl(t->fd, F_GETFL); if (err < 0) { perror("fcntl()"); exit(-1); } fd = open(FILENAME, err&O_ACCMODE, 0); if (fd < 0) { perror("open()"); exit(-1); } t->addr = mmap(0, t->len, t->prot, t->flags, fd, t->offset); if (t->addr == MAP_FAILED) { perror("mmap()"); exit(-1); } (void)close(fd); } if ((t->fd >= 0) && !(t->test_flags & TEST_WRITE_FD)) (void)close(t->fd); crut_pipes_putchar(&t->checker, MSG_CHILD_READY); while (1) { crut_pipes_expect(&t->checker, MSG_PARENT_REQUEST); if (strncmp(t->addr, MSG2, sizeof(MSG2))) { crut_pipes_putchar(&t->checker, MSG_CHILD_BAD); CRUT_FAIL("Wrong value read. Pre-checkpoint sharing lost? '%s' '%s'", t->addr, MSG2); exit(-1); } if (t->test_flags & TEST_WRITE_FD) { if (lseek(t->fd, t->offset, SEEK_SET) == (off_t)-1) { CRUT_FAIL("lseek failed in checker child: %s (%d)", strerror(errno), errno); exit(-1); } if (write(t->fd, MSG3, sizeof(MSG3)) != sizeof(MSG3)) { CRUT_FAIL("write failed in checker child: %s (%d)", strerror(errno), errno); exit(-1); } } else { strcpy(t->addr, MSG3); } crut_pipes_putchar(&t->checker, MSG_CHILD_GOOD); } } static int mmaps_setup_common(void **testdata, void *start, int prot , int flags, int fd, off_t offset, int test_flags) { struct testcase *t = malloc(sizeof(*t)); size_t len = pagesize; size_t real_offset = offset; if (!(flags & MAP_ANONYMOUS)) { if (lseek(fd, offset, SEEK_SET) == (off_t)-1) return -1; write(fd, MSG1, sizeof(MSG1)); /* Includes \0 */ if (!(prot & PROT_WRITE)) { fchmod(fd, S_IREAD); close(fd); fd = open(FILENAME, O_RDONLY); if (fd < 0) return fd; } } t->test_flags = test_flags; t->len = len; t->prot = prot; t->flags = flags; t->fd = fd; t->offset = offset; if ((flags & MAP_SHARED) && offset) { len += offset; real_offset = 0; } t->addr = mmap(start, len, prot, flags, fd, real_offset); CRUT_DEBUG("mmap(%p, %d, 0x%x, 0x%x, %d, %d) -> %p (%d)", start, (int)len, prot, flags, fd, (int)real_offset, t->addr, errno); if (t->addr == MAP_FAILED) return -1; if (flags & MAP_SHARED) { (void)signal(SIGPIPE, &sigpipe); if (offset) { munmap(t->addr, offset); t->addr += offset; } if (!crut_pipes_fork(&t->checker)) { /* In the child */ checker_child(t); exit(-1); /* Not reached */ } else { /* In the parent */ crut_pipes_expect(&t->checker, MSG_CHILD_READY); CRUT_DEBUG("Child ready"); } } if (flags & MAP_ANONYMOUS) { strcpy(t->addr, MSG1); } *testdata = t; return 0; } static int mmaps_setup_anon_common(void **testdata, int prot, int flags, off_t offset) { return mmaps_setup_common(testdata, 0, prot, MAP_ANONYMOUS|flags, -1, offset, 0); } static int mmaps_setup_file_common(void **testdata, int prot, int flags, off_t offset, int test_flags) { int fd, retval; (void)unlink(FILENAME); fd = open(FILENAME, O_CREAT|O_RDWR|O_TRUNC, S_IREAD|S_IWRITE); if (fd < 0) return fd; retval = mmaps_setup_common(testdata, 0, prot, flags, fd, offset, test_flags); close(fd); if (test_flags & TEST_UNLINK) (void)unlink(FILENAME); return retval; } static int mmaps_setup_rw_as(void **testdata) { return mmaps_setup_anon_common(testdata, PROT_READ|PROT_WRITE, MAP_SHARED, 0); } static int mmaps_setup_rw_ap(void **testdata) { return mmaps_setup_anon_common(testdata, PROT_READ|PROT_WRITE, MAP_PRIVATE, 0); } static int mmaps_setup_rw_fs(void **testdata) { return mmaps_setup_file_common(testdata, PROT_READ|PROT_WRITE, MAP_SHARED, 0, 0); } static int mmaps_setup_rw_fp(void **testdata) { return mmaps_setup_file_common(testdata, PROT_READ|PROT_WRITE, MAP_PRIVATE, 0, 0); } static int mmaps_setup_rw_us(void **testdata) { return mmaps_setup_file_common(testdata, PROT_READ|PROT_WRITE, MAP_SHARED, 0, TEST_UNLINK); } static int mmaps_setup_rw_up(void **testdata) { return mmaps_setup_file_common(testdata, PROT_READ|PROT_WRITE, MAP_PRIVATE, 0, TEST_UNLINK); } static int mmaps_setup_ro_fs(void **testdata) { return mmaps_setup_file_common(testdata, PROT_READ, MAP_SHARED, 0, 0); } #define the_OFFSET (2*pagesize) static int mmaps_setup_rw_as_offset(void **testdata) { return mmaps_setup_anon_common(testdata, PROT_READ|PROT_WRITE, MAP_SHARED, the_OFFSET); } static int mmaps_setup_rw_ap_offset(void **testdata) { return mmaps_setup_anon_common(testdata, PROT_READ|PROT_WRITE, MAP_PRIVATE, the_OFFSET); } static int mmaps_setup_rw_fs_offset(void **testdata) { return mmaps_setup_file_common(testdata, PROT_READ|PROT_WRITE, MAP_SHARED, the_OFFSET, 0); } static int mmaps_setup_rw_fp_offset(void **testdata) { return mmaps_setup_file_common(testdata, PROT_READ|PROT_WRITE, MAP_PRIVATE, the_OFFSET, 0); } static int mmaps_setup_rw_us_offset(void **testdata) { return mmaps_setup_file_common(testdata, PROT_READ|PROT_WRITE, MAP_SHARED, the_OFFSET, TEST_UNLINK); } static int mmaps_setup_rw_up_offset(void **testdata) { return mmaps_setup_file_common(testdata, PROT_READ|PROT_WRITE, MAP_PRIVATE, the_OFFSET, TEST_UNLINK); } static int mmaps_setup_ro_fs_offset(void **testdata) { return mmaps_setup_file_common(testdata, PROT_READ, MAP_SHARED, the_OFFSET, 0); } static int mmaps_setup_rw_fs2(void **testdata) { return mmaps_setup_file_common(testdata, PROT_READ|PROT_WRITE, MAP_SHARED, 0, TEST_WRITE_FD); } static int mmaps_setup_rw_fs2_offset(void **testdata) { return mmaps_setup_file_common(testdata, PROT_READ|PROT_WRITE, MAP_SHARED, the_OFFSET, TEST_WRITE_FD); } static int mmaps_setup_rw_us2(void **testdata) { return mmaps_setup_file_common(testdata, PROT_READ|PROT_WRITE, MAP_SHARED, 0, TEST_UNLINK|TEST_WRITE_FD); } static int mmaps_setup_rw_us2_offset(void **testdata) { return mmaps_setup_file_common(testdata, PROT_READ|PROT_WRITE, MAP_SHARED, the_OFFSET, TEST_UNLINK|TEST_WRITE_FD); } static int check_private(struct testcase *t) { if (strncmp(t->addr, MSG1, sizeof(MSG1))) { CRUT_FAIL("Wrong value read from memory"); return -1; } return 0; } static int mmaps_precheckpoint_private(void *p) { CRUT_DEBUG("Sanity check before checkpoint."); return check_private(p); } static int mmaps_continue_private(void *p) { CRUT_DEBUG("Continuing after checkpoint."); return check_private(p); } static int mmaps_restart_private(void *p) { CRUT_DEBUG("Restarting from checkpoint."); return check_private(p); } static int check_shared(struct testcase *t) { int rc; pid_t pid; rc = check_private(t); if (rc < 0) return rc; if (!(t->prot & PROT_WRITE)) { if (mprotect(t->addr, t->len, PROT_READ|PROT_WRITE) == 0) { CRUT_FAIL("Unexpected success from mprotect(READ|WRITE) of read-only file"); return -1; } return 0; } /* Fork a transient child to read MSG1 and write MSG2 */ pid = fork(); if (pid < 0) { CRUT_FAIL("fork() failed: %s", strerror(errno)); return -1; } if (!pid) { /* Child */ if (strncmp(t->addr, MSG1, sizeof(MSG1))) { CRUT_FAIL("Wrong value read in child. Post-checkpoint sharing lost? '%s' '%s'", t->addr, MSG1); exit(-1); } strcpy(t->addr, MSG2); exit(0); } crut_waitpid_expect(pid, 0); /* Now ask the permanent child to read MSG2 and write MSG3 */ crut_pipes_putchar(&t->checker, MSG_PARENT_REQUEST); crut_pipes_expect(&t->checker, MSG_CHILD_GOOD); if (strncmp(t->addr, MSG3, sizeof(MSG3))) { CRUT_FAIL("Wrong value read from memory. Pre-checkpoint sharing lost? '%s' '%s'", t->addr, MSG3); return -1; } strcpy(t->addr, MSG1); return 0; } static int mmaps_precheckpoint_shared(void *p) { CRUT_DEBUG("Sanity check before checkpoint."); return check_shared(p); } static int mmaps_continue_shared(void *p) { CRUT_DEBUG("Continuing after checkpoint."); return check_shared(p); } static int mmaps_restart_shared(void *p) { CRUT_DEBUG("Restarting from checkpoint."); return check_shared(p); } static int mmaps_teardown(void *p) { struct testcase *t = (struct testcase *)p; (void)unlink(FILENAME); if (t->flags & MAP_SHARED) { crut_pipes_putchar(&t->checker, MSG_PARENT_DONE); crut_waitpid_expect(t->checker.child, MSG_PARENT_DONE); } return munmap(t->addr, t->len); } int main(int argc, char *argv[]) { int ret; struct crut_operations rw_as_test_ops = { test_scope:CR_SCOPE_TREE, test_name:"mmaps_rw_as", test_description:"Test mmap(READ|WRITE,ANONYMOUS|SHARED).", test_setup:mmaps_setup_rw_as, test_precheckpoint:mmaps_precheckpoint_shared, test_continue:mmaps_continue_shared, test_restart:mmaps_restart_shared, test_teardown:mmaps_teardown, }; struct crut_operations rw_ap_test_ops = { test_scope:CR_SCOPE_TREE, test_name:"mmaps_rw_ap", test_description:"Test mmap(READ|WRITE,ANONYMOUS|PRIVATE).", test_setup:mmaps_setup_rw_ap, test_precheckpoint:mmaps_precheckpoint_private, test_continue:mmaps_continue_private, test_restart:mmaps_restart_private, test_teardown:mmaps_teardown, }; struct crut_operations rw_as_offset_test_ops = { test_scope:CR_SCOPE_TREE, test_name:"mmaps_rw_as_offset", test_description:"Test mmap(READ|WRITE,ANONYMOUS|SHARED) w/ unmapped prefix.", test_setup:mmaps_setup_rw_as_offset, test_precheckpoint:mmaps_precheckpoint_shared, test_continue:mmaps_continue_shared, test_restart:mmaps_restart_shared, test_teardown:mmaps_teardown, }; struct crut_operations rw_ap_offset_test_ops = { test_scope:CR_SCOPE_TREE, test_name:"mmaps_rw_ap_offset", test_description:"Test mmap(READ|WRITE,ANONYMOUS|PRIVATE) w/ unmapped prefix.", test_setup:mmaps_setup_rw_ap_offset, test_precheckpoint:mmaps_precheckpoint_private, test_continue:mmaps_continue_private, test_restart:mmaps_restart_private, test_teardown:mmaps_teardown, }; struct crut_operations rw_fs_test_ops = { test_scope:CR_SCOPE_TREE, test_name:"mmaps_rw_fs", test_description:"Test mmap(READ|WRITE,SHARED) of a file.", test_setup:mmaps_setup_rw_fs, test_precheckpoint:mmaps_precheckpoint_shared, test_continue:mmaps_continue_shared, test_restart:mmaps_restart_shared, test_teardown:mmaps_teardown, }; struct crut_operations rw_fp_test_ops = { test_scope:CR_SCOPE_TREE, test_name:"mmaps_rw_fp", test_description:"Test mmap(READ|WRITE,PRIVATE) of a file.", test_setup:mmaps_setup_rw_fp, test_precheckpoint:mmaps_precheckpoint_private, test_continue:mmaps_continue_private, test_restart:mmaps_restart_private, test_teardown:mmaps_teardown, }; struct crut_operations rw_us_test_ops = { test_scope:CR_SCOPE_TREE, test_name:"mmaps_rw_us", test_description:"Test mmap(READ|WRITE,SHARED) of an unlinked file.", test_setup:mmaps_setup_rw_us, test_precheckpoint:mmaps_precheckpoint_shared, test_continue:mmaps_continue_shared, test_restart:mmaps_restart_shared, test_teardown:mmaps_teardown, }; struct crut_operations rw_up_test_ops = { test_scope:CR_SCOPE_TREE, test_name:"mmaps_rw_up", test_description:"Test mmap(READ|WRITE,PRIVATE) of an unlinked file.", test_setup:mmaps_setup_rw_up, test_precheckpoint:mmaps_precheckpoint_private, test_continue:mmaps_continue_private, test_restart:mmaps_restart_private, test_teardown:mmaps_teardown, }; struct crut_operations ro_fs_test_ops = { test_scope:CR_SCOPE_TREE, test_name:"mmaps_ro_fs", test_description:"Test mmap(READ,SHARED) of a file.", test_setup:mmaps_setup_ro_fs, test_precheckpoint:mmaps_precheckpoint_shared, test_continue:mmaps_continue_shared, test_restart:mmaps_restart_shared, test_teardown:mmaps_teardown, }; struct crut_operations rw_fs_offset_test_ops = { test_scope:CR_SCOPE_TREE, test_name:"mmaps_rw_fs_offset", test_description:"Test mmap(READ|WRITE,SHARED,OFFSET>0) of a file.", test_setup:mmaps_setup_rw_fs_offset, test_precheckpoint:mmaps_precheckpoint_shared, test_continue:mmaps_continue_shared, test_restart:mmaps_restart_shared, test_teardown:mmaps_teardown, }; struct crut_operations rw_fp_offset_test_ops = { test_scope:CR_SCOPE_TREE, test_name:"mmaps_rw_fp_offset", test_description:"Test mmap(READ|WRITE,PRIVATE,OFFSET>0) of a file.", test_setup:mmaps_setup_rw_fp_offset, test_precheckpoint:mmaps_precheckpoint_private, test_continue:mmaps_continue_private, test_restart:mmaps_restart_private, test_teardown:mmaps_teardown, }; struct crut_operations rw_us_offset_test_ops = { test_scope:CR_SCOPE_TREE, test_name:"mmaps_rw_us_offset", test_description:"Test mmap(READ|WRITE,SHARED,OFFSET>0) of an unlinked file.", test_setup:mmaps_setup_rw_us_offset, test_precheckpoint:mmaps_precheckpoint_shared, test_continue:mmaps_continue_shared, test_restart:mmaps_restart_shared, test_teardown:mmaps_teardown, }; struct crut_operations rw_up_offset_test_ops = { test_scope:CR_SCOPE_TREE, test_name:"mmaps_rw_up_offset", test_description:"Test mmap(READ|WRITE,PRIVATE,OFFSET>0) of an unlinked file.", test_setup:mmaps_setup_rw_up_offset, test_precheckpoint:mmaps_precheckpoint_private, test_continue:mmaps_continue_private, test_restart:mmaps_restart_private, test_teardown:mmaps_teardown, }; struct crut_operations ro_fs_offset_test_ops = { test_scope:CR_SCOPE_TREE, test_name:"mmaps_ro_fs_offset", test_description:"Test mmap(READ,SHARED,OFFSET>0) of a file.", test_setup:mmaps_setup_ro_fs_offset, test_precheckpoint:mmaps_precheckpoint_shared, test_continue:mmaps_continue_shared, test_restart:mmaps_restart_shared, test_teardown:mmaps_teardown, }; struct crut_operations rw_fs2_test_ops = { test_scope:CR_SCOPE_TREE, test_name:"mmaps_rw_fs2", test_description:"Test mmap(READ|WRITE,SHARED) of a file via memory and fd.", test_setup:mmaps_setup_rw_fs2, test_precheckpoint:mmaps_precheckpoint_shared, test_continue:mmaps_continue_shared, test_restart:mmaps_restart_shared, test_teardown:mmaps_teardown, }; struct crut_operations rw_fs2_offset_test_ops = { test_scope:CR_SCOPE_TREE, test_name:"mmaps_rw_fs2_offset", test_description:"Test mmap(READ|WRITE,SHARED,OFFSET>0) of a file via memory and fd.", test_setup:mmaps_setup_rw_fs2_offset, test_precheckpoint:mmaps_precheckpoint_shared, test_continue:mmaps_continue_shared, test_restart:mmaps_restart_shared, test_teardown:mmaps_teardown, }; struct crut_operations rw_us2_test_ops = { test_scope:CR_SCOPE_TREE, test_name:"mmaps_rw_us2", test_description:"Test mmap(READ|WRITE,SHARED) of an unlinked file via memory and fd.", test_setup:mmaps_setup_rw_us2, test_precheckpoint:mmaps_precheckpoint_shared, test_continue:mmaps_continue_shared, test_restart:mmaps_restart_shared, test_teardown:mmaps_teardown, }; struct crut_operations rw_us2_offset_test_ops = { test_scope:CR_SCOPE_TREE, test_name:"mmaps_rw_us2_offset", test_description:"Test mmap(READ|WRITE,SHARED,OFFSET>0) of an unlinked file via memory and fd.", test_setup:mmaps_setup_rw_us2_offset, test_precheckpoint:mmaps_precheckpoint_shared, test_continue:mmaps_continue_shared, test_restart:mmaps_restart_shared, test_teardown:mmaps_teardown, }; /* MAP_ANONYMOUS tests */ crut_add_test(&rw_as_test_ops); crut_add_test(&rw_ap_test_ops); crut_add_test(&rw_as_offset_test_ops); crut_add_test(&rw_ap_offset_test_ops); /* "normal" file tests */ crut_add_test(&rw_fs_test_ops); crut_add_test(&rw_fp_test_ops); crut_add_test(&ro_fs_test_ops); crut_add_test(&rw_fs_offset_test_ops); crut_add_test(&rw_fp_offset_test_ops); crut_add_test(&ro_fs_offset_test_ops); crut_add_test(&rw_fs2_test_ops); crut_add_test(&rw_fs2_offset_test_ops); /* unlinked file tests */ crut_add_test(&rw_us_test_ops); crut_add_test(&rw_up_test_ops); crut_add_test(&rw_us_offset_test_ops); crut_add_test(&rw_up_offset_test_ops); crut_add_test(&rw_us2_test_ops); crut_add_test(&rw_us2_offset_test_ops); pagesize = getpagesize(); ret = crut_main(argc, argv); return ret; } blcr-0.8.5/tests/simple_pthread.c0000664000000000000000000001307511114414150013643 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2003, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * 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 * * $Id: simple_pthread.c,v 1.11 2008/11/30 04:36:56 phargrov Exp $ * * Simple example for using crut */ #include #include #include #include #include #include #include #include #include "crut.h" #include "crut_util.h" #define MSG "Hello world!\n" #define NUM_PTHREADS 5 static int my_barrier; static void * do_thread_stuff(void *p) { int retval; void *thread_ret; thread_ret = malloc(sizeof(int)); if (thread_ret == NULL) { goto out_nomem; } CRUT_DEBUG("thread_ret = %p", thread_ret); /* check that the poll routines are working correctly. */ retval = crut_poll(CRUT_EVENT_SETUP); if (retval < 0) { goto out; } else if (retval == 0) { CRUT_FAIL("crut_poll(CRUT_EVENT_SETUP) returned wrong answer!"); goto out; } /* check that the poll routines are working correctly. */ retval = crut_poll(CRUT_EVENT_NEVER); if (retval < 0) { goto out; } else if (retval == 1) { CRUT_FAIL("crut_poll(CRUT_EVENT_NEVER) returned wrong answer!"); goto out; } CRUT_DEBUG("crut_wait(setup)"); retval = crut_wait(CRUT_EVENT_SETUP); if (retval < 0) { goto out; } CRUT_DEBUG("crut_wait(precheckpoint)"); retval = crut_wait(CRUT_EVENT_PRECHECKPOINT); if (retval < 0) { goto out; } CRUT_DEBUG("crut_wait(continue)"); retval = crut_wait(CRUT_EVENT_CONTINUE); if (retval < 0) { goto out; } crut_barrier(&my_barrier); CRUT_DEBUG("crut_wait(restart)"); retval = crut_wait(CRUT_EVENT_RESTART); if (retval < 0) { goto out; } CRUT_DEBUG("crut_wait(teardown)"); retval = crut_wait(CRUT_EVENT_TEARDOWN); if (retval < 0) { goto out; } *(int *) thread_ret = retval; out: return thread_ret; out_nomem: return NULL; } static int simple_pthread_setup(void **testdata) { int retval; pthread_t *test_thread; int num_threads = NUM_PTHREADS; int i; test_thread = malloc(sizeof(pthread_t)*num_threads); if (test_thread == NULL) { perror("malloc"); goto out; } my_barrier = NUM_PTHREADS+1; for (i=0; i=0; --i) { if (pthread_cancel(test_thread[i])) { perror("pthread_cancel"); } } free(test_thread); *testdata = NULL; return retval; } static int simple_pthread_precheckpoint(void *p) { CRUT_DEBUG("Preparing to checkpoint."); return 0; } static int simple_pthread_continue(void *p) { CRUT_DEBUG("Continuing after checkpoint."); crut_barrier(&my_barrier); return 0; } static int simple_pthread_restart(void *p) { CRUT_DEBUG("Restarting from checkpoint."); crut_barrier(&my_barrier); return 0; } static int simple_pthread_teardown(void *p) { int retval; int join_ret; void *pthread_ret; int *thread_ret; pthread_t *threads = (pthread_t *) p; int num_threads = NUM_PTHREADS; int i; retval = 0; for (i=0; i #include #include #include #include #include #include #include #include #include #include "crut.h" #include "libcr.h" static char *context_filename; static int crut_initialized = 0; static struct crut_operations crut_tests[CRUT_MAX_TESTS]; static char crut_usage_message[] = { "\n" " -h,-? --help Print this help message.\n" " -l --list List tests.\n" " -v --verbose Show checkpoint steps.\n" " -d --debug Show debugging messages.\n" "\n" }; enum crut_state { crut_error=0, crut_continue, crut_restart, }; static int crut_callback_counter = 0; static enum crut_state crut_checkpoint_status = crut_error; static int crut_saved_error = 0; /* * * crut_wait and crut_signal use this to keep track of where we are in the * * checkpoint progression * */ static int crut_event_state = 0; /* lock for crut_event_state */ static pthread_mutex_t crut_event_mutex = PTHREAD_MUTEX_INITIALIZER; static pthread_cond_t crut_event_condition = PTHREAD_COND_INITIALIZER; int optind; /* Extended perror() while preserving errno */ static void my_perror(const char *msg) { int saved_errno = errno; fprintf(stderr, "%s: %s\n", msg, cr_strerror(errno)); errno = saved_errno; } /* * We use a callback to find out whether we're continuing or restarting. */ static int crut_callback(void *arg) { int ret; ++crut_callback_counter; ret = cr_checkpoint(0); if (ret > 0) { crut_checkpoint_status = crut_restart; } else if (ret == 0) { crut_checkpoint_status = crut_continue; } else { crut_checkpoint_status = crut_error; crut_saved_error = ret; } return 0; } static void crut_list_tests(FILE *stream) { int i=0; while (crut_tests[i].test_name[0] != '\0' && i < CRUT_MAX_TESTS) { fprintf(stream, "%s\n", crut_tests[i].test_name); i++; } } static void crut_usage(FILE *stream, char *name) { fprintf(stream, "Usage: %s [OPTIONS] test_name\n", name); } static void crut_help(FILE *stream) { int i; fprintf(stream, "%s", crut_usage_message); fprintf(stream, "Tests available:\n"); for (i = 0; i < CRUT_MAX_TESTS && crut_tests[i].test_name[0] != '\0'; ++i) { fprintf(stream, " %s: %s\n", crut_tests[i].test_name, crut_tests[i].test_description); } fprintf(stream, "\nSubmit bugs to http://mantis.lbl.gov/bugzilla\n"); } static struct crut_operations * crut_find_test(const char *test_name) { int i; for (i=0; i 0. */ if (crut_event_state <= 0) { fprintf(stderr, "crut_poll: Never initialized!\n"); retval = -1; } if (pthread_mutex_unlock(&crut_event_mutex) < 0) { my_perror("WARNING: pthread_mutex_unlock"); goto out; } out: return retval; #if 0 // unused path out_unlock: if (pthread_mutex_unlock(&crut_event_mutex)) { /* ignore return code of unlock on error */ my_perror("pthread_mutex_unlock"); } return retval; #endif } /* * wake up all processes waiting for this event or any preceding events */ static int crut_signal(crut_event_t event) { int retval; retval = pthread_mutex_lock(&crut_event_mutex); if (retval) { my_perror("pthread_mutex_lock"); goto out; } crut_event_state = event; retval = pthread_cond_broadcast(&crut_event_condition); if (retval) { my_perror("pthread_cond_broadcast"); goto out_unlock; } retval = pthread_mutex_unlock(&crut_event_mutex); if (retval) { my_perror("pthread_mutex_unlock"); goto out; } out: return retval; out_unlock: if(pthread_mutex_unlock(&crut_event_mutex)) { /* ignore return code of unlock on error */ my_perror("pthread_mutex_unlock"); } return retval; } void crut_exit(int exitcode) { exit(exitcode); } void crut_add_test(struct crut_operations *test_ops) { int i; const char noname[] = "(unnamed)"; /* We fix their input as a side effect... */ test_ops->test_name[CRUT_TESTNAME_MAX] = '\0'; if (!crut_initialized) { initialize_crut(); } for (i=0; itest_name, strlen(test_ops->test_name))) { fprintf(stderr, "Duplicate test (%s).\n", crut_tests[i].test_name); exit(-1); } else if (crut_tests[i].test_name[0] == '\0') { memcpy(&crut_tests[i], test_ops, sizeof(*test_ops)); if (crut_tests[i].test_name[0] == '\0') { strncpy(crut_tests[i].test_name, noname, sizeof(noname)); } goto out; } } switch (test_ops->test_scope) { case CR_SCOPE_PROC: case CR_SCOPE_TREE: case CR_SCOPE_PGRP: break; case CR_SCOPE_SESS: /* Not automated, since parent must exit for setsid() to work and * that prevents returning an exit code. * XXX: This could be implemented, if really needed, by sending * the return value through a named fifo or something similar. */ default: CRUT_FAIL("Invalid scope %d specified", test_ops->test_scope); exit(-1); } out: return; } /* XXX: global so dup test can read it */ cr_checkpoint_handle_t crut_cr_handle; int crut_checkpoint_to_file(const char *filename, int scope) { int ret; cr_checkpoint_args_t cr_args; /* remove existing context file, if any */ (void)unlink(filename); /* open the context file */ CRUT_VERBOSE("opening the context file: %s", filename); ret = open(filename, O_WRONLY | O_CREAT | O_TRUNC | O_LARGEFILE, 0600); if (ret < 0) { my_perror("open"); goto out; } cr_initialize_checkpoint_args_t(&cr_args); cr_args.cr_fd = ret; cr_args.cr_scope = scope; /* issue the request */ ret = cr_request_checkpoint(&cr_args, &crut_cr_handle); if (ret < 0) { (void)close(cr_args.cr_fd); (void)unlink(filename); my_perror("cr_request_checkpoint"); goto out; } /* wait for the request to complete */ do { char *kmsgs = NULL; ret = cr_poll_checkpoint_msg(&crut_cr_handle, NULL, &kmsgs); if (ret < 0) { if ((ret == CR_POLL_CHKPT_ERR_POST) && (errno == CR_ERESTARTED)) { /* restarting -- not an error */ ret = 0; } else if (errno == EINTR) { /* retry */ ; } else { int saved_errno = errno; fprintf(stderr, "cr_poll_checkpoint returned %d: %s\n", ret, cr_strerror(errno)); if (kmsgs) { fputs(kmsgs, stderr); } errno = saved_errno; goto out; } } else if (ret == 0) { fprintf(stderr, "cr_poll_checkpoint returned unexpected 0\n"); exit(1); } } while (ret < 0); close(cr_args.cr_fd); out: return ret; } int crut_main(int argc, char * const *argv) { int ret; struct crut_operations *test_ops; char *test_name; void *testdata = NULL; cr_client_id_t client_id = 0; int opt_fake_cr = 0; char *shortflags = "Flh?vd"; /* 1 colon == requires argument */ struct option longflags[] = { /* misc options: */ {"fake-cr", no_argument, 0, 'F'}, {"list", no_argument, 0, 'l'}, {"help", no_argument, 0, '?'}, {"debug", no_argument, 0, 'd'}, {"verbose", no_argument, 0, 'v'}, {0, 0, 0, 0} }; while (1) { int longindex = -1; int opt = getopt_long(argc, argv, shortflags, longflags, &longindex); if (opt == -1) { ret = optind; break; /* reached last option */ } switch (opt) { case 'F': opt_fake_cr = 1; break; case 'l': crut_list_tests(stdout); exit(0); case '?': case 'h': crut_usage(stdout, argv[0]); crut_help(stdout); exit(0); case 'v': crut_trace_mask |= CRUT_TRACETYPE_VERBOSE; break; case 'd': crut_trace_mask |= (CRUT_TRACETYPE_DEBUG | CRUT_TRACETYPE_VERBOSE); break; default: crut_usage(stderr, argv[0]); fprintf(stderr, "Try '%s --help' for more information.\n", argv[0]); exit(-1); } } crut_program_name = argv[0]; if (!argv[ret] || ret > argc) { crut_usage(stderr, crut_program_name); fprintf(stderr, "Try '%s --help' for more information.\n", argv[0]); exit(-1); } test_name = argv[ret]; test_ops = crut_find_test(test_name); if (!test_ops) { CRUT_FAIL("No such test %s", test_name); exit(-1); } CRUT_VERBOSE("PID %d", getpid()); if (opt_fake_cr) { CRUT_VERBOSE("Skipping cr_init and cr_register_callback."); } else { CRUT_VERBOSE("cr_init()"); client_id = cr_init(); if (client_id < 0) { CRUT_FAIL("cr_init() failed. ret=%d. errno=%d", client_id, errno); my_perror("crut"); crut_exit(client_id); } CRUT_VERBOSE("cr_register_callback()"); ret = cr_register_callback(crut_callback, NULL, CR_SIGNAL_CONTEXT); if (ret < 0) { CRUT_FAIL("cr_register_callback() failed. ret=%d", ret); crut_exit(ret); } } if (test_ops->test_setup) { CRUT_VERBOSE("test_setup()"); ret = crut_signal(CRUT_EVENT_SETUP); if (ret < 0) { CRUT_FAIL("crut_signal(CRUT_EVENT_SETUP) failed. ret=%d", ret); crut_exit(ret); } ret = test_ops->test_setup(&testdata); if (ret < 0) { CRUT_FAIL("test_setup() failed. ret=%d", ret); crut_exit(ret); } } CRUT_VERBOSE("test_precheckpoint()"); ret = crut_signal(CRUT_EVENT_PRECHECKPOINT); if (ret < 0) { CRUT_FAIL("crut_signal(CRUT_EVENT_PRECHECKPOINT) failed. ret=%d", ret); crut_exit(ret); } ret = test_ops->test_precheckpoint(testdata); if (ret < 0) { CRUT_FAIL("test_precheckpoint() failed. ret=%d", ret); crut_exit(ret); } if (opt_fake_cr) { CRUT_VERBOSE("Skipping cr_request_checkpoint() and faking restart."); crut_checkpoint_status = crut_restart; } else { CRUT_VERBOSE("crut_checkpoint_to_file()"); ret = crut_checkpoint_to_file(context_filename, test_ops->test_scope); if (ret < 0) { CRUT_FAIL("crut_checkpoint_to_file(%s, %d) failed ret=%d errno=%s", context_filename, test_ops->test_scope, ret, cr_strerror(errno)); crut_exit(ret); } ret = cr_status(); if (ret != CR_STATE_IDLE) { CRUT_FAIL("cr_status() unexpectedly returned %d", ret); crut_exit(ret); } } switch (crut_checkpoint_status) { case crut_continue: CRUT_VERBOSE("test_continue()"); ret = crut_signal(CRUT_EVENT_CONTINUE); if (ret < 0) { CRUT_FAIL("crut_signal(CRUT_EVENT_CONTINUE) failed. ret=%d", ret); crut_exit(ret); } ret = test_ops->test_continue(testdata); if (ret < 0) { CRUT_FAIL("test_continue() unexpectedly returned %d", ret); crut_exit(ret); } CRUT_VERBOSE("test_continue() complete"); break; case crut_restart: CRUT_VERBOSE("test_restart()"); ret = crut_signal(CRUT_EVENT_RESTART); if (ret < 0) { CRUT_FAIL("crut_signal(CRUT_EVENT_RESTART) failed. ret=%d", ret); crut_exit(ret); } ret = test_ops->test_restart(testdata); if (ret < 0) { CRUT_FAIL("test_restart() unexpectedly returned %d", ret); crut_exit(ret); } if (test_ops->test_teardown) { CRUT_VERBOSE("test_teardown()"); ret = crut_signal(CRUT_EVENT_TEARDOWN); if (ret < 0) { CRUT_FAIL("crut_signal(CRUT_EVENT_TEARDOWN) failed. ret=%d", ret); crut_exit(ret); } ret = test_ops->test_teardown(testdata); if (ret < 0) { CRUT_FAIL("test_teardown() failed. ret=%d", ret); crut_exit(ret); } } break; case crut_error: default: CRUT_FAIL("Error during checkpoint. crut_checkpoint_status = %d, saved error = %d", crut_checkpoint_status, crut_saved_error); crut_exit(-1); } crut_initialized = 0; CRUT_DEBUG("Exiting successfully."); crut_exit(0); /* NOT REACHED */ return 0; /* avoid compiler warning */ } blcr-0.8.5/tests/python_test.sh0000664000000000000000000000312311015415407013412 00000000000000#!/bin/bash # # Test of checkpoint/restart of a python script. # Note that the outer shell script is bash # First ensure we have python python -c 1 || exit 77 . ${cr_testsdir:-`dirname $0`}/shellinit \rm -f Context[123] .Context[123].tmp 2>/dev/null bash <<-'__OUTER__' exec 2>/dev/null # Drop job control message(s) from the outer script echo '#ST_ALARM:120' $cr_run python 2>&1 <<'__INNER__' import os, sys, time, signal chkpt_cmd = os.environ.get("cr_checkpoint") rstrt_cmd = os.environ.get("cr_restart") def checkpoint(file,pid): cmd = ['cr_checkpoint', '--file='+file, '--tree', '--term', str(pid)] #print '# ' + ' '.join(cmd) os.spawnv(os.P_WAIT,chkpt_cmd,cmd) if pid != os.getpid(): os.waitpid(pid, 0) time.sleep(1) def restart(file): cmd = ['cr_restart', file] #print '# ' + ' '.join(cmd) pid = os.spawnl(os.P_NOWAIT,rstrt_cmd,'cr_restart',file) time.sleep(3) return pid pid = os.fork() if pid == 0: for i in range(16): print i, 'Hello' time.sleep(1) sys.exit(0) time.sleep(3) print '# Checkpoint original child' checkpoint('Context1',pid) print '# Restart 1' pid = restart('Context1') print '# Checkpoint restarted child' checkpoint('Context2',pid) print '# Restart^2' pid = restart('Context2') print '# Checkpoint self' checkpoint('Context3',os.getpid()) os.waitpid(pid, 0) print '16 DONE' sys.exit(0) __INNER__ exec 2>&1 sleep 3 echo "# Restart interpreter" $cr_restart Context3 __OUTER__ \rm -f Context[123] .Context[123].tmp 2>/dev/null blcr-0.8.5/tests/hugetlbfs2.c0000664000000000000000000001614511056065765012734 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2008, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * 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 * * $Id: hugetlbfs2.c,v 1.3 2008/08/29 21:36:53 phargrov Exp $ * * Test of PRIVATE mmap()s on hugetlbfs across a checkpoint */ #define _GNU_SOURCE /* Ensures we get getline() */ #include #include #include #include #include #include #include #include #include #include #include #include "crut.h" static const char MSG[] = "MSG: Hello world!"; static int pagesize = -1; #define FILESTEM "/tstfile.0" static char *filename; enum { TEST_UNLINK = 1, }; struct testcase { char * addr; size_t len; int prot; int flags; int fd; int test_flags; }; static int mmaps_setup_common(void **testdata, void *start, int prot , int flags, int fd, int test_flags) { struct testcase *t = malloc(sizeof(*t)); size_t len = pagesize; t->test_flags = test_flags; t->len = len; t->prot = prot; t->flags = flags; t->fd = fd; t->addr = mmap(start, len, prot, flags, fd, 0); CRUT_DEBUG("mmap(%p, %d, 0x%x, 0x%x, %d, 0) -> %p (%d)", start, (int)len, prot, flags, fd, t->addr, errno); if (t->addr == MAP_FAILED) return -1; strcpy(t->addr, MSG); *testdata = t; return 0; } static int mmaps_setup_file_common(void **testdata, int prot, int flags, off_t offset, int test_flags) { int fd, retval; (void)unlink(filename); fd = open(filename, O_CREAT|O_RDWR|O_TRUNC, S_IREAD|S_IWRITE); if (fd < 0) return fd; retval = mmaps_setup_common(testdata, 0, prot, flags, fd, test_flags); close(fd); if (test_flags & TEST_UNLINK) (void)unlink(filename); return retval; } static int mmaps_setup_rw_fp(void **testdata) { return mmaps_setup_file_common(testdata, PROT_READ|PROT_WRITE, MAP_PRIVATE, 0, 0); } static int mmaps_setup_rw_up(void **testdata) { return mmaps_setup_file_common(testdata, PROT_READ|PROT_WRITE, MAP_PRIVATE, 0, TEST_UNLINK); } static int check_private(struct testcase *t) { if (strncmp(t->addr, MSG, sizeof(MSG))) { CRUT_FAIL("Wrong value read from memory"); return -1; } if (!(t->prot & PROT_WRITE)) { if (mprotect(t->addr, t->len, PROT_READ|PROT_WRITE) == 0) { CRUT_FAIL("Unexpected success from mprotect(READ|WRITE) of read-only file"); return -1; } return 0; } return 0; } static int mmaps_precheckpoint_private(void *p) { CRUT_DEBUG("Sanity check before checkpoint."); return check_private(p); } static int mmaps_continue_private(void *p) { CRUT_DEBUG("Continuing after checkpoint."); return check_private(p); } static int mmaps_restart_private(void *p) { CRUT_DEBUG("Restarting from checkpoint."); return check_private(p); } static int mmaps_teardown(void *p) { struct testcase *t = (struct testcase *)p; (void)unlink(filename); return munmap(t->addr, t->len); } static void test_init(void) { FILE *fp; int rc, fd; size_t len; char *line = NULL; char *mntpnt = NULL; void *addr; /* Find the pagesize */ fp = fopen("/proc/meminfo", "r"); if (!fp) { perror("open(/proc/meminfo)"); exit(1); } while ((rc = getline(&line, &len, fp)) >= 0) { const char key[] = "Hugepagesize:"; char *s; int kb; if (strncmp(key, line, sizeof(key) - 1)) { continue; } s = strchr(line, ' '); /* space after key */ if (!s) { continue; } if (sscanf(s, " %d", &kb) != 1) { continue; } pagesize = 1024 * kb; break; } free(line); line = NULL; (void)fclose(fp); if (pagesize < 0) { fprintf(stderr, "Unable to determine huge pagesize, if any (test skipped).\n"); exit(77); } /* Find the mount point */ fp = fopen("/proc/mounts", "r"); if (!fp) { perror("open(/proc/mounts)"); exit(1); } while ((rc = getline(&line, &len, fp)) >= 0) { const char key[] = "hugetlbfs"; char *s, *fstype; s = strchr(line, ' '); /* space after device */ if (!s) { continue; } mntpnt = s + 1; s = strchr(mntpnt, ' '); /* space after mntpnt */ if (!s) { continue; } *s = '\0'; len = s - mntpnt; fstype = s + 1; if (strncmp(key, fstype, sizeof(key) - 1)) { continue; } mntpnt = strdup(mntpnt); break; } free(line); line = NULL; (void)fclose(fp); if (rc < 0) { fprintf(stderr, "No hugetlbfs mount point found (test skipped)\n"); exit(77); } /* Build the filename */ len += sizeof(FILESTEM); filename = malloc(len); strcpy(filename, mntpnt); strcat(filename, FILESTEM); free(mntpnt); /* Basic test that we can create and mmap the file */ (void)unlink(filename); fd = open(filename, O_CREAT|O_RDWR|O_TRUNC, S_IREAD|S_IWRITE); if (fd < 0) { fprintf(stderr, "Could not create file on hugetlbfs (test skipped)\n"); exit(77); } (void)unlink(filename); addr = mmap(0, pagesize, PROT_READ|PROT_WRITE, MAP_PRIVATE, fd, 0); (void)close(fd); if (addr == MAP_FAILED) { fprintf(stderr, "Could not private mmap %dKB file on hugetlbfs (test skipped)\n", pagesize/1024); (void)unlink(filename); exit(77); } (void)munmap(addr, pagesize); } int main(int argc, char *argv[]) { int ret; struct crut_operations rw_fp_test_ops = { test_scope:CR_SCOPE_TREE, test_name:"mmaps_rw_fp", test_description:"Test mmap(READ|WRITE,PRIVATE) of a file.", test_setup:mmaps_setup_rw_fp, test_precheckpoint:mmaps_precheckpoint_private, test_continue:mmaps_continue_private, test_restart:mmaps_restart_private, test_teardown:mmaps_teardown, }; struct crut_operations rw_up_test_ops = { test_scope:CR_SCOPE_TREE, test_name:"mmaps_rw_up", test_description:"Test mmap(READ|WRITE,PRIVATE) of an unlinked file.", test_setup:mmaps_setup_rw_up, test_precheckpoint:mmaps_precheckpoint_private, test_continue:mmaps_continue_private, test_restart:mmaps_restart_private, test_teardown:mmaps_teardown, }; /* Make sure we have a usable hugetlbfs */ test_init(); /* "normal" file test */ crut_add_test(&rw_fp_test_ops); /* unlinked file test */ crut_add_test(&rw_up_test_ops); ret = crut_main(argc, argv); return ret; } blcr-0.8.5/tests/cr_omit.sh0000664000000000000000000000114011010246535012462 00000000000000#!/bin/bash . ${cr_testsdir:-`dirname $0`}/shellinit # ${cr_run} --omit ${cr_testsdir}/pause >/dev/null 2>/dev/null & pid=$! sleep 1 ESRCH=3 ${cr_checkpoint} --clobber --term $pid 2>/dev/null result=$? if test $result = $ESRCH; then : # OK elif test $result = 0; then echo "Checkpoint suceeded unexpectedly" >&2 exit 1 else echo "Checkpoint unexpectedly failed with exit code $result" >&2 exit 1 fi exec 2>/dev/null # Drop job control message(s) kill $pid result=$? wait $pid exec 2>&1 if test $result = 0; then : # OK else echo "Target process disappeared unexpectedly" >&2 exit 1 fi exit 0 blcr-0.8.5/tests/hugetlbfs.c0000664000000000000000000002324211056065765012646 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2003, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * 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 * * $Id: hugetlbfs.c,v 1.7 2008/08/29 21:36:53 phargrov Exp $ * * Test of mmap()s on hugetlbfs across a checkpoint */ #define _GNU_SOURCE /* Ensures we get getline() */ #include #include #include #include #include #include #include #include #include #include #include #include "crut.h" enum { MSG_PARENT_DONE = 17, MSG_CHILD_READY, MSG_PARENT_REQUEST, MSG_CHILD_GOOD, MSG_CHILD_BAD }; static const char MSG1[] = "MSG1: Hello world!"; static const char MSG2[] = "MSG2: The quick brown fox jumps over the lazy dog."; static const char MSG3[] = "MSG3: All good things come to those who waitpid()."; static int pagesize = -1; #define FILESTEM "/tstfile.0" static char *filename; enum { TEST_UNLINK = 1, }; struct testcase { char * addr; size_t len; int prot; int flags; int fd; struct crut_pipes checker; int test_flags; }; static void sigpipe(int signo) { fprintf(stderr, "%d exiting on SIGPIPE\n", getpid()); exit(-1); } static void checker_child(struct testcase *t) { /* If shared mapping of a file, them map via a separate file descriptor */ if ((t->fd >= 0) && (t->flags & MAP_SHARED)) { int err, fd; err = fcntl(t->fd, F_GETFL); if (err < 0) { perror("fcntl()"); exit(-1); } fd = open(filename, err&O_ACCMODE, 0); if (fd < 0) { perror("open()"); exit(-1); } t->addr = mmap(0, t->len, t->prot, t->flags, fd, 0); if (t->addr == MAP_FAILED) { perror("mmap()"); exit(-1); } (void)close(fd); } if (t->fd >= 0) (void)close(t->fd); crut_pipes_putchar(&t->checker, MSG_CHILD_READY); while (1) { crut_pipes_expect(&t->checker, MSG_PARENT_REQUEST); if (strncmp(t->addr, MSG2, sizeof(MSG2))) { crut_pipes_putchar(&t->checker, MSG_CHILD_BAD); CRUT_FAIL("Wrong value read. Pre-checkpoint sharing lost?"); exit(-1); } strcpy(t->addr, MSG3); crut_pipes_putchar(&t->checker, MSG_CHILD_GOOD); } } static int mmaps_setup_common(void **testdata, void *start, int prot , int flags, int fd, int test_flags) { struct testcase *t = malloc(sizeof(*t)); size_t len = pagesize; t->test_flags = test_flags; t->len = len; t->prot = prot; t->flags = flags; t->fd = fd; t->addr = mmap(start, len, prot, flags, fd, 0); CRUT_DEBUG("mmap(%p, %d, 0x%x, 0x%x, %d, 0) -> %p (%d)", start, (int)len, prot, flags, fd, t->addr, errno); if (t->addr == MAP_FAILED) return -1; if (flags & MAP_SHARED) { (void)signal(SIGPIPE, &sigpipe); if (!crut_pipes_fork(&t->checker)) { /* In the child */ checker_child(t); exit(-1); /* Not reached */ } else { /* In the parent */ crut_pipes_expect(&t->checker, MSG_CHILD_READY); CRUT_DEBUG("Child ready"); } } strcpy(t->addr, MSG1); *testdata = t; return 0; } static int mmaps_setup_file_common(void **testdata, int prot, int flags, off_t offset, int test_flags) { int fd, retval; (void)unlink(filename); fd = open(filename, O_CREAT|O_RDWR|O_TRUNC, S_IREAD|S_IWRITE); if (fd < 0) return fd; retval = mmaps_setup_common(testdata, 0, prot, flags, fd, test_flags); close(fd); if (test_flags & TEST_UNLINK) (void)unlink(filename); return retval; } static int mmaps_setup_rw_fs(void **testdata) { return mmaps_setup_file_common(testdata, PROT_READ|PROT_WRITE, MAP_SHARED, 0, 0); } static int mmaps_setup_rw_us(void **testdata) { return mmaps_setup_file_common(testdata, PROT_READ|PROT_WRITE, MAP_SHARED, 0, TEST_UNLINK); } static int check_shared(struct testcase *t) { pid_t pid; if (strncmp(t->addr, MSG1, sizeof(MSG1))) { CRUT_FAIL("Wrong value read from memory"); return -1; } if (!(t->prot & PROT_WRITE)) { if (mprotect(t->addr, t->len, PROT_READ|PROT_WRITE) == 0) { CRUT_FAIL("Unexpected success from mprotect(READ|WRITE) of read-only file"); return -1; } return 0; } /* Fork a transient child to read MSG1 and write MSG2 */ pid = fork(); if (pid < 0) { CRUT_FAIL("fork() failed: %s", strerror(errno)); return -1; } if (!pid) { /* Child */ if (strncmp(t->addr, MSG1, sizeof(MSG1))) { CRUT_FAIL("Wrong value read in child. Post-checkpoint sharing lost?"); exit(-1); } strcpy(t->addr, MSG2); exit(0); } crut_waitpid_expect(pid, 0); /* Now ask the permanent child to read MSG2 and write MSG3 */ crut_pipes_putchar(&t->checker, MSG_PARENT_REQUEST); crut_pipes_expect(&t->checker, MSG_CHILD_GOOD); if (strncmp(t->addr, MSG3, sizeof(MSG3))) { CRUT_FAIL("Wrong value read from memory. Pre-checkpoint sharing lost?"); return -1; } strcpy(t->addr, MSG1); return 0; } static int mmaps_precheckpoint_shared(void *p) { CRUT_DEBUG("Sanity check before checkpoint."); return check_shared(p); } static int mmaps_continue_shared(void *p) { CRUT_DEBUG("Continuing after checkpoint."); return check_shared(p); } static int mmaps_restart_shared(void *p) { CRUT_DEBUG("Restarting from checkpoint."); return check_shared(p); } static int mmaps_teardown(void *p) { struct testcase *t = (struct testcase *)p; (void)unlink(filename); if (t->flags & MAP_SHARED) { crut_pipes_putchar(&t->checker, MSG_PARENT_DONE); crut_waitpid_expect(t->checker.child, MSG_PARENT_DONE); } return munmap(t->addr, t->len); } static void test_init(void) { FILE *fp; int rc, fd; size_t len; char *line = NULL; char *mntpnt = NULL; void *addr; /* Find the pagesize */ fp = fopen("/proc/meminfo", "r"); if (!fp) { perror("open(/proc/meminfo)"); exit(1); } while ((rc = getline(&line, &len, fp)) >= 0) { const char key[] = "Hugepagesize:"; char *s; int kb; if (strncmp(key, line, sizeof(key) - 1)) { continue; } s = strchr(line, ' '); /* space after key */ if (!s) { continue; } if (sscanf(s, " %d", &kb) != 1) { continue; } pagesize = 1024 * kb; break; } free(line); line = NULL; (void)fclose(fp); if (pagesize < 0) { fprintf(stderr, "Unable to determine huge pagesize, if any (test skipped).\n"); exit(77); } /* Find the mount point */ fp = fopen("/proc/mounts", "r"); if (!fp) { perror("open(/proc/mounts)"); exit(1); } while ((rc = getline(&line, &len, fp)) >= 0) { const char key[] = "hugetlbfs"; char *s, *fstype; s = strchr(line, ' '); /* space after device */ if (!s) { continue; } mntpnt = s + 1; s = strchr(mntpnt, ' '); /* space after mntpnt */ if (!s) { continue; } *s = '\0'; len = s - mntpnt; fstype = s + 1; if (strncmp(key, fstype, sizeof(key) - 1)) { continue; } mntpnt = strdup(mntpnt); break; } free(line); line = NULL; (void)fclose(fp); if (rc < 0) { fprintf(stderr, "No hugetlbfs mount point found (test skipped)\n"); exit(77); } /* Build the filename */ len += sizeof(FILESTEM); filename = malloc(len); strcpy(filename, mntpnt); strcat(filename, FILESTEM); free(mntpnt); /* Basic test that we can create and mmap the file */ (void)unlink(filename); fd = open(filename, O_CREAT|O_RDWR|O_TRUNC, S_IREAD|S_IWRITE); if (fd < 0) { fprintf(stderr, "Could not create file on hugetlbfs (test skipped)\n"); exit(77); } addr = mmap(0, pagesize, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0); (void)close(fd); if (addr == MAP_FAILED) { fprintf(stderr, "Could not mmap %dKB file on hugetlbfs (test skipped)\n", pagesize/1024); (void)unlink(filename); exit(77); } (void)munmap(addr, pagesize); (void)unlink(filename); } int main(int argc, char *argv[]) { int ret; struct crut_operations rw_fs_test_ops = { test_scope:CR_SCOPE_TREE, test_name:"mmaps_rw_fs", test_description:"Test mmap(READ|WRITE,SHARED) of a file.", test_setup:mmaps_setup_rw_fs, test_precheckpoint:mmaps_precheckpoint_shared, test_continue:mmaps_continue_shared, test_restart:mmaps_restart_shared, test_teardown:mmaps_teardown, }; struct crut_operations rw_us_test_ops = { test_scope:CR_SCOPE_TREE, test_name:"mmaps_rw_us", test_description:"Test mmap(READ|WRITE,SHARED) of an unlinked file.", test_setup:mmaps_setup_rw_us, test_precheckpoint:mmaps_precheckpoint_shared, test_continue:mmaps_continue_shared, test_restart:mmaps_restart_shared, test_teardown:mmaps_teardown, }; /* Make sure we have a usable hugetlbfs */ test_init(); /* "normal" file test */ crut_add_test(&rw_fs_test_ops); /* unlinked file test */ crut_add_test(&rw_us_test_ops); ret = crut_main(argc, argv); return ret; } blcr-0.8.5/tests/dev_null.c0000664000000000000000000001147211056065765012475 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2003, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * 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 * * $Id: dev_null.c,v 1.6 2008/08/29 21:36:53 phargrov Exp $ * * Test of /dev/{null,zero,full} */ #include #include #include #include #include #include #include #include #include #include "crut.h" struct testdata { int null; int zero; int full; }; static int dev_null_setup(void **testdata) { struct testdata *td; int fd; CRUT_DEBUG("Initializing dev_null."); td = malloc(sizeof(struct testdata)); if (!td) return -1; td->null = fd = open("/dev/null", O_RDWR); if (fd < 0) { CRUT_FAIL("open(/dev/null): %s", strerror(errno)); return -1; } td->zero = fd = open("/dev/zero", O_RDWR); if (fd < 0) { CRUT_FAIL("open(/dev/zero): %s", strerror(errno)); return -1; } td->full = fd = open("/dev/full", O_WRONLY); if (fd < 0) { CRUT_FAIL("open(/dev/full): %s", strerror(errno)); return -1; } *testdata = td; return 0; } static int check_it(struct testdata *td) { int retval = 0; int i; int rc; /* /dev/null: reads get EOF, writes succeed */ i = 0x12345678; rc = read(td->null, &i, sizeof(i)); if (rc < 0) { CRUT_FAIL("read(/dev/null) failed: %s", strerror(errno)); retval = -1; } else if (rc != 0) { CRUT_FAIL("read(/dev/null) returned %d (expect 0)", rc); retval = -1; } rc = write(td->null, &i, sizeof(i)); if (rc < 0) { CRUT_FAIL("write(/dev/null) failed: %s", strerror(errno)); retval = -1; } else if (rc != sizeof(i)) { CRUT_FAIL("write(/dev/null) returned %d (expect %d)", rc, (int)sizeof(i)); retval = -1; } /* /dev/zero: reads get zeroed bytes, writes succeed */ i = 0x12345678; rc = read(td->zero, &i, sizeof(i)); if (rc < 0) { CRUT_FAIL("read(/dev/zero) failed: %s", strerror(errno)); retval = -1; } else if (rc != sizeof(i)) { CRUT_FAIL("read(/dev/zero) returned %d (expect %d)", rc, (int)sizeof(i)); retval = -1; } else if (i != 0) { CRUT_FAIL("read(/dev/zero) read value %d (expect 0)", i); retval = -1; } rc = write(td->zero, &i, sizeof(i)); if (rc < 0) { CRUT_FAIL("write(/dev/zero) failed: %s", strerror(errno)); retval = -1; } else if (rc != sizeof(i)) { CRUT_FAIL("write(/dev/zero) returned %d (expect %d)", rc, (int)sizeof(i)); retval = -1; } /* /dev/full: writes fail w/ ENOSPC */ i = 0x12345678; rc = write(td->full, &i, sizeof(i)); if (rc >= 0) { CRUT_FAIL("write(/dev/zero) returned %d (expect < 0)", rc); retval = -1; } else if (errno != ENOSPC) { CRUT_FAIL("write(/dev/full) failed: %s", strerror(errno)); retval = -1; } return retval; } static int dev_null_precheckpoint(void *p) { CRUT_DEBUG("Testing sanity before we checkpoint"); return check_it((struct testdata *)p); } static int dev_null_continue(void *p) { CRUT_DEBUG("Continuing after checkpoint."); return check_it((struct testdata *)p); } static int dev_null_restart(void *p) { CRUT_DEBUG("Restarting from checkpoint."); return check_it((struct testdata *)p); } static int dev_null_teardown(void *p) { struct testdata *td = (struct testdata *)p; close(td->null); close(td->zero); close(td->full); free(td); return 0; } int main(int argc, char *argv[]) { int ret; struct crut_operations dev_null_test_ops = { test_scope:CR_SCOPE_PROC, test_name:"/dev/null", test_description:"Test of /dev/{null,zero,full}", test_setup:dev_null_setup, test_precheckpoint:dev_null_precheckpoint, test_continue:dev_null_continue, test_restart:dev_null_restart, test_teardown:dev_null_teardown, }; /* add the basic tests */ crut_add_test(&dev_null_test_ops); ret = crut_main(argc, argv); return ret; } blcr-0.8.5/tests/license.txt0000664000000000000000000000143707755231463012705 00000000000000This 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 If you are recieving this as part of BLCR, you will find the GNU GPL in the file COPYING in the top-level BLCR directory. blcr-0.8.5/tests/get_info.c0000664000000000000000000001231211056065765012451 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2007, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * 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 * * $Id: get_info.c,v 1.9 2008/08/29 21:36:53 phargrov Exp $ * * crut-based test for cr_get_{checkpoint,restart}_info() functions. */ #include #include #include #include #include #include #include #include #include "libcr.h" #include "crut.h" static char *filename = NULL; /* Callback to verify checkpoint info */ static int my_callback_chkpt(void* arg) { const struct cr_checkpoint_info *chkpt_info; int status, rc; chkpt_info = cr_get_checkpoint_info(); status = CR_CHECKPOINT_READY; if (!chkpt_info) { fprintf(stderr, "NULL checkpoint info\n"); status = CR_CHECKPOINT_PERM_FAILURE; } if (strcmp(chkpt_info->dest, filename)) { fprintf(stderr, "Destination filename mismatch\nWant '%s'\nGot '%s'\n", filename, chkpt_info->dest); status = CR_CHECKPOINT_PERM_FAILURE; } if (chkpt_info->signal != 0) { fprintf(stderr, "Unexpected non-zero signal\n"); status = CR_CHECKPOINT_PERM_FAILURE; } rc = cr_checkpoint(status); return 0; } /* Callback to verify restart info */ static int my_callback_rstrt(void* arg) { const struct cr_restart_info *rstrt_info; int status, rc; rc = cr_checkpoint(CR_CHECKPOINT_READY); status = CR_CHECKPOINT_READY; if (rc > 0) { /* Restart */ rstrt_info = cr_get_restart_info(); if (!rstrt_info) { fprintf(stderr, "NULL checkpoint info\n"); status = CR_CHECKPOINT_PERM_FAILURE; } if (strcmp(rstrt_info->src, filename)) { fprintf(stderr, "Source filename mismatch\nWant '%s'\nGot '%s'\n", filename, rstrt_info->src); status = CR_CHECKPOINT_PERM_FAILURE; } /* The kill(pid,0) will check for an existing process w/ same uid */ if ((rstrt_info->requester <= 0) || kill(rstrt_info->requester, 0)) { fprintf(stderr, "Invalid requester %d\n", rstrt_info->requester); status = CR_CHECKPOINT_PERM_FAILURE; } } return status; } static int get_info_setup_generic(void **testdata, cr_callback_t cb) { size_t alloc_size= PATH_MAX+1; int rc, pid; CRUT_DEBUG("Initializing get_info."); filename = malloc(alloc_size); pid = getpid(); if (pid < 0) { perror("getpid"); return -1; } filename = getcwd(filename, alloc_size); if ((filename == NULL) || (*filename == '\0')) { perror("getcwd"); return -1; } filename = crut_sappendf(filename, "/context.%d", pid); rc = (int)cr_init(); rc = (int)cr_register_callback(cb, NULL, CR_THREAD_CONTEXT); *testdata = NULL; return 0; } static int get_info_setup_chkpt(void **testdata) { return get_info_setup_generic(testdata, my_callback_chkpt); } static int get_info_setup_rstrt(void **testdata) { return get_info_setup_generic(testdata, my_callback_rstrt); } static int get_info_precheckpoint(void *p) { return 0; } static int get_info_continue(void *p) { CRUT_DEBUG("Continuing after checkpoint."); return 0; } static int get_info_restart(void *p) { CRUT_DEBUG("Restarting from checkpoint."); return 0; } static int get_info_teardown(void *p) { free(filename); return 0; } int main(int argc, char *argv[]) { int ret; struct crut_operations chkpt_test_ops = { test_scope:CR_SCOPE_PROC, test_name:"cr_get_checkpoint_info", test_description:"cr_get_checkpoint_info() validation test.", test_setup:get_info_setup_chkpt, test_precheckpoint:get_info_precheckpoint, test_continue:get_info_continue, test_restart:get_info_restart, test_teardown:get_info_teardown, }; struct crut_operations rstrt_test_ops = { test_scope:CR_SCOPE_PROC, test_name:"cr_get_restart_info", test_description:"cr_get_restart_info() validation test.", test_setup:get_info_setup_rstrt, test_precheckpoint:get_info_precheckpoint, test_continue:get_info_continue, test_restart:get_info_restart, test_teardown:get_info_teardown, }; /* add the basic tests */ crut_add_test(&chkpt_test_ops); crut_add_test(&rstrt_test_ops); ret = crut_main(argc, argv); return ret; } blcr-0.8.5/tests/stopped.c0000664000000000000000000002274011056052650012330 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2007, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * 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 * * $Id: stopped.c,v 1.10 2008/08/29 20:01:44 phargrov Exp $ */ /* Tests interaction of stopped processes, and the --stop/--cont options * of both cr_checkpoint and cr_restart. * Tests all (2*2*3*3 = 36) combinations of the folowing variables: * + Callback in app registered as SIGNAL or THREAD context (2 choices) * + App is RUNNING or STOPPED at time checkpoint is taken (2 choices) * + cr_checkpoint invoked with --stop, --cont, or neither (3 choices) * + cr_restart invoked with --stop, --cont, or neither (3 choices) * * Validation consists of checking that: * 1) the app is in the proper state (either RUNNING or STOPPED) * 2) the callback runs at the expected point in time (but see bug 2216) * 3) the app is able to complete its execution (after SIGCONT if appropriate) */ #define _GNU_SOURCE // for getline() #include #include #include #include #include #include #include #include #include #include "libcr.h" #include "crut_util.h" static char *filename = NULL; const char *chkpt_cmd; const char *rstrt_cmd; enum { MSG_CHILD_READY = 42, MSG_CHILD_CALLBACK, MSG_PARENT_DONE, TEST_EXIT_VAL }; static struct { int count; struct crut_pipes *pipes; } cb_args; static int my_cb(void* arg) { cr_checkpoint(CR_CHECKPOINT_READY); crut_pipes_putchar(cb_args.pipes, MSG_CHILD_CALLBACK); return 0; } void child_main(struct crut_pipes *pipes, int count, int flags) { cr_callback_id_t cb_id; cr_client_id_t my_id; int mypid = getpid(); printf("#ST_ALARM:60\n"); my_id = cr_init(); if (my_id < 0) { printf("XXX child %d cr_init() failed, returning %d\n", mypid, my_id); exit(-1); } cb_id = cr_register_callback(my_cb, (void*)(uintptr_t)(count), flags); if (cb_id < 0) { printf("XXX cr_register_callback() unexpectedly returned %d\n", cb_id); exit(-1); } cb_args.count = count; cb_args.pipes = pipes; crut_pipes_putchar(pipes, MSG_CHILD_READY); crut_pipes_expect(pipes, MSG_PARENT_DONE); exit(TEST_EXIT_VAL); } static char get_task_state(int pid) { char *procfile; char *line = NULL; char result = '?'; FILE *fp; size_t len; int rc; procfile = crut_aprintf("/proc/%d/status", pid); fp = fopen(procfile, "r"); if (fp) { while (((rc = getline(&line, &len, fp)) >= 0) && !sscanf(line, "State: %c", &result)) { /* nothing */ } (void)fclose(fp); } free(procfile); return result; } // Wait for our direct child to stop static void wait_child_stop(int child, int count) { int rc, status; do { rc = waitpid(child, &status, WUNTRACED); } while ((rc < 0) && (errno == EINTR)); if ((rc > 0) && WIFSTOPPED(status) && (WSTOPSIG(status) == SIGSTOP)) { printf("%03d child %d is STOPped\n", count, child); } else { printf("XXX waitpid(%d,...) failed\n", child); kill(child, SIGKILL); exit(1); } // Sanity check if (get_task_state(child) != 'T') { printf("XXX waitpid(%d,...) and /proc/%d/status disagree\n", child, child); kill(child, SIGKILL); exit(1); } } // Wait for our INdirect child to stop // count+1 static void wait_other_stop(int child, int count) { // XXX: Fixing bug 1974 will make this *much* easier while (get_task_state(child) != 'T') sched_yield(); printf("%03d child %d is STOPped\n", count, child); } // count+1 static void check_callback(struct crut_pipes *pipes, int child, int count) { crut_pipes_expect(pipes, MSG_CHILD_CALLBACK); printf("%03d child %d callback ran\n", count, child); } // count+1 static void check_exit(struct crut_pipes *pipes, int child, int count) { crut_pipes_putchar(pipes, MSG_PARENT_DONE); // Note: cr_restart is the child to wait for when restarting, thus pipes->child crut_waitpid_expect(pipes->child, TEST_EXIT_VAL); printf("%03d child %d completed\n", count, child); crut_pipes_close(pipes); } // count+2 static int check_running(struct crut_pipes *pipes, int child, int count) { check_callback(pipes, child, count++); check_exit(pipes, child, count++); return 2; } // count+3 static int check_stopped(struct crut_pipes *pipes, int child, int count) { check_callback(pipes, child, count++); // callback BEFORE stopping wait_other_stop(child, count++); // May not be direct child (restart time) kill(child, SIGCONT); check_exit(pipes, child, count++); return 3; } // count+1 static int checkpoint(struct crut_pipes *pipes, const char *sigarg, int count) { char *cmd; int rc; cmd = crut_aprintf("exec %s --pid --file %s %s --quiet %d", chkpt_cmd, filename, sigarg, pipes->child); rc = system(cmd); if (!WIFEXITED(rc) || (WEXITSTATUS(rc) != 0)) { printf("XXX system(%s) unexpectedly returned %d\n", cmd, rc); exit(1); } else { printf("%03d ran '%s'\n", count, cmd); } free(cmd); return 1; } // count+0 static void restart(struct crut_pipes *pipes, const char *sigarg) { printf("# run: %s %s %s\n", rstrt_cmd, sigarg?sigarg:"", filename); if (!crut_pipes_fork(pipes)) { if (sigarg) { (void)execlp(rstrt_cmd, "cr_restart", sigarg, filename, NULL); } else { (void)execlp(rstrt_cmd, "cr_restart", filename, NULL); } exit(-1); } } // count+(2+stopped) static int run_continue_test(struct crut_pipes *pipes, int count, int stopped) { int child = pipes->child; // The PID of the orignal child if (stopped) { (void)check_stopped(pipes, child, count); // +3 } else { (void)check_running(pipes, child, count); // +2 } return 2 + !!stopped; } // count+(7+stopped) static int run_restart_tests(struct crut_pipes *pipes, int count, int stopped) { int child = pipes->child; // The PID of the orignal child // restart in default state restart(pipes, NULL); count += stopped ? check_stopped(pipes, child, count) // +3 : check_running(pipes, child, count); // +2 // restart w/ explicit --cont restart(pipes, "--cont"); count += check_running(pipes, child, count); // +2 // restart w/ explicit --stop restart(pipes, "--stop"); count += check_stopped(pipes, child, count); // +3 return 7 + !!stopped; } // count+(1+stop) static int launch_child(struct crut_pipes *pipes, int flags, int count, int stop) { int child = crut_pipes_fork(pipes); if (!child) { child_main(pipes, count+1, flags); exit(1); } else { crut_pipes_expect(pipes, MSG_CHILD_READY); printf("%03d child %d is READY (context=%s stopped=%s)\n", count++, child, ((flags==CR_SIGNAL_CONTEXT)?"SIGNAL":"THREAD"), (stop?"YES":"NO")); } if (stop) { kill(child, SIGSTOP); wait_child_stop(child, count); } return 1 + !!stop; } static int run_tests(int count, int flags, int pre_stopped) { struct crut_pipes pipes; int base = count; // Test 1: checkpoint w/o any args count += launch_child(&pipes, flags, count, pre_stopped); count += checkpoint(&pipes, "", count); count += run_continue_test(&pipes, count, pre_stopped); count += run_restart_tests(&pipes, count, pre_stopped); (void)unlink(filename); // Test 2: checkpoint w/ --stop count += launch_child(&pipes, flags, count, pre_stopped); count += checkpoint(&pipes, "--stop", count); count += run_continue_test(&pipes, count, 1); count += run_restart_tests(&pipes, count, pre_stopped); (void)unlink(filename); // Test 3: checkpoint w/ --cont count += launch_child(&pipes, flags, count, pre_stopped); count += checkpoint(&pipes, "--cont", count); count += run_continue_test(&pipes, count, 0); count += run_restart_tests(&pipes, count, pre_stopped); (void)unlink(filename); return count - base; } int main(int argc, char * const argv[]) { int count = 0; int mypid = getpid(); setlinebuf(stdout); printf("%03d Process started with pid %d\n", count++, mypid); filename = crut_aprintf("context.%d", mypid); chkpt_cmd = crut_find_cmd(argv[0], "cr_checkpoint"); rstrt_cmd = crut_find_cmd(argv[0], "cr_restart"); count += run_tests(count, CR_SIGNAL_CONTEXT, 0); count += run_tests(count, CR_SIGNAL_CONTEXT, 1); if (crut_is_linuxthreads()) { fprintf(stderr, "Skipping threaded portion of 'stopped' tests due to LinuxThreads issues\n"); } else { count += run_tests(count, CR_THREAD_CONTEXT, 0); count += run_tests(count, CR_THREAD_CONTEXT, 1); } printf("%03d DONE\n", count); return 0; } blcr-0.8.5/tests/readdir.c0000664000000000000000000000674011117616077012275 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2003, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * 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 * * $Id: readdir.c,v 1.6 2008/12/10 01:32:47 phargrov Exp $ * * Test directory open across a checkpoint */ #include #include #include #include #include #include #include #include #include #include #include "crut.h" #define MYNAME "readdir" static char *test_dir = NULL; static int opendir_setup(void **testdata) { DIR *dp; CRUT_DEBUG("Initializing opendir."); dp = opendir(test_dir); if (dp == NULL) { return -1; } *testdata = dp; return 0; } static int scan(DIR *dp, int check_ptr) { static off_t prev_pos; struct dirent *ent; int found = 0; int retval = 0; if (check_ptr) { if (prev_pos != telldir(dp)) return -1; CRUT_DEBUG("Verified position %d", (int)prev_pos); } rewinddir(dp); while (!found && ((ent = readdir(dp)) != NULL)) { CRUT_DEBUG("Entry '%s'", ent->d_name); if (!strcmp(ent->d_name, MYNAME)) { CRUT_DEBUG("Found '" MYNAME "'"); found = 1; } } if (!found) { retval = -1; } else if (!check_ptr) { prev_pos = telldir(dp); if ((int)prev_pos == -1) retval = -1; CRUT_DEBUG("Saved position %d", (int)prev_pos); } return retval; } static int opendir_precheckpoint(void *p) { DIR *dp = (DIR*)p; int retval; CRUT_DEBUG("Testing sanity before we checkpoint"); retval = scan(dp, 0); return retval; } static int opendir_continue(void *p) { DIR *dp = (DIR*)p; int retval; CRUT_DEBUG("Continuing after checkpoint."); retval = scan(dp, 1); return retval; } static int opendir_restart(void *p) { DIR *dp = (DIR*)p; int retval; CRUT_DEBUG("Restarting from checkpoint."); retval = scan(dp, 1); return retval; } static int opendir_teardown(void *p) { DIR *dp = (DIR*)p; return closedir(dp); } int main(int argc, char *argv[]) { int ret; struct crut_operations opendir_test_ops = { test_scope:CR_SCOPE_PROC, test_name:"opendir", test_description:"opendir() test.", test_setup:opendir_setup, test_precheckpoint:opendir_precheckpoint, test_continue:opendir_continue, test_restart:opendir_restart, test_teardown:opendir_teardown, }; /* add the basic tests */ crut_add_test(&opendir_test_ops); test_dir = crut_find_testsdir(argv[0]); ret = crut_main(argc, argv); return ret; } blcr-0.8.5/tests/ash_test.sh0000664000000000000000000000243211043752776012664 00000000000000#!/bin/sh # # Test of checkpoint/restart of a ash script. # Note that the outer script is bash # Check for ash ash -c true || exit 77 . ${cr_testsdir:-`dirname $0`}/shellinit \rm -f Context[123] .Context[123].tmp 2>/dev/null bash <<-'__OUTER__' exec 2>/dev/null # Drop job control message(s) from the outer script echo '#ST_ALARM:120' $cr_run ash 2>&1 <<-'__INNER__' echo '#ST_IGNORE:^\[1\]' # Tell seq_wrapper to ignore job-control msgs echo '#ST_IGNORE:^[0-9]*:' # Tell seq_wrapper to ignore job-control msgs echo '#ST_IGNORE:^[[:space:]]*$' # ...and the whitespace lines that may accompany them. ash -c 'for i in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15; do echo $i Hello; sleep 1; done' & pid=$! sleep 3 echo "# Checkpoint original child" $cr_checkpoint --file=Context1 --tree --term $pid wait sleep 1 echo "# Restart 1" $cr_restart Context1 & pid=$! sleep 3 echo "# Checkpoint restarted child" $cr_checkpoint --file=Context2 --tree --term $pid wait sleep 1 echo "# Restart^2" $cr_restart Context2 & pid=$! sleep 3 echo "# Checkpoint self" $cr_checkpoint --file=Context3 --term --tree $$ wait echo "16 DONE" __INNER__ exec 2>&1 sleep 3 echo "# Restart shell" $cr_restart Context3 __OUTER__ \rm -f Context[123] .Context[123].tmp 2>/dev/null blcr-0.8.5/configure.ac0000664000000000000000000022550412100616611011627 00000000000000# Process this file with autoconf to produce a configure script. # # Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) # 2012, The Regents of the University of California, through Lawrence # Berkeley National Laboratory (subject to receipt of any required # approvals from the U.S. Dept. of Energy). All rights reserved. # # Portions may be copyrighted by others, as may be noted in specific # copyright notices within specific files. # # 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 # # $Id: configure.ac,v 1.410.2.52 2013/01/26 00:04:25 phargrov Exp $ # ################################################################################ # version numbers: separate for 'release' vs. 'libcr' vs. 'kernel' # - only change these for a new **RELEASE** ################################################################################ # # 1. Release version: # ------------------- # For marketing purposes. Determines the tarball and RPM names, # and the string that our utilities print for --version. Bumping the major # number does NOT cause incompatility, so we can bump from 1.0 to 2.0, etc., w/o # causing users grief. # # For non-released versions, we want RELEASE_PATCH to include some non-numeric # qualifier. For instance, after releasing X.Y.0 the RELEASE_PATCH in the CVS # HEAD should be "pre1". While preparing for X.Y.1, RELEASE_PATCH might be # "1_rc0" or similar. For snapshots sent to collaborators, the RELEASE_PATCH # should be something like "pre1_snapshot_YYYY_MM_DD" where YYYY, MM and DD # form a date code. # # AC_INIT wants to see constants, not shell vars, so we define these with m4. m4_define(RELEASE_MAJOR, 0) m4_define(RELEASE_MINOR, 8) m4_define(RELEASE_PATCH, 5) m4_define(RELEASE_VERSION, RELEASE_MAJOR.RELEASE_MINOR.RELEASE_PATCH) AC_INIT([blcr],[RELEASE_VERSION], [http://ftg.lbl.gov/checkpoint]) # 2. Library version: # ------------------- # Determines which versions of the library are compatible with one another. # # 'major' number: increment if backward-compatibility has just been broken # - set MINOR and PATCH to 0 whenever MAJOR is incremented. # 'minor' number: increment if added new feature, but still backward-compatible # - set PATCH to 0 whenever MINOR incremented. # 'patch' number: increment if changes are bug fixes, not interface changes. # # Note: automake doesn't detect changes to the interface number, so you need to # 'make clean' and rebuild everything to see the new library names. LIBCR_MAJOR=0 LIBCR_MINOR=5 LIBCR_PATCH=5 # 3. Kernel module version # ------------------------ # Determines if a particular version of our library/utilities will work with the # the checkpoint module that's loaded in the kernel. # # A library/utility should die if the kernel's major number is different that # the one it was built to run against. If the kernel's minor number is less # than the interface it expects, it can either die, or restrict its kernel calls # to those supported by the older interface. # # Observe same rules as for library (ie patch->0 when changing minor, etc). CR_MODULE_MAJOR=0 CR_MODULE_MINOR=10 CR_MODULE_PATCH=3 # Derived version variables ### # - Exported, so you can use @CR_FOO@ to get them in any files that configure # generates. # - They are all also #defined in blcr_common.h. CR_RELEASE_MAJOR=RELEASE_MAJOR CR_RELEASE_MINOR=RELEASE_MINOR CR_RELEASE_PATCH=RELEASE_PATCH CR_RELEASE_VERSION="$CR_RELEASE_MAJOR.$CR_RELEASE_MINOR.$CR_RELEASE_PATCH" AC_SUBST(CR_RELEASE_MAJOR) AC_SUBST(CR_RELEASE_MINOR) AC_SUBST(CR_RELEASE_PATCH) AC_SUBST(CR_RELEASE_VERSION) LIBCR_VERSION="$LIBCR_MAJOR.$LIBCR_MINOR.$LIBCR_PATCH" AC_SUBST(LIBCR_MAJOR) AC_SUBST(LIBCR_MINOR) AC_SUBST(LIBCR_PATCH) AC_SUBST(LIBCR_VERSION) CR_MODULE_VERSION="$CR_MODULE_MAJOR.$CR_MODULE_MINOR.$CR_MODULE_PATCH" AC_SUBST(CR_MODULE_MAJOR) AC_SUBST(CR_MODULE_MINOR) AC_SUBST(CR_MODULE_PATCH) AC_SUBST(CR_MODULE_VERSION) # Libtool versioning: they just had to be different... LIBTOOL_INTERFACE=`expr $LIBCR_MAJOR + $LIBCR_MINOR` LIBTOOL_AGE=$LIBCR_MINOR LIBTOOL_REVISION=$LIBCR_PATCH AC_SUBST(LIBTOOL_INTERFACE) AC_SUBST(LIBTOOL_AGE) AC_SUBST(LIBTOOL_REVISION) # Save our ARGS for use in an RPM spec file AC_SUBST(CONFIGURE_ARGS) CONFIGURE_ARGS=$ac_configure_args ### rest of init setup AC_CONFIG_SRCDIR(cr_module/cr_module.c) AC_CONFIG_AUX_DIR(./config) AM_INIT_AUTOMAKE([foreign no-exeext std-options]) ################################################################################ # Boilerplate for versions and copyrights in generated files ################################################################################ AC_REVISION($Revision: 1.410.2.52 $) AC_COPYRIGHT([[ Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) 2012, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy). All rights reserved. Portions may be copyrighted by others, as may be noted in specific copyright notices within specific files. 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 ]]) AH_TOP([/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2012, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * 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 */]) ################################################################################ # Absolute paths to build and source dirs # need to substitute these into cscope script ################################################################################ AC_PATH_PROG(PWD_PROG, pwd, "pwd -P") TOP_BUILDDIR=`${PWD_PROG}` AC_SUBST(TOP_BUILDDIR) TOP_SRCDIR=`cd $srcdir && $PWD_PROG` AC_SUBST(TOP_SRCDIR) ################################################################################ # Check which components are enabled. ################################################################################ CR_WITH_COMPONENTS([modules util libcr include tests examples contrib]) ################################################################################ # Check platform ################################################################################ AC_CANONICAL_HOST case $host_os in linux*) ;; *) AC_CACHE_SAVE AC_MSG_ERROR([[the host system must be Linux (have $host_os)]]) ;; esac AC_SUBST([CR_ARCH],$host_cpu) AC_SUBST([CR_CPU],$host_cpu) case $host_cpu in i386) AC_CACHE_SAVE AC_MSG_ERROR([[i386 not supported, i486 or higher is required]]) ;; i?86) CR_ARCH=i386 cr_wordsize=4 ;; x86_64) CR_ARCH32=i686 CR_LIBARCH32=i386 cr_wordsize=8 ;; ppc64|powerpc64) CR_ARCH=ppc64 CR_CPU=ppc64 CR_ARCH32=ppc cr_wordsize=8 cr_arch_experimental=yes ;; ppc|powerpc) CR_ARCH=ppc CR_CPU=ppc cr_wordsize=4 cr_arch_experimental=yes ;; arm|armv*) CR_ARCH=arm CR_CPU=arm cr_wordsize=4 cr_arch_experimental=yes ;; sparc) CR_ARCH=sparc cr_wordsize=4 cr_arch_incomplete=yes ;; sparc64) CR_ARCH=sparc64 CR_ARCH32=sparc cr_wordsize=8 cr_arch_incomplete=yes ;; *) AC_MSG_ERROR([[Sorry, architecture $host_cpu is not supported at this time.]]) ;; esac ################################################################################ # Parse user args into variables # Try not to call any actual configuration probes yet. ################################################################################ # Let user specify location of Linux kernel headers and build AC_ARG_WITH([linux], [AC_HELP_STRING([--with-linux=DIR],[specify Linux kernel release (e.g. 2.6.7-123) or full path to build directory (default is to search for currently running kernel in some standard locations)])], [AS_IF([test x"$with_linux" != xyes],[LINUX_OBJ_ARG=$with_linux])],) AC_ARG_WITH([linux-src], [AC_HELP_STRING([--with-linux-src=DIR],[specify full path to Linux kernel source directory if needed (default is to search in some standard locations)])], [AS_IF([test x"$with_linux_src" != xyes],[LINUX_SRC_ARG=$with_linux_src])],) # Let user specify location of kernel System.map and/or vmlinux AC_ARG_WITH([system-map], [AC_HELP_STRING([--with-system-map=FILE],[specify location of Linux kernel System.map file (default is to search some standard locations)])], [AS_IF([test x"$with_system_map" != xyes],[LINUX_SYSTEM_MAP=$with_system_map])],) AC_ARG_WITH([vmlinux], [AC_HELP_STRING([--with-vmlinux=FILE],[specify location of kernel image (default is to search some standard locations)])], [AS_IF([test x"$with_vmlinux" != xyes],[LINUX_VMLINUX=$with_vmlinux])],) # Let user specify dir to install kernel modules AC_ARG_WITH([kmod-dir], [AC_HELP_STRING([--with-kmod-dir=DIR],[specify location to install kernel modules])], [AS_IF([test x"$with_kmod_dir" != xyes],[CR_MODULE_DIR=$with_kmod_dir])],) # Let user force UP, SMP or HUGEMEM kernel configs on RH (and similar) systems AC_ARG_WITH([kernel-type], [AC_HELP_STRING([--with-kernel-type=TYPE],[specify kernel type (UP, SMP, BIGMEM, HUGEMEM, etc.) to override /boot/kernel.h when present (default is not to override)])]) # Let user supress the printing of the final configuration report CR_ARG_ENABLE([config-report], [enable report at the conclusion of the configure script (default is yes)], [yes]) # Let the user request/supress use of V=1 with kbuild CR_ARG_ENABLE([kbuild-verbose], [enable verbose output from the kbuild facility. (default is no)], [no]) # Debugging (implies tracing enabled by default) CR_ARG_ENABLE([debug], [enable debugging of BLCR (default is no)],[no]) AM_CONDITIONAL(CRI_DEBUG,[test x$enable_debug = xyes]) CR_DEFINE(CRI_DEBUG,[test x$enable_debug = xyes], [Define to 1 to enable debugging of BLCR]) AS_IF([test x$enable_debug = xyes],[CR_NDEBUG=""],[CR_NDEBUG="-DNDEBUG"]) AC_SUBST(CR_NDEBUG) # Feature libcr-tracing CR_ARG_ENABLE([libcr-tracing], [enable debugging/tracing output from libcr, controlled by the 'LIBCR_TRACE_MASK' environment variable (default is no)],$enable_debug) AM_CONDITIONAL(LIBCR_TRACING,[test x$enable_libcr_tracing = xyes]) CR_DEFINE(LIBCR_TRACING,[test x$enable_libcr_tracing = xyes], [Define to 1 to enable debugging/tracing output from libcr, controlled by the 'LIBCR_TRACE_MASK' environment variable]) # Feature kernel-tracing CR_ARG_ENABLE([kernel-tracing], [enable debugging/tracing output from kernel modules, controlled by the 'cr_ktrace_mask' module option (default is no)], $enable_debug) AM_CONDITIONAL(CR_KERNEL_TRACING,[test x$enable_kernel_tracing = xyes]) CR_DEFINE(CR_KERNEL_TRACING,[test x$enable_kernel_tracing = xyes], [Define to 1 to enable debugging/tracing output from kernel modules, controlled by the 'cr_ktrace_mask' module option]) # Multilib support CR_ARG_ENABLE([multilib], [enable both 32- and 64-bit libs from a single build (default is no)], [no]) # Optional /etc/init.d/blcr file CR_ARG_ENABLE([init-script], [install /etc/init.d/blcr to load modules at boot time (default is no)], [no]) AM_CONDITIONAL(CR_BUILD_ETC,[test x$enable_init_script = xyes]) # Check is restoring uid, gid and supplemental groups is requested CR_ARG_ENABLE([restore-ids], [enable restoring uid, gid and supplemental groups when invoked by root (default is no)], [no]) CR_DEFINE(CR_RESTORE_IDS,[test x$enable_restore_ids = xyes], [Define to 1 to enable restore of uid, gid and supplemental groups when invoked by root. (default is no)]) # Let user build against an already installed libcr AC_ARG_WITH([installed-libcr], [AC_HELP_STRING([--with-installed-libcr],[link executables against an existing libcr in $includedir and $libdir. Assumes LD_LIBRARY_PATH is set correctly. (default is to build the library)])],[ cr_build_libcr=no cr_build_include=no ]) AM_CONDITIONAL(CR_INSTALLED_LIBCR,[test x$with_installed_libcr = xyes]) # Let user build/test against already installed utilities AC_ARG_WITH([installed-util], [AC_HELP_STRING([--with-installed-util],[run tests using utilities installed in $bindir (default is to build the utilities)])],[ cr_build_util=no ]) AM_CONDITIONAL(CR_INSTALLED_UTIL,[test x$with_installed_util = xyes]) # Let user build/run/test against already installed kernel modules AC_ARG_WITH([installed-modules], [AC_HELP_STRING([--with-installed-modules],[use existing blcr kernel modules in $libdir (default is to build the kernel modules)])],[ cr_build_modules=no ]) # Let user request installation of the test suite CR_ARG_ENABLE([testsuite], [enable installation of the BLCR testsuite (default is no)], [no]) AM_CONDITIONAL(CR_BUILD_TESTSUITE,[test x$enable_testsuite = xyes]) # Let user request static utils, tests and examples CR_ARG_ENABLE([all-static], [enable linking programs (utilities, tests and examples) with -static flag (default is no)],[no]) # Let user request optional "cr_info" util CR_ARG_ENABLE([cr-info], [build cr_info utility (default is no, because this is currently broken)], [no]) # Let user specify location of optional FTB headers & libs AC_ARG_WITH([ftb], [AC_HELP_STRING([--with-ftb],[specify path to optional FTB headers and libraries (default /usr/local/ftb)])], [FTB_HOME=$withval; cr_force_ftb=yes], [FTB_HOME='/usr/local/ftb']) #XXX: HACK to disable FTB unless explictly requested if test x"$cr_force_ftb" != xyes; then FTB_HOME=no; fi # Let user request work-around for bug 2524 (ppc only) # TODO: automate when building both kernel modules and libcr if expr $CR_ARCH : ppc >/dev/null; then AC_ARG_WITH([bug2524], [AC_HELP_STRING([--with-bug2524],[request that blcr use a work around for bug 2524 (ppc specific)])], [force_bug2524=$withval]) fi ################################################################################ # Check and configure the build environment (compiler, linker, etc.) ################################################################################ # Collect doc strings together here AC_ARG_VAR([PERL],[perl interpreter (required: for configure, build and testsuite)]) AC_ARG_VAR([MAKE],[GNU make (required: for configure and build only)]) AC_ARG_VAR([RPMBUILD],[rpmbuild command (optional: for building RPMs)]) AC_ARG_VAR([KCC],[C compiler command to build kernel modules (default: '$CC')]) # XXX: need to verify version of perl? AC_PATH_PROGS([PERL],[perl5 perl]) if test -z "$PERL"; then AC_MSG_ERROR(cannot find a version of perl - please install perl and/or set \$PERL to indicate where it's located) fi AC_SUBST([PERL],$PERL) # Check for GNU make AC_PATH_PROGS([MAKE],[gmake make]) if test -n "$MAKE"; then AC_MSG_CHECKING(if $MAKE is GNU make) MAKE_VERSTR=`$MAKE --version | grep GNU 2> /dev/null` if test -z "$MAKE_VERSTR" ; then AC_MSG_RESULT(no) else #MAKE_VER=`echo "$MAKE_VERSTR" | perl -n -e 'if (/([[0-9]]+)\.([[0-9]]+)(\.[[0-9]]+)?/) { $maj=$1; $min=$2; $pat=$3; printf "%i%03i%03i",($maj,$min,($pat?$pat=~s/\.//:0)) }'` MAKE_VERSION=`echo "$MAKE_VERSTR" | perl -n -e 'if (/(([[0-9]]+)\.([[0-9]]+)(\.[[0-9]]+)?)/) { print $1 }'` AC_MSG_RESULT([yes ($MAKE_VERSION)]) fi fi if test -z "$MAKE_VERSTR" ; then AC_MSG_ERROR(cannot find a version of GNU make - please install GNU make and/or set \$MAKE to indicate where it's located) fi # What language(s) do we need AC_LANG([C]) # For static convenience libs AC_PROG_RANLIB # For symbolic links AC_PROG_LN_S # Need our own probe prior to any done in AC_PROG_LIBTOOL # Note bug 2619 reports that we can't call this conditionally: CR_PROG_CXX # We use libtool to build # - only build shared lib for now AC_DISABLE_STATIC AC_PROG_LIBTOOL if test x"$enable_static$enable_all_static" = xnoyes; then AC_MSG_ERROR([You cannot pass --enable-all-static without one of --enable-static or --disable-shared]) fi AM_CONDITIONAL(CR_ENABLE_STATIC,[test $enable_static = yes]) AM_CONDITIONAL(CR_ENABLE_SHARED,[test $enable_shared = yes]) # Check for rpmbuild CR_PROG_RPMBUILD AM_CONDITIONAL(HAVE_RPMBUILD,[test $RPMBUILD != none]) # Check for a GNU C compiler (or a work alike?) CR_PROG_GCC(,, [AC_CACHE_SAVE AC_MSG_ERROR([[the C compiler '$CC' is not a GNU C compiler.]])]) # Configure inlining (XXX: need to probe gcc for support?) AC_DEFINE(CR_INLINE,[static __inline__ __attribute__ ((__unused__))], [Define to the proper incantation for inline functions]) # Check for additional flags needed when building libcr if test x"$cr_build_libcr" = xyes; then CR_LIBCR_CFLAGS="" CR_TRY_GCC_FLAG([-Wall], [CR_LIBCR_CFLAGS="$CR_LIBCR_CFLAGS -Wall"]) CR_TRY_GCC_FLAG([-Wno-unused-function], [CR_LIBCR_CFLAGS="$CR_LIBCR_CFLAGS -Wno-unused-function"]) AC_SUBST(CR_LIBCR_CFLAGS) fi # cr_build_libcr # Additional flags needed when linking utils, tests and examples CR_CLIENT_LDADD="" if test x"$enable_all_static" = xyes; then CR_CLIENT_LDADD="$CR_CLIENT_LDADD -all-static" fi AC_SUBST(CR_CLIENT_LDADD) ################################################################################ # Check libraries ################################################################################ if test x"$cr_build_libcr" = xyes; then # Check for a sufficiently new glibc # XXX: What is our true lower bound? CR_CHECK_GLIBC(2,2,, [AC_CACHE_SAVE AC_MSG_ERROR([[the C library does not appear to be glibc 2.2 or higher.]])]) # Checks for required libraries and fail if they are not found # Note that we are NOT adding them to LIBS, just verifying their presence. AC_CHECK_LIB([dl], [dlsym], [:], [AC_CACHE_SAVE AC_MSG_ERROR([[required library libdl not found.]])]) AC_CHECK_LIB([pthread], [pthread_create], [:], [AC_CACHE_SAVE AC_MSG_ERROR([[required library libpthread not found.]])]) # Prep a variable for possible use in messages below if test x"$enable_multilib" = xyes; then ldsuggest='-L/usr/lib/nptl -L/usr/lib64/nptl' elif test x"$ac_cv_sizeof_void_p" = x8; then ldsuggest='-L/usr/lib64/nptl' else ldsuggest='-L/usr/lib/nptl' fi # Helper for LinuxThreads probes # CR_LT_PROBE(cv_varname, cross_varname) AC_DEFUN([CR_LT_PROBE],[ AC_TRY_RUN([ #include #include #include #include static void *thread_pid(void *arg) { return (void *)(long)getpid(); } int main(void) { pthread_t th; void *join_val; if (0 != pthread_create(&th, NULL, &thread_pid, NULL)) { fputs("Error calling pthread_create()\n", stderr); return -1; } if (0 != pthread_join(th, &join_val)) { fputs("Error calling pthread_join()\n", stderr); return -1; } /* zero = NOT equal pids = LinuxThreads */ return ((long)join_val == (long)getpid()); }], [$1=yes], [$1=no],[ CR_CROSS_VAR($2) AS_IF([test x"$[]$2" != x0], [$1=yes], [$1=no])]) ]) # Look for LinuxThreads in the default (probably dynamic) library AC_CACHE_CHECK([[whether default pthreads library is LinuxThreads]], cr_cv_pt_default_lt, [ SAVE_LIBS="$LIBS" LIBS="-lpthread $LIBS" CR_LT_PROBE([cr_cv_pt_default_lt],[cross_linuxthreads]) LIBS="$SAVE_LIBS" ]) if test x"$cr_cv_pt_default_lt" = xyes; then AC_MSG_ERROR([[linking of BLCR to LinuxThreads is NOT supported. Please try LDFLAGS='$ldsuggest' (or similar) on the configure command line to get NPTL.]]) fi # Now look for LinuxThreads in the static libs if we are building static ones ourself if test x"$enable_static" = xyes; then # Look for LinuxThreads in the static library AC_CACHE_CHECK([[whether static pthreads library is LinuxThreads]], cr_cv_pt_static_lt, [ SAVE_LIBS="$LIBS" SAVE_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -static" LIBS="-lpthread $LIBS" CR_LT_PROBE([cr_cv_pt_static_lt],[cross_linuxthreads_static]) LIBS="$SAVE_LIBS" LDFLAGS="$SAVE_LDFLAGS" ]) if test x"$cr_cv_pt_static_lt" = xyes; then AC_MSG_WARN([[static linking with pthreads appears to yield LinuxThreads, but BLCR supports only NPTL.]]) cr_static_link_warning="yes" if test x"$enable_all_static" = xyes; then AC_CACHE_SAVE AC_MSG_ERROR([[static linking of BLCR to LinuxThreads is NOT supported. Please try LDFLAGS='$ldsuggest' (or similar) on the configure command line to get NPTL.]]) fi fi fi # Check for atfork handling AC_CHECK_FUNCS([__register_atfork]) # Check for call to disable NSCD AC_CHECK_FUNCS([__nss_disable_nscd]) # Check for pthread_attr_setstacksize SAVE_LIBS="$LIBS" LIBS="-lpthread $LIBS" AC_CHECK_FUNCS([pthread_attr_setstacksize]) LIBS="$SAVE_LIBS" # Look for prctl(PR_SET_PDEATHSIG, ...) AC_CACHE_CHECK([[for pctrl()]], cr_cv_prctl, [ AC_TRY_COMPILE([ #include ], [ int rc = prctl(PR_SET_PDEATHSIG, 0); ], [cr_cv_prctl=yes], [cr_cv_prctl=no]) ]) CR_DEFINE(HAVE_PRCTL,[test x$cr_cv_prctl = xyes], [Define to 1 if prctl() function is available.]) # Check various constants needed for asm SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -I${TOP_SRCDIR}/include" CR_DEFINE_INT(CR_ASM_OP_HAND_CHKPT, [CR_OP_HAND_CHKPT], [#include #include "blcr_ioctl.h"]) CR_DEFINE_INT(CR_ASM_CHECKPOINT_STUB, [_CR_CHECKPOINT_STUB], [#include "blcr_common.h.in"]) # ICK! CR_DEFINE_INT(CR_ASM_OP_HAND_ABORT, [CR_OP_HAND_ABORT], [#include #include "blcr_ioctl.h"]) CR_DEFINE_INT(CR_ASM_CHECKPOINT_OMIT, [CR_CHECKPOINT_OMIT], [#include "blcr_common.h.in"]) # ICK! CR_DEFINE_INT(CR_ASM_SI_PID_OFFSET, [offsetof(siginfo_t, si_pid)], [#include #include #ifndef offsetof #define offsetof(TYPE, MEMBER) ((unsigned long) &((TYPE *)0)->MEMBER) #endif]) CR_DEFINE_INT(CR_ASM_NR_ioctl,[__NR_ioctl], [#include #include ]) CR_DEFINE_INT(CR_ASM_NR_rt_sigreturn,[__NR_rt_sigreturn], [#include #include ]) CFLAGS="$SAVE_CFLAGS" # Probe for direction of stack growth CR_STACK_DIRECTION # Look for FTB header and libs cr_have_ftb=no if test x"$FTB_HOME" != xno; then cr_have_ftb=yes SAVE_CPPFLAGS="$CPPFLAGS" SAVE_LDFLAGS="$LDFLAGS" SAVE_LIBS="$LIBS" CR_FTB_INCLUDES="" CR_FTB_LDFLAGS="" AC_CACHE_CHECK([[for FTB headers]],cr_cv_ftb_incdir,[ cr_result=no for cr_tmp in "" "${FTB_HOME}/include"; do CPPFLAGS="$SAVE_CPPFLAGS${cr_tmp:+ -I$cr_tmp}" AC_TRY_COMPILE([ #include ],[ FTB_client_t x; ], [cr_result="$cr_tmp"; break]) done if test -z "$cr_result"; then cr_cv_ftb_incdir="default" else cr_cv_ftb_incdir="$cr_result" fi ]) if test x"$cr_cv_ftb_incdir" = xno; then cr_have_ftb=no elif test x"$cr_cv_ftb_incdir" != "xdefault"; then CR_FTB_INCLUDES="-I$cr_cv_ftb_incdir" fi AC_CACHE_CHECK([[for FTB libs]],cr_cv_ftb_libdir,[ CPPFLAGS="$SAVE_CPPFLAGS $CR_FTB_INCLUDES" LIBS="-lftb -lpthread $SAVE_LIBS" cr_result=no for cr_tmp in "" "${FTB_HOME}/lib64" "${FTB_HOME}/lib32" "${FTB_HOME}/lib"; do LDFLAGS="$SAVE_LDFLAGS${cr_tmp:+-L$cr_tmp}" AC_TRY_LINK([ #include ],[ return FTB_Connect(NULL, NULL); ], [cr_result="$cr_tmp"; break]) done if test -z "$cr_result"; then cr_cv_ftb_libdir="default" else cr_cv_ftb_libdir="$cr_result" fi ]) if test x"$cr_cv_ftb_libdir" = xno; then cr_have_ftb=no elif test x"$cr_cv_ftb_libdir" != "xdefault"; then CR_FTB_LDFLAGS="-L$cr_cv_ftb_libdir" CR_FTB_LDADD="-lftb" fi LIBS="$SAVE_LIBS" LDFLAGS="$SAVE_LDFLAGS" CPPFLAGS="$SAVE_CPPFLAGS" if test x"$cr_have_ftb$cr_force_ftb" = xnoyes; then AC_MSG_ERROR([Configured with --with-ftb='$FTB_HOME', but unable to build FTB test case]) fi AC_SUBST([CR_FTB_INCLUDES]) AC_SUBST([CR_FTB_LDFLAGS]) AC_SUBST([CR_FTB_LDADD]) fi CR_DEFINE(HAVE_FTB,[test x$cr_have_ftb = xyes], [Define to 1 if the Fault Tolerance Backplane is available.]) fi # cr_build_libcr # Probe libc for the RT signal number to use CR_CHECK_SIGNUM # Check for 32- or 64-bit architecture AC_CHECK_SIZEOF(void *, $cross_void_P) CR_LIBARCH=$CR_ARCH if test $ac_cv_sizeof_void_p != $cr_wordsize; then if test $cr_wordsize = 8; then CR_LIBARCH=${CR_LIBARCH32:-$CR_ARCH32} else AC_MSG_ERROR([CC='$CC' yields sizeof(void *) = $ac_cv_sizeof_void_p when expecting $cr_wordsize.$clue]) fi fi AC_SUBST([CR_LIBARCH]) ################################################################################ # Sub-configure for 32-bit libs on 64-bit platforms ################################################################################ cr_build_libcr32=no if test x"$enable_multilib" = xyes; then if test x"$cr_build_libcr" != xyes; then AC_MSG_ERROR([--enable-multilib requested but not building libcr]) elif test -f "${TOP_BUILDDIR}/configure.ac"; then # More robust than TOP_BUILDDIR == TOP_SRCDIR AC_MSG_ERROR([When requesting --enable-multilib, you must configure/build in a directory other than the one holding the BLCR sources]) elif test -z "$CR_ARCH32"; then AC_MSG_ERROR([--enable-multilib not supported on architecture $CR_ARCH]) elif test $ac_cv_sizeof_void_p = 4; then AC_MSG_ERROR([--enable-multilib requested but CC='$CC' generates 32-bit objects. Perhaps try configuring with CC='$CC -m64' or similar.]) elif test \! -d /lib64; then AC_MSG_ERROR([--enable-multilib requested but /lib64 does not exist]) fi if test -z "$libdir32"; then if expr "$libdir" : '.*/lib64$' >/dev/null; then libdir32=`echo $libdir | sed -e 's/64$//'` elif test "$libdir" = '${exec_prefix}/lib'; then libdir32='${exec_prefix}/lib' libdir='${exec_prefix}/lib64' else AC_MSG_ERROR([--enable-multilib requested but libdir='$libdir' does not end in 'lib64']); fi fi SUBCMD="${TOP_SRCDIR}/configure '--srcdir=${TOP_SRCDIR}' '--build=${CR_ARCH32}-linux' '--libdir=${libdir32}' --with-components=libcr,tests,examples" eval set -- $ac_configure_args for x in "$@"; do case "$x" in --host=*|--build=*|--target=*|host_alias=*|build_alias=*|target_alias=*|--libdir=*|--srcdir=*|--with-components=*|--enable-multilib|--enable-testsuite|--enable-init-script|CFLAGS=*|CXXFLAGS=*) # skip ;; *) # keep as-is SUBCMD="$SUBCMD '$x'" ;; esac done # Strip -m64 out of CFLAGS and CXXFLAGS, if present if test -n "$CFLAGS32"; then SUBCMD="$SUBCMD 'CFLAGS=$CFLAGS32'" elif test -n "$CFLAGS"; then set -- for x in $CFLAGS; do test x"$x" = "x-m64" || set -- "$@" "$x"; done SUBCMD="$SUBCMD 'CFLAGS=$@'" fi if test -n "$CXXFLAGS32"; then SUBCMD="$SUBCMD 'CXXFLAGS=$CXXFLAGS32'" elif test -n "$CXXFLAGS"; then set -- for x in $CXXFLAGS; do test x"$x" = "x-m64" || set -- "$@" "$x"; done SUBCMD="$SUBCMD 'CXXFLAGS=$@'" fi # Strip -m64 from definitions of CC and CXX, adding -m32 if test -n "$CC32"; then SUBCMD="$SUBCMD 'CC=$CC32'" else set -- for x in $CC; do test x"$x" = "x-m64" || set -- "$@" "$x"; done SUBCMD="$SUBCMD 'CC=$@ -m32'" fi if test -n "$CXX32"; then SUBCMD="$SUBCMD 'CXX=$CXX32'" elif test -n "$CXX" -a "$CXX" != no; then set -- for x in $CXX; do test x"$x" = "x-m64" || set -- "$@" "$x"; done SUBCMD="$SUBCMD 'CXX=$@ -m32'" fi # Look for 32-bit versions of remaining bin tools if test -n "$CPP32"; then SUBCMD="$SUBCMD 'CPP=$CPP32'" fi if test -n "$LD32"; then SUBCMD="$SUBCMD 'LD=$LD32'" fi if test -n "$AR32"; then SUBCMD="$SUBCMD 'AR=$AR32'" fi if test -n "$NM32"; then SUBCMD="$SUBCMD 'NM=$NM32'" fi if test -n "$RANLIB32"; then SUBCMD="$SUBCMD 'RANLIB=$RANLIB32'" fi # Others? AC_MSG_NOTICE([>>>> BEGIN sub-configure for 32-bit libs >>>>]) AC_MSG_NOTICE([${SUBCMD}]) ( mkdir -p libcr32 && cd libcr32 && ln -sf ../util . && eval "${SUBCMD}" ) if test "$?" = 0; then AC_MSG_NOTICE([<<<< END sub-configure for 32-bit libs <<<<]) cr_build_libcr32=yes else rm -rf libcr32 AC_MSG_ERROR([--enable-multilib requested but FAILED sub-configure for 32-bit libs]) fi fi AM_CONDITIONAL(CR_BUILD_LIBCR32,[test x$cr_build_libcr32 = xyes]) ################################################################################ # Check kernel (source location, symbol table, features, etc.) ################################################################################ if test x"$cr_build_modules" = xyes; then # Compiler to build kernel modules AC_MSG_CHECKING([compiler to build kernel modules]) if test -n "${KCC}"; then AC_MSG_RESULT([$KCC (user setting)]) else KCC=$CC AC_MSG_RESULT([$KCC (default)]) fi AC_SUBST([KCC]) # Find BSD-compatible NM command AC_PROG_NM AC_SUBST([NM],$NM) # First deal with user-specified kernel type (UP, SMP, BIGMEM, etc.) if any. case x"$with_kernel_type" in x|xyes|xno) ;; *) CR_KERNEL_TYPE("$with_kernel_type") esac # Checks for required kernel src/obj dirs and fail if they are not found CR_CHECK_LINUX() AS_IF([test -z "${HAVE_LINUX_2_6}" -a -z "${HAVE_LINUX_3}"], [AC_CACHE_SAVE AC_MSG_ERROR([[required Linux 2.6.x or 3.x.y kernel headers and/or build not found.]])]) # Module install dir AC_SUBST([CR_MODULE_DIR]) AC_MSG_CHECKING([directory to install kernel modules]) if test -n "${CR_MODULE_DIR}"; then cr_why='passed via --with-kmod-dir' elif test ${sysconfdir} = /etc; then CR_MODULE_DIR="/lib/modules/${LINUX_VER}/extra" cr_why='default when sysconfdir=/etc' else CR_MODULE_DIR="${libdir}/${PACKAGE}/${LINUX_VER}" cr_why='default' fi AC_MSG_RESULT([${CR_MODULE_DIR} ($cr_why)]) # Checks for matching (we hope) symbol table CR_LINUX_SYMTAB # Setup CR_KARCH to enable 32-bit user-space on 64-bit kernels CR_KARCH=$CR_ARCH if test $cr_wordsize = 4; then # Count pointer hex digits in the System.map to id a 64-bit kernel # Based on logic provided by Alan Woodland AC_PROG_EGREP AC_MSG_CHECKING([if kernel and user-space wordsize match]) if eval $LINUX_SYMTAB_CMD | head | $EGREP '^[[a-f0-9]]{16}' >/dev/null 2>&1;then AC_MSG_RESULT([no (32-bit user-space with 64-bit kernel)]) case $CR_KARCH in i386) CR_KARCH=x86_64;; ppc) CR_KARCH=ppc64;; sparc) CR_KARCH=sparc64;; esac else AC_MSG_RESULT([yes]) fi fi AC_SUBST(CR_KARCH) # Configure automake/kbuild glue CR_CHECK_KBUILD # Configure module compile flags and perform a sanity check CR_SET_KCFLAGS # Now we can check if SYMTAB matches the kernel CR_LINUX_SYMTAB_VALIDATE ## Check for optional kernel headers... CR_CHECK_KERNEL_HEADER([linux/syscalls.h]) CR_CHECK_KERNEL_HEADER([linux/pspace.h]) CR_CHECK_KERNEL_HEADER([linux/pid_namespace.h]) CR_CHECK_KERNEL_HEADER([linux/lockdep.h]) CR_CHECK_KERNEL_HEADER([linux/compile.h]) CR_CHECK_KERNEL_HEADER([linux/fdtable.h]) CR_CHECK_KERNEL_HEADER([linux/utrace.h]) CR_CHECK_KERNEL_HEADER([linux/perf_event.h]) CR_CHECK_KERNEL_HEADER([linux/audit.h]) CR_CHECK_KERNEL_HEADER([asm/elf.h]) CR_CHECK_KERNEL_HEADER([asm/desc.h],[#include ]) CR_CHECK_KERNEL_HEADER([asm/vsyscall32.h]) CR_CHECK_KERNEL_HEADER([asm/i387.h]) CR_CHECK_KERNEL_HEADER([asm/switch_to.h]) CR_CHECK_KERNEL_HEADER([asm/tls.h]) CR_CHECK_KERNEL_HEADER([linux/utsrelease.h]) CR_CHECK_KERNEL_HEADER([generated/utsrelease.h]) ## Now we check for specific kernel features... CR_FIND_KSYM([timeval_to_jiffies],[CODE]) CR_FIND_KSYM([jiffies_to_timeval],[CODE]) CR_CHECK_KERNEL_TYPE([struct fdtable],[ #include #include #if HAVE_LINUX_FDTABLE_H #include #endif ]) if test -n "${HAVE_STRUCT_FDTABLE}"; then CR_CHECK_KERNEL_MEMBER([open_fds.fds_bits],[ #include #include #if HAVE_LINUX_FDTABLE_H #include #endif ],[struct fdtable],[unsigned long *],[open_fds->fds_bits]) CR_CHECK_KERNEL_CALL([fd_is_open],[ #include #include #if HAVE_LINUX_FDTABLE_H #include #endif ]) CR_CHECK_KERNEL_CALL([__set_open_fd],[ #include #include #if HAVE_LINUX_FDTABLE_H #include #endif ]) CR_CHECK_KERNEL_CALL([close_on_exec],[ #include #include #if HAVE_LINUX_FDTABLE_H #include #endif ]) CR_CHECK_KERNEL_CALL([__set_close_on_exec],[ #include #include #if HAVE_LINUX_FDTABLE_H #include #endif ]) # OK if those are missing else CR_CHECK_KERNEL_MEMBER([open_fds.fds_bits],[ #include #include #if HAVE_LINUX_FDTABLE_H #include #endif ],[struct files_struct],[unsigned long *],[open_fds->fds_bits]) fi CR_CHECK_KERNEL_MEMBER([files_struct.next_fd],[ #include #include #if HAVE_LINUX_FDTABLE_H #include #endif ],[struct files_struct],[int],[next_fd]) CR_CHECK_KERNEL_MEMBER([fdtable.next_fd],[ #include #include #if HAVE_LINUX_FDTABLE_H #include #endif ],[struct fdtable],[int],[next_fd]) # Allow only exactly one match if test "${HAVE_FILES_STRUCT_NEXT_FD}${HAVE_FDTABLE_NEXT_FD}" != "1"; then CR_BAD_KERNEL([unable to determine where to find next_fd]) fi CR_CHECK_KERNEL_MEMBER([files_struct.max_fdset],[ #include #include #if HAVE_LINUX_FDTABLE_H #include #endif ],[struct files_struct],[int],[max_fdset]) CR_CHECK_KERNEL_TYPE([struct path],[#include ]) CR_CHECK_KERNEL_COMPILE([nameidata.path],[ #include #include #include #include #include ],[ /* Expect "struct path pwd" in fs_struct */ struct fs_struct s1; struct path t1 = s1.pwd; /* Expect "struct path path" used in nameidata */ struct nameidata s2; struct path t2 = s2.path; /* Expect d_path() and set_fs_pwd() to pass path */ (void)d_path(&t1, NULL, 0); (void)set_fs_pwd(&s1, &t2); ],[Define to 1 if fs functions pass 'struct path']) CR_CHECK_KERNEL_COMPILE([nameidata.dentry],[ #include #include #include #include #include ],[ /* Expect "struct dentry *pwd" in fs_struct */ struct fs_struct s1; struct dentry t1 = *s1.pwd; /* Expect "struct dentry *dentry" in nameidata */ struct nameidata s2; struct dentry t2 = *s2.dentry; /* Expect d_path() and set_fs_pwd() to pass dentry */ (void)d_path(&t1, NULL, NULL, 0); (void)set_fs_pwd(&s1, NULL, &t2); ]) if test "${HAVE_NAMEIDATA_PATH}${HAVE_NAMEIDATA_DENTRY}" != "1"; then CR_BAD_KERNEL([unable to determine composition of struct nameidata]) fi CR_CHECK_KERNEL_CALL([path_lookup],[#include ]) CR_CHECK_KERNEL_CALL([kern_path],[#include ]) # Require 1 or more match if test -z "${HAVE_PATH_LOOKUP}{HAVE_KERN_PATH}"; then CR_BAD_KERNEL([unable to find either path_lookup() or kern_path()]) fi CR_CHECK_KERNEL_CALL([__putname],[#include ]) CR_CHECK_KERNEL_TYPE([struct delayed_work],[#include ]) # Order for "best" match CR_CHECK_KERNEL_MACRO([do_each_pid_task],[#include ]) CR_CHECK_KERNEL_MACRO([do_each_task_pid],[#include ]) if test -z "${HAVE_DO_EACH_TASK_PID}"; then CR_CHECK_KERNEL_MACRO([for_each_task_pid],[#include ]) fi # Require 1 or more match if test -z "${HAVE_DO_EACH_PID_TASK}${HAVE_DO_EACH_TASK_PID}${HAVE_FOR_EACH_TASK_PID}"; then CR_BAD_KERNEL([unable to find a task iterator]) fi CR_CHECK_KERNEL_MEMBER([2.6.0 task ids],[#include ], [struct task_struct],[int],[__pgrp]) CR_CHECK_KERNEL_MEMBER([2.6.6 task ids],[#include ], [struct task_struct],[int],[signal->session]) CR_CHECK_KERNEL_CALL_FULL([2.6.20 task ids],[process_session],[#include ],[int],[NULL]) CR_CHECK_KERNEL_CALL_FULL([2.6.24 task ids],[task_session_vnr],[#include ],[int],[NULL]) # Should allow only exactly one match, except that 2.6.6 and 2.6.20/24 overlap during transitional period case "${HAVE_2_6_0_TASK_IDS}X${HAVE_2_6_6_TASK_IDS}X${HAVE_2_6_20_TASK_IDS}${HAVE_2_6_24_TASK_IDS}" in 1XX|X1X|X1X1|XX1) # OK ;; *) CR_BAD_KERNEL([can't find pgrp/session of a task_struct]) ;; esac CR_CHECK_KERNEL_CALL([set_task_pgrp],[#include ]) CR_CHECK_KERNEL_CALL([set_task_session],[#include ]) CR_CHECK_KERNEL_CALL([valid_signal],[#include ]) CR_CHECK_KERNEL_MACRO([REMOVE_LINKS],[#include ]) CR_CHECK_KERNEL_MEMBER([task.pids pid_link],[#include ], [struct task_struct], [struct pid_link], [pids[0]]) CR_CHECK_KERNEL_MEMBER([task.pids pid],[#include ], [struct task_struct], [struct pid], [pids[0]]) # Allow zero or one match if test "${HAVE_TASK_PIDS_PID_LINK}${HAVE_TASK_PIDS_PID}" = "11"; then CR_BAD_KERNEL([unable to determine type of task.pids array]) fi # put_task_struct() requires one of these: CR_FIND_KSYM([__put_task_struct],[CODE],[extern void __put_task_struct(struct task_struct *);]) CR_FIND_KSYM([__put_task_struct_cb],[CODE]) CR_CHECK_KERNEL_MEMBER([mm.task_size],[#include ], [struct mm_struct],[unsigned long],[task_size]) CR_CHECK_KERNEL_MEMBER([mm.exe_file],[ #include #include ], [struct mm_struct],[struct file *],[exe_file]) CR_CHECK_KERNEL_MEMBER([vma.vm_mm],[#include ], [struct vm_area_struct],[struct mm_struct *],[vm_mm]) CR_CHECK_KERNEL_CALL([PageAnon],[#include ]) # Look for various VDSO-related bits (arch and version dependent) CR_CHECK_KERNEL_MEMBER([thread.vdso_base],[#include ], [struct thread_struct],[unsigned long],[vdso_base]) CR_CHECK_KERNEL_MEMBER([mm.context.vdso_base],[#include ], [mm_context_t],[unsigned long],[vdso_base]) CR_CHECK_KERNEL_MEMBER([mm.context.vdso],[#include ], [mm_context_t],[unsigned long],[vdso]) CR_CHECK_KERNEL_MEMBER([thread_info.sysenter_return],[#include ], [struct thread_info],[void *],[sysenter_return]) if test $CR_KARCH = arm; then CR_CHECK_KERNEL_MEMBER([thread_info.tp_value],[#include ], [struct thread_info],[unsigned long],[tp_value]) CR_FIND_KSYM([__kuser_helper_start],[CODE],[extern int __kuser_helper_start(void);]) CR_FIND_KSYM([__kuser_cmpxchg],[CODE],[extern int __kuser_cmpxchg(void);]) fi CR_CHECK_KERNEL_CONSTANT([VSYSCALL_BASE],[#include ]) CR_CHECK_KERNEL_CALL_NARGS([arch_setup_additional_pages],[ #include #include ],[NULL,0],[NULL,0,0,0]) if test -n "${HAVE_2_ARG_ARCH_SETUP_ADDITIONAL_PAGES}${HAVE_4_ARG_ARCH_SETUP_ADDITIONAL_PAGES}"; then CR_FIND_KSYM([arch_setup_additional_pages],[CODE]) fi CR_CHECK_KERNEL_CALL([map_vsyscall],[ #include #include #ifndef __HAVE_ARCH_VSYSCALL choke me #endif]) if test -n "${HAVE_MAP_VSYSCALL}"; then CR_FIND_KSYM([map_vsyscall],[CODE]) fi if test $CR_KARCH = x86_64; then CR_FIND_KSYM([syscall32_setup_pages],[CODE], [extern int syscall32_setup_pages(void *, int);]) fi if test $CR_KARCH = arm; then CR_FIND_KSYM([vectors_user_mapping],[CODE], [extern int vectors_user_mapping(void);]) fi CR_FIND_KSYM([arch_pick_mmap_layout],[CODE]) CR_FIND_KSYM([arch_get_unmaped_area],[CODE]) CR_FIND_KSYM([arch_unmap_area],[CODE]) CR_CHECK_KERNEL_MEMBER([mm.mmap_base],[#include ], [struct mm_struct],[unsigned long],[mmap_base]) CR_CHECK_KERNEL_MEMBER([mm.cached_hole_size],[#include ], [struct mm_struct],[unsigned long],[cached_hole_size]) CR_FIND_KSYM([do_munmap],[CODE]) CR_CHECK_KERNEL_CALL([do_mmap],[#include ]) CR_CHECK_KERNEL_CALL([do_mmap_pgoff],[#include ]) if test -n "${HAVE_DO_MMAP_PGOFF}"; then CR_FIND_KSYM([do_mmap_pgoff],[CODE]) elif test -n "${HAVE_DO_MMAP}"; then CR_FIND_KSYM([do_mmap],[CODE]) else CR_BAD_KERNEL([could not locate either do_mmap() or do_mmap_pgoff()]) fi CR_CHECK_KERNEL_MACRO([CONFIG_HUGETLBFS]) if test -n "${HAVE_CONFIG_HUGETLBFS}"; then CR_FIND_KSYM([hugetlbfs_file_operations],[DATA], [extern const struct file_operations hugetlbfs_file_operations;]) CR_FIND_KSYM([is_file_shm_hugepages],[CODE], [extern int is_file_shm_hugepages(struct file *file);]) CR_FIND_KSYM([hugepage_vma],[CODE], [extern struct vm_area_struct *hugepage_vma(struct mm_struct *, unsigned long);]) CR_FIND_KSYM([pmd_huge],[CODE], [extern int pmd_huge(pmd_t pmd);]) CR_FIND_KSYM([follow_huge_pmd],[CODE], [extern struct page * follow_huge_pmd(struct mm_struct *, unsigned long pmd_t *, int);]) CR_FIND_KSYM([follow_huge_addr],[CODE]) # Must have prototype, or NARGS probe will fail CR_CHECK_KERNEL_CALL_NARGS([follow_huge_addr],[#include #include ],[NULL,0,0],[NULL,NULL,0,0]) if test "${HAVE_3_ARG_FOLLOW_HUGE_ADDR}${HAVE_4_ARG_FOLLOW_HUGE_ADDR}" != "1"; then CR_BAD_KERNEL([CONFIG_HUGETLBFS set, but unable to determine how invoke follow_huge_addr()]) fi else # Avoid gripes from gcc AC_DEFINE([HAVE_3_ARG_FOLLOW_HUGE_ADDR], [0]) AC_DEFINE([HAVE_4_ARG_FOLLOW_HUGE_ADDR], [0]) fi # Import the correct symbol for arch-specific ZERO_PAGE(), # which must have a prototype in asm/pgtable.h (arch-specific) # If we support ia64 or mips in the future we'll need to add more cases here. # NOTE: don't try to factor the CR_FIND_KSYM() call; it requires a literal. case $CR_KARCH in sparc*) CR_FIND_KSYM([mem_map_zero],[DATA]) ZERO_PAGE_SYMBOL=mem_map_zero ;; *) CR_FIND_KSYM([empty_zero_page],[DATA]) ZERO_PAGE_SYMBOL=empty_zero_page ;; esac if test -z "$cr_addr"; then AC_MSG_ERROR([failed to find symbol $ZERO_PAGE_SYMBOL]) fi # How to check for permission CR_CHECK_KERNEL_CALL([inode_permission],[#include ]) CR_CHECK_KERNEL_CALL([permission],[#include ]) if test -z "${HAVE_INODE_PERMISSION}${HAVE_PERMISSION}"; then CR_BAD_KERNEL([unable to determine how to invoke permission() or inode_permission]) fi # Bits for save/restore of pending signals CR_FIND_KSYM([copy_siginfo_to_user],[CODE], [extern int copy_siginfo_to_user(siginfo_t *to, siginfo_t *from);]) CR_FIND_KSYM([group_send_sig_info],[CODE], [extern int group_send_sig_info(int, struct siginfo *, struct task_struct *);]) # For save/restore of sigaltstack CR_FIND_KSYM([do_sigaltstack],[CODE], [extern int do_sigaltstack(const stack_t *, stack_t *, unsigned long);]) if test $CR_KARCH = i386 -o $CR_KARCH = x86_64; then CR_CHECK_KERNEL_TYPE([struct n_desc_struct],[ #include #include ]) CR_CHECK_KERNEL_SYMBOL([cpu_gdt_descr],[#include #include ]) if test -n "${HAVE_CPU_GDT_DESCR}"; then CR_FIND_KSYM([cpu_gdt_descr],[DATA]) fi CR_FIND_KSYM([cpu_gdt_table],[DATA]) CR_FIND_KSYM([per_cpu__cpu_gdt_descr],[DATA]) CR_CHECK_KERNEL_MEMBER([thread.sp0],[#include ], [struct thread_struct],[unsigned long],[sp0]) CR_CHECK_KERNEL_MEMBER([thread.esp0],[#include ], [struct thread_struct],[unsigned long],[esp0]) CR_CHECK_KERNEL_MEMBER([thread.rsp0],[#include ], [struct thread_struct],[unsigned long],[rsp0]) CR_CHECK_KERNEL_MEMBER([thread.usersp],[#include ], [struct thread_struct],[unsigned long],[usersp]) CR_CHECK_KERNEL_MEMBER([thread.userrsp],[#include ], [struct thread_struct],[unsigned long],[userrsp]) CR_CHECK_KERNEL_MEMBER([thread.debugreg0],[#include ], [struct thread_struct],[unsigned long],[debugreg0]) CR_CHECK_KERNEL_MEMBER([thread.debugregs],[#include ], [struct thread_struct],[unsigned long],[debugreg[1]]) CR_CHECK_KERNEL_MEMBER([thread.ptrace_bps],[ #include #include ], [struct thread_struct],[struct perf_event *],[ptrace_bps[1]]) CR_CHECK_KERNEL_MEMBER([thread.i387],[#include ], [struct thread_struct],[union i387_union],[i387]) CR_CHECK_KERNEL_MEMBER([thread.xstate],[#include ], [struct thread_struct],[union thread_xstate *],[xstate]) CR_CHECK_KERNEL_MEMBER([thread.fpu],[#include ], [struct thread_struct],[struct fpu],[fpu]) CR_CHECK_KERNEL_MEMBER([pt_regs.eflags],[#include ],[struct pt_regs],[unsigned long],[eflags]) CR_CHECK_KERNEL_MEMBER([pt_regs.flags],[#include ],[struct pt_regs],[unsigned long],[flags]) CR_FIND_KSYM([init_fpu],[CODE],[extern void init_fpu(struct task_struct *);]) CR_FIND_KSYM([xstate_size],[DATA],[extern unsigned int xstate_size;]) CR_CHECK_KERNEL_CALL([restore_fpu_checking],[#include ]) if test -n "${HAVE_RESTORE_FPU_CHECKING}"; then CR_CHECK_KERNEL_DECL([2.6.0 restore_fpu_checking],[restore_fpu_checking], [#include ], [int restore_fpu_checking(struct i387_fxsave_struct *);]) CR_CHECK_KERNEL_DECL([2.6.28 restore_fpu_checking],[restore_fpu_checking], [#include ], [int restore_fpu_checking(struct task_struct *);]) if test "${HAVE_2_6_0_RESTORE_FPU_CHECKING}${HAVE_2_6_28_RESTORE_FPU_CHECKING}" != "1"; then CR_BAD_KERNEL([unable to determine how to call restore_fpu_checking()]) fi fi fi if test $CR_KARCH = i386; then CR_CHECK_KERNEL_MEMBER([pt_regs.xcs],[#include ],[struct pt_regs],[int],[xcs]) CR_CHECK_KERNEL_MEMBER([pt_regs.xfs],[#include ],[struct pt_regs],[int],[xfs]) CR_CHECK_KERNEL_MEMBER([pt_regs.xgs],[#include ],[struct pt_regs],[int],[xgs]) CR_CHECK_KERNEL_MEMBER([pt_regs.cs],[#include ],[struct pt_regs],[int],[cs]) CR_CHECK_KERNEL_MEMBER([pt_regs.fs],[#include ],[struct pt_regs],[int],[fs]) CR_CHECK_KERNEL_MEMBER([pt_regs.gs],[#include ],[struct pt_regs],[int],[gs]) fi CR_CHECK_KERNEL_MEMBER([inode sem],[ #include #include ],[struct inode],[struct semaphore],[i_sem]) CR_CHECK_KERNEL_MEMBER([inode mutex],[ #include #include #include ],[struct inode],[struct mutex],[i_mutex]) # Allow exactly one match if test "${HAVE_INODE_SEM}${HAVE_INODE_MUTEX}" != "1"; then CR_BAD_KERNEL([unrecognized lock type for struct inode]) fi CR_CHECK_KERNEL_MEMBER([mm.dumpable],[#include ], [struct mm_struct],[int],[dumpable]) CR_FIND_KSYM([get_dumpable],[CODE],[extern int get_dumpable(struct mm_struct *mm);]) # Allow one or more match(es) if test -z "${HAVE_MM_DUMPABLE}${cr_addr}"; then CR_BAD_KERNEL([unable to determine how to identify non-dumpable tasks]) fi CR_CHECK_KERNEL_MEMBER([task.rlim],[#include ], [struct task_struct],[struct rlimit],[rlim[0]]) CR_CHECK_KERNEL_MEMBER([signal.rlim],[#include ], [struct task_struct],[struct rlimit],[signal->rlim[0]]) # Allow exactly one match if test "${HAVE_TASK_RLIM}${HAVE_SIGNAL_RLIM}" != "1"; then CR_BAD_KERNEL([unable to determine location of rlim structure]) fi CR_CHECK_KERNEL_MEMBER([task.cred],[#include ], [struct task_struct],[const struct cred *],[cred]) if test -n "${HAVE_TASK_CRED}"; then CR_CHECK_KERNEL_CALL_NARGS([dentry_open],[#include ], [NULL,0,NULL],[NULL,NULL,0,NULL]) fi CR_CHECK_KERNEL_MEMBER([task.group_info],[#include ], [struct task_struct],[struct group_info *],[group_info]) CR_CHECK_KERNEL_SYMBOL([suid_dumpable],[#include ]) if test -n "${HAVE_SUID_DUMPABLE}"; then CR_FIND_KSYM([suid_dumpable],[DATA]) fi CR_CHECK_KERNEL_CALL([set_dumpable],[#include ]) if test -n "${HAVE_SET_DUMPABLE}"; then CR_FIND_KSYM([set_dumpable],[CODE]) fi CR_FIND_KSYM([groups_search],[CODE],[extern int groups_search(struct group_info *, gid_t);]) CR_FIND_KSYM([supplemental_group_member],[CODE],[extern int supplemental_group_member(gid_t);]) CR_CHECK_KERNEL_CONSTANT([PIDTYPE_TGID],[#include ]) CR_CHECK_KERNEL_MEMBER([task.thread_group],[#include ], [struct task_struct],[struct list_head],[thread_group]) if test "${HAVE_PIDTYPE_TGID}${HAVE_TASK_THREAD_GROUP}" != "1"; then CR_BAD_KERNEL([unable to determine thread group list]) fi CR_FIND_KSYM([detach_pid],[CODE]) CR_FIND_KSYM([attach_pid],[CODE]) CR_FIND_KSYM([change_pid],[CODE]) CR_FIND_KSYM([find_pid],[CODE]) CR_FIND_KSYM([link_pid],[CODE]) CR_CHECK_KERNEL_CALL_NARGS([find_pid],[#include ],[0],[0,0]) CR_CHECK_KERNEL_CALL([find_pid_ns],[#include ]) if test -z "${HAVE_1_ARG_FIND_PID}${HAVE_2_ARG_FIND_PID}${HAVE_FIND_PID_NS}"; then CR_BAD_KERNEL([unable to determine how to map pid_nr -> struct pid]) fi CR_CHECK_KERNEL_CALL([find_task_by_pid],[#include ]) CR_CHECK_KERNEL_CALL([find_task_by_pid_ns],[#include ]) if test -z "${HAVE_FIND_TASK_BY_PID}${HAVE_FIND_TASK_BY_PID_NS}"; then CR_BAD_KERNEL([unable to determine how to map pid_nr -> struct task]) fi CR_FIND_KSYM([find_task_by_pid_ns],[CODE]) CR_CHECK_KERNEL_CALL([find_task_by_pid_type],[#include ]) CR_CHECK_KERNEL_CALL([find_task_by_pid_type_ns],[#include ]) if test -z "${HAVE_2_ARG_FIND_PID}${HAVE_FIND_TASK_BY_PID}${HAVE_FIND_TASK_BY_PID_NS}"; then CR_BAD_KERNEL([unable to determine how to map (type, pid_nr) -> struct task]) fi CR_CHECK_KERNEL_CALL([alloc_pid],[#include ]) if test -n "${HAVE_ALLOC_PID}"; then CR_CHECK_KERNEL_CALL_NARGS([alloc_pid],[#include ],[],[NULL]) if test "${HAVE_0_ARG_ALLOC_PID}${HAVE_1_ARG_ALLOC_PID}" != "1"; then CR_BAD_KERNEL([unable to determine how to call alloc_pid()]) fi CR_FIND_KSYM([free_pid],[CODE]) CR_FIND_KSYM([pid_hash],[DATA],[extern struct hlist_head *pid_hash;]) CR_FIND_KSYM([pidhash_shift],[DATA],[extern int pidhash_shift;]) # Can't use true type because 'struct kmem_cache' is opaque by design CR_CHECK_KERNEL_MEMBER([pid_namespace.pid_cachep],[ #include #include ], [struct pid_namespace],[void *],[pid_cachep]) CR_FIND_KSYM([pid_cachep],[DATA],[ #if HAVE_KMEM_CACHE_T extern kmem_cache_t *pid_cachep; #else extern struct kmem_cache *pid_cachep; #endif ]) if test -z "${cr_addr}${HAVE_PID_NAMESPACE_PID_CACHEP}"; then CR_BAD_KERNEL([unable to determine where to find pid_cachep]) fi if test -n "${HAVE_LINUX_PSPACE_H}"; then CR_FIND_KSYM([init_pspace],[DATA]) elif test -n "${HAVE_LINUX_PID_NAMESPACE_H}"; then CR_FIND_KSYM([init_pid_ns],[DATA]) fi fi CR_CHECK_KERNEL_DECL([2.6.0 attach_pid],[attach_pid], [#include #include ], [extern int FASTCALL(attach_pid(struct task_struct *task, enum pid_type type, int nr));]) CR_CHECK_KERNEL_DECL([2.6.22 attach_pid],[attach_pid], [#include #include ], [extern int FASTCALL(attach_pid(struct task_struct *task, enum pid_type type, struct pid *pid));]) CR_CHECK_KERNEL_DECL([2.6.26 attach_pid],[attach_pid], [#include #include ], [extern void attach_pid(struct task_struct *task, enum pid_type type, struct pid *pid);]) # Require exactly one match if test "${HAVE_2_6_0_ATTACH_PID}${HAVE_2_6_22_ATTACH_PID}${HAVE_2_6_26_ATTACH_PID}" != "1"; then CR_BAD_KERNEL([unable to determine how to call attach_pid()]) fi CR_CHECK_KERNEL_CALL([change_pid],[ #include #include ]) # OK if missing CR_CHECK_KERNEL_TYPE([struct pidmap],[ #if HAVE_LINUX_PSPACE_H #include #endif #if HAVE_LINUX_PID_NAMESPACE_H #include #endif ]) CR_FIND_KSYM([pidmap_array],[DATA],[ #if !HAVE_STRUCT_PIDMAP struct pidmap { atomic_t nr_free; void *page; }; #endif extern struct pidmap pidmap_array[]; ]) if test x"$cr_kernel_smp" = xyes; then CR_FIND_KSYM([pidmap_lock],[DATA],[extern spinlock_t pidmap_lock;]) if test -z "$cr_addr"; then AC_MSG_ERROR([failed to find symbol pidmap_lock]) fi fi CR_CHECK_KERNEL_CALL(kill_pid,[#include ]) CR_CHECK_KERNEL_CALL(kill_proc,[#include ]) # Require at least one if test -z "${HAVE_KILL_PID}${HAVE_KILL_PROC}"; then CR_BAD_KERNEL([unable to find kill_pid() or kill_proc()]) fi CR_CHECK_KERNEL_CALL([child_reaper],[#include ]) CR_CHECK_KERNEL_CALL([task_child_reaper],[#include ]) if test -z "${HAVE_CHILD_REAPER}${HAVE_TASK_CHILD_REAPER}"; then CR_FIND_KSYM([child_reaper],[DATA],[extern struct task_struct *child_reaper;]) fi CR_CHECK_KERNEL_MEMBER([task.parent],[#include ], [struct task_struct],[struct task_struct *],[parent]) CR_CHECK_KERNEL_MEMBER([task.real_parent],[#include ], [struct task_struct],[struct task_struct *],[real_parent]) # Look for non-deprecated "typedef struct SOMETHING kmem_cache_t". # This is slightly complicated by the fact that this is an opaque type (with # the struct itself forward-declared but not defined in the public headers). pushdef([cr_cvname],cr_cv_kconfig_HAVE_KMEM_CACHE_T)[]dnl AC_CACHE_CHECK([kernel for kmem_cache_t],cr_cvname,[ CR_TRY_KERNEL_COMPILE([#include ],[kmem_cache_t *x = NULL;],[ CR_EGREP_KERNEL_HEADER([typedef.+[[:space:]]kmem_cache_t[[:space:]].+deprecated], [linux/slab.h],[cr_cvname=no],[cr_cvname=yes]) # Want *not* found ], [cr_cvname=no]) ]) popdef([cr_cvname])[]dnl CR_DEFINE(HAVE_KMEM_CACHE_T,[test x$cr_cv_kconfig_HAVE_KMEM_CACHE_T = xyes], [Define to 1 if the kmem_cache_t typedef exists and is not deprecated]) # type of (struct fs_struct).lock CR_CHECK_KERNEL_MEMBER([fs_struct rwlock],[ #include #include ],[struct fs_struct],[rwlock_t],[lock]) CR_CHECK_KERNEL_MEMBER([fs_struct spinlock],[ #include #include ],[struct fs_struct],[spinlock_t],[lock]) if test "$HAVE_FS_STRUCT_RWLOCK$HAVE_FS_STRUCT_SPINLOCK" = "11" \ -o "$HAVE_FS_STRUCT_RWLOCK$HAVE_FS_STRUCT_SPINLOCK" = "00" ; then CR_BAD_KERNEL([unrecognized type for fs_struct.lock]) fi CR_CHECK_KERNEL_TYPE([gfp_t],[#include ]) # OK if missing CR_CHECK_KERNEL_CALL([kzalloc],[#include ]) # OK if missing CR_CHECK_KERNEL_CALL([kmem_cache_zalloc],[#include ]) # OK if missing CR_CHECK_KERNEL_CALL([kmemdup],[#include ]) # OK if missing CR_CHECK_KERNEL_MEMBER([pipe_inode_info.base],[ #include #include ],[struct pipe_inode_info],[char*],[base]) # OK if missing. CR_CHECK_KERNEL_MEMBER([pipe_inode_info.buffers],[ #include #include ],[struct pipe_inode_info],[unsigned int],[buffers]) # OK if missing. CR_CHECK_KERNEL_MEMBER([pipe_buf_operations.pin],[ #include #include ],[struct pipe_buf_operations],[],[pin]) if test -z "${HAVE_PIPE_BUF_OPERATIONS_PIN}"; then CR_CHECK_KERNEL_COMPILE([2-arg pipe_ops.unmap],[ #include #include ],[ struct pipe_buf_operations p; (void)p.unmap(NULL,NULL); ]) CR_CHECK_KERNEL_COMPILE([3-arg pipe_ops.unmap],[ #include #include ],[ struct pipe_buf_operations p; (void)p.unmap(NULL,NULL,NULL); ]) fi # Require exactly one match if test "${HAVE_PIPE_INODE_INFO_BASE}${HAVE_PIPE_BUF_OPERATIONS_PIN}${HAVE_2_ARG_PIPE_OPS_UNMAP}${HAVE_3_ARG_PIPE_OPS_UNMAP}" != "1"; then CR_BAD_KERNEL([unrecognized pipe buf operations]) fi CR_FIND_KSYM([anon_pipe_buf_ops],[DATA], [extern struct pipe_buf_operations anon_pipe_buf_ops;]) CR_CHECK_KERNEL_CALL([pipe_fcntl],[ #include #include ]) if test "${HAVE_PIPE_FCNTL}" = "1"; then CR_FIND_KSYM([pipe_fcntl],[CODE], [long pipe_fcntl(struct file *file, unsigned int cmd, unsigned long arg);]) fi # Now try to define CR_F_SETPIPE_SZ and CR_F_GETPIPE_SZ, for the pipe test. # # We try the user space headers first. If we don't find a definition, then we # poke around the kernel headers for the definition. # # If we still don't have a definition at this point, the crut test also # uses an #ifdef F_SETPIPE_SZ before using CR_F_SETPIPE_SZ, so we have # one more chance. CR_CHECK_KERNEL_MACRO([F_SETPIPE_SZ],[#include ]) CR_CHECK_KERNEL_MACRO([F_GETPIPE_SZ],[#include ]) if test "${HAVE_F_SETPIPE_SZ}${HAVE_F_GETPIPE_SZ}" = "11"; then CR_DEFINE_INT(CR_F_SETPIPE_SZ,[F_SETPIPE_SZ],[#include ]) if test -z "${CR_F_SETPIPE_SZ}"; then CR_DEFINE_KERNEL_INT( CR_F_SETPIPE_SZ,[F_SETPIPE_SZ],[#include ]) fi CR_DEFINE_INT(CR_F_GETPIPE_SZ,[F_GETPIPE_SZ],[#include ]) if test -z "${CR_F_GETPIPE_SZ}"; then CR_DEFINE_KERNEL_INT( CR_F_GETPIPE_SZ,[F_GETPIPE_SZ],[#include ]) fi fi # The user space headers may not define F_SETPIPE_SZ or F_GETPIPE_SZ, # and we need these values to run the unit test, # so we define CR_F_SETPIPE_SZ and CR_F_GETPIPE_SZ to hold the values # that we find in the kernel. # For O_DIRECT support CR_CHECK_KERNEL_MEMBER([file_operations.check_flags],[#include ], [struct file_operations],[],[check_flags]) CR_CHECK_KERNEL_MEMBER([file.f_lock],[#include ], [struct file],[spinlock_t],[f_lock]) CR_CHECK_KERNEL_MEMBER([inode.i_mapping],[#include ], [struct inode],[struct address_space*],[i_mapping]) CR_CHECK_KERNEL_MEMBER([file.f_mapping],[#include ], [struct file],[struct address_space*],[f_mapping]) # Require one or more match on mapping if test -z "${HAVE_INODE_I_MAPPING}${HAVE_FILE_F_MAPPING}"; then CR_BAD_KERNEL([could not locate address_space in inode or file structs]) fi CR_CHECK_KERNEL_MEMBER([file_operations.unlocked_ioctl],[#include ], [struct file_operations],[],[unlocked_ioctl]) CR_CHECK_KERNEL_CALL_NARGS([do_generic_file_read],[#include ], [NULL,NULL,NULL,NULL],[NULL,NULL,NULL,NULL,0]) CR_CHECK_KERNEL_MEMBER([read_descriptor_t.arg.data],[#include ], [read_descriptor_t],[void*],[arg.data]) CR_CHECK_KERNEL_MEMBER([read_descriptor_t.buf],[#include ], [read_descriptor_t],[char*],[buf]) if test "${HAVE_READ_DESCRIPTOR_T_ARG_DATA}${HAVE_READ_DESCRIPTOR_T_BUF}" != "1"; then CR_BAD_KERNEL([unable to determine how to use do_generic_file_read()]) fi CR_CHECK_KERNEL_CALL([splice_direct_to_actor],[ #include #include ]) CR_CHECK_KERNEL_MEMBER([task.ptrace],[#include ], [struct task_struct],[unsigned long],[ptrace]) CR_CHECK_KERNEL_MEMBER([task.ptracees],[#include ], [struct task_struct],[struct list_head],[ptracees]) CR_CHECK_KERNEL_MEMBER([task.ptraced],[#include ], [struct task_struct],[struct list_head],[ptraced]) if test -n "${HAVE_TASK_PTRACEES}"; then CR_FIND_KSYM([ptrace_utrace_ops],[DATA], [extern struct utrace_engine_ops ptrace_utrace_ops;]) if test -z "$cr_addr"; then AC_MSG_ERROR([failed to find symbol ptrace_utrace_ops]) fi fi if test "${HAVE_TASK_PTRACE}${HAVE_TASK_PTRACEES}" != "1"; then CR_BAD_KERNEL([unable to determine how to identify ptrace()ed/ing processes]) fi CR_CHECK_KERNEL_SYMBOL([proc_root],[#include ]) # check kmalloc max size CR_CHECK_KMALLOC_MAX ## Now we check for some additional (potentially) non-exported kernel symbols... # DATA CR_FIND_KSYM([tasklist_lock],[DATA]) CR_FIND_KSYM([shmem_file_operations],[DATA], [extern const struct file_operations shmem_file_operations;]) CR_FIND_KSYM([ramfs_file_operations],[DATA], [extern const struct file_operations ramfs_file_operations;]) CR_FIND_KSYM([HPAGE_SHIFT],[DATA],[extern unsigned int HPAGE_SHIFT;]) CR_FIND_KSYM([phys_base],[DATA],[extern unsigned long phys_base;]) # CODE CR_FIND_KSYM([do_pipe],[CODE]) CR_FIND_KSYM([do_pipe_flags],[CODE]) CR_FIND_KSYM([sys_munmap],[CODE], [extern asmlinkage long sys_munmap(unsigned long addr, size_t len);]) CR_FIND_KSYM([sys_dup2],[CODE], [extern asmlinkage long sys_dup2(unsigned int oldfd, unsigned int newfd);]) CR_FIND_KSYM([sys_lseek],[CODE], [extern asmlinkage off_t sys_lseek(unsigned int fd, off_t offset, unsigned int origin);]) CR_FIND_KSYM([sys_ftruncate],[CODE], [extern asmlinkage long sys_ftruncate(unsigned int fd, unsigned long length);]) CR_FIND_KSYM([sys_mprotect],[CODE], [extern asmlinkage long sys_mprotect(unsigned long start, size_t len, unsigned long prot);]) CR_FIND_KSYM([sys_setitimer],[CODE], [extern asmlinkage long sys_setitimer(int which, struct itimerval *value, struct itimerval *ovalue);]) CR_FIND_KSYM([sys_prctl],[CODE], [extern asmlinkage long sys_prctl(int option, unsigned long arg2, unsigned long arg3, unsigned long arg4, unsigned long arg5);]) CR_FIND_KSYM([copy_fs_struct],[CODE]) CR_FIND_KSYM([put_fs_struct],[CODE]) if test -z "$cr_addr"; then CR_FIND_KSYM([free_fs_struct],[CODE]) if test -z "$cr_addr"; then AC_MSG_ERROR([failed to find either symbol put_fs_struct or free_fs_struct]) fi fi # Check for auditing support CR_CHECK_KERNEL_MACRO([CONFIG_AUDITSYSCALL]) if test -n "${HAVE_CONFIG_AUDITSYSCALL}"; then CR_CHECK_KERNEL_CALL([audit_dummy_context], [#include ]) CR_CHECK_KERNEL_CALL_FULL([2.6.6 audit_syscall_exit],[audit_syscall_exit],[ #include #ifdef AUDITSC_RESULT choke me #endif ],[ ],[NULL,0]) CR_CHECK_KERNEL_CALL_FULL([2.6.12 audit_syscall_exit],[audit_syscall_exit],[ #include #ifndef AUDITSC_RESULT choke me #endif ],[ ],[NULL,AUDITSC_RESULT(0),0]) CR_CHECK_KERNEL_CALL_FULL([2.6.17 audit_syscall_exit],[audit_syscall_exit],[ #include #ifndef AUDITSC_RESULT choke me #endif ],[ ],[AUDITSC_RESULT(0),0]) CR_CHECK_KERNEL_CALL([__audit_syscall_exit], [#include ]) if test x"${HAVE_2_6_6_AUDIT_SYSCALL_EXIT}${HAVE_2_6_12_AUDIT_SYSCALL_EXIT}${HAVE_2_6_17_AUDIT_SYSCALL_EXIT}${HAVE___AUDIT_SYSCALL_EXIT}" != x"1"; then AC_MSG_ERROR([failed to determine arguments to audit_syscall_exit()]) fi if test x"${HAVE_2_6_17_AUDIT_SYSCALL_EXIT}" = x"1"; then CR_FIND_KSYM([audit_syscall_exit],[CODE], [extern void audit_syscall_exit(int failed, long return_code);]) elif test x"${HAVE_2_6_12_AUDIT_SYSCALL_EXIT}" = x"1"; then CR_FIND_KSYM([audit_syscall_exit],[CODE], [extern void audit_syscall_exit(struct task_struct *task, int failed, long return_code);]) elif test x"${HAVE_2_6_6_AUDIT_SYSCALL_EXIT}" = x"1"; then CR_FIND_KSYM([audit_syscall_exit],[CODE], [extern void audit_syscall_exit(struct task_struct *task, int return_code);]) elif test x"${HAVE___AUDIT_SYSCALL_EXIT}" = x"1"; then CR_FIND_KSYM([__audit_syscall_exit],[CODE], [extern void __audit_syscall_exit(int ret_success, long ret_value);]) else : # Unreachable? AC_MSG_ERROR([failed to determine arguments to audit_syscall_exit()]) fi if test -z "$cr_addr"; then AC_MSG_ERROR([failed to find symbol audit_syscall_exit()]) fi fi # For blcr CR_FIND_KSYM([set_fs_pwd],[CODE]) # For vmadump4 CR_FIND_KSYM([sys_mremap],[CODE], [extern asmlinkage unsigned long sys_mremap(unsigned long addr, unsigned long old_len, unsigned long new_len, unsigned long flags, unsigned long new_addr);]) CR_FIND_KSYM([do_sigaction],[CODE]) if test $CR_KARCH = x86_64; then CR_FIND_KSYM([load_gs_index],[CODE]) CR_CHECK_KERNEL_CALL([read_pda],[#include ]) CR_CHECK_KERNEL_CALL([write_pda],[#include ]) if test "$HAVE_READ_PDA$HAVE_WRITE_PDA" != "11"; then CR_CHECK_KERNEL_CALL([percpu_read],[#include ]) CR_CHECK_KERNEL_CALL([percpu_write],[#include ]) CR_CHECK_KERNEL_CALL([this_cpu_read],[#include ]) CR_CHECK_KERNEL_CALL([this_cpu_write],[#include ]) if test "$HAVE_PERCPU_READ$HAVE_PERCPU_WRITE" != "11" -a \ "$HAVE_THIS_CPU_READ$HAVE_THIS_CPU_WRITE" != "11" ; then CR_BAD_KERNEL([found neither {read,write}_pda() nor percpu_{read,write}() nor this_cpu_{read,write}()]) else CR_FIND_KSYM([per_cpu__old_rsp],[DATA],[DECLARE_PER_CPU(unsigned long, old_rsp);]) if test -z "$cr_addr"; then CR_FIND_KSYM([old_rsp],[DATA],[DECLARE_PER_CPU(unsigned long, old_rsp);]) if test -z "$cr_addr"; then AC_MSG_ERROR([failed to locate either symbol per_cpu__old_rsp or old_rsp]) fi fi fi fi fi if test x$enable_restore_ids = xyes; then CR_FIND_KSYM([sys_setgroups],[CODE], [extern asmlinkage long sys_setgroups(int, gid_t *);]) CR_FIND_KSYM([sys_setresuid],[CODE], [extern asmlinkage long sys_setresuid(uid_t, uid_t, uid_t);]) CR_FIND_KSYM([sys_setresgid],[CODE], [extern asmlinkage long sys_setresgid(gid_t, gid_t, gid_t);]) fi CR_FIND_KSYM([expand_files],[CODE], [extern int expand_files(struct files_struct *, int);]) CR_FIND_KSYM([__flush_icache_range],[CODE]) CR_FIND_KSYM([sys_fchmod],[CODE], [extern asmlinkage long sys_fchmod(int fd, mode_t mode);]) CR_FIND_KSYM([sys_link],[CODE], [extern asmlinkage long sys_link(const char *oldname, const char *newname);]) CR_FIND_KSYM([sys_unlink],[CODE], [extern asmlinkage long sys_unlink(const char *pathname);]) CR_FIND_KSYM([sys_mknod],[CODE], [extern asmlinkage long sys_mknod(const char *filename, int mode, unsigned int dev);]) # CODE & DATA used for sanity checks # # Unless you are adding additional sanity checks, there is # no good reason to add more calls to CR_FIND_EXPORTED_KSYM. # # register_{chr,blk}dev are used at module load to validate # the System.map used to locate symbols and configure time. CR_FIND_EXPORTED_KSYM([register_chrdev],[CODE]) if test "$cr_addr" = "0"; then CR_FIND_EXPORTED_KSYM([__register_chrdev],[CODE]) if test "$cr_addr" = "0"; then CR_BAD_KERNEL([kernel does not export register_chrdev or __register_chrdev]) fi fi CR_FIND_EXPORTED_KSYM([register_blkdev],[CODE]) if test "$cr_addr" = "0"; then CR_BAD_KERNEL([kernel does not export register_blkdev]) fi # One of {init,system}_utsname is used to validate UTS_RELEASE CR_CHECK_KERNEL_CALL([init_utsname],[#include ]) CR_CHECK_KERNEL_SYMBOL([system_utsname],[#include ]) if test -z "${HAVE_INIT_UTSNAME}${HAVE_SYSTEM_UTSNAME}"; then CR_BAD_KERNEL([unable to determine how to query UTSNAME]) fi AC_DEFINE_UNQUOTED([BLCR_CONFIG_TIMESTAMP], "`date`", [Timestamp of BLCR configuration]) fi # cr_build_modules if test x"$cr_build_libcr" = xyes && expr $CR_ARCH : ppc >/dev/null; then AC_MSG_CHECKING([for work around for bug 2524]) if test "$cr_build_modules,$force_bug2524" = "yes,"; then if test [`echo $LINUX_VER | sed -e 's/^2\.6\.\([0-9]*\).*/\1/;' -e 's/^3\..*/999/;'`] -le 15; then AC_MSG_ERROR([Because you are building for a PowerPC kernel 2.6.15 or older, you must specify either --with-bug2524 or --without-bug2524. If in doubt --with-bug2524 is the safe option (with a small performance penalty).]) fi fi case "$force_bug2524" in yes|no) ;; # nothing to do '') force_bug2524=no ;; # empty is no *) AC_MSG_ERROR([Argument to --with-bug2524 must be 'yes', 'no' or empty]) ;; esac AC_MSG_RESULT([$force_bug2524]) CR_DEFINE(CR_HAVE_BUG2524,[test x$force_bug2524 = xyes], [Define to 1 if work around for bug 2524 is requested.]) fi ################################################################################ # AM_CONDITIONAL may not be called contitionally, so these go here ################################################################################ AM_CONDITIONAL(CR_HAVE_SYSTEM_MAP,[echo $LINUX_SYMTAB_CMD | grep ^cat >/dev/null 2>&1]) AM_CONDITIONAL(CR_BUILD_MAN,[test x$cr_build_util$cross_compiling = xyesno]) AM_CONDITIONAL(CR_HAVE_FTB,[test x$cr_have_ftb = xyes]) AM_CONDITIONAL(CR_HAVE_CXX, [test "x$CXX" != xno]) ################################################################################ # Automake sillyness ################################################################################ AC_SUBST([GMAKE_IFEQ], ifeq) AC_SUBST([GMAKE_IFNEQ], ifneq) AC_SUBST([GMAKE_ELSE], else) AC_SUBST([GMAKE_ENDIF], endif) ################################################################################ # Kbuild glue ################################################################################ AC_SUBST([KBUILD_MAK], "${TOP_BUILDDIR}/config/kbuild.mak") ################################################################################ # Enable/disable building various pieces of the code ################################################################################ AM_CONDITIONAL(BUILD_CR_INFO, [test x$enable_cr_info = xyes]) AM_CONDITIONAL(BUILD_VMADLIB, false) AM_CONDITIONAL(CR_BUILD_MODULES,[test x$cr_build_modules = xyes]) AM_CONDITIONAL(CR_BUILD_UTIL, [test x$cr_build_util = xyes]) AM_CONDITIONAL(CR_BUILD_LIBCR, [test x$cr_build_libcr = xyes]) AM_CONDITIONAL(CR_BUILD_INCLUDE,[test x$cr_build_include = xyes]) AM_CONDITIONAL(CR_BUILD_TESTS, [test x$cr_build_tests = xyes]) AM_CONDITIONAL(CR_BUILD_EXAMPLES,[test x$cr_build_examples = xyes]) AM_CONDITIONAL(CR_BUILD_CONTRIB,[test x$cr_build_contrib = xyes]) ################################################################################ # Finally generate the files and a report (unless supressed) ################################################################################ if test x"$cr_build_modules" = xyes; then AC_CONFIG_FILES([cr_module/Makefile cr_module/kbuild/Makefile vmadump4/Makefile include/blcr_imports.h blcr_imports/imports.c blcr_imports/Makefile blcr_imports/kbuild/Makefile config/kbuild.mak ]) fi if test x"$cr_build_util" = xyes; then AC_CONFIG_FILES([util/Makefile util/cr_checkpoint/Makefile util/cr_restart/Makefile util/cr_run/Makefile util/cr_info/Makefile man/Makefile ]) fi if test x"$cr_build_libcr" = xyes; then AC_CONFIG_FILES([libcr/Makefile]) fi if test x"$cr_build_tests" = xyes; then AC_CONFIG_FILES([tests/Makefile]) AC_CONFIG_FILES(tests/shellinit, chmod +x tests/shellinit) fi if test x"$cr_build_examples" = xyes; then AC_CONFIG_FILES([examples/Makefile examples/counting/Makefile examples/pthread_counting/Makefile examples/pthread_misc/Makefile examples/file_counting/Makefile examples/io_bench/Makefile examples/pipe_counting/Makefile ]) fi if test x"$cr_build_contrib" = xyes; then AC_CONFIG_FILES(contrib/Makefile) AC_CONFIG_FILES(contrib/cr_insmod, chmod +x contrib/cr_insmod) AC_CONFIG_FILES(contrib/gen_cscope, chmod +x contrib/gen_cscope) AC_CONFIG_FILES(contrib/batch_build, chmod +x contrib/batch_build) fi AC_CONFIG_HEADER(blcr_config.h) AC_CONFIG_FILES([Makefile etc/Makefile rpm/Makefile rpm/specfile include/Makefile include/blcr_common.h doc/Makefile ]) AC_OUTPUT if test x"$enable_config_report$cr_build_modules" = xyesyes; then echo '' current_kernel=`uname -r` if test "`uname -r`" != "$LINUX_VER" -a $cross_compiling = no; then echo '*******************************************************************' echo '***** WARNING WARNING WARNING WARNING WARNING WARNING WARNING *****' echo '*******************************************************************' echo '* The kernel source does not match currently the running kernel. *' echo '* Compilation will produce modules unsuitable for the currently *' echo '* running kernel, which may not be what you intended. *' echo '*******************************************************************' echo '***** WARNING WARNING WARNING WARNING WARNING WARNING WARNING *****' echo '*******************************************************************' fi if test x"$cr_static_link_warning" = xyes; then tmp=`echo "'$ldsuggest' " | cut -c-44` echo '*******************************************************************' echo '***** WARNING WARNING WARNING WARNING WARNING WARNING WARNING *****' echo '*******************************************************************' echo '* Static linking with -lpthread appears to yield LinuxThreads, *' echo '* but BLCR supports only the NPTL implementation of pthreads. *' echo "* Please use LDFLAGS=$tmp *" echo "* (or similar) when linking static executables with BLCR's libs *" echo '* to ensure you get the supported NPTL pthreads implementation. *' echo '*******************************************************************' echo '***** WARNING WARNING WARNING WARNING WARNING WARNING WARNING *****' echo '*******************************************************************' fi CR_CONFIG_REPORT if test x"$cr_arch_experimental" = xyes; then echo echo 'WARNING: BLCR support for architecture "'$host_cpu'" is EXPERIMENTAL at this time.' echo fi if test x"$cr_arch_incomplete" = xyes; then echo echo 'WARNING: BLCR support for architecture "'$host_cpu'" is INCOMPLETE at this time.' echo 'WARNING: You probably won'\''t be able to do anything useful with this build.' echo fi fi blcr-0.8.5/cr_module/0000755000000000000000000000000012102072125011356 500000000000000blcr-0.8.5/cr_module/cr_fops.c0000664000000000000000000003705512064133245013121 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2003, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * 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 * * $Id: cr_fops.c,v 1.69.8.4 2012/12/18 18:32:05 phargrov Exp $ */ #include "cr_module.h" /** * cr_hand_complete - wrapper/helper for CR_OP_HAND_DONE * @file: (struct file *) of the control node * * DESCRIPTION: * This function dispatches to the checkpoint-time or restart-time * post-handler "task_complete" code. */ int cr_hand_complete(struct file *filp, unsigned int flags) { cr_task_t *cr_task; int retval; CR_KTRACE_FUNC_ENTRY(); retval = -EINVAL; if (flags & ~CR_HOLD_BOTH) { CR_ERR("%s: invalid flags", __FUNCTION__); goto out_no_task; } // Lookup this task retval = -ESRCH; cr_task = cr_task_get(current); if (!cr_task) { // No matching task found. CR_ERR("%s: No matching task found!", __FUNCTION__); goto out_no_task; } // Dispatch according to the matching request if (cr_task->chkpt_proc_req) { retval = cr_chkpt_task_complete(cr_task, flags & CR_HOLD_CONT); } else if (cr_task->rstrt_proc_req) { retval = cr_rstrt_task_complete(cr_task, flags & CR_HOLD_RSTRT, /* need_lock= */ 1); } else { // No matching request found. CR_ERR("%s: No matching request found!", __FUNCTION__); } cr_task_put(cr_task); out_no_task: CR_KTRACE_FUNC_EXIT("Returning %d", retval); return retval; } /** * cr_hand_abort - wrapper/helper for CR_OP_HAND_ABORT * @file: (struct file *) of the control node * @flags: abort type * * DESCRIPTION: * This function dispatches to the checkpoint-time or restart-time * "abort" code. */ int cr_hand_abort(struct file *filp, unsigned int flags) { cr_task_t *cr_task; int retval; CR_KTRACE_FUNC_ENTRY(); // Lookup this task retval = -ESRCH; cr_task = cr_task_get(current); if (!cr_task) { // No matching task found. CR_ERR("%s: No matching task found!", __FUNCTION__); goto out_no_task; } // Dispatch according to the matching request if (cr_task->chkpt_proc_req) { retval = cr_chkpt_abort(cr_task, flags); } else if (cr_task->rstrt_proc_req) { retval = cr_rstrt_abort(cr_task, flags); } else { // No matching request found. CR_ERR("%s: No matching request found!", __FUNCTION__); } cr_task_put(cr_task); out_no_task: CR_KTRACE_FUNC_EXIT("Returning %d", retval); return retval; } /** * ctrl_ioctl - ioctl() method for the C/R control node * @inode: (struct inode *) of the control node * @file: (struct file *) of the control node * @op: The operation/command to perform * @arg: The (optional) argument to the command as an unsigned long * * DESCRIPTION: * This function is the ioctl() method in the file_operations for * the C/R control node. It acts as a dispatcher to the functions * which do the real work. */ #if HAVE_FILE_OPERATIONS_UNLOCKED_IOCTL static long ctrl_unlocked_ioctl(struct file *file, unsigned int op, unsigned long arg) #else static int ctrl_ioctl(struct inode *inode, struct file *file, unsigned int op, unsigned long arg) #endif { int result = -ENOTTY; CR_KTRACE_FUNC_ENTRY("op=%08x arg=0x%lx", op, arg); switch(op) { // // Calls from libcr: // // XXX: When adding cases here, also add to the ioctl32 init/cleanup // code below and to the big switch in cr_compat.c. case CR_OP_HAND_CHKPT: result = cr_dump_self(file, arg); break; case CR_OP_HAND_ABORT: result = cr_hand_abort(file, arg); break; case CR_OP_HAND_SUSP: result = cr_suspend(file, (struct timeval __user *)arg); break; case CR_OP_HAND_PHASE1: result = cr_phase1_register(file, (int)arg); break; case CR_OP_HAND_PHASE2: result = cr_phase2_register(file, (int)arg); break; case CR_OP_HAND_SRC: result = cr_rstrt_src(file, (char __user *)arg); break; case CR_OP_HAND_CHKPT_INFO: result = cr_chkpt_info(file, (struct cr_chkpt_info __user *)arg); break; case CR_OP_HAND_DONE: result = cr_hand_complete(file, arg); break; // // Calls from cr_checkpoint: // case CR_OP_CHKPT_REQ: result = cr_chkpt_req(file, (struct cr_chkpt_args __user *)arg); break; case CR_OP_CHKPT_REAP: result = cr_chkpt_reap(file); break; case CR_OP_CHKPT_FWD: result = cr_chkpt_fwd(file, (struct cr_fwd_args __user *)arg); break; case CR_OP_CHKPT_LOG: result = cr_chkpt_log(file, (struct cr_log_args __user *)arg); break; // // Calls from cr_restart: // case CR_OP_RSTRT_REQ: result = cr_rstrt_request_restart(file, (struct cr_rstrt_args __user *)arg); break; case CR_OP_RSTRT_REAP: result = cr_rstrt_reap(file); break; case CR_OP_RSTRT_CHILD: result = cr_rstrt_child(file); break; case CR_OP_RSTRT_PROCS: result = cr_rstrt_procs(file, (struct cr_procs_tbl __user *)arg); break; case CR_OP_RSTRT_LOG: result = cr_rstrt_log(file, (struct cr_log_args __user *)arg); break; // // General calls // case CR_OP_VERSION: { // Simple enough to do here // User-space must have equal MAJOR and MINOR <= kernel // If we supported multiple major versions then this is // where we could do the "personallity switching". unsigned long major = (arg >> 16); unsigned long minor = (arg & 0xffff); // If major==0, must match minor; otherwise user-MINOR <= kernel-MINOR int match = (major == CR_MODULE_MAJOR) && (major ? (minor <= CR_MODULE_MINOR) : (minor == CR_MODULE_MINOR)); if (!match) { CR_WARN("request from pid %d for unsupported version %d.%d", (int)current->pid, (int)major, (int)minor); } result = match ? 0 : -CR_EVERSION; break; } default: CR_KTRACE_BADPARM("unknown op %x", _IOC_NR(op)); } return result; } static int ctrl_open(struct inode * inode, struct file * file) { cr_pdata_t *priv; CR_KTRACE_FUNC_ENTRY(); CR_NO_LOCKS(); priv = cr_kmem_cache_zalloc(cr_pdata_t, cr_pdata_cachep, GFP_KERNEL); if (priv) { file->private_data = (void*)priv; } return priv ? 0 : -ENOMEM; } static int ctrl_release(struct inode * inode, struct file * file) { cr_pdata_t *priv; CR_KTRACE_FUNC_ENTRY(); priv = file->private_data; if (priv) { cr_chkpt_req_release(file, priv); cr_rstrt_req_release(file, priv); cr_phase1_release(file, priv); cr_phase2_release(file, priv); kmem_cache_free(cr_pdata_cachep, priv); file->private_data = NULL; } return 0; } static unsigned int ctrl_poll(struct file *filp, poll_table *wait) { unsigned int mask; cr_pdata_t *priv; CR_KTRACE_FUNC_ENTRY(); priv = filp->private_data; if (priv && priv->rstrt_req) { mask = cr_rstrt_poll(filp, wait); } else if (priv && priv->chkpt_req) { mask = cr_chkpt_poll(filp, wait); } else { mask = POLLERR; } return mask; } /* * Ops for the C/R control node */ struct file_operations cr_ctrl_fops = { owner: THIS_MODULE, open: ctrl_open, release: ctrl_release, #if HAVE_FILE_OPERATIONS_UNLOCKED_IOCTL unlocked_ioctl: ctrl_unlocked_ioctl, #else ioctl: ctrl_ioctl, #endif poll: ctrl_poll, #if defined(CONFIG_COMPAT) && defined(HAVE_COMPAT_IOCTL) compat_ioctl: cr_compat_ctrl_ioctl, #endif }; /* * Ops for files we didn't/couldn't reconnect. * XXX: These will get more tuning as time goes on. */ #ifdef CR_ENABLE_BOGUS_FOPS static loff_t cr_llseek_EIO(struct file *f, loff_t o, int w) { return (loff_t)(-EIO); } static ssize_t cr_read_EIO(struct file *f, char *b, size_t s, loff_t *o) { return (ssize_t)(-EIO); } static ssize_t cr_write_EIO(struct file *f, const char *b, size_t s, loff_t *o) { return (ssize_t)(-EIO); } static int cr_readdir_EIO(struct file *f, void *b, filldir_t fd) { return -EIO; } static int cr_ioctl_EIO(struct inode *i, struct file *f, unsigned int cmd, unsigned long op) { return -EIO; } static int cr_mmap_EIO(struct file *f, struct vm_area_struct *v) { return -EIO; } static int cr_open_EIO(struct inode *i, struct file *f) { return -EIO; } static int cr_flush_EIO(struct file *f) { return -EIO; } static int cr_fsync_EIO(struct file *f, struct dentry *d, int s) { return -EIO; } static int cr_fasync_EIO(int fd, struct file *f, int a) { return -EIO; } static int cr_lock_EIO(struct file *f, int op, struct file_lock *fl) { return -EIO; } static ssize_t cr_readv_EIO(struct file *f, const struct iovec *i, unsigned long c, loff_t *o) { return (ssize_t)(-EIO); } static ssize_t cr_writev_EIO(struct file *f, const struct iovec *i, unsigned long c, loff_t *o) { return (ssize_t)(-EIO); } #if 0 /* Not present in all kernels */ static ssize_t cr_sendpage_EIO(struct file *f, struct page *p, int off, size_t s, loff_t *o, int fl) { return (ssize_t)(-EIO); } static unsigned long cr_get_unmapped_area_EIO(struct file *f, unsigned long a, unsigned long b, unsigned long c, unsigned long d) { return (unsigned long)(-EIO); } #endif struct file_operations cr_generic_bogus_fops = { owner: THIS_MODULE, poll: NULL, /* XXX: Not yet sure what we want to do here */ release: NULL, /* Just let the close proceed */ llseek: cr_llseek_EIO, read: cr_read_EIO, write: cr_write_EIO, readdir: cr_readdir_EIO, ioctl: cr_ioctl_EIO, mmap: cr_mmap_EIO, open: cr_open_EIO, flush: cr_flush_EIO, fsync: cr_fsync_EIO, fasync: cr_fasync_EIO, lock: cr_lock_EIO, readv: cr_readv_EIO, writev: cr_writev_EIO, #if 0 /* Not present in all kernels */ sendpage: cr_sendpage_EIO, get_unmapped_area: cr_get_unmapped_area_EIO, #endif }; /* based on pipefs code from linux/fs/pipe.c */ static struct vfsmount *cr_blcr_mnt; static int cr_delete_dentry(struct dentry *dentry) { return 1; } static struct dentry_operations cr_dentry_operations = { d_delete: cr_delete_dentry, }; struct inode * cr_get_bogus_inode(umode_t mode) { struct inode *inode = new_inode(cr_blcr_mnt->mnt_sb); if (inode) { inode->i_fop = &cr_generic_bogus_fops; inode->i_state = I_DIRTY; /* so mark_inode_dirty() will ignore us */ inode->i_mode = mode; inode->i_uid = current->fsuid; inode->i_gid = current->fsgid; inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; inode->i_blksize = PAGE_SIZE; } return inode; } #define BLCRFS_MAGIC 0x626c6372 /* 'b' 'l' 'c' 'r' */ static int blcrfs_statfs(struct super_block *sb, struct statfs *buf) { buf->f_type = BLCRFS_MAGIC; buf->f_bsize = 1024; buf->f_namelen = 255; return 0; } static struct super_operations blcrfs_ops = { statfs: blcrfs_statfs, }; static struct super_block * blcrfs_read_super(struct super_block *sb, void *data, int silent) { struct inode *root = new_inode(sb); if (!root) return NULL; root->i_mode = S_IFDIR | S_IRUSR | S_IWUSR; root->i_uid = root->i_gid = 0; root->i_atime = root->i_mtime = root->i_ctime = CURRENT_TIME; sb->s_blocksize = 1024; sb->s_blocksize_bits = 10; sb->s_magic = BLCRFS_MAGIC; sb->s_op = &blcrfs_ops; sb->s_root = d_alloc(NULL, &(const struct qstr) { "blcr:", 5, 0 }); if (!sb->s_root) { iput(root); return NULL; } sb->s_root->d_sb = sb; sb->s_root->d_parent = sb->s_root; d_instantiate(sb->s_root, root); return sb; } static DECLARE_FSTYPE(blcr_fs_type, "blcrfs", blcrfs_read_super, FS_NOMOUNT); int cr_fs_init(void) { int err = register_filesystem(&blcr_fs_type); #if 0 /* XXX: if we kern_mount() then we can't rmmod :-( */ if (!err) { cr_blcr_mnt = kern_mount(&blcr_fs_type); err = PTR_ERR(cr_blcr_mnt); if (IS_ERR(cr_blcr_mnt)) unregister_filesystem(&blcr_fs_type); else err = 0; } #endif return err; } int cr_fs_cleanup(void) { unregister_filesystem(&blcr_fs_type); #if 0 mntput(cr_blcr_mnt); #endif return 0; } #endif /* CR_ENABLE_BOGUS_FOPS */ #if defined(CONFIG_COMPAT) && !defined(HAVE_COMPAT_IOCTL) #include static int ctrl_ioctl32(unsigned int fd, unsigned int op, unsigned long arg, struct file *filp) { return cr_compat_ctrl_ioctl(filp, op, arg); } int cr_init_ioctl32(void) { register_ioctl32_conversion(CR_IOCTL32_MAP(CR_OP_HAND_CHKPT), &ctrl_ioctl32); register_ioctl32_conversion(CR_IOCTL32_MAP(CR_OP_HAND_ABORT), &ctrl_ioctl32); register_ioctl32_conversion(CR_IOCTL32_MAP(CR_OP_HAND_SUSP), &ctrl_ioctl32); register_ioctl32_conversion(CR_IOCTL32_MAP(CR_OP_HAND_PHASE1), &ctrl_ioctl32); register_ioctl32_conversion(CR_IOCTL32_MAP(CR_OP_HAND_PHASE2), &ctrl_ioctl32); register_ioctl32_conversion(CR_IOCTL32_MAP(CR_OP_HAND_SRC), &ctrl_ioctl32); register_ioctl32_conversion(CR_IOCTL32_MAP(CR_OP_HAND_CHKPT_INFO), &ctrl_ioctl32); register_ioctl32_conversion(CR_IOCTL32_MAP(CR_OP_HAND_DONE), &ctrl_ioctl32); register_ioctl32_conversion(CR_IOCTL32_MAP(CR_OP_CHKPT_REQ), &ctrl_ioctl32); register_ioctl32_conversion(CR_IOCTL32_MAP(CR_OP_CHKPT_REAP), &ctrl_ioctl32); register_ioctl32_conversion(CR_IOCTL32_MAP(CR_OP_CHKPT_FWD), &ctrl_ioctl32); register_ioctl32_conversion(CR_IOCTL32_MAP(CR_OP_CHKPT_LOG), &ctrl_ioctl32); register_ioctl32_conversion(CR_IOCTL32_MAP(CR_OP_RSTRT_REQ), &ctrl_ioctl32); register_ioctl32_conversion(CR_IOCTL32_MAP(CR_OP_RSTRT_REAP), &ctrl_ioctl32); register_ioctl32_conversion(CR_IOCTL32_MAP(CR_OP_RSTRT_CHILD), &ctrl_ioctl32); register_ioctl32_conversion(CR_IOCTL32_MAP(CR_OP_RSTRT_PROCS), &ctrl_ioctl32); register_ioctl32_conversion(CR_IOCTL32_MAP(CR_OP_RSTRT_LOG), &ctrl_ioctl32); register_ioctl32_conversion(CR_IOCTL32_MAP(CR_OP_VERSION), &ctrl_ioctl32); return 0; } int cr_cleanup_ioctl32(void) { unregister_ioctl32_conversion(CR_IOCTL32_MAP(CR_OP_HAND_CHKPT)); unregister_ioctl32_conversion(CR_IOCTL32_MAP(CR_OP_HAND_ABORT)); unregister_ioctl32_conversion(CR_IOCTL32_MAP(CR_OP_HAND_SUSP)); unregister_ioctl32_conversion(CR_IOCTL32_MAP(CR_OP_HAND_PHASE1)); unregister_ioctl32_conversion(CR_IOCTL32_MAP(CR_OP_HAND_PHASE2)); unregister_ioctl32_conversion(CR_IOCTL32_MAP(CR_OP_HAND_SRC)); unregister_ioctl32_conversion(CR_IOCTL32_MAP(CR_OP_HAND_CHKPT_INFO)); unregister_ioctl32_conversion(CR_IOCTL32_MAP(CR_OP_HAND_DONE)); unregister_ioctl32_conversion(CR_IOCTL32_MAP(CR_OP_CHKPT_REQ)); unregister_ioctl32_conversion(CR_IOCTL32_MAP(CR_OP_CHKPT_REAP)); unregister_ioctl32_conversion(CR_IOCTL32_MAP(CR_OP_CHKPT_FWD)); unregister_ioctl32_conversion(CR_IOCTL32_MAP(CR_OP_CHKPT_LOG)); unregister_ioctl32_conversion(CR_IOCTL32_MAP(CR_OP_RSTRT_REQ)); unregister_ioctl32_conversion(CR_IOCTL32_MAP(CR_OP_RSTRT_REAP)); unregister_ioctl32_conversion(CR_IOCTL32_MAP(CR_OP_RSTRT_CHILD)); unregister_ioctl32_conversion(CR_IOCTL32_MAP(CR_OP_RSTRT_PROCS)); unregister_ioctl32_conversion(CR_IOCTL32_MAP(CR_OP_RSTRT_LOG)); unregister_ioctl32_conversion(CR_IOCTL32_MAP(CR_OP_VERSION)); return 0; } #endif blcr-0.8.5/cr_module/arch/0000775000000000000000000000000012102072126012276 500000000000000blcr-0.8.5/cr_module/arch/sparc64/0000775000000000000000000000000012102072126013560 500000000000000blcr-0.8.5/cr_module/arch/sparc64/cr_arch.h0000664000000000000000000000261111115077244015263 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2008, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * 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 * * $Id: cr_arch.h,v 1.2 2008/12/02 00:17:40 phargrov Exp $ * * Experimental SPARC support contributed to BLCR by Vincentius Robby * and Andrea Pellegrini . */ // File for misc. arch-specific bits #ifndef _CR_ARCH_H #include "../sparc/cr_arch.h" #endif blcr-0.8.5/cr_module/arch/x86_64/0000775000000000000000000000000012102072126013234 500000000000000blcr-0.8.5/cr_module/arch/x86_64/cr_arch.h0000664000000000000000000000237110762172021014736 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2008, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * 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 * * $Id: cr_arch.h,v 1.3 2008/03/01 06:13:37 phargrov Exp $ */ // File for misc. arch-specific bits #ifndef _CR_ARCH_H #include "../i386/cr_arch.h" #endif blcr-0.8.5/cr_module/arch/i386/0000775000000000000000000000000012102072126012767 500000000000000blcr-0.8.5/cr_module/arch/i386/cr_arch.h0000664000000000000000000000357311057341302014474 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2004, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * 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 * * $Id: cr_arch.h,v 1.8 2008/09/02 22:48:34 phargrov Exp $ */ // File for misc. arch-specific bits #ifndef _CR_ARCH_H #define _CR_ARCH_H 1 static inline struct pt_regs * get_pt_regs(struct task_struct *tsk) { #if HAVE_THREAD_SP0 return (struct pt_regs *)(tsk->thread.sp0) - 1; #elif HAVE_THREAD_ESP0 return (struct pt_regs *)(tsk->thread.esp0) - 1; #elif HAVE_THREAD_RSP0 return (struct pt_regs *)(tsk->thread.rsp0) - 1; #else #error #endif } #if 0 // Unused currenty, but might be needed again for trampolines static inline unsigned long get_stack_pointer(struct pt_regs *regs) { #if HAVE_THREAD_SP0 return regs->sp; #elif HAVE_THREAD_ESP0 return regs->esp; #elif HAVE_THREAD_RSP0 return regs->rsp; #else #error #endif } #endif #endif blcr-0.8.5/cr_module/arch/ppc64/0000775000000000000000000000000012102072126013232 500000000000000blcr-0.8.5/cr_module/arch/ppc64/cr_arch.h0000664000000000000000000000301211057341304014725 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2004, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * 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 * * $Id: cr_arch.h,v 1.4 2008/09/02 22:48:36 phargrov Exp $ */ // File for misc. arch-specific bits #ifndef _CR_ARCH_H #define _CR_ARCH_H 1 static inline struct pt_regs * get_pt_regs(struct task_struct *tsk) { return tsk->thread.regs; } #if 0 // Unused currenty, but might be needed again for trampolines static inline unsigned long get_stack_pointer(struct pt_regs *regs) { return regs->gpr[1]; } #endif #endif blcr-0.8.5/cr_module/arch/sparc/0000775000000000000000000000000012102072126013406 500000000000000blcr-0.8.5/cr_module/arch/sparc/cr_arch.h0000775000000000000000000000336611115077242015122 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2007, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * 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 * * $Id: cr_arch.h,v 1.2 2008/12/02 00:17:38 phargrov Exp $ * * Experimental SPARC support contributed to BLCR by Vincentius Robby * and Andrea Pellegrini . */ // File for misc. arch-specific bits #ifndef _CR_ARCH_H #define _CR_ARCH_H 1 #include #include static inline struct pt_regs * get_pt_regs(struct task_struct *tsk) { #ifdef task_pt_regs return task_pt_regs(tsk); #else return task_thread_info(tsk)->kregs; #endif } #if 0 /* Not currently used */ static inline unsigned long get_stack_pointer(struct pt_regs *regs) { return regs->u_regs[UREG_FP]; } #endif #endif blcr-0.8.5/cr_module/arch/ppc/0000775000000000000000000000000012102072126013060 500000000000000blcr-0.8.5/cr_module/arch/ppc/cr_arch.h0000664000000000000000000000237211015445071014563 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2008, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * 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 * * $Id: cr_arch.h,v 1.1 2008/05/23 04:38:17 phargrov Exp $ */ // File for misc. arch-specific bits #ifndef _CR_ARCH_H #include "../ppc64/cr_arch.h" #endif blcr-0.8.5/cr_module/arch/arm/0000775000000000000000000000000012102072126013055 500000000000000blcr-0.8.5/cr_module/arch/arm/cr_arch.h0000664000000000000000000000363711057341300014561 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2007, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * 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 * * $Id: cr_arch.h,v 1.4 2008/09/02 22:48:32 phargrov Exp $ * * Experimental ARM support contributed by Anton V. Uzunov * of the Australian Government * Department of Defence, Defence Science and Technology Organisation. * * ARM-specific questions should be directed to blcr-arm@lbl.gov. */ // File for misc. arch-specific bits #ifndef _CR_ARCH_H #define _CR_ARCH_H 1 #include #include static inline struct pt_regs * get_pt_regs(struct task_struct *tsk) { #ifdef KSTK_REGS return( KSTK_REGS( tsk ) ); #else return( task_pt_regs( tsk ) ); #endif } #if 0 // Unused currenty, but might be needed again for trampolines static inline unsigned long get_stack_pointer(struct pt_regs *regs) { // stack pointer return( regs->ARM_sp ); } #endif #endif blcr-0.8.5/cr_module/cr_sync.c0000664000000000000000000000663411053175651013131 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2003, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * 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 * * $Id: cr_sync.c,v 1.16 2008/08/21 05:22:49 phargrov Exp $ * * * This file deals with Phase2 threads/tasks. * The filename "cr_sync.c" is legacy from when these were * known as "synchronous threads/tasks". */ #include "cr_module.h" // cr_phase2_release(filp, priv) // // Remove Phase2 tasks from the task list when the file is closed. // Note that the close might be implictly at exit and could also // come from a task other than the one originally registered. // // XXX: could keep a hash mapping phase2_filp -> cr_task rather than // walking the entire list each time. void cr_phase2_release(struct file *filp, cr_pdata_t *priv) { cr_task_t *cr_task, *next; write_lock(&cr_task_lock); list_for_each_entry_safe(cr_task, next, &cr_task_list, task_list) { if ((cr_task->filp == filp) && (cr_task->phase == CR_PHASE2)) { cr_task->phase = CR_NO_PHASE; cr_task->filp = NULL; cr_task->fd = -1; __cr_task_put(cr_task); } } write_unlock(&cr_task_lock); } // cr_phase2_register(file, arg) // // Registers the calling task as having a Phase2 checkpoint handler. // Returns: // 0 on success // -EAGAIN if a checkpoint is pending for this task // -EEXIST if this task is already registered // other < 0 on other error conditions int cr_phase2_register(struct file *filp, int arg) { cr_task_t *cr_task; int retval; CR_KTRACE_FUNC_ENTRY(); write_lock(&cr_task_lock); cr_task = __cr_task_get(current, 1); retval = -ENOMEM; if (!cr_task) { // Can't create the task list entry. goto out_noput; } retval = -EAGAIN; if (cr_task->chkpt_req || cr_task->rstrt_req) { // Can't register a Phase2 handler task // while a checkpoint or restart is in progress. goto out; } retval = -EEXIST; if (cr_task->phase == CR_PHASE2) { // Duplicate registration goto out; } retval = -EINVAL; if (cr_task->phase == CR_PHASE1) { // Conflicting registration goto out; } retval = 0; cr_task->phase = CR_PHASE2; cr_task->filp = filp; cr_task->fd = arg; atomic_inc(&cr_task->ref_count); // We assume our proper signal handler is registered at this time. // So, we save it for later use in case the user has overwitten it. CR_SIGNAL_LOCK(current); cr_task->handler_sa = CR_SIGACTION(current, CR_SIGNUM); CR_SIGNAL_UNLOCK(current); out: __cr_task_put(cr_task); out_noput: write_unlock(&cr_task_lock); return retval; } blcr-0.8.5/cr_module/cr_module.c0000664000000000000000000001414012066216440013426 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2003, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * 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 * * $Id: cr_module.c,v 1.51.4.1 2012/12/25 03:27:28 phargrov Exp $ */ #include "cr_module.h" #include #include /* Find some always-exported symbols needed to validate System.map */ #include /* for __NR_close */ MODULE_AUTHOR("Lawrence Berkeley National Lab " PACKAGE_BUGREPORT); MODULE_DESCRIPTION("Berkeley Lab Checkpoint/Restart (BLCR) kernel module"); MODULE_LICENSE("GPL"); #if CR_KERNEL_TRACING module_param(cr_ktrace_mask, uint, 0644); MODULE_PARM_DESC(cr_ktrace_mask, "Mask of ORed tracing flags: see cr_ktrace.h for list"); #endif #if CRI_DEBUG extern unsigned int cr_read_fault_rate; extern unsigned int cr_write_fault_rate; module_param(cr_read_fault_rate, uint, 0644); module_param(cr_write_fault_rate, uint, 0644); MODULE_PARM_DESC(cr_read_fault_rate, "Injection rate (1-in-value) of artificial read faults"); MODULE_PARM_DESC(cr_write_fault_rate, "Injection rate (1-in-value) of artificial write faults"); #endif extern unsigned long cr_io_max, cr_io_max_mask; module_param(cr_io_max, ulong, 0644); MODULE_PARM_DESC(cr_io_max, "Maximum size of an I/O request (must be a power of 2)"); cr_kmem_cache_ptr cr_pdata_cachep = NULL; cr_kmem_cache_ptr cr_task_cachep = NULL; cr_kmem_cache_ptr cr_chkpt_req_cachep = NULL; cr_kmem_cache_ptr cr_chkpt_proc_req_cachep = NULL; cr_kmem_cache_ptr cr_rstrt_req_cachep = NULL; cr_kmem_cache_ptr cr_rstrt_proc_req_cachep = NULL; static int __init cr_init_module(void) { int err; err = vmadump_init_module(); if (err) return err; CR_INFO("Berkeley Lab Checkpoint/Restart (BLCR) module version " PACKAGE_VERSION "."); #if CR_KERNEL_TRACING CR_INFO(" Tracing enabled (trace_mask=0x%x)", cr_ktrace_mask); #endif CR_INFO(" Parameter cr_io_max = 0x%lx", cr_io_max); #if CRI_DEBUG CR_INFO(" Parameter cr_read_fault_rate = %d", cr_read_fault_rate); CR_INFO(" Parameter cr_write_fault_rate = %d", cr_write_fault_rate); #endif CR_INFO(" Supports kernel interface version " CR_MODULE_VERSION "."); #if CR_CONTEXT_VERSION == CR_CONTEXT_VERSION_MIN CR_INFO(" Supports context file format version %d.", CR_CONTEXT_VERSION); #else CR_INFO(" Supports context file format versions %d though %d.", CR_CONTEXT_VERSION_MIN, CR_CONTEXT_VERSION); #endif CR_INFO(PACKAGE_BUGREPORT); /* Check for correct blcr_imports */ if (strcmp(blcr_config_timestamp, BLCR_CONFIG_TIMESTAMP)) { CR_ERR("Module blcr_imports timestamp (%s) does not match that of blcr (" BLCR_CONFIG_TIMESTAMP ").", blcr_config_timestamp); return -EINVAL; } /* validate/setup for I/O max */ if (cr_io_max & (cr_io_max - 1)) { CR_ERR("Module parameter cr_io_max must be a power of 2"); return -EINVAL; } cr_io_max_mask = ~(cr_io_max - 1); err = cr_proc_init(); if (err) { goto bad_proc_init; } #ifdef CR_ENABLE_BOGUS_FOPS err = cr_fs_init(); if (err) { goto bad_fs_init; } #endif #if defined(CONFIG_COMPAT) && !defined(HAVE_COMPAT_IOCTL) err = cr_init_ioctl32(); if (err) { goto bad_ioctl32; } #endif err = cr_rstrt_init(); if (err) { goto bad_rstrt_init; } err = cr_object_init(); if (err) { goto bad_object_init; } err = -ENOMEM; cr_pdata_cachep = CR_KMEM_CACHE(cr_pdata_s); if (!cr_pdata_cachep) goto no_pdata_cachep; cr_task_cachep = CR_KMEM_CACHE(cr_task_s); if (!cr_task_cachep) goto no_task_cachep; cr_chkpt_req_cachep = CR_KMEM_CACHE(cr_chkpt_req_s); if (!cr_chkpt_req_cachep) goto no_chkpt_req_cachep; cr_chkpt_proc_req_cachep = CR_KMEM_CACHE(cr_chkpt_preq_s); if (!cr_chkpt_proc_req_cachep) goto no_chkpt_proc_req_cachep; cr_rstrt_req_cachep = CR_KMEM_CACHE(cr_rstrt_req_s); if (!cr_rstrt_req_cachep) goto no_rstrt_req_cachep; cr_rstrt_proc_req_cachep = CR_KMEM_CACHE(cr_rstrt_preq_s); if (!cr_rstrt_proc_req_cachep) goto no_rstrt_proc_req_cachep; return 0; no_rstrt_proc_req_cachep: kmem_cache_destroy(cr_rstrt_req_cachep); no_rstrt_req_cachep: kmem_cache_destroy(cr_chkpt_proc_req_cachep); no_chkpt_proc_req_cachep: kmem_cache_destroy(cr_chkpt_req_cachep); no_chkpt_req_cachep: kmem_cache_destroy(cr_task_cachep); no_task_cachep: kmem_cache_destroy(cr_pdata_cachep); no_pdata_cachep: cr_object_cleanup(); bad_object_init: cr_rstrt_cleanup(); bad_rstrt_init: #if defined(CONFIG_COMPAT) && !defined(HAVE_COMPAT_IOCTL) cr_cleanup_ioctl32(); bad_ioctl32: #endif #ifdef CR_ENABLE_BOGUS_FOPS cr_fs_cleanup(); bad_fs_init: #endif cr_proc_cleanup(); bad_proc_init: return err; } static void __exit cr_cleanup_module(void) { #if defined(CONFIG_COMPAT) && !defined(HAVE_COMPAT_IOCTL) cr_cleanup_ioctl32(); #endif #ifdef CR_ENABLE_BOGUS_FOPS cr_fs_cleanup(); #endif cr_proc_cleanup(); cr_wd_flush(); cr_object_cleanup(); cr_rstrt_cleanup(); kmem_cache_destroy(cr_rstrt_proc_req_cachep); kmem_cache_destroy(cr_rstrt_req_cachep); kmem_cache_destroy(cr_chkpt_proc_req_cachep); kmem_cache_destroy(cr_chkpt_req_cachep); kmem_cache_destroy(cr_task_cachep); kmem_cache_destroy(cr_pdata_cachep); CR_INFO("Checkpoint/Restart module removed"); vmadump_cleanup_module(); } module_init(cr_init_module); module_exit(cr_cleanup_module); blcr-0.8.5/cr_module/cr_creds.c0000664000000000000000000002202711143172456013247 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2008, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * 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 * * $Id: cr_creds.c,v 1.384.8.2 2009/02/07 02:42:54 phargrov Exp $ */ #include "cr_module.h" struct cr_context_creds { uid_t uid,euid,suid; gid_t gid,egid,sgid; unsigned int ngroups; #if HAVE_TASK_GROUP_INFO || HAVE_TASK_CRED const struct group_info *group_info; #define CR_HAVE_GROUP_INFO 1 #endif /* We write the ngroups gids as an array after this struct */ }; #if HAVE_TASK_CRED typedef const struct group_info *cr_group_info_t; #define cr_current_groups() ((current_cred())->group_info) #define CR_NGROUPS_MAX NGROUPS_MAX #define CR_NGROUPS(gi) ((gi)->ngroups) #define CR_GROUP_AT(gi,idx) GROUP_AT((gi), (idx)) #elif HAVE_TASK_GROUP_INFO typedef const struct group_info *cr_group_info_t; #define cr_current_groups() (current->group_info) #define CR_NGROUPS_MAX NGROUPS_MAX #define CR_NGROUPS(gi) ((gi)->ngroups) #define CR_GROUP_AT(gi,idx) GROUP_AT((gi), (idx)) #else typedef const struct task_struct *cr_group_info_t; #define cr_current_groups() (current) #define CR_NGROUPS_MAX NGROUPS #define CR_NGROUPS(task) ((task)->ngroups) #define CR_GROUP_AT(task,idx) ((task)->groups[(idx)]) #endif int cr_load_creds(cr_rstrt_proc_req_t *proc_req) { cr_errbuf_t *eb = proc_req->req->errbuf; struct cr_context_creds cf_creds; int retval; gid_t *groups = NULL; CR_KTRACE_HIGH_LVL("%d: Restoring credentials", current->pid); retval = cr_kread(eb, proc_req->file, &cf_creds, sizeof(cf_creds)); if (retval < sizeof(cf_creds)) { CR_ERR_PROC_REQ(proc_req, "credentials: read returned %d", retval); goto out; } if (cf_creds.ngroups > CR_NGROUPS_MAX) { CR_ERR_PROC_REQ(proc_req, "Invalid supplemental group count (%d)", (int)cf_creds.ngroups); retval = -EINVAL; goto out; } else if (cf_creds.ngroups) { size_t sizeof_groups = cf_creds.ngroups*sizeof(gid_t); groups = vmalloc(sizeof_groups); retval = -ENOMEM; if (groups == NULL) { goto out; } retval = cr_kread(eb, proc_req->file, groups, sizeof_groups); if (retval < sizeof_groups) { CR_ERR_PROC_REQ(proc_req, "groups: read returned %d", retval); goto out_vfree; } } #if CR_RESTORE_IDS if (cf_creds.ngroups) { #if CR_HAVE_GROUP_INFO || defined(CR_KCODE_groups_search) || !defined(CR_KCODE_supplemental_group_member) cr_group_info_t gi = cr_current_groups(); #endif int i; /* Search for any required "expansion" of the group set */ for (i = 0; i < cf_creds.ngroups; ++i) { gid_t g = groups[i]; int gid_ok = 0; /* Assume no match for this gid */ #if defined(CR_KCODE_groups_search) gid_ok = groups_search((struct group_info *)gi, g); // search is const, but not declared as such #elif defined(CR_KCODE_supplemental_group_member) gid_ok = supplemental_group_member(g); #else /* Just in case groups_search() or supplemental_group_member() * is not found (each was static in some kernels) */ int j; for (j = 0; j < gi->ngroups; ++j) { if (g == CR_GROUP_AT(gi, j)) { gid_ok = 1; /* OK, g is in the existing set */ break; } } #endif if (!gid_ok) { /* If we reach here then we've seen a supplemental group in the * saved context, which is not present in the current list. * The set_groups() call checks permissions for us. If we fail, * then we must not have enough credentials. */ mm_segment_t oldfs = get_fs(); set_fs(KERNEL_DS); retval = sys_setgroups(cf_creds.ngroups, groups); set_fs(oldfs); if (retval < 0) { CR_ERR_PROC_REQ(proc_req, "Failed to restore supplemental group(s)."); goto out_vfree; } CR_KTRACE_LOW_LVL("Restored %d supplemental group(s)", cf_creds.ngroups); break; /* no need to continue the i loop */ } } #if CR_HAVE_GROUP_INFO (void)cr_insert_object(proc_req->req->map, (void *)cf_creds.group_info, (void *)gi, GFP_KERNEL); #endif } #if CR_HAVE_GROUP_INFO else { // NOTE: requires restore order match save order struct group_info *found_group_info = NULL; if (!cr_find_object(proc_req->req->map, (void *)cf_creds.group_info, (void **)&found_group_info)) { // Nothing to do } else if (found_group_info != cr_current_groups()) { // validation and sort were done previously, but are not worth avoiding set_current_groups(found_group_info); CR_KTRACE_LOW_LVL("Reuse cached group_info %p", found_group_info); } else { CR_KTRACE_LOW_LVL("Cached group_info == current"); } } #endif { cr_cred_t my_cred = cr_current_cred(); /* The set_setresgid() call checks permissions for us, always OK if no change . */ retval = sys_setresgid(cf_creds.gid, cf_creds.egid, cf_creds.sgid); if (retval < 0) { CR_ERR_PROC_REQ(proc_req, "Failed to restore real/effective/saved gids."); goto out_vfree; } CR_KTRACE_LOW_LVL("Restored gids"); /* The set_setresuid() call checks permissions for us, always OK if no change . */ retval = sys_setresuid(cf_creds.uid, cf_creds.euid, cf_creds.suid); if (retval < 0) { CR_ERR_PROC_REQ(proc_req, "Failed to restore real/effective/saved uids."); goto out_vfree; } CR_KTRACE_LOW_LVL("Restored uids"); /* * sys_setresuid sets current->mm->dumpable to suid_dumpable if the * call was successful. This can have some weird side-effects on * restarted jobs, like /proc/self/fd will not be accessable. * * We should probably save this flag and restore it if we ever * support real setuid checkpoints from the user, but for now we'll * just set the flag to 1 if the user had permission to restore their * credentials in the first place. This should mimic the behavior * of exec. * * Set the dumpable flag for the process, taken from 2.6.22 fs/exec.c */ if (my_cred->euid == my_cred->uid && my_cred->egid == my_cred->gid) { cr_set_dumpable(current->mm, 1); } else { cr_set_dumpable(current->mm, cr_suid_dumpable); } } #endif /* CR_RESTORE_IDS */ out_vfree: vfree(groups); out: return retval; } int cr_save_creds(cr_chkpt_proc_req_t *proc_req) { cr_errbuf_t *eb = proc_req->req->errbuf; struct cr_context_creds cf_creds; size_t sizeof_groups; int bytes = 0; int result; cr_cred_t my_cred = cr_current_cred(); cr_group_info_t gi; cf_creds.uid = my_cred->uid; cf_creds.euid = my_cred->euid; cf_creds.suid = my_cred->suid; cf_creds.gid = my_cred->gid; cf_creds.egid = my_cred->egid; cf_creds.sgid = my_cred->sgid; /* save the number of groups, so we know how many to read later */ gi = cr_current_groups(); cf_creds.ngroups = CR_NGROUPS(gi); #if CR_HAVE_GROUP_INFO cf_creds.group_info = gi; /* We save the entire array only on the first occurance. * NOTE: we currently rely on the restore order matching the save order. */ if (cr_insert_object(proc_req->req->map, (void *)gi, (void *)gi, GFP_KERNEL)) { /* Ensure we don't save it again, and signal to restart time as well */ cf_creds.ngroups = 0; } #endif sizeof_groups = cf_creds.ngroups*sizeof(gid_t); CR_KTRACE_HIGH_LVL("Writing credentials"); result = cr_kwrite(eb, proc_req->file, &cf_creds, sizeof(cf_creds)); if (result < sizeof(cf_creds)) { CR_ERR_PROC_REQ(proc_req, "credentials: write returned %d", result); goto out; } bytes += result; #if CR_HAVE_GROUP_INFO if (sizeof_groups != 0) { /* copy current->groups into an array and write it out */ int i; gid_t *groups; result = -ENOMEM; groups = vmalloc(sizeof_groups); if (groups == NULL) { goto out; } for (i=0; ifile, groups, sizeof_groups); vfree(groups); } #else result = cr_kwrite(eb, proc_req->file, current->groups, sizeof_groups); #endif if (result < sizeof_groups) { CR_ERR_PROC_REQ(proc_req, "groups: write returned %d", result); goto out; } bytes += result; out: return ((result < 0) ? result : bytes); } blcr-0.8.5/cr_module/cr_kcompat.h0000664000000000000000000005212712071454304013612 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2008, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * 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 * * $Id: cr_kcompat.h,v 1.247.8.8 2013/01/04 04:21:24 phargrov Exp $ * * This file tries to hide as much as practical the differences among Linux * kernel versions. Preferably this is done by back-porting new features, but * sometimes by providing the "least common denominator" */ #ifndef _CR_KCOMPAT_H #define _CR_KCOMPAT_H 1 #ifndef _IN_CR_MODULE_H #error "This file is only for inclusion from cr_module.h" #endif // Not defined in all kernels #ifndef TASK_COMM_LEN #define TASK_COMM_LEN 16 #endif // Provide uniform lockdep support #if !defined(DECLARE_WAIT_QUEUE_HEAD_ONSTACK) #if defined(CONFIG_LOCKDEP) #define __WAIT_QUEUE_HEAD_INIT_ONSTACK(name) \ ({ init_waitqueue_head(&name); name; }) #define DECLARE_WAIT_QUEUE_HEAD_ONSTACK(name) \ wait_queue_head_t name = __WAIT_QUEUE_HEAD_INIT_ONSTACK(name) #else #define DECLARE_WAIT_QUEUE_HEAD_ONSTACK DECLARE_WAIT_QUEUE_HEAD #endif #endif #if !HAVE_LINUX_LOCKDEP_H struct lock_class_key { }; // uses no space #define lockdep_set_class(A,B) do { (void)(B); } while (0) #endif #if defined(CONFIG_LOCKDEP) static __inline__ void CR_NO_LOCKS(void) { if (current->lockdep_depth) { debug_show_held_locks(current); dump_stack(); } } #else #define CR_NO_LOCKS() ((void)0) #endif // MOD_{INC,DEC}_USE_COUNT were removed prior to 2.6.x #define CR_MODULE_GET() try_module_get(THIS_MODULE) #define CR_MODULE_PUT() module_put(THIS_MODULE) #undef MOD_INC_USE_COUNT #undef MOD_DEC_USE_COUNT #define MOD_INC_USE_COUNT %%%%ERROR%%%% use CR_MODULE_GET() #define MOD_DEC_USE_COUNT %%%%ERROR%%%% use CR_MODULE_PUT() #ifdef CAP_KILL #define cr_capable(X) capable(X) #else #define cr_capable(X) suser() #endif #ifndef MAY_CHDIR #define MAY_CHDIR 0 #endif #if HAVE_INODE_PERMISSION #define cr_permission(I,M) inode_permission((I),(M)) #elif HAVE_PERMISSION /* Safe to pass nd=NULL since we don't use LOOKUP_{OPEN,ACCESS} */ #define cr_permission(I,M) permission((I),(M),NULL) #else #error #endif #if HAVE_TASK_RLIM #define CR_RLIM(task) (task)->rlim #elif HAVE_SIGNAL_RLIM #define CR_RLIM(task) (task)->signal->rlim #else #error #endif #ifndef rcu_assign_pointer #define rcu_assign_pointer(A,B) ((A) = (B)) #endif #ifndef rcu_read_lock #define rcu_read_lock() do {} while (0) #define rcu_read_unlock() do {} while (0) #endif #if HAVE_STRUCT_FDTABLE typedef struct fdtable cr_fdtable_t; #define cr_fdtable(files) files_fdtable(files) #else typedef struct files_struct cr_fdtable_t; #define cr_fdtable(files) (files) #endif #if HAVE_OPEN_FDS_FDS_BITS #define CR_OPEN_FDS_BITS(_fdt) ((_fdt)->open_fds->fds_bits) #define CR_CLOSE_ON_EXEC_BITS(_fdt) ((_fdt)->close_on_exec->fds_bits) #else #define CR_OPEN_FDS_BITS(_fdt) ((_fdt)->open_fds) #define CR_CLOSE_ON_EXEC_BITS(_fdt) ((_fdt)->close_on_exec) #endif #if HAVE_CLOSE_ON_EXEC #if HAVE___SET_CLOSE_ON_EXEC #define cr_set_close_on_exec(_fd,_fdt) __set_close_on_exec(_fd,_fdt) #define cr_clear_close_on_exec(_fd,_fdt) __clear_close_on_exec(_fd,_fdt) #else #define cr_set_close_on_exec(_fd,_fdt) __set_bit(_fd,CR_CLOSE_ON_EXEC_BITS(_fdt)) #define cr_clear_close_on_exec(_fd,_fdt) __clear_bit(_fd,CR_CLOSE_ON_EXEC_BITS(_fdt)) #endif #define cr_read_close_on_exec(_fd,_fdt) close_on_exec(_fd,_fdt) #else #define cr_set_close_on_exec(_fd,_fdt) FD_SET(_fd,(_fdt)->close_on_exec) #define cr_clear_close_on_exec(_fd,_fdt) FD_CLR(_fd,(_fdt)->close_on_exec) #define cr_read_close_on_exec(_fd,_fdt) FD_ISSET(_fd,(_fdt)->close_on_exec) #endif #if HAVE_FD_IS_OPEN #if HAVE___SET_OPEN_FD #define cr_set_open_fd(_fd,_fdt) __set_open_fd(_fd,_fdt) #define cr_clear_open_fd(_fd,_fdt) __clear_open_fd(_fd,_fdt) #else #define cr_set_open_fd(_fd,_fdt) __set_bit(_fd,CR_OPEN_FDS_BITS(_fdt)) #define cr_clear_open_fd(_fd,_fdt) __clear_bit(_fd,CR_OPEN_FDS_BITS(_fdt)) #endif #define cr_read_open_fd(_fd,_fdt) fd_is_open(_fd,_fdt) #else #define cr_set_open_fd(_fd,_fdt) FD_SET(_fd,(_fdt)->open_fds) #define cr_clear_open_fd(_fd,_fdt) FD_CLR(_fd,(_fdt)->open_fds) #define cr_read_open_fd(_fd,_fdt) FD_ISSET(_fd,(_fdt)->open_fds) #endif #if HAVE_FILES_STRUCT_NEXT_FD #define CR_NEXT_FD(_files, _fdt) ((_files)->next_fd) #elif HAVE_FDTABLE_NEXT_FD #define CR_NEXT_FD(_files, _fdt) ((_fdt)->next_fd) #else #error "no next_fd" #endif #if HAVE_FILES_STRUCT_MAX_FDSET #define CR_MAX_FDS(_fdt) ((_fdt)->max_fdset) #else #define CR_MAX_FDS(_fdt) ((_fdt)->max_fds) #endif #ifndef thread_group_leader #define thread_group_leader(p) ((p)->pid == (p)->tgid) #endif #define CR_SIGNAL_LOCK(_task) spin_lock_irq(&(_task)->sighand->siglock) #define CR_SIGNAL_UNLOCK(_task) spin_unlock_irq(&(_task)->sighand->siglock) #define CR_SIGACTION(_task,_num) ((_task)->sighand->action[(_num)-1]) #define CR_SIGNAL_HAND(_task,_num) (CR_SIGACTION((_task),(_num)).sa.sa_handler) #if HAVE_KMEM_CACHE_T typedef kmem_cache_t *cr_kmem_cache_ptr; #else typedef struct kmem_cache *cr_kmem_cache_ptr; #endif #ifndef KMEM_CACHE #define KMEM_CACHE(__struct, __flags) \ kmem_cache_create(#__struct,\ sizeof(struct __struct),\ __alignof__(struct __struct),\ (__flags), NULL, NULL) #endif #if defined(CONFIG_SLUB) && defined(SLAB_POISON) // Work-around a SLUB bug seen in 3.7.1 kernel in which some KMEM_CACHE // calls get merged with the kmalloc-* pools (which is fine by itself). // HOWEVER, these have ZERO rather then ONE as their initial refcount. // That leads to an attempt to close the non-empty kmalloc-8 and // kmalloc-96 slabs when we remove the module. #define CR_KMEM_CACHE(__struct) KMEM_CACHE(__struct, SLAB_POISON) #else #define CR_KMEM_CACHE(__struct) KMEM_CACHE(__struct, 0) #endif #if !HAVE_GFP_T typedef unsigned int gfp_t; #endif #if HAVE_KZALLOC #define cr_kzalloc kzalloc #else static __inline__ void *cr_kzalloc(size_t len, gfp_t flags) { void *result = kmalloc(len, flags); if (result) { memset(result, 0, len); } return result; } #endif #if HAVE_KMEM_CACHE_ZALLOC #define cr_kmem_cache_zalloc(_szof_arg, _cachep, _flags) \ kmem_cache_zalloc(_cachep, _flags) #else #define cr_kmem_cache_zalloc(_szof_arg, _cachep, _flags) \ __cr_kmem_cache_zalloc(sizeof(_szof_arg), (_cachep), (_flags)) static __inline__ void *__cr_kmem_cache_zalloc(size_t len, cr_kmem_cache_ptr cachep, gfp_t flags) { void *result = kmem_cache_alloc(cachep, flags); if (result) { memset(result, 0, len); } return result; } #endif #if HAVE_KMEMDUP #define cr_kmemdup kmemdup #else static __inline__ void *cr_kmemdup(const void *src, size_t len, gfp_t flags) { void *result = kmalloc(len, flags); if (result) { memcpy(result, src, len); } return result; } #endif #if HAVE_DO_MMAP_PGOFF #define cr_mmap_pgoff do_mmap_pgoff #elif HAVE_DO_MMAP #define cr_mmap_pgoff(_filp, _start, _len, _prot, _flags, _pgoff) \ do_mmap(_filp, _start, _len, _prot, _flags, ((_pgoff) << PAGE_SHIFT)) #else #error "Neither do_mmap() nor do_mmap_pgoff() was found?" #endif // Task accessor macros #if HAVE_2_6_24_TASK_IDS #define cr_task_pgrp(_t) task_pgrp_vnr(_t) #define cr_task_tty_old_pgrp(_t) ((_t)->signal->tty_old_pgrp) #define cr_task_session(_t) task_session_vnr(_t) #define cr_task_leader(_t) ((_t)->signal->leader) #define cr_task_tty(_t) ((_t)->signal->tty) #if HAVE_SET_TASK_PGRP #define cr_set_pgrp(_t,_id) set_task_pgrp((_t),(_id)) #else #define cr_set_pgrp(_t,_id) ((void)0) #endif #if HAVE_SET_TASK_SESSION #define cr_set_sid(_t,_id) set_task_session((_t),(_id)) #else #define cr_set_sid(_t,_id) ((void)0) #endif #elif HAVE_2_6_20_TASK_IDS #define cr_task_pgrp(_t) ((_t)->signal->pgrp) #define cr_task_tty_old_pgrp(_t) ((_t)->signal->tty_old_pgrp) #define cr_task_session(_t) process_session(_t) #define cr_task_leader(_t) ((_t)->signal->leader) #define cr_task_tty(_t) ((_t)->signal->tty) #define cr_set_pgrp(_t,_id) ((_t)->signal->pgrp = (_id)) #define cr_set_sid(_t,_id) ((_t)->signal->__session = (_id)) #elif HAVE_2_6_6_TASK_IDS #define cr_task_pgrp(_t) ((_t)->signal->pgrp) #define cr_task_tty_old_pgrp(_t) ((_t)->signal->tty_old_pgrp) #define cr_task_session(_t) ((_t)->signal->session) #define cr_task_leader(_t) ((_t)->signal->leader) #define cr_task_tty(_t) ((_t)->signal->tty) #define cr_set_pgrp(_t,_id) ((_t)->signal->pgrp = (_id)) #define cr_set_sid(_t,_id) ((_t)->signal->session = (_id)) #elif HAVE_2_6_0_TASK_IDS #define cr_task_pgrp(_t) ((_t)->__pgrp) #define cr_task_tty_old_pgrp(_t) ((_t)->tty_old_pgrp) #define cr_task_session(_t) ((_t)->session) #define cr_task_leader(_t) ((_t)->leader) #define cr_task_tty(_t) ((_t)->tty) #define cr_set_pgrp(_t,_id) ((_t)->__pgrp = (_id)) #define cr_set_sid(_t,_id) ((_t)->session = (_id)) #else #error #endif #if defined(CR_KDATA_init_pspace) #define cr_init_pid_ns init_pspace #elif defined(CR_KDATA_init_pid_ns) #define cr_init_pid_ns init_pid_ns #else // Shouldn't need it #endif #if HAVE_FIND_PID_NS // XXX: should move to vpid #define cr_find_pid(P) find_pid_ns((P),&cr_init_pid_ns) #elif HAVE_1_ARG_FIND_PID #define cr_find_pid(P) find_pid(P) #elif HAVE_2_ARG_FIND_PID #define cr_find_pid(P) find_pid(PIDTYPE_PID, (P)) #else #error #endif #if HAVE_FIND_TASK_BY_PID_NS // XXX: should move to by_vpid #define cr_find_task_by_pid(P) find_task_by_pid_ns((P),&cr_init_pid_ns) #elif HAVE_FIND_TASK_BY_PID #define cr_find_task_by_pid(P) find_task_by_pid(P) #else #error #endif #if HAVE_FIND_TASK_BY_PID_TYPE_NS // XXX: should move to by_vpid #define cr_have_pid(T,P) (find_task_by_pid_type_ns((T),(P),&cr_init_pid_ns) != NULL) #elif HAVE_FIND_TASK_BY_PID_TYPE #define cr_have_pid(T,P) (find_task_by_pid_type((T),(P)) != NULL) #elif HAVE_2_ARG_FIND_PID #define cr_have_pid(T,P) (find_pid((T),(P)) != NULL) #else #define cr_have_pid(T,P) (pid_task(find_vpid(P),(T)) != NULL) #endif // Process table iterators #if HAVE_DO_EACH_PID_TASK && !HAVE_DO_EACH_TASK_PID #define do_each_task_pid(ID, TYPE, T) \ do { \ struct pid *the_pid = cr_find_pid(ID); \ do_each_pid_task(the_pid, (TYPE), (T)) #define while_each_task_pid(ID, TYPE, T) \ while_each_pid_task(the_pid, (TYPE), (T)); \ } while (0) #undef HAVE_DO_EACH_TASK_PID #define HAVE_DO_EACH_TASK_PID 1 #endif #if HAVE_DO_EACH_TASK_PID #define CR_DO_EACH_TASK_PGID(ID, T) \ do_each_task_pid((ID), PIDTYPE_PGID, (T)) #define CR_WHILE_EACH_TASK_PGID(ID, T) \ while_each_task_pid((ID), PIDTYPE_PGID, (T)) #define CR_DO_EACH_TASK_SID(ID, T) \ do_each_task_pid((ID), PIDTYPE_SID, (T)) #define CR_WHILE_EACH_TASK_SID(ID, T) \ while_each_task_pid((ID), PIDTYPE_SID, (T)) #if HAVE_PIDTYPE_TGID #define CR_DO_EACH_TASK_TGID(ID, T) \ do_each_task_pid((ID), PIDTYPE_TGID, (T)) #define CR_WHILE_EACH_TASK_TGID(ID, T) \ while_each_task_pid((ID), PIDTYPE_TGID, (T)) #elif HAVE_TASK_THREAD_GROUP #define CR_DO_EACH_TASK_TGID(ID, T) \ { \ struct task_struct *_leader = cr_find_task_by_pid(ID); \ if (_leader) { \ /* "extra" iteration for thread group leader (the list head): */ \ (T) = _leader; goto _label; \ list_for_each_entry((T), &(_leader->thread_group), thread_group) { \ _label: #define CR_WHILE_EACH_TASK_TGID(ID, T) \ } \ } \ } #else #error "CR_DO_EACH_TASK_TGID not implemented" #endif #define CR_DO_EACH_TASK_PROC(P, T) \ if ((P)->mm) { \ pid_t _id = cr_task_pgrp(P); \ CR_DO_EACH_TASK_PGID(_id, (T)) \ if ((T)->mm == (P)->mm) #define CR_WHILE_EACH_TASK_PROC(ID, T) \ while_each_task_pid(_id, PIDTYPE_PGID, (T)); \ } #elif HAVE_FOR_EACH_TASK_PID #define CR_DO_EACH_TASK_PGID(ID, T) \ do { \ struct list_head *_l; \ struct pid *_p; \ for_each_task_pid((ID), PIDTYPE_PGID, (T), _l, _p) #define CR_WHILE_EACH_TASK_PGID(ID, T) \ } while(0) #define CR_DO_EACH_TASK_SID(ID, T) \ do { \ struct list_head *_l; \ struct pid *_p; \ for_each_task_pid((ID), PIDTYPE_SID, (T), _l, _p) #define CR_WHILE_EACH_TASK_SID(ID, T) \ } while(0) #define CR_DO_EACH_TASK_TGID(ID, T) \ do { \ struct list_head *_l; \ struct pid *_p; \ for_each_task_pid((ID), PIDTYPE_TGID, (T), _l, _p) #define CR_WHILE_EACH_TASK_TGID(ID, T) \ } while(0) #define CR_DO_EACH_TASK_PROC(P, T) \ if ((P)->mm) { \ pid_t _id = cr_task_pgrp(P); \ CR_DO_EACH_TASK_PGID(_id, (T)) { \ if ((T)->mm == (P)->mm) { #define CR_WHILE_EACH_TASK_PROC(P, T) \ } \ } CR_WHILE_EACH_TASK_PGID(_id, (T)); \ } #else #error No tasklist iterators available #endif #define CR_DO_EACH_CHILD(C, T) \ list_for_each_entry((C), &(T)->children, sibling) { #define CR_WHILE_EACH_CHILD(C, T) \ } #ifndef wait_event_interruptible_timeout /* from 2.6.8 */ #define __wait_event_interruptible_timeout(wq, condition, ret) \ do { \ DECLARE_WAITQUEUE(__wait, current); \ add_wait_queue(&(wq), &__wait); \ for (;;) { \ set_current_state(TASK_INTERRUPTIBLE); \ if (condition) break; \ if (!signal_pending(current)) { \ ret = schedule_timeout(ret); \ if (!ret) break; \ continue; \ } \ ret = -ERESTARTSYS; \ break; \ } \ current->state = TASK_RUNNING; \ remove_wait_queue(&(wq), &__wait); \ } while(0) #define wait_event_interruptible_timeout(wq, condition, timeout) \ ({ long __ret = timeout; \ if (!(condition)) \ __wait_event_interruptible_timeout(wq, condition, __ret); \ __ret; \ }) #endif #if defined(EXIT_ZOMBIE) #define cri_task_zombie(task) ((task)->exit_state & EXIT_ZOMBIE) #elif defined(TASK_DEAD) #define cri_task_zombie(task) ((task)->state & TASK_ZOMBIE) #else #define cri_task_zombie(task) ((task)->state == TASK_ZOMBIE) #endif #define cri_task_dead(task) ((task)->flags & PF_EXITING) #ifdef DEFINE_SPINLOCK #define CR_DEFINE_SPINLOCK DEFINE_SPINLOCK #else #define CR_DEFINE_SPINLOCK(_l) spinlock_t _l = SPIN_LOCK_UNLOCKED #endif #ifdef DEFINE_RWLOCK #define CR_DEFINE_RWLOCK DEFINE_RWLOCK #else #define CR_DEFINE_RWLOCK(_l) rwlock_t _l = RW_LOCK_UNLOCKED #endif /* We use __putname() if we can, putname() otherwise */ #if !HAVE___PUTNAME #define __putname putname #endif /* Implement "struct path" in terms of dentry & vfsmnt */ #if !HAVE_STRUCT_PATH struct path { struct vfsmount *mnt; struct dentry *dentry; }; #endif #if HAVE_NAMEIDATA_PATH static __inline__ void cr_set_pwd_file(struct fs_struct *fs, struct file *filp) { set_fs_pwd(fs, &filp->f_path); } static __inline__ void cr_set_pwd_path(struct fs_struct *fs, struct path *path) { set_fs_pwd(fs, path); } #define CR_PATH_DECL(_name) \ struct path *_name /* NO semicolon */ #define CR_PATH_GET_FS(_name,_arg) \ path_get((struct path *)((_name) = &(_arg))) #define CR_PATH_GET_FILE(_name,_arg) \ path_get((struct path *)((_name) = &(_arg)->f_path)) #elif HAVE_NAMEIDATA_DENTRY static __inline__ void path_get(struct path *path) { mntget(path->mnt); dget(path->dentry); } static __inline__ void path_put(struct path *path) { dput(path->dentry); mntput(path->mnt); } static __inline__ void cr_set_pwd_file(struct fs_struct *fs, struct file *filp) { set_fs_pwd(fs, filp->f_vfsmnt, filp->f_dentry); } static __inline__ void cr_set_pwd_path(struct fs_struct *fs, struct path *path) { set_fs_pwd(fs, path->mnt, path->dentry); } #define CR_PATH_DECL(_name) \ struct path _##_name, *_name /* NO semicolon */ #define _CR_PATH_GET(_name,_mnt,_dentry) do { \ _##_name.mnt = mntget(_mnt); \ _##_name.dentry = dget(_dentry); \ (_name) = &(_##_name); \ } while (0) #define CR_PATH_GET_FS(_name,_arg) \ _CR_PATH_GET(_name, _arg##mnt, _arg) #define CR_PATH_GET_FILE(_name,_arg) \ _CR_PATH_GET(_name, (_arg)->f_vfsmnt, (_arg)->f_dentry) #else #error #endif #if HAVE_PROC_ROOT #define cr_proc_root (&proc_root) #else #define cr_proc_root NULL #endif #if HAVE_SET_DUMPABLE #define cr_set_dumpable(_mm,_val) set_dumpable((_mm),(_val)) #elif HAVE_MM_DUMPABLE #define cr_set_dumpable(_mm,_val) do { (_mm)->dumpable = (_val); } while (0) #else #error #endif #if HAVE_SUID_DUMPABLE #define cr_suid_dumpable suid_dumpable #else #define cr_suid_dumpable 0 #endif // wait_event_timeout() first appears in 2.6.9 // This is reproduced from linux-2.6.9/include/linux/wait.h #ifndef wait_event_timeout #define __wait_event_timeout(wq, condition, ret) \ do { \ DEFINE_WAIT(__wait); \ \ for (;;) { \ prepare_to_wait(&wq, &__wait, TASK_UNINTERRUPTIBLE); \ if (condition) \ break; \ ret = schedule_timeout(ret); \ if (!ret) \ break; \ } \ finish_wait(&wq, &__wait); \ } while (0) #define wait_event_timeout(wq, condition, timeout) \ ({ \ long __ret = timeout; \ if (!(condition)) \ __wait_event_timeout(wq, condition, __ret); \ __ret; \ }) #endif #if HAVE_KILL_PID #define cr_kill_process(task, sig) kill_pid(task_tgid(task), sig, 0) #elif HAVE_KILL_PROC #define cr_kill_process(task, sig) kill_proc((task)->tgid, sig, 0) #else #error "No cr_kill_process() definition" #endif #if !HAVE_VALID_SIGNAL static __inline__ int valid_signal(unsigned long sig) { return !!(sig <= _NSIG); } #endif #if HAVE_TASK_CRED typedef const struct cred *cr_cred_t; #define cr_current_cred() current_cred() #define cr_task_cred(_t) __task_cred(_t) #else typedef const struct task_struct *cr_cred_t; #define cr_current_cred() current #define cr_task_cred(_t) (_t) #endif #if defined(CR_KCODE_put_fs_struct) static __inline__ void cr_free_fs_struct(struct fs_struct *fs) { CRI_ASSERT(atomic_read(&fs->count) == 1); put_fs_struct(fs); } #elif defined(CR_KCODE_free_fs_struct) #define cr_free_fs_struct free_fs_struct #else #error "no cr_free_fs_struct() definition" #endif #if defined(CR_KCODE_do_pipe_flags) #define cr_do_pipe(_fds) do_pipe_flags((_fds),0) #elif defined(CR_KCODE_do_pipe) #define cr_do_pipe(_fds) do_pipe(_fds) #else #error "no cr_do_pipe() definition" #endif #if !defined(DECLARE_MUTEX) #define DECLARE_MUTEX(m) DEFINE_SEMAPHORE(m) #define init_MUTEX(m) sema_init(m, 1) #endif #if HAVE_FS_STRUCT_RWLOCK #define cr_read_lock_fs read_lock #define cr_read_unlock_fs read_unlock #elif HAVE_FS_STRUCT_SPINLOCK #define cr_read_lock_fs spin_lock #define cr_read_unlock_fs spin_unlock #else #error "fs_struct.lock has unknown type" #endif #endif /* _CR_KCOMPAT_H */ blcr-0.8.5/cr_module/Makefile.am0000664000000000000000000000211011345271143013337 00000000000000# Needed by kbuild glue my_sources = \ cr_async.c \ cr_barrier.c \ cr_chkpt_req.c \ cr_dest_file.c \ cr_dump_self.c \ cr_fops.c \ cr_io.c \ cr_module.c \ cr_proc.c \ cr_rstrt_req.c \ cr_sync.c \ cr_task.c \ cr_trigger.c \ cr_module.h \ cr_kcompat.h \ cr_barrier.h \ cr_ktrace.h \ cr_ktrace.c \ cr_objects.c \ cr_context.h \ cr_compat.c \ cr_mmaps.c \ cr_vmadump.c \ cr_timers.c \ cr_pipes.c \ cr_creds.c \ cr_relocate.c \ cr_watchdog.c BPROC_VERSION = "4.0.0pre8" vmadump_dir = $(top_srcdir)/vmadump4 vmad_sources = $(vmadump_dir)/vmadump_common.c $(vmadump_dir)/vmadump_@CR_KARCH@.c vmad_include = -I$(vmadump_dir) -D__NR_vmadump=-1 -DBPROC_VERSION='$(BPROC_VERSION)' cr_sources = $(my_sources) $(vmad_sources) INCLUDES = -I$(top_builddir)/include \ -I$(top_srcdir)/include \ -I$(srcdir)/arch/@CR_KARCH@ \ $(vmad_include) # echo an arbitrary make/environment variable (needed by kbuild glue) echoval: @echo $($(VARNAME)) | sed 's/"/\\"/'g .PHONY: echoval EXTRA_DIST = arch license.txt $(my_sources) SUBDIRS = kbuild . blcr-0.8.5/cr_module/cr_ktrace.c0000664000000000000000000000777611120132103013412 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2008, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * 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 * * $Id: cr_ktrace.c,v 1.15 2008/12/11 06:33:39 phargrov Exp $ * * * Tracing and error/warning output for checkpoint/restart kernel code. */ #include "cr_module.h" #include #include "cr_ktrace.h" static char cr_trace_buf[4096]; static CR_DEFINE_SPINLOCK(cr_trace_lock); #if CR_KERNEL_TRACING unsigned int cr_ktrace_mask = CR_KTRACE_DEFAULT; void cr_print_trace(const char *file, int line, const char *func, const char * fmt, ...) { va_list args; const char *p; spin_lock(&cr_trace_lock); va_start(args, fmt); vsprintf(cr_trace_buf, fmt, args); va_end(args); /* simple basename implementation: */ for (p = file; *p != '\0'; ++p) { if (*p == '/') { file = p + 1; } } printk(KERN_INFO "%s <%s:%d>, pid %d: %s\n", func, file, line, current->pid, cr_trace_buf); spin_unlock(&cr_trace_lock); } #endif /* * Error/warning generation */ static CR_DEFINE_SPINLOCK(cr_errbuf_lock); struct cr_errbuf_s { unsigned short used, remain; char buffer[0]; // GNU (not ISO C99) variable length array }; cr_errbuf_t *cr_errbuf_alloc(void) { cr_errbuf_t *p = (cr_errbuf_t *)__get_free_page(GFP_KERNEL); p->used = 0; p->remain = PAGE_SIZE - sizeof(cr_errbuf_t); return p; } void cr_errbuf_free(cr_errbuf_t *eb) { free_page((unsigned long)eb); } static int cr_errbuf_vprintf(const char *lvl, cr_errbuf_t *eb, const char * fmt, va_list args) { char *p; int len; if (!eb || !eb->remain) { #ifndef CR_QUIET spin_lock(&cr_trace_lock); vsprintf(cr_trace_buf, fmt, args); printk("%sblcr: %s", lvl, cr_trace_buf); spin_unlock(&cr_trace_lock); #endif return 0; } spin_lock(&cr_errbuf_lock); p = eb->buffer + eb->used; len = vsnprintf(p, eb->remain, fmt, args); if (len > 0) { #ifndef CR_QUIET printk("%sblcr: %s", lvl, p); #endif if (len > eb->remain) { eb->used += eb->remain; eb->remain = 0; } else { eb->remain -= len; eb->used += len; } } spin_unlock(&cr_errbuf_lock); return len; } int cr_errbuf_printf(const char *lvl, cr_errbuf_t *eb, const char * fmt, ...) { va_list args; int len; va_start(args, fmt); len = cr_errbuf_vprintf(lvl, eb, fmt, args); va_end(args); return len; } /* * Copy eb contents up to len bytes (including final nul) * Returns space that would be required to accept full contents. * If len is zero, buf is ignored. */ int cr_errbuf_read(char /*__user*/ *buf, unsigned int len, cr_errbuf_t *eb) { if (!eb) { return -EINVAL; } if (len) { /* Don't read past used space (rest of buffer uninitialized == security risk) * or write beyond user's buffer. */ len = min((len-1), (unsigned int)(eb->used)); /* Copy to user if non-empty */ if (len && copy_to_user(buf, eb->buffer, len)) { return -EFAULT; } /* Add nul termination */ if (put_user('\0', buf+len)) { return -EFAULT; } } return eb->used ? (eb->used + 1) : 0; } blcr-0.8.5/cr_module/cr_relocate.c0000664000000000000000000001720011120344004013723 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2008, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * 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 * * $Id: cr_relocate.c,v 1.14 2008/12/12 02:10:12 phargrov Exp $ * * This file implements functions to handle file/directory relocation */ #include "cr_module.h" #include struct cr_rstrt_relocate_s { unsigned int count; struct cr_rstrt_relocate_rec_s { const char *oldpath; const char *newpath; unsigned int old_len; unsigned int new_len; } path[0]; /* GNU (not ISO C99) variable length array */ }; // Bytes to allocate for struct cr_rstrt_relocate_x with _cnt path entries: #define CR_RSTRT_RELOCATE_T_SIZE(_cnt) (sizeof(struct cr_rstrt_relocate_s) + \ (_cnt) * sizeof(struct cr_rstrt_relocate_rec_s)) const char * cr_relocate_path(cr_rstrt_relocate_t reloc, const char *path, int put_old) { unsigned int i; struct cr_rstrt_relocate_rec_s *record; if (!reloc) { return path; } for (i = 0, record = &reloc->path[0]; i < reloc->count; i++, record++) { if (!strncmp(path, record->oldpath, record->old_len)) { const char *suffix = path + record->old_len; unsigned int suff_len; char *reloc_path; if ((*suffix != '\0') && (*suffix != '/')) { /* Match not on a component boundary */ continue; } suff_len = strlen(suffix); if ((record->new_len + suff_len) >= PATH_MAX) { return ERR_PTR(-ENAMETOOLONG); } reloc_path = __getname(); if (!reloc_path) { return ERR_PTR(-ENOMEM); } memcpy(reloc_path, record->newpath, record->new_len); memcpy(reloc_path+record->new_len, suffix, suff_len+1); CR_KTRACE_LOW_LVL("'%s' -> '%s'", path, reloc_path); if (put_old) { __putname(path); } return reloc_path; } } return path; } /* Taken (almost) directly from linux-2.6.0/fs/namei.c:do_getname * Modified to return len (including nul byte) */ static int my_getname(const char __user *filename, char *work_page) { int result; unsigned long len = PATH_MAX; if ((unsigned long) filename >= TASK_SIZE) { if (!segment_eq(get_fs(), KERNEL_DS)) return -EFAULT; } else if (TASK_SIZE - (unsigned long) filename < PATH_MAX) { len = TASK_SIZE - (unsigned long) filename; } result = strncpy_from_user(work_page, filename, len); if (result >= len) { result = -ENAMETOOLONG; } else if (!result) { result = -EINVAL; } else { result += 1; } return result; } static int do_read_reloc(cr_rstrt_req_t *req, unsigned int count, const struct cr_rstrt_relocate_pair *path) { cr_rstrt_relocate_t reloc = NULL; unsigned int i; char *page = NULL; long result = 0; CR_NO_LOCKS(); result = -ENOMEM; reloc = cr_kzalloc(CR_RSTRT_RELOCATE_T_SIZE(count), GFP_KERNEL); if (!reloc) { CR_ERR_REQ(req, "failed to allocate memory to store relocation records"); goto out; } reloc->count = count; page = __getname(); if (!page) { CR_ERR_REQ(req, "failed to allocate memory to parse relocation records"); goto out_free; } /* Copy paths from user-space */ for (i = 0; i < count; i++) { const char *oldpath = path[i].oldpath; const char *newpath = path[i].newpath; result = my_getname(oldpath, page); if (result < 0) { goto out_put; } if (*page != '/') { CR_ERR_REQ(req, "relocate.oldpath '%s' is not a full path", page); result = -EINVAL; goto out_put; } reloc->path[i].old_len = result - 1; reloc->path[i].oldpath = cr_kmemdup(page, result, GFP_KERNEL); if (!reloc->path[i].oldpath) { CR_ERR_REQ(req, "failed to allocate memory to dup reloction record"); result = -ENOMEM; goto out_put; } result = my_getname(newpath, page); if (result < 0) { goto out_put; } if (*page != '/') { CR_ERR_REQ(req, "relocate.newpath '%s' is not a full path", page); result = -EINVAL; goto out_put; } reloc->path[i].new_len = result - 1; reloc->path[i].newpath = cr_kmemdup(page, result, GFP_KERNEL); if (!reloc->path[i].newpath) { CR_ERR_REQ(req, "failed to allocate memory to dup reloction record"); result = -ENOMEM; goto out_put; } } __putname(page); req->relocate = reloc; return 0; out_put: __putname(page); out_free: cr_free_reloc(reloc); out: return result; } int cr_read_reloc(cr_rstrt_req_t *req, void __user *void_arg) { struct cr_rstrt_relocate __user *arg = void_arg; struct cr_rstrt_relocate_pair *path = NULL; unsigned int count; size_t alloc_sz; int result = 0; CR_NO_LOCKS(); if (get_user(count, &arg->count)) { result = -EFAULT; goto out; } if (!count) { /* result = 0 already */ goto out; } else if (count > CR_MAX_RSTRT_RELOC) { CR_ERR_REQ(req, "Relocation count of %u exceedes max %d\n", count, CR_MAX_RSTRT_RELOC); result = -EINVAL; goto out; } result = -ENOMEM; alloc_sz = count * sizeof(struct cr_rstrt_relocate_pair); path = cr_kzalloc(alloc_sz, GFP_KERNEL); if (!path) { goto out; } /* Copy path pairs from user-space */ result = -EFAULT; if (copy_from_user(path, &arg->path, alloc_sz)) { goto out_free; } result = do_read_reloc(req, count, path); out_free: kfree(path); out: return result; } void cr_free_reloc(cr_rstrt_relocate_t reloc) { if (reloc) { unsigned int i; for (i = 0; i < reloc->count; i++) { kfree(reloc->path[i].oldpath); /* kfree(NULL) OK */ kfree(reloc->path[i].newpath); /* kfree(NULL) OK */ } kfree(reloc); } } #ifdef CONFIG_COMPAT int cr_read_reloc32(cr_rstrt_req_t *req, void __user *void_arg) { struct cr_compat_rstrt_relocate __user *arg = void_arg; struct cr_rstrt_relocate_pair *path = NULL; unsigned int count, i; size_t alloc_sz; int result = 0; CR_NO_LOCKS(); if (get_user(count, &arg->count)) { result = -EFAULT; goto out; } if (!count) { /* result = 0 already */ goto out; } else if (count > CR_MAX_RSTRT_RELOC) { CR_ERR_REQ(req, "Relocation count of %u exceedes max %d\n", count, CR_MAX_RSTRT_RELOC); result = -EINVAL; goto out; } result = -ENOMEM; alloc_sz = count * sizeof(struct cr_rstrt_relocate_pair); path = cr_kzalloc(alloc_sz, GFP_KERNEL); if (!path) { goto out; } /* Copy paths from user-space */ result = -EFAULT; for (i = 0; i < count; i++) { compat_uptr_t oldptr, newptr; if (get_user(oldptr, &arg->path[i].oldpath) || get_user(newptr, &arg->path[i].newpath)) { goto out_free; } path[i].oldpath = compat_ptr(oldptr); path[i].newpath = compat_ptr(newptr); } result = do_read_reloc(req, count, path); out_free: kfree(path); out: return result; } #endif // CONFIG_COMPAT blcr-0.8.5/cr_module/cr_module.h0000664000000000000000000005163712101606501013436 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2008, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * 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 * * $Id: cr_module.h,v 1.285.4.7 2013/01/28 23:44:01 phargrov Exp $ */ #ifndef _CR_MODULE_H #define _CR_MODULE_H 1 #define _IN_CR_MODULE_H 1 #include "blcr_config.h" // Configuration #include #ifdef CR_NEED_AUTOCONF_H #include #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #if HAVE_LINUX_SYSCALLS_H #include /* for sys_close, etc. */ #endif #include #include #if defined(CONFIG_COMPAT) #include /* This mapping works only because we only pass pointers and longs */ #define CR_IOCTL32_MAP(x) ((((x)&0xff0000) == 0x80000) ? (((x)&~0xff0000)|0x40000) : (x)) #define CR_IOCTL32_UNMAP(x) ((((x)&0xff0000) == 0x40000) ? (((x)&~0xff0000)|0x80000) : (x)) #endif #include // For the stuff common to user space #include // Prototypes for non-exported and/or non-prototyped kernel symbols #include "cr_arch.h" // Architecture-specific bits #include "cr_barrier.h" // Code for kernel barriers. #include "cr_ktrace.h" // Code for trace messages // forward decls/typedefs for use w/i vmadump struct cr_chkpt_preq_s; typedef struct cr_chkpt_preq_s cr_chkpt_proc_req_t; struct cr_rstrt_preq_s; typedef struct cr_rstrt_preq_s cr_rstrt_proc_req_t; #include "vmadump.h" #include "cr_kcompat.h" // For providing the illusion of a uniform kernel platform #undef _IN_CR_MODULE_H // Current and oldest-supported versions of the context file format // // Must advance CR_CONTEXT_VERSION in each public release that generates // context files not readable by the previous release. // Must correct CR_CONTEXT_VERSION_MIN in any public release that cannot // read context files produced by older versions. #define CR_CONTEXT_VERSION 9 #define CR_CONTEXT_VERSION_MIN 8 // cr_objectmap_t is an opaque type struct cr_objectmap_s; typedef struct cr_objectmap_s *cr_objectmap_t; // cr_rstrt_relocate_t is an opaque type struct cr_rstrt_relocate_s; typedef struct cr_rstrt_relocate_s *cr_rstrt_relocate_t; // Foward type decls: struct cr_mmaps_desc; // Source/Destination location info for a checkpoint typedef struct cr_location_s { int is_write; // file pointer (NULL iff location is a directory) struct file * filp; struct semaphore mutex; // fs struct pointer (NULL iff location is not a directory) struct fs_struct * fs; } cr_location_t; typedef struct cr_work_s { struct list_head list; void (*f)(struct cr_work_s *); } cr_work_t; #define CR_INIT_WORK(_work, _func) do { \ (_work)->f = (_func); \ INIT_LIST_HEAD(&(_work)->list); \ } while (0) // memory pools for our most common types extern cr_kmem_cache_ptr cr_pdata_cachep; extern cr_kmem_cache_ptr cr_task_cachep; extern cr_kmem_cache_ptr cr_chkpt_req_cachep; extern cr_kmem_cache_ptr cr_chkpt_proc_req_cachep; extern cr_kmem_cache_ptr cr_rstrt_req_cachep; extern cr_kmem_cache_ptr cr_rstrt_proc_req_cachep; // Kernel-side tracking of a checkpoint request struct cr_chkpt_preq_s { // grumble... need short name for KMEM_CACHE() struct list_head list; int ref_count; // (non-atomic) count of references const struct mm_struct *mm; struct cr_chkpt_req_s *req; struct list_head tasks; // Tasks in this proc_req (protected by req->lock) */ int thread_count; struct file *file; // per-process context file (may equal master) struct semaphore serial_mutex; // globally order steps in req cr_barrier_t phase_barrier; // between phases 1 & 2 cr_barrier_t predump_barrier; // at start of dump cr_barrier_t vmadump_barrier; // at end of vmadump int omit; struct k_sigaction saved_sa; // Space to save user-registered sigaction. struct k_sigaction forced_sa; // Space to save blcr-registered sigaction. cr_bool_t have_leader; cr_bool_t done_init; cr_bool_t done_header; cr_bool_t done_linkage; cr_bool_t done_fs; cr_bool_t done_mmaps_maps; cr_bool_t done_itimers; cr_bool_t done_files; cr_bool_t done_mmaps_data; cr_bool_t done_fini; /* To ensure req->signal (if non-zero) is delivered correctly */ cr_barrier_t pre_complete_barrier; cr_barrier_t post_complete_barrier; /* For vmadump thread management */ wait_queue_head_t wait; cr_bool_t done_leader; /* For special mmap()s tracking */ int mmaps_cnt; struct cr_mmaps_desc *mmaps_tbl; /* For pause/resume and save of itimers */ struct itimerval itimers[3]; cr_bool_t done_resume_itimers; cr_bool_t duplicate_flag; /* For fd to pass to the signal handler */ int ctrl_fd; // >= 0 if any of our threads are "registered"... int tmp_fd; // ...else open() at trigger, close() in OP_HAND_CHKPT }; typedef struct cr_chkpt_req_s { pid_t requester; // who requested the checkpoint pid_t target; // who is to be checkpointed atomic_t ref_count; // reference count atomic_t completed; // count of successful completions rwlock_t lock; // spinlock for task_list & wait wait_queue_head_t wait; // place for requester to wait struct list_head tasks; // list of target cr_task_t's struct list_head procs; // list of target cr_chkpt_proc_req_t's cr_location_t dest; // checkpoint destination struct semaphore serial_mutex; // mutex for i/o serialization cr_bool_t done_header; cr_bool_t done_trailer; unsigned int flags; // flags supplied by requestor int result; // value returned by REAP int die; // flag indicating we must die int has_expiration; // 'expiration' is used unsigned long expiration; // limit on time to chkpt cr_work_t work; cr_format_t dump_format; // Format to use for this dump int signal; // sent after CHECKPOINT cr_scope_t checkpoint_scope; cr_objectmap_t map; cr_barrier_t preshared_barrier; // before files & mmaps_data cr_barrier_t postdump_barrier; // at end of dump struct file *ctrl_file; cr_errbuf_t *errbuf; } cr_chkpt_req_t; #define CR_CHKPT_RESTARTED ((cr_chkpt_req_t *)1UL) typedef volatile enum { CR_RSTRT_STATE_REQUESTER, // Requester needs to fork() child to read context CR_RSTRT_STATE_CHILD, // A child is reading the context file CR_RSTRT_STATE_DONE // Finished, possibly in error } cr_rstrt_state_t; struct cr_rstrt_preq_s { // grumble... need short name for KMEM_CACHE() struct list_head list; const struct mm_struct *mm; struct cr_rstrt_req_s *req; cr_bool_t have_leader; cr_bool_t done_fs; cr_bool_t done_mmaps_maps; cr_bool_t done_itimers; cr_bool_t done_files; cr_bool_t done_mmaps_data; cr_bool_t done_hide_cr_fds; cr_bool_t done_close_cr_fds; cr_bool_t done_linkage; int clone_flags; int clones_needed; struct list_head linkage; int linkage_size; int thread_count; struct list_head tasks; struct semaphore serial_mutex; struct file *file; // per-process context file (may equal master) atomic_t final_counter; /* For vmadump thread management and inter-thread communication */ cr_barrier_t pre_vmadump_barrier; cr_barrier_t post_vmadump_barrier; wait_queue_head_t wait; cr_bool_t done_leader; int thaw_error; /* To ensure req->signal (if non-zero) is delivered correctly */ cr_barrier_t pre_complete_barrier; cr_barrier_t post_complete_barrier; /* For special mmap()s tracking */ int mmaps_cnt; struct cr_mmaps_desc *mmaps_tbl; /* For restore of itimers */ struct itimerval itimers[3]; cr_bool_t done_resume_itimers; int tmp_fd; // fd, if any, openned at trigger time }; typedef struct cr_rstrt_req_s { pid_t requester; // who requested the restart cr_location_t src; atomic_t ref_count; struct task_struct *cr_restart_task; struct file *dpipe_in; struct file *dpipe_out; int need_procs; cr_rstrt_state_t state; wait_queue_head_t wait; // place for requester to wait for state changes int result; // value returned by REAP int die; // indicates spawned threads must die unsigned int flags; // flags supplied by requestor cr_objectmap_t map; // map from old object addrs to new struct file *file0; // "master" context file cr_barrier_t barrier; rwlock_t lock; // protects procs and tasks lists struct list_head procs; // list of target cr_rstrt_proc_req_t's struct list_head tasks; // list of target tasks not yet completed struct list_head linkage; // list of "linkage" entries cr_scope_t scope; int signal; cr_work_t work; cr_rstrt_relocate_t relocate; // For path relocations cr_errbuf_t *errbuf; } cr_rstrt_req_t; typedef enum { CR_NO_PHASE = 0, CR_PHASE1, CR_PHASE2 } cr_phase_t; // For forming a list of tasks. typedef struct cr_task_s { struct list_head task_list; // All tasks struct list_head req_list; // Tasks in same req struct list_head proc_req_list; // Tasks in same proc_req atomic_t ref_count; struct task_struct *task; cr_chkpt_req_t *chkpt_req; cr_chkpt_proc_req_t *chkpt_proc_req; cr_rstrt_req_t *rstrt_req; cr_rstrt_proc_req_t *rstrt_proc_req; cr_phase_t phase; // When setting phase, we also set the next three: struct k_sigaction handler_sa; // sigaction in place when phase was set struct file *filp; // filp used to set phase int fd; // fd "registered" with phase int stopped; int step; // Step in progress, for recovery if task dies u32 self_exec_id; // For detection of ill-timed exec() unsigned long chkpt_flags; // flags supplied at checkpoint time } cr_task_t; // Private data attached to an instance of the file typedef struct cr_pdata_s { cr_chkpt_req_t *chkpt_req; cr_rstrt_req_t *rstrt_req; } cr_pdata_t; /* Steps for checkpoint - named for the syncronization that comes next: */ enum { CR_CHKPT_STEP_PRESHARED = 0, CR_CHKPT_STEP_PHASE, CR_CHKPT_STEP_PREDUMP, CR_CHKPT_STEP_VMADUMP, CR_CHKPT_STEP_POSTDUMP, CR_CHKPT_STEP_PRE_COMPLETE, CR_CHKPT_STEP_POST_COMPLETE, CR_CHKPT_STEP_DONE }; /* Steps for restart - named for the syncronization that comes next: */ enum { CR_RSTRT_STEP_PRE_VMADUMP = 0, CR_RSTRT_STEP_POST_VMADUMP, CR_RSTRT_STEP_REQ_BARRIER, CR_RSTRT_STEP_PRE_COMPLETE, CR_RSTRT_STEP_POST_COMPLETE, CR_RSTRT_STEP_DONE }; #if CRI_DEBUG || 1 /* Always on for now */ #define CR_ASSERT_STEP_inner(_t, _s, _cmp) \ do { \ if (!((_t)->step _cmp (_s))) \ CR_ERR("%s:%d Expect step " #_cmp " " #_s "(%d) but found %d", __FUNCTION__, __LINE__, (_s), (_t)->step); \ } while (0) #else #define CR_ASSERT_STEP_inner(_t, _s, _cmp) do {} while(0) #endif #define CR_ASSERT_STEP_EQ(_t, _s) CR_ASSERT_STEP_inner(_t, _s, ==) #define CR_ASSERT_STEP_NE(_t, _s) CR_ASSERT_STEP_inner(_t, _s, !=) #define CR_ASSERT_STEP_GE(_t, _s) CR_ASSERT_STEP_inner(_t, _s, >=) #define CR_ASSERT_STEP_GT(_t, _s) CR_ASSERT_STEP_inner(_t, _s, >) #define CR_ASSERT_STEP_LE(_t, _s) CR_ASSERT_STEP_inner(_t, _s, <=) #define CR_ASSERT_STEP_LT(_t, _s) CR_ASSERT_STEP_inner(_t, _s, <) // cr_proc.c extern int cr_proc_init(void); extern void cr_proc_cleanup(void); // cr_fops.c extern struct file_operations cr_ctrl_fops; extern int cr_hand_complete(struct file *filp, unsigned int flags); extern int cr_hand_abort(struct file *filp, unsigned int flags); #if defined(CONFIG_COMPAT) && !defined(HAVE_COMPAT_IOCTL) extern int cr_init_ioctl32(void); extern int cr_cleanup_ioctl32(void); #endif // cr_dump_self.c extern int cr_dump_self(struct file *filp, unsigned long flags); // cr_chkpt_req.c extern int cr_chkpt_req(struct file *filp, struct cr_chkpt_args __user *arg); extern unsigned int cr_chkpt_poll(struct file *filp, poll_table *wait); extern int cr_chkpt_reap(struct file *filp); extern int cr_chkpt_log(struct file *filp, struct cr_log_args __user *arg); extern int cr_chkpt_task_complete(cr_task_t *cr_task, int block); extern int cr_chkpt_fwd(struct file *filp, struct cr_fwd_args __user *arg); extern void cr_chkpt_req_release(struct file *filp, cr_pdata_t *priv); extern int cr_signal_predump_barrier(cr_task_t *cr_task, int block); extern void cr_signal_phase_barrier(cr_task_t *cr_task, int block, int need_lock); extern void cr_chkpt_advance_to(cr_task_t *cr_task, int step, int hold_lock); extern int cr_chkpt_abort(cr_task_t *cr_task, unsigned int flags); extern int cr_chkpt_info(struct file *filp, struct cr_chkpt_info __user *arg); // cr_async.c extern int cr_suspend(struct file *filp, struct timeval __user *arg); extern int cr_phase1_register(struct file *filp, int arg); extern void cr_phase1_release(struct file *filp, cr_pdata_t *priv); // cr_sync.c extern int cr_phase2_register(struct file *filp, int arg); extern void cr_phase2_release(struct file *filp, cr_pdata_t *priv); // cr_task.c extern rwlock_t cr_task_lock; extern struct list_head cr_task_list; extern cr_task_t *__cr_task_get(struct task_struct *task, int create); extern void __cr_task_put(cr_task_t *cr_task); extern cr_task_t *cr_task_get(struct task_struct *task); extern void cr_task_put(cr_task_t *cr_task); // cr_rstrt_req.c extern int cr_rstrt_request_restart(struct file *filp, struct cr_rstrt_args __user *arg); extern unsigned int cr_rstrt_poll(struct file *filp, poll_table *wait); extern int cr_rstrt_reap(struct file *filp); extern int cr_rstrt_log(struct file *filp, struct cr_log_args __user *arg); extern int cr_rstrt_child(struct file *filp); extern int cr_rstrt_procs(struct file *filp, struct cr_procs_tbl __user *arg); extern int cr_rstrt_src(struct file *filp, char __user *arg); extern int cr_rstrt_req_release(struct file *filp, cr_pdata_t *priv); extern int cr_rstrt_task_complete(cr_task_t *cr_task, int block, int need_lock); extern int cr_rstrt_abort(cr_task_t *cr_task, unsigned int flags); extern int cr_rstrt_init(void); extern void cr_rstrt_cleanup(void); // cr_dest_file.c extern int cr_loc_init(cr_errbuf_t *eb, cr_location_t *loc, int fd, struct file *from, int is_write); extern void cr_loc_free(cr_location_t *loc); extern struct file *cr_loc_get(cr_location_t *loc, int *shared); extern void cr_loc_put(cr_location_t *loc, struct file *filp); // cr_trigger.c extern int __cr_trigger_phase1(cr_chkpt_proc_req_t *proc_req); extern int __cr_trigger_phase1_only(cr_chkpt_proc_req_t *req); extern int cr_trigger_phase1(cr_chkpt_req_t *req); extern int __cr_trigger_phase2(cr_chkpt_proc_req_t *proc_req); extern int cr_trigger_phase2(cr_chkpt_req_t *req, cr_chkpt_proc_req_t *proc_req); // cr_io.c extern ssize_t cr_uread(cr_errbuf_t *eb, struct file * file, void *buf, size_t count); extern ssize_t cr_uwrite(cr_errbuf_t *eb, struct file * file, const void *buf, size_t count); extern ssize_t cr_kread(cr_errbuf_t *eb, struct file * file, void *buf, size_t count); extern ssize_t cr_kwrite(cr_errbuf_t *eb, struct file * file, const void *buf, size_t count); extern int cr_skip(struct file *filp, loff_t len); extern int cr_fgets(cr_errbuf_t *eb, char *buf, int size, struct file *filp); extern int cr_fputs(cr_errbuf_t *eb, const char *buf, struct file *filp); extern int cr_save_pathname(cr_errbuf_t *eb, struct file *cr_filp, struct path *path, char *buf, int size); extern int cr_save_filename(cr_errbuf_t *eb, struct file *cr_filp, struct file *filp, char *buf, int size); extern const char *__cr_getname(cr_errbuf_t *eb, struct file *filp, int null_ok); extern const char *cr_getname(cr_errbuf_t *eb, cr_rstrt_relocate_t reloc, struct file *filp, int null_ok); extern const char *cr_location2path(cr_location_t *loc, char *buf, int size); extern int cr_kern_path(const char *name, unsigned int flags, struct path *path); extern struct file * cr_dentry_open(struct path *path, int flags); extern struct file * cr_dentry_open_perm(struct path *path, int flags); extern int cr_mknod(cr_errbuf_t *eb, struct path *path, const char *name, int mode, unsigned long unlinked_id); extern struct file *cr_filp_mknod(cr_errbuf_t *eb, const char *name, int mode, int flags, unsigned long unlinked_id); extern int cr_filp_chmod(struct file *filp, mode_t mode); extern struct file *cr_mkunlinked(cr_errbuf_t *eb, struct file *cr_filp, const char *name, int mode, int flags, loff_t size, unsigned long unlinked_id); extern loff_t cr_sendfile(cr_errbuf_t *eb, struct file *dst_filp, struct file *src_filp, loff_t *src_ppos, loff_t count); extern struct dentry *cr_link(cr_errbuf_t *eb, struct path *old_path, const char *name); extern struct file *cr_filp_reopen(struct file *orig_filp, int new_flags); extern int cr_fd_claim(int fd); extern int cr_dup_other(struct files_struct *files, struct file *filp); extern int cr_fstat(cr_objectmap_t, struct file *filp); // cr_objects.c extern int cr_object_init(void); extern void cr_object_cleanup(void); extern cr_objectmap_t cr_alloc_objectmap(void); extern void cr_release_objectmap(cr_objectmap_t); extern int cr_find_object(cr_objectmap_t, void *, void **); extern int cr_insert_object(cr_objectmap_t, void *, void *, gfp_t flags); extern int cr_remove_object(cr_objectmap_t, void *); #ifdef CONFIG_COMPAT // cr_compat.c extern long cr_compat_ctrl_ioctl(struct file *, unsigned, unsigned long); #endif // cr_watchdog.c extern void cr_wd_add(cr_work_t *work); extern int cr_wd_del(cr_work_t *work); #define __cr_wd_del(_work) list_del_init(&(_work)->list) extern void cr_wd_flush(void); // cr_relocate.c extern const char *cr_relocate_path(cr_rstrt_relocate_t reloc, const char *path, int put_old); extern void cr_free_reloc(cr_rstrt_relocate_t reloc); extern int cr_read_reloc(cr_rstrt_req_t *req, /*struct cr_rstrt_relocate*/ void __user *arg); // cr_creds.c extern int cr_load_creds(cr_rstrt_proc_req_t *proc_req); extern int cr_save_creds(cr_chkpt_proc_req_t *proc_req); // 32-bit compat bits in various files: #ifdef CONFIG_COMPAT struct cr_compat_fwd_args { compat_pid_t cr_target; compat_int_t cr_scope; /* enum */ }; extern int cr_chkpt_fwd32(struct file *filp, struct cr_compat_fwd_args __user *arg); extern int cr_suspend32(struct file *filp, struct compat_timeval __user *arg); struct cr_compat_chkpt_info { compat_pid_t requester; compat_pid_t target; compat_int_t scope; compat_int_t signal; compat_uptr_t dest; }; extern int cr_chkpt_info32(struct file *filp, struct cr_compat_chkpt_info __user *arg); struct cr_compat_log_args { compat_uint_t len; compat_uptr_t buf; }; extern int cr_chkpt_log32(struct file *filp, struct cr_compat_log_args __user *arg); extern int cr_rstrt_log32(struct file *filp, struct cr_compat_log_args __user *arg); struct cr_compat_procs_tbl { compat_int_t threads; compat_int_t clone_flags; }; extern int cr_rstrt_procs32(struct file *filp, struct cr_compat_procs_tbl __user *arg); struct cr_compat_chkpt_args { compat_pid_t cr_target; compat_int_t cr_scope; /* enum */ compat_int_t cr_fd; compat_uint_t cr_secs; compat_int_t dump_format; /* enum */ compat_int_t signal; compat_uint_t flags; }; extern int cr_chkpt_req32(struct file *file, struct cr_compat_chkpt_args __user *req); struct cr_compat_rstrt_args { compat_int_t cr_fd; compat_int_t signal; compat_uptr_t relocate; compat_int_t flags; }; extern int cr_rstrt_request_restart32(struct file *file, struct cr_compat_rstrt_args __user *req); struct cr_compat_rstrt_relocate { compat_uint_t count; struct { compat_uptr_t oldpath; compat_uptr_t newpath; } path[0]; // GNU (not ISO C99) variable length array }; extern int cr_read_reloc32(cr_rstrt_req_t *req, /*struct cr_compat_rstrt_relocate*/ void __user *arg); #endif // CONFIG_COMPAT #endif blcr-0.8.5/cr_module/cr_context.h0000664000000000000000000001517112064247330013637 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2003, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * 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 * * $Id: cr_context.h,v 1.72.8.2 2012/12/19 05:21:28 phargrov Exp $ */ /* * Defines data structures stored in context files * * XXX: Need a full specification of the file format one of these days */ #ifndef _CR_CONTEXT_H #define _CR_CONTEXT_H 1 #define CR_MAGIC {'C', 'R'} /* * XXX: Think about putting an enum here to identify the structs as we * read them in (write them out). */ struct cr_context_file_header { int magic[2]; int version; cr_scope_t scope; int arch_id; }; struct cr_section_header { int num_threads; int clone_flags; int tmp_fd; }; #define CR_PARENT_INIT ((struct task_struct *)-1) struct cr_context_tasklinkage { struct task_struct *myptr; /* Pointer to original task_struct */ /* This is enough to restore all the linkage information for both 2.4 and 2.6 * versions of the task_struct. The remaining linkage can all be inferred * from these. Though we don't restore the children in "age" order. */ struct task_struct *real_parent; /* real parent process (when being debugged) */ struct task_struct *parent; /* parent process */ pid_t pid; pid_t pgrp; #if 0 /* We don't handle this, and it changed type on us around 2.6.21 */ pid_t tty_old_pgrp; #endif pid_t session; pid_t tgid; int leader; int exit_signal; struct { int stopped; cr_phase_t phase; int fd; struct k_sigaction handler_sa; void * orig_filp; unsigned long chkpt_flags; } cr_task; }; /* Macros for reading linkage from a task * REAL_PARENT = My parent, not changed by ptrace * PARENT = REAL_PARENT unless I am ptrace'd * CHILD = Youngest child */ #if HAVE_TASK_REAL_PARENT #define CR_REAL_PARENT(T) ((T)->real_parent) #else #undef CR_REAL_PARENT #endif #if HAVE_TASK_PARENT #define CR_PARENT(T) ((T)->parent) #else #define CR_PARENT(T) ((T)->real_parent) #endif #define CR_CHILD(T) (((T)->children.prev == &(T)->children) ? NULL : list_entry((T)->children.prev,struct task_struct,sibling)) #if HAVE_TASK_CHILD_REAPER #define cr_child_reaper task_child_reaper(current) #elif HAVE_CHILD_REAPER #define cr_child_reaper child_reaper(current) #elif defined(CR_KDATA_child_reaper) #define cr_child_reaper child_reaper #else static inline struct task_struct *__cr_child_reaper(void) { struct pid_namespace *ns = task_active_pid_ns(current); return ns->child_reaper; } #define cr_child_reaper __cr_child_reaper() #endif /* * cr_type is one of these. */ typedef enum { cr_bad_obj, cr_fs_obj, cr_files_obj, cr_file_obj, cr_chrdev_obj, cr_dup_obj, cr_file_info_obj, cr_open_file_obj, cr_fifo_obj, cr_eofiles_obj, cr_dir_obj, cr_open_dir_obj, } cr_obj_t; struct cr_files_struct { cr_obj_t cr_obj; /* cr_files_obj */ int cr_max_fds; int cr_next_fd; }; typedef enum { cr_bad_file_type=0, cr_open_file=1, cr_open_directory, cr_open_link, cr_open_fifo, cr_open_socket, cr_open_chr, cr_open_blk, cr_open_dup, cr_open_chkpt_req, cr_unknown_file=99, cr_end_of_files, } cr_file_type_t; /* * Stores "generic" data - applicable to any file. (e.g. descriptor number, * close-on-exec flag, etc.) */ struct cr_file_info { cr_obj_t cr_type; /* cr_file_info_obj */ cr_file_type_t cr_file_type; int fd; int cloexec; int unlinked; void * orig_filp; }; struct cr_open_file { cr_obj_t cr_type; /* cr_open_file_obj */ void *file_id; /* pre-checkpoint inode for matching */ mode_t i_mode; loff_t f_pos; loff_t i_size; unsigned int f_flags; }; struct cr_open_dir { cr_obj_t cr_type; /* cr_open_dir_obj */ mode_t i_mode; loff_t f_pos; unsigned int f_flags; }; struct cr_chrdev { cr_obj_t cr_type; /* cr_chrdev_obj */ unsigned int cr_major; unsigned int cr_minor; mode_t i_mode; unsigned int f_flags; }; struct cr_dup { cr_obj_t cr_type; /* cr_dup_obj */ /* nothing more */ }; struct cr_eofiles { cr_obj_t cr_type; /* cr_eofls_obj */ }; struct cr_fifo { cr_obj_t cr_type; /* cr_fifo_obj */ void *fifo_id; /* inode ptr at checkpoint time */ int fifo_internal; /* both reader and writer in the checkpoint? */ unsigned int fifo_len; loff_t fifo_pos; unsigned long fifo_version; unsigned int fifo_flags; int fifo_perms; /* for mknod */ void *fifo_dentry; /* f_dentry value at checkpoint time */ long pipe_sz; /* store the size of the pipe buffer */ }; /* * Prototypes only needed from the save and restore paths */ // cr_vmadump.c extern loff_t cr_freeze_threads(cr_chkpt_proc_req_t *proc_req, int flags, int i_am_leader); extern long cr_thaw_threads(cr_rstrt_proc_req_t *proc_req, int flags, int i_am_leader); // cr_mmaps.c extern long cr_save_mmaps_maps(cr_chkpt_proc_req_t *proc_req); extern loff_t cr_save_mmaps_data(cr_chkpt_proc_req_t *proc_req); extern long cr_load_mmaps_maps(cr_rstrt_proc_req_t *proc_req); extern long cr_load_mmaps_data(cr_rstrt_proc_req_t *proc_req); // cr_timers.c extern void cr_pause_itimers(struct itimerval *itimers); extern void cr_resume_itimers(struct itimerval *itimers); extern long cr_load_itimers(cr_rstrt_proc_req_t *proc_req); extern long cr_save_itimers(cr_chkpt_proc_req_t *proc_req); // cr_pipes.c extern int cr_restore_open_fifo(cr_rstrt_proc_req_t *proc_req, struct cr_file_info *file_info, int do_not_restore_flag); extern int cr_save_open_fifo(cr_chkpt_proc_req_t *proc_req, struct file *filp); #endif /* _CR_CONTEXT_H */ blcr-0.8.5/cr_module/cr_dump_self.c0000664000000000000000000010161612064247330014124 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2008, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * 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 * * $Id: cr_dump_self.c,v 1.228.8.7 2012/12/19 05:21:28 phargrov Exp $ */ #include "cr_module.h" #include #include #include #include "vmadump.h" #include "cr_context.h" /* * XXX: Fix to return number of bytes written */ static int cr_save_linkage(cr_chkpt_proc_req_t *proc_req, struct file *filp) { cr_chkpt_req_t *req = proc_req->req; cr_errbuf_t *eb = req->errbuf; struct cr_context_tasklinkage *linkage; int linkage_size; cr_task_t *cr_task; struct task_struct *task; int task_count = proc_req->thread_count; int task_num; int retval; /* check task count, just ensure non-zero and not too big for kmalloc */ linkage = NULL; linkage_size = sizeof(*linkage) * task_count; if ((task_count > 0) && linkage_size <= CR_KMALLOC_MAX) { /* allocate a cr_context_linkage large enough to hold all of the * available tasks */ linkage = kmalloc(linkage_size, GFP_KERNEL); } if (linkage == NULL) { retval = -ENOMEM; goto out; } read_lock(&tasklist_lock); read_lock(&req->lock); /* loop over each task, and copy important fields into the linkage */ task_num = 0; list_for_each_entry(cr_task, &proc_req->tasks, proc_req_list) { if (cr_task == NULL) { CR_ERR_REQ(req, "NULL cr_task found on task list!"); retval = -EINVAL; goto out_nulltask; } task = cr_task->task; /* XXX: can a task that has exited still be on the task list? If so, * how would we ever now? * -- Must we even care? Even if the task_struct is garbage, it * only matters we'll build a new process around it... */ linkage[task_num].myptr = task; #ifdef CR_REAL_PARENT linkage[task_num].real_parent = CR_REAL_PARENT(task); #endif linkage[task_num].parent = CR_PARENT(task); /* Handle init specially */ #ifdef CR_REAL_PARENT if (linkage[task_num].real_parent == cr_child_reaper) { linkage[task_num].real_parent = CR_PARENT_INIT; } #endif if (linkage[task_num].parent == cr_child_reaper) { linkage[task_num].parent = CR_PARENT_INIT; } if ((task->pid <= 0) || (task->pid >= PID_MAX_LIMIT)) { CR_ERR_REQ(req, "Saving an invalid pid %d", task->pid); } linkage[task_num].pid = task->pid; linkage[task_num].tgid = task->tgid; linkage[task_num].pgrp = cr_task_pgrp(task); #if 0 /* We don't do anything with this yet, and it changed type around 2.6.21 */ linkage[task_num].tty_old_pgrp = cr_task_tty_old_pgrp(task); #endif linkage[task_num].session = cr_task_session(task); linkage[task_num].leader = cr_task_leader(task); linkage[task_num].exit_signal = task->exit_signal; linkage[task_num].cr_task.stopped = cr_task->stopped; linkage[task_num].cr_task.phase = cr_task->phase; linkage[task_num].cr_task.fd = cr_task->fd; linkage[task_num].cr_task.handler_sa = cr_task->handler_sa; linkage[task_num].cr_task.orig_filp = cr_task->filp; linkage[task_num].cr_task.chkpt_flags = cr_task->chkpt_flags; ++task_num; } out_nulltask: read_unlock(&req->lock); read_unlock(&tasklist_lock); /* This will catch the goto, and a possible race condition */ if (task_num != task_count) { CR_ERR_REQ(req, "wrong number of tasks counted: task_count = %d, task_num = %d", task_count, task_num); retval = -EINVAL; goto out_free; } /* write the length of the linkage structure to the context file */ retval = cr_kwrite(eb, filp, &linkage_size, sizeof(linkage_size)); if (retval != sizeof(linkage_size)) { CR_ERR_REQ(req, "linkage: write size returned %d", retval); goto out_free; } /* now write the linkage structure */ retval = cr_kwrite(eb, filp, linkage, linkage_size); if (retval != linkage_size) { CR_ERR_REQ(req, "linkage: write table returned %d", retval); goto out_free; } out_free: kfree(linkage); out: return retval; } static int cr_save_fs_struct(cr_chkpt_proc_req_t *proc_req) { cr_errbuf_t *eb = proc_req->req->errbuf; CR_PATH_DECL(root_path); CR_PATH_DECL(pwd_path); struct file *cf_filp = proc_req->file; int retval; int umask; void *buf; buf = __getname(); if (!buf) { retval = -ENOMEM; goto out_nomem; } cr_read_lock_fs(¤t->fs->lock); umask = current->fs->umask; CR_PATH_GET_FS(root_path, current->fs->root); CR_PATH_GET_FS(pwd_path, current->fs->pwd); cr_read_unlock_fs(¤t->fs->lock); /* save umask */ retval = cr_kwrite(eb, cf_filp, &umask, sizeof(umask)); if (retval != sizeof(umask)) { CR_ERR_PROC_REQ(proc_req, "umask: write returned %d", retval); goto out_writerr; } /* save root */ retval = cr_save_pathname(eb, cf_filp, root_path, buf, PATH_MAX); if (retval < 0) { CR_ERR_PROC_REQ(proc_req, "root: Bad file write!"); goto out_writerr; } /* save pwd */ retval = cr_save_pathname(eb, cf_filp, pwd_path, buf, PATH_MAX); if (retval < 0) { CR_ERR_PROC_REQ(proc_req, "pwd: Bad file write!"); goto out_writerr; } out_writerr: path_put(root_path); path_put(pwd_path); __putname(buf); out_nomem: return retval; } /* * Saves the files_struct * * This looks silly, but we actually restore the values of max_fds array * later. Since we know how many files are open, we don't have to guess * the way get_unused_fd does. * * returns max_fds or error */ static int cr_save_files_struct(cr_chkpt_proc_req_t *proc_req, struct files_struct *files) { cr_errbuf_t *eb = proc_req->req->errbuf; cr_fdtable_t *fdt; struct cr_files_struct cr_fs; struct file *cf_filp = proc_req->file; int retval=0; cr_fs.cr_obj = cr_files_obj; #if !HAVE_STRUCT_FDTABLE spin_lock(&files->file_lock); #endif rcu_read_lock(); fdt = cr_fdtable(files); cr_fs.cr_max_fds = fdt->max_fds; cr_fs.cr_next_fd = CR_NEXT_FD(files, fdt); rcu_read_unlock(); #if !HAVE_STRUCT_FDTABLE spin_unlock(&files->file_lock); #endif retval = cr_kwrite(eb, cf_filp, &cr_fs, sizeof(cr_fs)); if (retval != sizeof(cr_fs)) { CR_ERR_PROC_REQ(proc_req, "files struct: write returned %d", retval); goto out_writerr; } retval = cr_fs.cr_max_fds; out_writerr: return retval; } /* * cr_get_fd_info * * Saves flags associated with the file descriptor. (stored in files_struct) * * Must be called with the file_lock held, unless HAVE_STRUCT_FDTABLE for RCU. * * Assumes that the file is open. (descriptor refers to an open file in fd) */ static int cr_get_fd_info(struct files_struct *files, int fd, struct cr_file_info *file_info) { cr_fdtable_t *fdt; rcu_read_lock(); fdt = cr_fdtable(files); if (cr_read_open_fd(fd, fdt)) { file_info->fd = fd; file_info->cloexec = cr_read_close_on_exec(fd, fdt); file_info->orig_filp = fcheck(fd); } else { CR_WARN("cr_get_fd_info: Called on closed file!"); } rcu_read_unlock(); return 0; } static int cr_is_open_chkpt_req(cr_chkpt_proc_req_t *proc_req, struct file *filp) { struct dentry *ctrl = proc_req->req->ctrl_file->f_dentry; struct dentry *dentry = filp->f_dentry; cr_pdata_t *priv = filp->private_data; return (((dentry == ctrl) || (dentry->d_inode == ctrl->d_inode)) && priv && priv->chkpt_req); } static int cr_get_file_info(cr_chkpt_proc_req_t *proc_req, struct file *filp, struct cr_file_info *file_info) { struct dentry *dentry = filp->f_dentry; int retval=0; file_info->unlinked = vmad_dentry_unlinked(dentry); if (cr_insert_object(proc_req->req->map, file_info->orig_filp, file_info->orig_filp, GFP_KERNEL)) { /* Was in the object table (and thus is dup) */ file_info->cr_file_type = cr_open_dup; } else if (cr_is_open_chkpt_req(proc_req, filp)) { file_info->cr_file_type = cr_open_chkpt_req; } else { switch (dentry->d_inode->i_mode & S_IFMT) { case S_IFREG: file_info->cr_file_type = cr_open_file; break; case S_IFDIR: file_info->cr_file_type = cr_open_directory; break; case S_IFLNK: file_info->cr_file_type = cr_open_link; break; case S_IFIFO: file_info->cr_file_type = cr_open_fifo; break; case S_IFSOCK: file_info->cr_file_type = cr_open_socket; break; case S_IFCHR: file_info->cr_file_type = cr_open_chr; break; case S_IFBLK: file_info->cr_file_type = cr_open_blk; break; default: /* completely unknown */ file_info->cr_file_type = cr_unknown_file; } } return retval; } static int cr_save_file_info(cr_chkpt_proc_req_t *proc_req, struct cr_file_info *file_info) { cr_errbuf_t *eb = proc_req->req->errbuf; struct file *cf_filp = proc_req->file; int retval; retval = cr_kwrite(eb, cf_filp, file_info, sizeof(*file_info)); if (retval != sizeof(*file_info)) { CR_ERR_PROC_REQ(proc_req, "file_info: write returned %d", retval); goto out; } retval = 0; out: return retval; } static int cr_save_open_file(cr_chkpt_proc_req_t *proc_req, struct file *filp) { cr_errbuf_t *eb = proc_req->req->errbuf; struct file *cf_filp = proc_req->file; /* the context file */ struct cr_open_file open_file; struct dentry *dentry = filp->f_dentry; struct inode *inode = dentry->d_inode; int retval = -EBADF; open_file.cr_type = cr_open_file_obj; /* XXX: Fix to use better representation. */ open_file.file_id = inode; open_file.i_mode = inode->i_mode; open_file.i_size = i_size_read(inode); open_file.f_flags = filp->f_flags; open_file.f_pos = filp->f_pos; /* write out the open_file struct */ retval = cr_kwrite(eb, cf_filp, &open_file, sizeof(open_file)); if (retval != sizeof(open_file)) { CR_ERR_PROC_REQ(proc_req, "open_file: write returned %d", retval); goto out; } /* Write the filename */ retval = cr_save_filename(eb, cf_filp, filp, NULL, 0); if (retval < 0) { CR_ERR_PROC_REQ(proc_req, "cr_save_open_file - Bad file write (filename)!"); } /* If unlinked, first instance saves data too */ if (vmad_dentry_unlinked(dentry) && !cr_insert_object(proc_req->req->map, inode, inode, GFP_KERNEL)) { loff_t size = open_file.i_size; loff_t src_pos = 0; loff_t tmp = cr_sendfile(eb, cf_filp, filp, &src_pos, size); if (tmp != size) { CR_ERR_PROC_REQ(proc_req, "%s: copy-out of unlinked file returned %d", __FUNCTION__, (int)tmp); retval = (tmp < 0) ? tmp : -EIO; goto out; } } out: return retval; } static int cr_save_open_dir(cr_chkpt_proc_req_t *proc_req, struct file *filp) { cr_errbuf_t *eb = proc_req->req->errbuf; struct file *cf_filp = proc_req->file; /* the context file */ struct cr_open_dir open_dir; int retval = -EBADF; open_dir.cr_type = cr_open_dir_obj; /* XXX: Fix to use better representation. */ open_dir.i_mode = filp->f_dentry->d_inode->i_mode; open_dir.f_flags = filp->f_flags; open_dir.f_pos = filp->f_pos; /* write out the open_dir struct */ retval = cr_kwrite(eb, cf_filp, &open_dir, sizeof(open_dir)); if (retval != sizeof(open_dir)) { CR_ERR_PROC_REQ(proc_req, "open_dir: write returned %d", retval); goto out; } retval = cr_save_filename(eb, cf_filp, filp, NULL, 0); if (retval < 0) { CR_ERR_PROC_REQ(proc_req, "cr_save_open_dir - Bad file write (filename)!"); } out: return retval; } static int cr_save_open_link(cr_chkpt_proc_req_t *proc_req, struct file *filp) { int retval = -ENOSYS; return retval; } static int cr_save_open_socket(cr_chkpt_proc_req_t *proc_req, struct file *filp) { int retval = -ENOSYS; /* XXX: Hack to do absolutely nothing here... */ CR_WARN_PROC_REQ(proc_req, "warning: skipped a socket."); retval = 0; return retval; } /* * Saves major and minor numbers, plus mode and flags for reopen. */ static int cr_save_open_chr(cr_chkpt_proc_req_t *proc_req, struct file *filp) { cr_errbuf_t *eb = proc_req->req->errbuf; struct cr_chrdev cf_chrdev; struct file *cf_filp = proc_req->file; struct inode *inode; int retval; retval = -EINVAL; if (!filp) goto out; inode = filp->f_dentry->d_inode; cf_chrdev.cr_type = cr_chrdev_obj; if (cr_task_tty(current) && (cr_task_tty(current) == (struct tty_struct *)filp->private_data)) { /* Map CTTY -> /dev/tty */ cf_chrdev.cr_major = TTYAUX_MAJOR; cf_chrdev.cr_minor = 0; } else { cf_chrdev.cr_major = MAJOR(inode->i_rdev); cf_chrdev.cr_minor = MINOR(inode->i_rdev); } cf_chrdev.i_mode = filp->f_dentry->d_inode->i_mode; cf_chrdev.f_flags = filp->f_flags; retval = cr_kwrite(eb, cf_filp, &cf_chrdev, sizeof(cf_chrdev)); if (retval != sizeof(cf_chrdev)) { CR_ERR_PROC_REQ(proc_req, "open_chr: write returned %d", retval); goto out; } retval = 0; out: return retval; } static int cr_save_open_blk(cr_chkpt_proc_req_t *proc_req, struct file *filp) { int retval = -ENOSYS; return retval; } /* * dup info is associated with a file descriptor, not a file, * so it's saved in cr_save_file_info, and nothing is saved here, * other than a placeholder data structure. */ static int cr_save_open_dup(cr_chkpt_proc_req_t *proc_req, struct file *filp) { cr_errbuf_t *eb = proc_req->req->errbuf; struct cr_dup cf_dup; struct file *cf_filp = proc_req->file; int retval; retval = -EINVAL; if (!filp) goto out; /* placeholder... just in case we need to do something later */ cf_dup.cr_type = cr_dup_obj; retval = cr_kwrite(eb, cf_filp, &cf_dup, sizeof(cf_dup)); if (retval != sizeof(cf_dup)) { CR_ERR_PROC_REQ(proc_req, "open_dup: write returned %d", retval); goto out; } retval = 0; out: return retval; } static int cr_save_open_chkpt_req(cr_chkpt_proc_req_t *proc_req, struct file *filp) { /* Only differences from regular files are at restart */ /* XXX: could save time/space by specializing? */ return cr_save_open_file(proc_req, filp); } static int cr_save_file_locks(cr_chkpt_proc_req_t *proc_req, struct file *filp) { int retval = -ENOSYS; return retval; } static int cr_save_all_files(cr_chkpt_proc_req_t *proc_req) { int retval; int fd; struct file *cf_filp = proc_req->file; struct cr_file_info file_info; struct file *filp; int max_fds; CR_KTRACE_FUNC_ENTRY(""); /* save the files info, and get max_fds as a side-effect */ CR_KTRACE_HIGH_LVL(" ...files_struct"); retval = cr_save_files_struct(proc_req, current->files); if (retval < 0) { CR_ERR_PROC_REQ(proc_req, "cr_save_all_files: Error saving files_struct"); goto out_nolocks; } max_fds = retval; CR_KTRACE_HIGH_LVL(" ...files"); /* now save the per file info */ spin_lock(¤t->files->file_lock); for (fd = 0; fd < max_fds; ++fd) { /* * We have to do our own fget here to avoid a possible race on * file close. (Probably impossible, but just to be on the safe * side. */ /* loop around again if the file is not open or not to be saved */ filp = fcheck(fd); if (! filp) { continue; } if (filp == cf_filp) { CR_KTRACE_LOW_LVL("fd %d is the context file - skipping", fd); continue; } get_file(filp); // CR_KTRACE_LOW_LVL("fd %d is open", fd); memset(&file_info, 0, sizeof(file_info)); file_info.cr_type = cr_file_info_obj; /* now save data for this file descriptor */ cr_get_fd_info(current->files, fd, &file_info); spin_unlock(¤t->files->file_lock); /* Ensure up-to-date inode information (e.g. on a network fs) */ retval = cr_fstat(proc_req->req->map, filp); if (retval) { CR_ERR_PROC_REQ(proc_req, "Unable to fstat() file"); fput(filp); goto out_nolocks; } /* write out the file header */ retval = cr_get_file_info(proc_req, filp, &file_info); if (retval) { retval = -EBADF; CR_ERR_PROC_REQ(proc_req, "Unable to determine file info!"); fput(filp); goto out_nolocks; } retval = cr_save_file_info(proc_req, &file_info); if (retval < 0) { CR_ERR_PROC_REQ(proc_req, "%s: cr_save_file_info failed", __FUNCTION__); fput(filp); goto out_nolocks; } switch(file_info.cr_file_type) { case cr_open_file: CR_KTRACE_LOW_LVL(" ...%d is regular file.", fd); retval = cr_save_open_file(proc_req, filp); break; case cr_open_directory: CR_KTRACE_LOW_LVL(" ...%d is open directory.", fd); retval = cr_save_open_dir(proc_req, filp); break; case cr_open_link: CR_KTRACE_LOW_LVL(" ...%d is open symlink.", fd); retval = cr_save_open_link(proc_req, filp); break; case cr_open_fifo: CR_KTRACE_LOW_LVL(" ...%d is open fifo.", fd); retval = cr_save_open_fifo(proc_req, filp); break; case cr_open_socket: CR_KTRACE_LOW_LVL(" ...%d is open socket.", fd); retval = cr_save_open_socket(proc_req, filp); break; case cr_open_chr: CR_KTRACE_LOW_LVL(" ...%d is open character device.", fd); retval = cr_save_open_chr(proc_req, filp); break; case cr_open_blk: CR_KTRACE_LOW_LVL(" ...%d is an open block device.", fd); retval = cr_save_open_blk(proc_req, filp); break; case cr_open_dup: CR_KTRACE_LOW_LVL(" ...%d is dup of %p", fd, file_info.orig_filp); retval = cr_save_open_dup(proc_req, filp); break; case cr_open_chkpt_req: CR_KTRACE_LOW_LVL(" ...%d is a checkpoint request.", fd); retval = cr_save_open_chkpt_req(proc_req, filp); break; case cr_bad_file_type: /* fall through */ default: retval = -EBADF; break; } if (retval < 0) { fput(filp); retval = -EBADF; CR_ERR_PROC_REQ(proc_req, "Unable to save open file!"); goto out_nolocks; } /* Now write out any locks we had on the file. */ // CR_KTRACE_LOW_LVL(" ...locks on %d", fd); retval = cr_save_file_locks(proc_req, filp); /* We did the fget() manually with the lock held. */ fput(filp); spin_lock(¤t->files->file_lock); } spin_unlock(¤t->files->file_lock); /* now write one last record to indicate that there are no files left. */ memset(&file_info, 0, sizeof(file_info)); file_info.cr_type = cr_file_info_obj; file_info.cr_file_type = cr_end_of_files; file_info.fd = -1; retval = cr_save_file_info(proc_req, &file_info); if (retval < 0) { CR_ERR_PROC_REQ(proc_req, "%s: cr_save_file_info failed", __FUNCTION__); goto out_nolocks; } out_nolocks: return retval; } static int cr_save_file_header(cr_chkpt_req_t *req, struct file *filp) { int result; cr_errbuf_t *eb = req->errbuf; struct cr_context_file_header cf_fhead; result = 0; CR_KTRACE_LOW_LVL("Dumping file header"); cf_fhead.magic[0] = 'C'; cf_fhead.magic[1] = 'R'; cf_fhead.version = CR_CONTEXT_VERSION; cf_fhead.scope = req->checkpoint_scope; cf_fhead.arch_id = VMAD_ARCH; result = cr_kwrite(eb, filp, &cf_fhead, sizeof(cf_fhead)); if (result != sizeof(cf_fhead)) { CR_ERR_REQ(req, "file_header: write returned %d", result); goto out; } result = 0; out: return result; } static int cr_save_header(cr_chkpt_proc_req_t *proc_req, struct file *filp) { int result; struct cr_section_header cf_head; int thread_count = proc_req ? proc_req->thread_count : 0; cr_errbuf_t *eb = proc_req ? proc_req->req->errbuf : NULL; result = 0; CR_KTRACE_LOW_LVL("Dumping header for %d threads", thread_count); cf_head.num_threads = thread_count; /* If !proc_req, the rest are meaningless */ cf_head.clone_flags = CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND; cf_head.clone_flags |= CLONE_THREAD | CLONE_DETACHED; cf_head.tmp_fd = proc_req ? proc_req->tmp_fd : -1; result = cr_kwrite(eb, filp, &cf_head, sizeof(cf_head)); if (result != sizeof(cf_head)) { CR_ERR_PROC_REQ(proc_req, "proc_header: write returned %d", result); goto out; } result = 0; out: return result; } // Create a vmadump file static int cr_do_vmadump(cr_task_t *cr_task, int i_am_leader) { cr_chkpt_req_t *req = cr_task->chkpt_req; cr_chkpt_proc_req_t *proc_req = cr_task->chkpt_proc_req; struct file *filp = proc_req->file; int result=0; loff_t bytes; CR_NO_LOCKS(); /* First arrival grabs mutex and starts to work... later arrivals find the work is all done */ down(&proc_req->serial_mutex); /* Write out the header(s) */ if (!test_and_set_bit(0, &proc_req->done_header)) { /* Determine surviving thread count */ struct list_head *l; int count = 0; list_for_each(l, &proc_req->tasks) { ++count; } if (count != proc_req->thread_count) { CR_WARN_PROC_REQ(proc_req, "Adjusting thread count for tgid %d from %d to %d", current->tgid, proc_req->thread_count, count); proc_req->thread_count = count; } CR_KTRACE_HIGH_LVL("Preparing to dump %d threads of %s", count, current->comm); result = cr_save_header(proc_req, filp); if (result < 0) { goto out_early_mutex; } } /* Now dump out the task linkage */ if (!test_and_set_bit(0, &proc_req->done_linkage)) { CR_KTRACE_LOW_LVL("Writing the per-process linkage."); result = cr_save_linkage(proc_req, filp); if (result < 0) { goto out_early_mutex; } } up(&proc_req->serial_mutex); /* Now use vmadump to write out the state for the thread. ALL threads call this and serialization is done within */ CR_KTRACE_LOW_LVL("Writing vmadump."); CR_ASSERT_STEP_EQ(cr_task, CR_CHKPT_STEP_VMADUMP); result = 0; bytes = cr_freeze_threads(proc_req, req->flags, i_am_leader); if (bytes < 0) { result = (int)bytes; CR_ERR_PROC_REQ(proc_req, "cr_freeze_threads failed (%d)", result); CR_BARRIER_NOTIFY(cr_task, &proc_req->vmadump_barrier); goto out; } CR_KTRACE_LOW_LVL("thread finished vmadump"); /* Need a barrier here to ensure all threads write their regs before the next * write to the file. */ if (CR_BARRIER_ENTER(cr_task, &proc_req->vmadump_barrier)) { CR_KTRACE_LOW_LVL("process finished vmadump"); } down(&proc_req->serial_mutex); if (!test_and_set_bit(0, &proc_req->done_fs)) { /* dump fs_struct (cwd, umask, etc.) */ CR_KTRACE_HIGH_LVL("Writing the fs struct..."); result = cr_save_fs_struct(proc_req); if (result < 0) { goto out_mutex; } } if (!test_and_set_bit(0, &proc_req->done_mmaps_maps)) { CR_KTRACE_HIGH_LVL("Writing the mmap()s table (if any)..."); result = cr_save_mmaps_maps(proc_req); if (result < 0) { goto out_mutex; } } if (!test_and_set_bit(0, &proc_req->done_itimers)) { /* itimers */ CR_KTRACE_HIGH_LVL("Writing POSIX interval timers..."); result = cr_save_itimers(proc_req); if (result < 0) { goto out_mutex; } } /* Wait for all tasks in all procs to leave user space before saving files * (due to pipe bufs) and shared memory, to ensure shared state is not changing. * XXX: We could/should replace this barrier w/ one much later by moving the * save of shared state to the end of the context file, after all processes * have saved VMDump+files. * NOTE: This is a WAIT (as opposed to ENTER), so it doesn't matter if one or * many threads do this. So, it is inside the serial_mutex-protected critical * section for simplicity. */ CR_ASSERT_STEP_GT(cr_task, CR_CHKPT_STEP_PRESHARED); cr_barrier_wait(&req->preshared_barrier); if (!test_and_set_bit(0, &proc_req->done_mmaps_data)) { CR_KTRACE_HIGH_LVL("Writing mmap()ed pages (if any)..."); bytes = cr_save_mmaps_data(proc_req); if (bytes < 0) { result = (int)bytes; goto out_mutex; } } if (!test_and_set_bit(0, &proc_req->done_files)) { /* dump the open files */ CR_KTRACE_HIGH_LVL("Writing the open file section..."); result = cr_save_all_files(proc_req); if (result < 0) { goto out_mutex; } } result = 0; // XXX out_mutex: up(&proc_req->serial_mutex); out: return result; out_early_mutex: CR_BARRIER_NOTIFY(cr_task, &proc_req->vmadump_barrier); goto out_mutex; } // Dump out to the given file // // XXX: When we define an options struct, it will need to be passed in too /* * XXX: Might want to change this a little (lot) when we support multiple * context files. Could be a separate format for directory set, etc. i.e. * cr_format_contextfile, cr_format_contextdir? */ static int cr_do_dump(int dump_format, cr_task_t *cr_task, int i_am_leader) { int result = -EINVAL; switch(dump_format) { case cr_format_vmadump: result = cr_do_vmadump(cr_task, i_am_leader); break; default: CR_ERR_PROC_REQ(cr_task->chkpt_proc_req, "unrecognized dump_format '%d'", dump_format); break; } return result; } /* * Public functions */ /** * cr_dump_self - dump 'current' * @filp: The file on which the request was received. * @flag: Flags to modify behavior. * * DESCRIPTION: * Dumps the current process to a file descriptor supplied by the * requester. * * This is the function that the handlers will call into when * the CHECKPOINT portion of callbacks are finished. * * Currently the 'flags' argument is unused. */ int cr_dump_self(struct file *filp, unsigned long flags) { cr_chkpt_proc_req_t *proc_req; struct file *dest_filp; cr_chkpt_req_t *req; cr_task_t *cr_task; sigset_t sig_blocked; int shared; int omit = 0; int result = 0; int once; CR_KTRACE_FUNC_ENTRY("flags=0x%lx", flags); // Lookup this task cr_task = cr_task_get(current); if (!cr_task) { // No matching task found. return -ESRCH; } // Find the matching request if (!(req = cr_task->chkpt_req) || !(proc_req = cr_task->chkpt_proc_req)) { // No matching request found. cr_task_put(cr_task); return -ESRCH; } cr_task->chkpt_flags = flags; // Ensure shared state save can start as soon as all tasks reach kernel space CR_ASSERT_STEP_EQ(cr_task, CR_CHKPT_STEP_PRESHARED); CR_BARRIER_NOTIFY(cr_task, &req->preshared_barrier); once = cr_barrier_test(&req->preshared_barrier); // If the handlers have all responded, then we should not "expire". // So exactly one task zeros req->has_expiration. if (req->has_expiration && once) { write_lock(&req->lock); req->has_expiration = 0; write_unlock(&req->lock); } // XXX: Once we define the options structure, this is the place // to merge the per-process options (attached to 'filp'?) and the // options passed by the requester. // Find the destination dest_filp = cr_loc_get(&req->dest, &shared); if (IS_ERR(dest_filp)) { return PTR_ERR(dest_filp); } // Before we go off and block on any barriers, block all but SIGKILL. // NOTE: this even blocks SIGSTOP! // The previous mask is saved in sig_blocked. siginitsetinv(&sig_blocked, sigmask(SIGKILL)); sigprocmask(SIG_SETMASK, &sig_blocked, &sig_blocked); // Ensure that exactly one caller (over all procs) writes the file header down(&req->serial_mutex); read_lock(&req->lock); if ((omit = proc_req->omit) || (result = req->result)) { goto cleanup_locked_and_down; } read_unlock(&req->lock); if (!test_and_set_bit(0, &req->done_header)) { result = cr_save_file_header(req, dest_filp); if (result < 0) { req->result = result; } /* result is checked after phase barrier */ } up(&req->serial_mutex); // If we have a Phase1 then start Phase2 when complete. cr_signal_phase_barrier(cr_task, /* block= */1, /* need_lock= */1); /* Check to see if error/abort has occurred */ read_lock(&req->lock); if (result || (omit = proc_req->omit) || (result = req->result)) { goto cleanup_locked; } read_unlock(&req->lock); // Synchronize to ensure all tasks in the current process have stopped running. once = cr_signal_predump_barrier(cr_task, /* block= */ 1); if (once < 0) { goto cleanup_unlocked; } /* check again for abort/error */ read_lock(&req->lock); if (result || (omit = proc_req->omit) || (result = req->result)) { goto cleanup_locked; } read_unlock(&req->lock); // One task pauses the itimers if (once) { cr_pause_itimers(proc_req->itimers); // vmadump_barrier ensures this is written before reading } // Ensure that exactly one caller (per procs) performs the init down(&proc_req->serial_mutex); if (!test_and_set_bit(0, &proc_req->done_init)) { proc_req->file = dest_filp; /* Acquire dest mutex (if any) on behalf of this process */ if (shared) { down(&req->dest.mutex); } } up(&proc_req->serial_mutex); // Send the dump to the proper destination filp. { // Distinguish a single thread group leader (no race here) */ int i_am_leader = (thread_group_leader(current) && !test_and_set_bit(0, &proc_req->have_leader)); result = cr_do_dump(req->dump_format, cr_task, i_am_leader); // If we experienced an error for the first time then // save it in the request so the requester will learn of it. if (result && !req->result) { req->result = result; } } // Release dest mutex (if any) exactly once // NOTE: assumes ALL writes complete before ANY return from cr_do_dump(). if (!test_and_set_bit(0, &proc_req->done_fini) && shared) { up(&req->dest.mutex); } // Synchronize to ensure all tasks have saved before we continue CR_ASSERT_STEP_EQ(cr_task, CR_CHKPT_STEP_POSTDUMP); result = CR_BARRIER_ENTER_INTERRUPTIBLE(cr_task, &req->postdump_barrier); // Ensure that exactly one caller (across all processes) writes the file trailer down(&req->serial_mutex); if (result < 0) { // Check postdump_barrier result req->result = result; } else if (!test_and_set_bit(0, &req->done_trailer)) { CR_KTRACE_LOW_LVL("Writing the trailer."); result = cr_save_header(NULL, dest_filp); if (result < 0) { req->result = result; } } result = req->result; up(&req->serial_mutex); if (result) { goto out; } // One task resumes the itimers (and "early" signal) if (!test_and_set_bit(0, &proc_req->done_resume_itimers)) { cr_resume_itimers(proc_req->itimers); if (req->signal < 0) { cr_kill_process(current, -(req->signal)); } } out: atomic_inc(&req->completed); cr_loc_put(&req->dest, dest_filp); if (req->die || result || (flags & _CR_CHECKPOINT_STUB)) { // this task will not call the HAND_DONE ioctl, so finish up now. cr_chkpt_task_complete(cr_task, 1); } out_omit: // Restore saved signal mask sigprocmask(SIG_SETMASK, &sig_blocked, NULL); // Release the task, balancing the cr_task_get() above. cr_task_put(cr_task); CR_KTRACE_HIGH_LVL("Kernel-level checkpoint completed."); CR_KTRACE_FUNC_EXIT("Returning %d", result); return result; //-------------------- cleanup_locked_and_down: up(&req->serial_mutex); cleanup_locked: read_unlock(&req->lock); cleanup_unlocked: if (omit) { cr_loc_put(&req->dest, dest_filp); // BEFORE abort releases req cr_chkpt_abort(cr_task, CR_CHECKPOINT_OMIT); result = -CR_EOMITTED; goto out_omit; } cr_chkpt_advance_to(cr_task, CR_CHKPT_STEP_PRE_COMPLETE, 0); CR_ASSERT_STEP_GT(cr_task, CR_CHKPT_STEP_POSTDUMP); cr_barrier_wait_interruptible(&req->postdump_barrier); goto out; } blcr-0.8.5/cr_module/Makefile.in0000664000000000000000000004543012102070007013350 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ 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 = cr_module DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/blcr_config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-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 uninstall-recursive RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir 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@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CONFIGURE_ARGS = @CONFIGURE_ARGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CR_ARCH = @CR_ARCH@ CR_CLIENT_LDADD = @CR_CLIENT_LDADD@ CR_CPU = @CR_CPU@ CR_FTB_INCLUDES = @CR_FTB_INCLUDES@ CR_FTB_LDADD = @CR_FTB_LDADD@ CR_FTB_LDFLAGS = @CR_FTB_LDFLAGS@ CR_KARCH = @CR_KARCH@ CR_KERNEL = @CR_KERNEL@ CR_KERNEL_BASE = @CR_KERNEL_BASE@ CR_LIBARCH = @CR_LIBARCH@ CR_LIBCR_CFLAGS = @CR_LIBCR_CFLAGS@ CR_MODULE_DIR = @CR_MODULE_DIR@ CR_MODULE_MAJOR = @CR_MODULE_MAJOR@ CR_MODULE_MINOR = @CR_MODULE_MINOR@ CR_MODULE_PATCH = @CR_MODULE_PATCH@ CR_MODULE_VERSION = @CR_MODULE_VERSION@ CR_NDEBUG = @CR_NDEBUG@ CR_RELEASE_MAJOR = @CR_RELEASE_MAJOR@ CR_RELEASE_MINOR = @CR_RELEASE_MINOR@ CR_RELEASE_PATCH = @CR_RELEASE_PATCH@ CR_RELEASE_VERSION = @CR_RELEASE_VERSION@ CR_SIGNUM = @CR_SIGNUM@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GMAKE_ELSE = @GMAKE_ELSE@ GMAKE_ENDIF = @GMAKE_ENDIF@ GMAKE_IFEQ = @GMAKE_IFEQ@ GMAKE_IFNEQ = @GMAKE_IFNEQ@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KBUILD_MAK = @KBUILD_MAK@ KBUILD_MAKE_ARGS = @KBUILD_MAKE_ARGS@ KCC = @KCC@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBCR_MAJOR = @LIBCR_MAJOR@ LIBCR_MINOR = @LIBCR_MINOR@ LIBCR_PATCH = @LIBCR_PATCH@ LIBCR_VERSION = @LIBCR_VERSION@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_AGE = @LIBTOOL_AGE@ LIBTOOL_INTERFACE = @LIBTOOL_INTERFACE@ LIBTOOL_REVISION = @LIBTOOL_REVISION@ LINUX_OBJ = @LINUX_OBJ@ LINUX_SRC = @LINUX_SRC@ LINUX_SYMTAB_CMD = @LINUX_SYMTAB_CMD@ LINUX_SYMTAB_CONF = @LINUX_SYMTAB_CONF@ LINUX_SYMTAB_FILE = @LINUX_SYMTAB_FILE@ LINUX_VER = @LINUX_VER@ LINUX_VERSION_H = @LINUX_VERSION_H@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKE = @MAKE@ MAKEINFO = @MAKEINFO@ 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_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PWD_PROG = @PWD_PROG@ RANLIB = @RANLIB@ RPMBUILD = @RPMBUILD@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TOP_BUILDDIR = @TOP_BUILDDIR@ TOP_SRCDIR = @TOP_SRCDIR@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ 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@ lt_ECHO = @lt_ECHO@ 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@ # Needed by kbuild glue my_sources = \ cr_async.c \ cr_barrier.c \ cr_chkpt_req.c \ cr_dest_file.c \ cr_dump_self.c \ cr_fops.c \ cr_io.c \ cr_module.c \ cr_proc.c \ cr_rstrt_req.c \ cr_sync.c \ cr_task.c \ cr_trigger.c \ cr_module.h \ cr_kcompat.h \ cr_barrier.h \ cr_ktrace.h \ cr_ktrace.c \ cr_objects.c \ cr_context.h \ cr_compat.c \ cr_mmaps.c \ cr_vmadump.c \ cr_timers.c \ cr_pipes.c \ cr_creds.c \ cr_relocate.c \ cr_watchdog.c BPROC_VERSION = "4.0.0pre8" vmadump_dir = $(top_srcdir)/vmadump4 vmad_sources = $(vmadump_dir)/vmadump_common.c $(vmadump_dir)/vmadump_@CR_KARCH@.c vmad_include = -I$(vmadump_dir) -D__NR_vmadump=-1 -DBPROC_VERSION='$(BPROC_VERSION)' cr_sources = $(my_sources) $(vmad_sources) INCLUDES = -I$(top_builddir)/include \ -I$(top_srcdir)/include \ -I$(srcdir)/arch/@CR_KARCH@ \ $(vmad_include) EXTRA_DIST = arch license.txt $(my_sources) SUBDIRS = kbuild . 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 cr_module/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign cr_module/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. $(RECURSIVE_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; 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" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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 CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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" 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 \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 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: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-generic clean-libtool \ ctags ctags-recursive 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-recursive \ uninstall uninstall-am # echo an arbitrary make/environment variable (needed by kbuild glue) echoval: @echo $($(VARNAME)) | sed 's/"/\\"/'g .PHONY: echoval # 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: blcr-0.8.5/cr_module/cr_dest_file.c0000664000000000000000000001467512064133245014113 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2008, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * 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 * * $Id: cr_dest_file.c,v 1.27.8.2 2012/12/18 18:32:05 phargrov Exp $ */ #include "cr_module.h" #define CR_FILE_PATT "context.%d" #define CR_FILE_MAX 32 // XXX: better size? #define CR_FILE_MODE 0400 // XXX: need comment here // Note: we fput if appropriate. // // XXX: Are these checks sufficient/correct? // // XXX: These need to return good error codes! static int validate_file(struct file *file, int is_write) { int retval = -EINVAL; struct dentry *dentry; struct inode *inode; if (file == NULL) { retval = -EBADF; // Fall through to failure } else if (IS_ERR(file)) { retval = PTR_ERR(file); // Fall through to failure } else { dentry = file->f_dentry; inode = dentry->d_inode; if (inode->i_nlink > 1) { retval = -EMLINK; // Don't dump to a file w/ multiple links // Fall through to failure } else if (d_unhashed(dentry)) { // Fail due to NFS or autofs timeouts. // Fall through to failure } else if (!S_ISREG(inode->i_mode) && !S_ISCHR(inode->i_mode) && !S_ISSOCK(inode->i_mode) && !S_ISFIFO(inode->i_mode)) { // Fall through to failure } else if(!(file->f_mode & (is_write ? FMODE_WRITE : FMODE_READ))) { retval = -EBADF; // Fail because there is no write/read permission // Fall through to failure } else { // SUCCESS: return 0; } // Only failure exits here fput(file); } // Only failure exits here return retval; } // XXX: need comment here static int do_init_reg(cr_location_t *loc, struct file *filp) { int result; result = validate_file(filp, loc->is_write); if (!result) { loc->filp = filp; init_MUTEX(&loc->mutex); } return result; } // XXX: need comment here // XXX: currently only check perms to create here. // XXX: other checks needed? static int do_init_dir(cr_location_t *loc, struct file *dirp) { int result = 0; result = cr_permission(dirp->f_dentry->d_inode, (loc->is_write ? MAY_WRITE : MAY_READ) | MAY_EXEC | MAY_CHDIR); if (!result) { loc->fs = copy_fs_struct(current->fs); if (loc->fs) { // replace the pwd with that of 'dirp' cr_set_pwd_file(loc->fs, dirp); } else { result = -EINVAL; } } // Error and normal paths exit here fput(dirp); // We don't hold the filp for a directory return result; } // cr_loc_init(loc, fd, from) // // Validate and record data about the requested destination of a checkpoint // // Returns 0 on success, negative error code on failure. // // XXX: need to document return cases? // XXX: need to be sure we make all the right checks. int cr_loc_init(cr_errbuf_t *eb, cr_location_t *loc, int fd, struct file *from, int is_write) { struct file *filp; memset(loc, 0, sizeof(*loc)); loc->is_write = is_write; if (fd != CR_DEST_CWD) { filp = fget(fd); } else { // XXX: do we want to shortcut and just copy current->fs? filp = filp_open(".", O_RDONLY|O_NDELAY|O_DIRECTORY, 0); } if (!filp) { CR_ERR_EB(eb, "invalid file descriptor %d received", fd); return -EINVAL; } else if (IS_ERR(filp)) { return PTR_ERR(filp); } else if (filp == from) { CR_ERR_EB(eb, "file descriptor %d is the ctrl descriptor", fd); fput(filp); return -EINVAL; } switch (filp->f_dentry->d_inode->i_mode & S_IFMT) { case S_IFREG: case S_IFCHR: case S_IFIFO: case S_IFSOCK: CR_KTRACE_LOW_LVL("Calling do_init_reg on fd %d", fd); return do_init_reg(loc, filp); break; case S_IFDIR: return do_init_dir(loc, filp); break; case S_IFBLK: // We don't deal with this case yet: // fall through... default: CR_ERR_EB(eb, "unsupported file type"); fput(filp); return -EINVAL; } } // cr_loc_free(loc) // // Free the checkpoint destination, decrementing use counts as appropriate. void cr_loc_free(cr_location_t *loc) { // For file/socket, etc.: if (loc->filp) { fput(loc->filp); } // For directory: if (loc->fs) { cr_free_fs_struct(loc->fs); } } // cr_loc_get(loc, shared) // // Returns the filp to write to. // Sets 'shared' to indicate if the file is shared with other threads. // If so, then the caller is responsible for any synchronization. // The loc->mutex field is provided for this purpose. // struct file *cr_loc_get(cr_location_t *loc, int *shared) { struct file *filp = NULL; if (loc->filp) { // Destination is a "regular" file. // Just return the filp. We don't need to fget() // because the fget() done in cr_loc_init is sufficient. filp = loc->filp; if (shared) { *shared = 1; } } else if (loc->fs) { // Destination is a per-process file in a given directory. struct fs_struct *saved_fs; char filename[CR_FILE_MAX]; int error; // Create a filename sprintf(filename, CR_FILE_PATT, current->pid); // Play with current->fs to open() in the destination dir saved_fs = current->fs; current->fs = loc->fs; filp = filp_open(filename, O_NOFOLLOW | (loc->is_write ? (O_WRONLY | O_CREAT | O_TRUNC) : O_RDONLY), CR_FILE_MODE); current->fs = saved_fs; error = validate_file(filp, loc->is_write); if (error) { filp = ERR_PTR(error); } if (shared) { *shared = 0; } } return filp; } // cr_loc_put() // // Put the filp written to. // This is always paired with cr_loc_get() calls. // void cr_loc_put(cr_location_t *loc, struct file *filp) { if (loc->filp) { // Dest is a "regular" file. DO NOTHING } else if (loc->fs && filp) { // Dest is a directory. Release the temporary filp. fput(filp); } } blcr-0.8.5/cr_module/cr_timers.c0000664000000000000000000000506111052401301013430 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2007, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * 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 * * $Id: cr_timers.c,v 1.7 2008/08/18 23:16:17 phargrov Exp $ */ #include "cr_module.h" #include void cr_pause_itimers(struct itimerval *itimers) { static struct itimerval cr_zero_itimer = { it_interval: { tv_sec: 0, tv_usec: 0}, it_value: { tv_sec: 0, tv_usec: 0}, }; mm_segment_t oldfs = get_fs(); set_fs(KERNEL_DS); (void)sys_setitimer(ITIMER_REAL, &cr_zero_itimer, itimers+0); (void)sys_setitimer(ITIMER_VIRTUAL, &cr_zero_itimer, itimers+1); (void)sys_setitimer(ITIMER_PROF, &cr_zero_itimer, itimers+2); set_fs(oldfs); } void cr_resume_itimers(struct itimerval *itimers) { mm_segment_t oldfs = get_fs(); set_fs(KERNEL_DS); (void)sys_setitimer(ITIMER_REAL, itimers+0, NULL); (void)sys_setitimer(ITIMER_VIRTUAL, itimers+1, NULL); (void)sys_setitimer(ITIMER_PROF, itimers+2, NULL); set_fs(oldfs); } long cr_load_itimers(cr_rstrt_proc_req_t *proc_req) { cr_errbuf_t *eb = proc_req->req->errbuf; long retval = cr_kread(eb, proc_req->file, &proc_req->itimers, sizeof(proc_req->itimers)); if (retval != sizeof(proc_req->itimers)) { CR_ERR_PROC_REQ(proc_req, "itimers: read returned %ld", retval); } return retval; } long cr_save_itimers(cr_chkpt_proc_req_t *proc_req) { cr_errbuf_t *eb = proc_req->req->errbuf; long retval = cr_kwrite(eb, proc_req->file, &proc_req->itimers, sizeof(proc_req->itimers)); if (retval != sizeof(proc_req->itimers)) { CR_ERR_PROC_REQ(proc_req, "itimers: write returned %ld", retval); } return retval; } blcr-0.8.5/cr_module/cr_rstrt_req.c0000664000000000000000000024464012066216440014200 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2008, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * 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 * * $Id: cr_rstrt_req.c,v 1.393.4.16 2012/12/25 03:27:28 phargrov Exp $ */ #include "cr_module.h" #include #include #include #include #include #if HAVE_LINUX_AUDIT_H #include #endif #include #include "cr_context.h" #include "vmadump.h" #ifndef PID_MAX /* XXX: Is this always true? */ #define PID_MAX 0x8000 #endif typedef struct cr_linkage_s { struct list_head list; struct cr_context_tasklinkage link; struct task_struct *tl_task; cr_task_t *cr_task; int reserved; } cr_linkage_entry_t; static cr_kmem_cache_ptr cr_linkage_cachep = NULL; #define CR_RESTORE_PIDS_MASK (CR_RSTRT_RESTORE_PID | CR_RSTRT_RESTORE_PGID | CR_RSTRT_RESTORE_SID) static void cr_release_ids(struct list_head *list_p); static int cr_restore_linkage(cr_rstrt_req_t *req); static void rstrt_watchdog(cr_work_t *work); /* * alloc_rstrt_request */ static cr_rstrt_req_t * alloc_rstrt_req(void) { static struct lock_class_key lock_key; cr_rstrt_req_t *req = NULL; cr_objectmap_t map; if (!CR_MODULE_GET()) { CR_ERR("Restart request after rmmod!"); req = ERR_PTR(-EINVAL); goto out_rmmod; } map = cr_alloc_objectmap(); if (!map) { goto out_modput; } CR_NO_LOCKS(); req = cr_kmem_cache_zalloc(*req, cr_rstrt_req_cachep, GFP_KERNEL); if (req) { CR_KTRACE_ALLOC("Alloc cr_rstrt_req_t %p", req); atomic_set(&req->ref_count, 1); req->requester = current->tgid; get_task_struct(current); req->cr_restart_task = current; req->state = CR_RSTRT_STATE_REQUESTER; init_waitqueue_head(&req->wait); cr_barrier_init(&req->barrier, 1); req->result = 0; req->die = 0; req->map = map; rwlock_init(&req->lock); lockdep_set_class(&req->lock, &lock_key); INIT_LIST_HEAD(&req->tasks); INIT_LIST_HEAD(&req->procs); INIT_LIST_HEAD(&req->linkage); CR_INIT_WORK(&req->work, &rstrt_watchdog); req->errbuf = cr_errbuf_alloc(); { struct files_struct *files = current->files; cr_fdtable_t *fdt; struct file *tmp; #if !HAVE_STRUCT_FDTABLE spin_lock(&files->file_lock); #endif rcu_read_lock(); fdt = cr_fdtable(files); /* Dup stdin, unless marked CLOEXEC */ tmp = fcheck_files(files, 0); if (tmp && !cr_read_close_on_exec(0, fdt)) { req->dpipe_in = tmp; get_file(tmp); } /* Dup stdout, unless marked CLOEXEC */ tmp = fcheck_files(files, 1); if (tmp && !cr_read_close_on_exec(1, fdt)) { req->dpipe_out = tmp; get_file(tmp); } rcu_read_unlock(); #if !HAVE_STRUCT_FDTABLE spin_unlock(&files->file_lock); #endif } } else { goto out_freemap; } return req; out_freemap: cr_release_objectmap(map); out_modput: CR_MODULE_PUT(); out_rmmod: return req; } static void release_rstrt_req(cr_rstrt_req_t *req) { CR_KTRACE_REFCNT("ref count is approximately %d", atomic_read(&req->ref_count)); CRI_ASSERT(atomic_read(&req->ref_count)); if (atomic_dec_and_test(&req->ref_count)) { cr_rstrt_proc_req_t *proc_req, *next; list_for_each_entry_safe(proc_req, next, &req->procs, list) { cr_release_ids(&proc_req->linkage); if (proc_req->mmaps_tbl) { vfree(proc_req->mmaps_tbl); } #if CRI_DEBUG if (proc_req->tmp_fd >= 0) { CR_ERR("Leaking tmp_fd"); } #endif kmem_cache_free(cr_rstrt_proc_req_cachep, proc_req); } cr_release_ids(&req->linkage); CR_KTRACE_REFCNT("Releasing source file"); cr_loc_put(&req->src, req->file0); cr_loc_free(&req->src); CR_KTRACE_REFCNT("fput()'ing stdin/out"); if (req->dpipe_in) fput(req->dpipe_in); if (req->dpipe_out) fput(req->dpipe_out); CR_KTRACE_REFCNT("put_task_struct(cr_restart_task)"); put_task_struct(req->cr_restart_task); cr_release_objectmap(req->map); cr_free_reloc(req->relocate); cr_errbuf_free(req->errbuf); kmem_cache_free(cr_rstrt_req_cachep, req); CR_MODULE_PUT(); CR_KTRACE_ALLOC("Free cr_rstrt_req_t %p", req); } } /* * cr_load_linkage * * Loads the linkage structure stored in the context file into a new * linked list of elements, returns linkage count (or error) * * This linkage structure is used by cr_restore_linkage() to set pid, * tgid, pgid and sid; and to reconstruct the graph of processes, */ static int cr_load_linkage(cr_rstrt_proc_req_t *proc_req) { struct list_head *list_p = &proc_req->linkage; cr_errbuf_t *eb = proc_req->req->errbuf; struct file *filp = proc_req->file; struct cr_context_tasklinkage *linkage; int linkage_bytes; /* size of linkage stored on disk */ int linkage_size; /* number of entries in array */ int retval; int i; /* find out how large the linkage structure is */ retval = cr_kread(eb, filp, &linkage_bytes, sizeof(linkage_bytes)); if (retval < sizeof(linkage_bytes)) { CR_ERR_PROC_REQ(proc_req, "linkage: read size returned %d", retval); goto out; } /* allocate memory for the linkage structure */ CR_NO_LOCKS(); linkage = NULL; linkage_size = 0; if (linkage_bytes < CR_KMALLOC_MAX) { linkage = kmalloc(linkage_bytes, GFP_KERNEL); linkage_size = linkage_bytes/sizeof(*linkage); } if (linkage == NULL || linkage_size == 0) { CR_ERR_PROC_REQ(proc_req, "Too many processes (size = %d)", linkage_bytes); retval = -ENOMEM; goto out; } /* Now load the linkage from disk */ retval = cr_kread(eb, filp, linkage, linkage_bytes); if (retval < linkage_bytes) { CR_ERR_PROC_REQ(proc_req, "linkage: read table returned %d", retval); goto out_free; } /* Build linked list */ retval = -ENOMEM; for (i=0; ilink = linkage[i]; #if 0 /* Redundant since we now use cr_kmem_cache_zalloc() */ entry->tl_task = NULL; /* NOTE: needed to check for missing tasks in cr restore linkage */ entry->cr_task = NULL; entry->reserved = 0; #endif list_add_tail(&entry->list, list_p); #if CRI_DEBUG /* Reverse the list to trigger any bugs related to pid_link() */ list_move(&entry->list, list_p); #endif } retval = linkage_size; out_free: kfree(linkage); out: return retval; } /* * cr_linkage_find_real_parent * * Figure out who your parent process ought to be. * * As a "Safety net" we default to becoming a child of the * cr_restart process if the original parent is not found. */ struct task_struct * cr_linkage_find_real_parent(cr_rstrt_req_t *req, struct task_struct *old_parent) { struct task_struct *parent = NULL; if (!cr_find_object(req->map, old_parent, (void **) &parent)) { /* No entry for this process, we'll reattatch it as a new child * of cr_restart. */ parent = req->cr_restart_task; } return parent; } /* Code based heavily on kernel/pid.c */ #include #define BITS_PER_PAGE (8*PAGE_SIZE) #define BITS_PER_PAGE_MASK (BITS_PER_PAGE-1) #if defined(CR_KDATA_pidmap_array) #define cr_pidmap(nr) &(pidmap_array[(nr) / BITS_PER_PAGE]) #define cr_pidmap_alloc() ((void *)get_zeroed_page(GFP_KERNEL)) #define cr_pidmap_free(_p) free_page((unsigned long)(_p)) #elif defined(CR_KDATA_init_pspace) || defined(CR_KDATA_init_pid_ns) #define cr_pidmap(nr) &(cr_init_pid_ns.pidmap[(nr) / BITS_PER_PAGE]) #define cr_pidmap_alloc() kzalloc(PAGE_SIZE, GFP_KERNEL) #define cr_pidmap_free(_p) kfree(_p) #else #error "Can't locate pidmap pages" #endif static inline void _cr_free_pid(int nr) /* Call w/ tasklist_lock held for writing */ { #if HAVE_ALLOC_PID CRI_ASSERT(nr); free_pid(cr_find_pid(nr)); #else struct pidmap *map = cr_pidmap(nr); int offset = nr & BITS_PER_PAGE_MASK; CRI_ASSERT(nr); clear_bit(offset, map->page); atomic_inc(&map->nr_free); #endif } #if !defined(CR_KDATA_pidmap_lock) /* Not SMP. Define here to allow same code to compile on SMP and UP */ static CR_DEFINE_SPINLOCK(pidmap_lock); #endif static int _cr_alloc_pid(int nr) /* MUST call with no locks held */ { struct pidmap *map; int offset = (nr & BITS_PER_PAGE_MASK); int result = 0; /* assume failure */ CR_NO_LOCKS(); if ((nr <= 0) || (nr >= PID_MAX_LIMIT)) { CR_ERR("Invalid pid %d", nr); return 0; } /* make sure we have a page */ map = cr_pidmap(nr); if (unlikely(map->page == NULL)) { void *page = cr_pidmap_alloc(); spin_lock_irq(&pidmap_lock); if (map->page) { /* lost a race, free our page */ cr_pidmap_free(page); } else { map->page = page; } spin_unlock_irq(&pidmap_lock); } /* XXX assert (map->page != NULL) */ if (!test_and_set_bit(offset, map->page)) { #if HAVE_ALLOC_PID struct pid *pid; rcu_read_lock(); pid = cr_find_pid(nr); rcu_read_unlock(); if (!pid) { #if HAVE_0_ARG_ALLOC_PID #define pid_hashfn(nr) hash_long((unsigned long)nr, pidhash_shift) enum pid_type type; pid = kmem_cache_alloc(pid_cachep, GFP_KERNEL); if (!pid) { clear_bit(offset, map->page); goto out; } atomic_set(&pid->count, 1); pid->nr = nr; for (type = 0; type < PIDTYPE_MAX; ++type) { INIT_HLIST_HEAD(&pid->tasks[type]); } spin_lock_irq(&pidmap_lock); hlist_add_head_rcu(&pid->pid_chain, &pid_hash[pid_hashfn(nr)]); spin_unlock_irq(&pidmap_lock); #elif HAVE_1_ARG_ALLOC_PID // XXX: Need multi-level support #define pid_hashfn(nr,ns) hash_long((unsigned long)nr + (unsigned long)ns, pidhash_shift) enum pid_type type; struct upid *upid; pid = kmem_cache_alloc(init_pid_ns.pid_cachep, GFP_KERNEL); if (!pid) { clear_bit(offset, map->page); goto out; } pid->numbers[0].nr = nr; pid->numbers[0].ns = &init_pid_ns; pid->level = init_pid_ns.level; atomic_set(&pid->count, 1); for (type = 0; type < PIDTYPE_MAX; ++type) { INIT_HLIST_HEAD(&pid->tasks[type]); } spin_lock_irq(&pidmap_lock); upid = &pid->numbers[0]; hlist_add_head_rcu(&upid->pid_chain, &pid_hash[pid_hashfn(upid->nr, upid->ns)]); spin_unlock_irq(&pidmap_lock); #endif } #endif atomic_dec(&map->nr_free); CRI_ASSERT(!cr_have_pid(PIDTYPE_PID, nr)); CRI_ASSERT(!cr_have_pid(PIDTYPE_PGID, nr)); CRI_ASSERT(!cr_have_pid(PIDTYPE_SID, nr)); result = 1; } #if HAVE_ALLOC_PID out: #endif return result; } /* Checks if any of the ids in 'entry' requested by 'mask' are * already registered by 'other'. * Returns modified 'mask' with bits cleared for any matches. */ static int cr_match_ids(const cr_linkage_entry_t *entry, const cr_linkage_entry_t *other, int mask) { int reserved = other->reserved; if (mask & CR_RSTRT_RESTORE_PID) { int id = entry->link.pid; if (((reserved & CR_RSTRT_RESTORE_PGID) && (id == entry->link.pgrp)) || ((reserved & CR_RSTRT_RESTORE_SID) && (id == entry->link.session))) { mask &= ~CR_RSTRT_RESTORE_PID; } } if (mask & CR_RSTRT_RESTORE_PGID) { int id = entry->link.pgrp; if (((reserved & CR_RSTRT_RESTORE_PID) && (id == entry->link.pid)) || ((reserved & CR_RSTRT_RESTORE_PGID) && (id == entry->link.pgrp)) || ((reserved & CR_RSTRT_RESTORE_SID) && (id == entry->link.session))) { mask &= ~CR_RSTRT_RESTORE_PGID; } } if (mask & CR_RSTRT_RESTORE_SID) { int id = entry->link.session; if (((reserved & CR_RSTRT_RESTORE_PID) && (id == entry->link.pid)) || ((reserved & CR_RSTRT_RESTORE_PGID) && (id == entry->link.pgrp)) || ((reserved & CR_RSTRT_RESTORE_SID) && (id == entry->link.session))) { mask &= ~CR_RSTRT_RESTORE_SID; } } return mask; } /* Reserve all the pids we need * Returns non-zero on failure */ static int cr_reserve_ids(cr_rstrt_proc_req_t *proc_req) { struct list_head *list_p = &proc_req->linkage; cr_rstrt_req_t *req = proc_req->req; cr_linkage_entry_t *entry, *next; int pid_flags = req->flags & CR_RESTORE_PIDS_MASK; int retval = 0; CR_KTRACE_HIGH_LVL("Now reserving required ids... "); /* Don't need to worry about session IDs, since exactly one member * of the session, the leader, will have a matching PID. (When that * leader exits the entire session dies). * XXX: verify that and simplify the code if needed */ #if CRI_DEBUG /* This otherwise pointless code ensures that a debug build * will exercise the _cr_free_pid() code that is otherwise * almost never reached. */ entry = list_entry(list_p->next, cr_linkage_entry_t, list); if (_cr_alloc_pid(entry->link.pid)) { _cr_free_pid(entry->link.pid); } #endif list_for_each_entry_safe(entry, next, list_p, list) { int mask = pid_flags; cr_linkage_entry_t *other, *next2; /* Only thread group leaders can change pgrp or session */ if (entry->link.pid != entry->link.tgid) { mask &= CR_RSTRT_RESTORE_PID; if (!mask) continue; } /* First try to allocated each needed identifier */ CRI_ASSERT(entry->reserved == 0); if ((mask & CR_RSTRT_RESTORE_PID) && _cr_alloc_pid(entry->link.pid)) { entry->reserved |= CR_RSTRT_RESTORE_PID; } if ((mask & CR_RSTRT_RESTORE_PGID) && _cr_alloc_pid(entry->link.pgrp)) { entry->reserved |= CR_RSTRT_RESTORE_PGID; } if ((mask & CR_RSTRT_RESTORE_SID) && _cr_alloc_pid(entry->link.session)) { entry->reserved |= CR_RSTRT_RESTORE_SID; } mask &= ~entry->reserved; if (!mask) continue; /* Next see of the needed ids have been allocated by an earlier thread of this * process or by our own self (e.g. process group leaders have pid == pgid) */ list_for_each_entry_safe(other, next2, &proc_req->linkage, list) { int tmp = cr_match_ids(entry, other, mask); if (tmp != mask) { // Move to head on assumption of "clustered" searches list_move(&other->list, &proc_req->linkage); } mask = tmp; if (!mask) goto done; if (other == entry) break; // No need to search past self } /* Finally check the rest of the req * XXX: This is not "safe" until we ensure list_splice + search are atomic, * but restores are currently serialized anyway. */ list_for_each_entry_safe(other, next2, &req->linkage, list) { int tmp = cr_match_ids(entry, other, mask); if (tmp != mask) { // Move to head on assumption of "clustered" searches list_move(&other->list, &req->linkage); } mask = tmp; if (!mask) goto done; } if (mask) { if (mask & CR_RSTRT_RESTORE_PID) { CR_ERR_PROC_REQ(proc_req, "found pid %d in use", entry->link.pid); } if (mask & CR_RSTRT_RESTORE_PGID) { CR_ERR_PROC_REQ(proc_req, "found pgrp %d in use", entry->link.pgrp); } if (mask & CR_RSTRT_RESTORE_SID) { CR_ERR_PROC_REQ(proc_req, "found session %d in use", entry->link.session); } retval = -EBUSY; /* continue looping to log all conflicts... */ } done: (void)0; // Because gcc may complain about label at end of a loop } return retval; } static void cr_release_ids(struct list_head *list_p) { cr_linkage_entry_t *entry, *next; write_lock_irq(&tasklist_lock); list_for_each_entry(entry, list_p, list) { int mask = entry->reserved; entry->reserved = 0; if (mask & CR_RSTRT_RESTORE_PID) { _cr_free_pid(entry->link.pid); } if (mask & CR_RSTRT_RESTORE_PGID) { _cr_free_pid(entry->link.pgrp); } if (mask & CR_RSTRT_RESTORE_SID) { _cr_free_pid(entry->link.session); } } write_unlock_irq(&tasklist_lock); /* Free the list in a second pass, w/o the tasklist_lock held */ list_for_each_entry_safe(entry, next, list_p, list) { kmem_cache_free(cr_linkage_cachep, entry); } INIT_LIST_HEAD(list_p); } static int do_rstrt_request_restart(struct file *filp, struct cr_rstrt_args *ureq, int (*reloc_reader)(cr_rstrt_req_t *, void __user *)) { struct cr_context_file_header cf_header; cr_pdata_t *priv; cr_rstrt_req_t *req; cr_errbuf_t *eb; int retval; CR_KTRACE_FUNC_ENTRY(); /* Make sure that we don't have any requests already on this fd */ retval = -EAGAIN; priv = filp->private_data; if (priv->rstrt_req || priv->chkpt_req) { goto out; } /* Allocate a request structure for bookkeeping */ retval = -ENOMEM; req = alloc_rstrt_req(); if (req == NULL) { goto out; } else if (IS_ERR(req)) { return PTR_ERR(req); goto out; } priv->rstrt_req = req; eb = req->errbuf; // get/validate relocation records if (ureq->relocate) { retval = reloc_reader(req, ureq->relocate); if (retval) { goto out_free_req; } } req->flags = ureq->flags; // validate signal number retval = -EINVAL; if (!valid_signal(ureq->signal) && !valid_signal(-ureq->signal)) { CR_ERR_REQ(req, "invalid signal value: %d", ureq->signal); goto out_free_req; } req->signal = ureq->signal; /* Check/get the file descriptor */ retval = cr_loc_init(eb, &req->src, ureq->cr_fd, filp, /* is_write= */ 0); if (retval) { CR_ERR_REQ(req, "failed to initialize source file descriptor"); goto out_free_req; } if (req->src.fs) { CR_ERR_REQ(req, "source descriptor must not be a directory"); retval = -EISDIR; goto out_free_req; } req->file0 = cr_loc_get(&req->src, NULL); if (IS_ERR(req->file0)) { retval = PTR_ERR(req->file0); req->file0 = NULL; /* wouldn't want to fput(ERRCODE) */ goto out_free_req; } /* Read in the context file header */ retval = cr_kread(eb, req->file0, &cf_header, sizeof(cf_header)); if (retval != sizeof(cf_header)) { CR_ERR_REQ(req, "failed to read file header"); goto out_free_req; } CR_KTRACE_HIGH_LVL("cr_magic = %d %d, " "cr_version = %d, " "scope = %d, " "arch = %d.", cf_header.magic[0], cf_header.magic[1], cf_header.version, cf_header.scope, cf_header.arch_id); // Check the header fields... retval = -EINVAL; { // ... magic static int the_magic[2] = CR_MAGIC; if ((the_magic[0] != cf_header.magic[0]) || (the_magic[1] != cf_header.magic[1])) { CR_ERR_REQ(req, "file header has invalid signature"); goto out_free_req; } } // ... file format version if ((cf_header.version > CR_CONTEXT_VERSION) || (cf_header.version < CR_CONTEXT_VERSION_MIN)) { CR_ERR_REQ(req, "file header has incorrect/unsupported version"); goto out_free_req; } // ... architecture retval = -CR_EBADARCH; if (cf_header.arch_id != VMAD_ARCH) { CR_ERR_REQ(req, "file header has incorrect architecture (%d, but expecting %d)", cf_header.arch_id, VMAD_ARCH); goto out_free_req; } req->scope = cf_header.scope; // Currently unused // add watchdog, which gets its own reference req->need_procs = 1; atomic_inc(&req->ref_count); cr_wd_add(&req->work); /* Normal case. We keep the req, since we will need it again */ return 0; out_free_req: if (req->flags & CR_RSTRT_ASYNC_ERR) { req->result = retval; retval = 0; } else { release_rstrt_req(req); priv->rstrt_req = NULL; } return retval; out: return retval; } // cr_rstrt_req(user_req) // // Processes a restart request received from user space. // // Returns 0 on sucess // Returns negative on failure // XXX: Return number of children to start when doing process groups? int cr_rstrt_request_restart(struct file *filp, struct cr_rstrt_args __user *arg) { struct cr_rstrt_args ureq; int retval; CR_KTRACE_FUNC_ENTRY(); retval = -EFAULT; if (copy_from_user(&ureq, arg, sizeof(ureq))) { goto out; } retval = do_rstrt_request_restart(filp, &ureq, cr_read_reloc); out: CR_KTRACE_FUNC_EXIT("Returning %d", retval); return retval; } static int do_rstrt_procs(struct file *filp, struct cr_section_header *cf_header) { cr_pdata_t *priv; cr_rstrt_req_t *req; cr_errbuf_t *eb; int retval, threads; CR_KTRACE_FUNC_ENTRY(); retval = -EINVAL; if (filp == NULL) { CR_ERR("%s: Called with NULL file structure", __FUNCTION__); goto out_noreq; } priv = filp->private_data; if (priv == NULL) { CR_ERR("%s: private_data is NULL!", __FUNCTION__); goto out_noreq; } req = priv->rstrt_req; if (req == NULL) { CR_ERR("%s: No rstrt_req attached to filp!", __FUNCTION__); goto out_noreq; } if (req->result) { // Already marked done retval = 0; goto out; } eb = req->errbuf; while (!req->die && (req->state == CR_RSTRT_STATE_CHILD) && !signal_pending(current)) { /* Wait for child to finish w/ the file */ unsigned long timeout = MAX_SCHEDULE_TIMEOUT; timeout = wait_event_interruptible_timeout(req->wait, (req->die || (req->state != CR_RSTRT_STATE_CHILD)), timeout); } if (signal_pending(current)) { retval = -EINTR; goto out; } else if (req->die || (req->state == CR_RSTRT_STATE_DONE)) { req->need_procs = 0; retval = 0; goto out; } /* Read in the context header */ retval = cr_kread(eb, req->file0, cf_header, sizeof(*cf_header)); if (retval != sizeof(*cf_header)) { CR_ERR_REQ(req, "proc_header: read returned %d", retval); goto out; } threads = cf_header->num_threads; if (threads == 0 /* EOF */) { // XXX: additional serialization will be needed when restores are parallel retval = cr_restore_linkage(req); if (retval) { req->die = 1; goto out; } /* XXX A hack to return a "lead" pid (a tgid, actually). * Currently we look for the first task that is a child of cr_restart. * The assumption was that there * is a single "lead" to waitpid() for, which might not be the case. * Looking for session or process group leaders would be good in the * case of multiple children of cr-restart. */ if (!req->result) { /* don't clobber an error indication */ cr_linkage_entry_t *entry; list_for_each_entry(entry, &req->linkage, list) { if (entry->link.parent == req->cr_restart_task) { req->result = entry->link.tgid; break; } } } CR_KTRACE_HIGH_LVL("Kernel-level restore completed."); req->need_procs = 0; retval = 0; } else { cr_rstrt_proc_req_t *proc_req; CR_NO_LOCKS(); proc_req = cr_kmem_cache_zalloc(*proc_req, cr_rstrt_proc_req_cachep, GFP_KERNEL); retval = -ENOMEM; if (!proc_req) { goto out; } init_MUTEX(&proc_req->serial_mutex); init_waitqueue_head(&proc_req->wait); INIT_LIST_HEAD(&proc_req->tasks); INIT_LIST_HEAD(&proc_req->linkage); /* Set number of threads for this one. */ proc_req->thread_count = threads; /* Now initialize the barrier count so we can block later */ atomic_set(&proc_req->final_counter, threads); cr_barrier_init(&proc_req->pre_vmadump_barrier, threads); cr_barrier_init(&proc_req->post_vmadump_barrier, threads); cr_barrier_init(&proc_req->pre_complete_barrier, threads); cr_barrier_init(&proc_req->post_complete_barrier, threads); proc_req->req = req; proc_req->file = req->file0; // XXX: KLUDGE proc_req->clone_flags = cf_header->clone_flags; proc_req->tmp_fd = cf_header->tmp_fd; write_lock(&req->lock); list_add(&proc_req->list, &req->procs); write_unlock(&req->lock); /* Normal case. */ req->state = CR_RSTRT_STATE_CHILD; retval = 1; } out: if (retval != 1) { cr_barrier_notify(&req->barrier); } out_noreq: CR_KTRACE_FUNC_EXIT("Returning %d", retval); return retval; } // cr_rstrt_procs() // // Called by requester to get "next" process // // Returns > 0 if 1 or more processes remain, 0 if none. // Returns negative on failure int cr_rstrt_procs(struct file *filp, struct cr_procs_tbl __user *arg) { struct cr_section_header cf_header; int retval; CR_KTRACE_FUNC_ENTRY(); retval = do_rstrt_procs(filp, &cf_header); if (retval == 1) { /* Copy the process-header info to user space */ if (!access_ok(VERIFY_WRITE, arg, sizeof(*arg)) || __put_user(cf_header.num_threads, &arg->threads) || __put_user(cf_header.clone_flags, &arg->clone_flags)) { retval = -EFAULT; } } CR_KTRACE_FUNC_EXIT("Returning %d", retval); return retval; } // Check that a request is "done", from the point of view of the // requestor. // Returns >0 if completed, 0 if not completed, <0 on error // Call w/o holding the locks static int check_done(cr_rstrt_req_t *req) { int retval; write_lock(&req->lock); retval = list_empty(&req->tasks) && !req->need_procs; write_unlock(&req->lock); // Try to remove from watchdog list if done // This is only an optimization, not a correctness requirement if (retval && cr_wd_del(&req->work)) { // Release watchdog's ref_count. // The current task (the requester) must hold an additional reference. CRI_ASSERT(atomic_read(&req->ref_count) >= 2); (void)release_rstrt_req(req); } return retval; } // poll method for file w/ associated restart request unsigned int cr_rstrt_poll(struct file *filp, poll_table *wait) { cr_pdata_t *priv; cr_rstrt_req_t *req; priv = filp->private_data; if (!priv) { return POLLERR; } req = priv->rstrt_req; if (!req) { return POLLERR; } poll_wait(filp, &req->wait, wait); return check_done(req) ? (POLLIN | POLLRDNORM) : 0; } // cr_rstrt_reap() // // Reap a completed restart. // Returns: // req->result on success (pid of restarted "leader") // -EINVAL if no un-reaped restart request is associated w/ this fd // -EAGAIN if the request is not completed int cr_rstrt_reap(struct file *filp) { cr_pdata_t *priv; cr_rstrt_req_t *req; int retval; CR_KTRACE_FUNC_ENTRY(); retval = -EINVAL; priv = filp->private_data; if (priv) { req = priv->rstrt_req; if (req) { retval = -EAGAIN; if (check_done(req)) { priv->rstrt_req = NULL; retval = req->result; (void) release_rstrt_req(req); } } } CR_KTRACE_FUNC_EXIT("Returning %d", retval); return retval; } /* * cr_linkage_find_by_old_pid * * Returns a pointer to a linkage entry with l.pid == pid * NULL if not found */ cr_linkage_entry_t * cr_linkage_find_by_old_pid(struct list_head *list_p, int pid) { cr_linkage_entry_t *entry; list_for_each_entry(entry, list_p, list) { if (entry->link.pid == pid) { goto out_found; } } entry = NULL; out_found: return entry; } static void cr_change_pid(struct task_struct *task, enum pid_type type, int nr) { #if HAVE_2_6_0_ATTACH_PID detach_pid(task, type); attach_pid(task, type, nr); #else struct pid *pid = cr_find_pid(nr); CRI_ASSERT(pid != NULL); #if HAVE_CHANGE_PID change_pid(task, type, pid); #elif HAVE_2_6_22_ATTACH_PID || HAVE_2_6_26_ATTACH_PID detach_pid(task, type); attach_pid(task, type, pid); #else #error "Unknown change_pid() or attach_pid() variant" #endif #endif } #if !HAVE_REMOVE_LINKS #if defined(remove_parent) #define REMOVE_LINKS(task) remove_parent(task) #define SET_LINKS(task) add_parent(task) #else #define REMOVE_LINKS(task) list_del_init(&(task)->sibling) #define SET_LINKS(task) list_move_tail(&(task)->sibling, &CR_PARENT(task)->children) #endif #endif /* * cr_restore_linkage * * NOTE: Must only be called by a single thread. This function acts on * every task contained in the restart request. All others must be blocked * to prevent return to user space prior to entry into this function. * * Acquires and releases tasklist_lock held for writing. */ static int cr_restore_linkage(cr_rstrt_req_t *req) { int pid_flags = req->flags & CR_RESTORE_PIDS_MASK; cr_linkage_entry_t *entry; int retval = 0; CR_KTRACE_HIGH_LVL("Now restoring the ids and linkage... "); /* Add linkage entry for init */ cr_insert_object(req->map, CR_PARENT_INIT, cr_child_reaper, GFP_KERNEL); write_lock(&req->lock); /* * Make a pass through to translate old task pointers to new ones */ list_for_each_entry(entry, &req->linkage, list) { if (!entry->tl_task) { /* No new task corresponding to this entry! */ CR_ERR_REQ(req, "ERROR: No task found for pid %d", entry->link.pid); retval = -EINVAL; goto out; } #ifdef CR_REAL_PARENT entry->link.real_parent = cr_linkage_find_real_parent(req, entry->link.real_parent); entry->link.parent = entry->link.real_parent; /* XXX: until/unless we support ptrace */ #else entry->link.parent = cr_linkage_find_real_parent(req, entry->link.parent); #endif } /* Now ensure nothing changes that might conflict */ write_lock_irq(&tasklist_lock); /* Final chance to give up... * * Try to avoid a possible race against req->cr_restart_task exiting * before we get to restore the linkage * XXX: Note that right now current == cr_restart, but might not be true later. */ if (cri_task_dead(req->cr_restart_task)) { CR_ERR_REQ(req, "Unrestorable linkage: cr_restart_task exited prematurely!"); retval = -EINVAL; /* XXX: other? */ goto out_write_unlock; } #if HAVE_PIDTYPE_TGID && HAVE_TASK_PIDS_PID_LINK if (pid_flags & CR_RSTRT_RESTORE_PID) { cr_linkage_entry_t *next; list_for_each_entry_safe(entry, next, &req->linkage, list) { /* Need to ensure thread group leaders precede the rest of * the threads so that link_pid() has something to link to. */ if (entry->link.pid == entry->link.tgid) { list_move(&entry->list, &req->linkage); } /* Also need to unhash all tgids before rehashing any */ detach_pid(entry->tl_task, PIDTYPE_TGID); } } #endif /* Now change the entire world... */ list_for_each_entry(entry, &req->linkage, list) { struct task_struct *task = entry->tl_task; int is_leader = (entry->link.pid == entry->link.tgid); int need_set_links = !(list_empty(&task->sibling)); /* thread_group is already correct by virtue of how we create threads */ CRI_ASSERT(is_leader == thread_group_leader(task)); REMOVE_LINKS(task); CR_PARENT(task) = entry->link.parent; #ifdef CR_REAL_PARENT CR_REAL_PARENT(task) = entry->link.real_parent; #endif if (need_set_links) { SET_LINKS(task); } if (pid_flags & CR_RSTRT_RESTORE_PID) { cr_change_pid(task, PIDTYPE_PID, entry->link.pid); #if HAVE_PIDTYPE_TGID #if HAVE_TASK_PIDS_PID cr_change_pid(task, PIDTYPE_TGID, entry->link.tgid); #elif HAVE_TASK_PIDS_PID_LINK if (is_leader) { CRI_ASSERT(HAVE_2_6_0_ATTACH_PID); attach_pid(task, PIDTYPE_TGID, entry->link.tgid); } else { link_pid(task, task->pids + PIDTYPE_TGID, &task->group_leader->pids[PIDTYPE_TGID].pid); } #else #error "HAVE_PIDTYPE_TGID w/ unknown linkage type" #endif #endif task->tgid = entry->link.tgid; task->pid = entry->link.pid; } else { // To help return correct tgid to requester entry->link.tgid = task->tgid; } if (is_leader) { if (pid_flags & CR_RSTRT_RESTORE_PGID) { cr_change_pid(task, PIDTYPE_PGID, entry->link.pgrp); cr_set_pgrp(task, entry->link.pgrp); } if (pid_flags & CR_RSTRT_RESTORE_SID) { cr_change_pid(task, PIDTYPE_SID, entry->link.session); cr_set_sid(task, entry->link.session); cr_task_leader(task) = entry->link.leader; cr_task_tty(task) = NULL; // no CTTY } } task->exit_signal = entry->link.exit_signal; /* XXX: We don't handle these correctly yet */ #if 0 task->tty_old_pgrp = entry->link.tty_old_pgrp; #endif /* XXX: these exec_ids really aren't correct. * XXX: If this changes, be sure to fix watchdog exec() detection too. */ if (is_leader) { /* To look like we called exec(): */ task->parent_exec_id = req->cr_restart_task->self_exec_id; task->self_exec_id = req->cr_restart_task->self_exec_id + 1; } else { /* To look like we were fork()ed by leader, who called exec(): */ task->parent_exec_id = req->cr_restart_task->self_exec_id + 1; task->self_exec_id = req->cr_restart_task->self_exec_id + 1; } entry->cr_task->self_exec_id = task->self_exec_id; entry->reserved = 0; /* We've consumed the reservation */ } out_write_unlock: write_unlock_irq(&tasklist_lock); /* on success retval is zero when we get here */ out: write_unlock(&req->lock); return retval; } /* * cr_restore_files_struct * * Restore the files_struct (file table). * * This function just expands our fd array to the correct size, * returning max_fds or error. * * In the future, if we need any information that applies to all opened files * that info can be placed here. */ static int cr_restore_files_struct(cr_rstrt_proc_req_t *proc_req) { cr_errbuf_t *eb = proc_req->req->errbuf; struct cr_files_struct cr_fs; struct file *cf_filp = proc_req->file; int retval = 0; retval = cr_kread(eb, cf_filp, &cr_fs, sizeof(cr_fs)); if (retval != sizeof(cr_fs)) { CR_ERR_PROC_REQ(proc_req, "files_struct: read returned %d", retval); goto out; } retval = 0; if (cr_fs.cr_obj != cr_files_obj) { CR_ERR_PROC_REQ(proc_req, "cr_fs: Invalid cr_files_struct!"); retval = -EINVAL; goto out; } /* check to see if we have too many files open */ retval = -EMFILE; if (((unsigned long) cr_fs.cr_max_fds) > CR_RLIM(current)[RLIMIT_NOFILE].rlim_cur) { CR_KTRACE_HIGH_LVL("Too many files %d > %lu", cr_fs.cr_max_fds, CR_RLIM(current)[RLIMIT_NOFILE].rlim_cur); goto out; } spin_lock(¤t->files->file_lock); retval = expand_files(current->files, cr_fs.cr_max_fds-1); if (retval < 0) { CR_ERR_PROC_REQ(proc_req, "Failed to resize the fd array. (err=%d)", retval); goto out_unlock; } CR_NEXT_FD(current->files,cr_fdtable(current->files)) = cr_fs.cr_next_fd; retval = cr_fs.cr_max_fds; out_unlock: spin_unlock(¤t->files->file_lock); out: return retval; } /* * cr_load_file_info * * Reads in a file_info from disk, returns it. */ static int cr_load_file_info(cr_rstrt_proc_req_t *proc_req, struct cr_file_info *file_info) { cr_errbuf_t *eb = proc_req->req->errbuf; struct file *cf_filp = proc_req->file; int retval; CR_KTRACE_FUNC_ENTRY(); retval = cr_kread(eb, cf_filp, file_info, sizeof(*file_info)); if (retval != sizeof(*file_info)) { CR_ERR_PROC_REQ(proc_req, "file_info: read returned %d", retval); goto out; } retval = -EINVAL; if (file_info->cr_type != cr_file_info_obj) { CR_ERR_PROC_REQ(proc_req, "cr_load_file_info: Garbage in context file! (type=%d)", file_info->cr_type); goto out; } retval = 0; out: return retval; } /* * cr_open_fd: open a file - accepts file descriptor as argument * * NOTE: Does not attempt to expand the fdset array. * Use cr_restore_files_struct to expand fdset to the correct size. * * NOTE: Does not check limits on number of open files. */ static struct file * cr_open_fd(int fd, const char *path, int flags, int mode) { int rc; struct file *filp; /* check to see if we have too many files open */ filp = ERR_PTR(-EMFILE); if (fd >= CR_RLIM(current)[RLIMIT_NOFILE].rlim_cur) goto out; #if 0 /* If we were paranoid */ filp = ERR_PTR(-EMFILE); if (fd >= current->files->max_fds) goto out; #endif /* Mark the fd in use */ rc = cr_fd_claim(fd); /* make sure it's not in use already. shouldn't ever happen */ if (rc) { CR_WARN("File opened unexpectedly."); filp = ERR_PTR(rc); goto out; } /* open the file */ filp = filp_open(path, flags, mode); if (IS_ERR(filp)) { goto out; } /* install the filp in the fd array -- note race see fd_install */ fd_install(fd, filp); out: return filp; } static int cr_claim_install_fd(int fd, struct file *filp) { int rc; rc = cr_fd_claim(fd); if (rc) { CR_WARN("File opened unexpectedly."); } else { fd_install(fd, filp); } return rc; } /* cr_set_f_pos * * simple wrapper around sys_lseek */ static inline int cr_set_f_pos(int fd, loff_t offset) { return (sys_lseek(fd, offset, 0) == offset) ? 0 : -EINVAL; } /* * cr_restore_open_file * * reopens files */ static int cr_restore_open_file(cr_rstrt_proc_req_t *proc_req, struct cr_file_info *file_info, int do_not_restore) { cr_errbuf_t *eb = proc_req->req->errbuf; int retval; const char *name; struct file *cf_filp = proc_req->file; struct file *filp; struct cr_open_file open_file; cr_rstrt_relocate_t reloc = proc_req->req->relocate; CR_KTRACE_FUNC_ENTRY(); #if 1 /* XXX: Hack!!! We don't "dnr" files (see bug 1987 for why) */ if (fcheck(file_info->fd) != NULL) { sys_close(file_info->fd); } do_not_restore = 0; #endif /* read in the cr_open_file struct */ retval = cr_kread(eb, cf_filp, &open_file, sizeof(open_file)); if (retval != sizeof(open_file)) { CR_ERR_PROC_REQ(proc_req, "open_file: read returned %d", retval); goto out; } if (open_file.cr_type != cr_open_file_obj) { CR_ERR_PROC_REQ(proc_req, "cr_restore_open_file. Garbage in context file!"); retval = -EINVAL; goto out; } /* now read out the name */ name = cr_getname(eb, reloc, cf_filp, 0); if (IS_ERR(name)) { CR_ERR_PROC_REQ(proc_req, "cr_restore_open_file - Bad pathname read!"); retval = PTR_ERR(name); goto out; } if (file_info->unlinked) { int found = cr_find_object(proc_req->req->map, open_file.file_id, (void **) &filp); if (found) { /* An earlier restore has done the data, we need only open the unlinked file */ retval = 0; if (do_not_restore) goto out_free; filp = cr_filp_reopen(filp, open_file.f_flags); retval = PTR_ERR(filp); if (IS_ERR(filp)) goto out_free; } else { /* Create and populate the unlinked file */ if (do_not_restore) { retval = cr_skip(cf_filp, open_file.i_size); goto out_free; } filp = cr_mkunlinked(eb, cf_filp, name, open_file.i_mode, open_file.f_flags, open_file.i_size, (unsigned long)open_file.file_id); retval = PTR_ERR(filp); if (IS_ERR(filp)) goto out_free; cr_insert_object(proc_req->req->map, open_file.file_id, (void *) filp, GFP_KERNEL); } retval = cr_claim_install_fd(file_info->fd, filp); } else { retval = 0; if (do_not_restore) goto out_free; /* reopen file */ filp = cr_open_fd(file_info->fd, name, open_file.f_flags, open_file.i_mode); if (IS_ERR(filp)) { CR_ERR_PROC_REQ(proc_req, "Failed to open file '%s'", name); retval = PTR_ERR(filp); goto out_free; } if (S_ISDIR(filp->f_dentry->d_inode->i_mode)) { retval = -EISDIR; goto out_free; } /* restore previous size */ if (!S_ISREG(filp->f_dentry->d_inode->i_mode)) { /* Skip the truncation on non-regular files */ } else if (filp->f_mode & FMODE_WRITE) { retval = sys_ftruncate(file_info->fd, open_file.i_size); if (retval < 0) { CR_ERR_PROC_REQ(proc_req, "Couldn't restore file length."); goto out_free; } } } /* restore position in file */ retval = cr_set_f_pos(file_info->fd, open_file.f_pos); if (retval < 0) { CR_ERR_PROC_REQ(proc_req, "Couldn't restore file pointer for file '%s'.", name); goto out_free; } out_free: __putname(name); out: return retval; } /* * cr_restore_open_dir * * reopens directories */ static int cr_restore_open_dir(cr_rstrt_proc_req_t *proc_req, struct cr_file_info *file_info, int do_not_restore) { cr_errbuf_t *eb = proc_req->req->errbuf; int retval; const char *name; struct file *cf_filp = proc_req->file; struct file *filp; struct cr_open_dir open_dir; cr_rstrt_relocate_t reloc = proc_req->req->relocate; CR_KTRACE_FUNC_ENTRY(); #if 1 /* XXX: Hack!!! We don't "dnr" dirs */ if (fcheck(file_info->fd) != NULL) { sys_close(file_info->fd); } do_not_restore = 0; #endif /* read in the cr_open_dir struct */ retval = cr_kread(eb, cf_filp, &open_dir, sizeof(open_dir)); if (retval != sizeof(open_dir)) { CR_ERR_PROC_REQ(proc_req, "open_dir: read returned %d", retval); goto out; } if (open_dir.cr_type != cr_open_dir_obj) { CR_ERR_PROC_REQ(proc_req, "cr_restore_open_dir. Garbage in context file!"); retval = -EINVAL; goto out; } /* now read out the name */ name = cr_getname(eb, reloc, cf_filp, 0); if (IS_ERR(name)) { CR_ERR_PROC_REQ(proc_req, "cr_restore_open_dir - Bad pathname read!"); retval = PTR_ERR(name); goto out; } if (do_not_restore) { /* XXX: Do we really want non-dir to ever replace dir? */ retval = 0; goto out_free; } /* reopen directory */ filp = cr_open_fd(file_info->fd, name, open_dir.f_flags, open_dir.i_mode); if (IS_ERR(filp)) { retval = PTR_ERR(filp); goto out_free; } if (!S_ISDIR(filp->f_dentry->d_inode->i_mode)) { retval = -ENOTDIR; goto out_free; } /* restore position */ retval = cr_set_f_pos(file_info->fd, open_dir.f_pos); if (retval < 0) { CR_ERR_PROC_REQ(proc_req, "Couldn't restore file pointer for directory '%s'.", name); goto out_free; } out_free: __putname(name); out: return retval; } static int cr_restore_open_link(cr_rstrt_proc_req_t *proc_req, struct cr_file_info *file_info, int do_not_restore) { int retval = -ENOSYS; CR_KTRACE_FUNC_ENTRY(); if (do_not_restore) { retval = 0; } return retval; } static int cr_restore_open_socket(cr_rstrt_proc_req_t *proc_req, struct cr_file_info *file_info, int do_not_restore) { int retval = -ENOSYS; CR_KTRACE_FUNC_ENTRY(); if (do_not_restore) { retval = 0; } /* XXX: Kludge to recover w/o restoring a socket */ retval = 0; return retval; } static int cr_restore_open_chr(cr_rstrt_proc_req_t *proc_req, struct cr_file_info *file_info, int do_not_restore) { cr_errbuf_t *eb = proc_req->req->errbuf; int retval = -ENOSYS; struct cr_chrdev cf_chrdev; struct file *cf_filp = proc_req->file; const char *path = NULL; CR_KTRACE_FUNC_ENTRY(); /* read in the cr_chrdev struct */ retval = cr_kread(eb, cf_filp, &cf_chrdev, sizeof(cf_chrdev)); if (retval != sizeof(cf_chrdev)) { CR_ERR_PROC_REQ(proc_req, "open_chr: read returned %d", retval); goto out; } /* XXX: Validate type */ retval = -EINVAL; if (cf_chrdev.cr_type != cr_chrdev_obj) { CR_ERR_PROC_REQ(proc_req, "cr_restore_open_chr: Garbage in context file."); goto out; } /* Handle any cases we know about. * In general, we don't support character devices unless we know they * are safe. */ switch (cf_chrdev.cr_major) { case MEM_MAJOR: { static const char *tbl[] = { NULL, /* 0 */ "/dev/mem", "/dev/kmem", "/dev/null", "/dev/port", /* 4 */ "/dev/zero", "/dev/core", "/dev/full", "/dev/random", /* 8 */ "/dev/urandom", "/dev/aio", "/dev/kmsg" }; unsigned int minor = cf_chrdev.cr_minor; if (minor < (sizeof(tbl)/sizeof(char *))) { path = tbl[minor]; } #if 1 if (path != NULL) { /* XXX: Hack!!! We don't "dnr" devs other than tty (see bug 2288 for why) */ if (fcheck(file_info->fd) != NULL) { sys_close(file_info->fd); } do_not_restore = 0; } #endif break; } case TTYAUX_MAJOR: switch (cf_chrdev.cr_minor) { case 0: path = "/dev/tty"; break; } break; } CR_KTRACE_LOW_LVL(" Character device. major=%u, minor=%u path='%s'", cf_chrdev.cr_major, cf_chrdev.cr_minor, path ? path : "(unknown)"); retval = 0; /* Default is to silently ignore */ if (do_not_restore) { goto out; } if (path != NULL) { struct file *file = cr_open_fd(file_info->fd, path, cf_chrdev.f_flags, cf_chrdev.i_mode); if (IS_ERR(file)) { CR_ERR_PROC_REQ(proc_req, "Failed to open chrdev major=%u minor=%u path='%s')", cf_chrdev.cr_major, cf_chrdev.cr_minor, path); retval = PTR_ERR(file); } } out: return retval; } static int cr_restore_open_blk(cr_rstrt_proc_req_t *proc_req, struct cr_file_info *file_info, int do_not_restore) { int retval = -ENOSYS; CR_KTRACE_FUNC_ENTRY(); if (do_not_restore) { retval = 0; } return retval; } static int cr_dup2(cr_rstrt_req_t *req, struct file *old_filp, int fd) { struct file *new_filp; int retval = 0; /* translate the filp to its new value */ if (!cr_find_object(req->map, old_filp, (void **) &new_filp)) { CR_ERR_REQ(req, "cr_dup2: Could not locate restored filp %p.", old_filp); retval = -EINVAL; goto out; } if (new_filp == NULL) { /* The file was silently ignored before - continue to do so. */ CR_WARN("cr_dup2: Skipping dup of ignored filp %p.", old_filp); goto out; } get_file(new_filp); /* allocate the fd */ retval = cr_fd_claim(fd); if (retval) { /* this should never happen. */ CR_ERR_REQ(req, "cr_dup2: File descriptor %d in use.", fd); fput(new_filp); goto out; } /* install it */ fd_install(fd, new_filp); out: return retval; } static int cr_restore_open_dup(cr_rstrt_proc_req_t *proc_req, struct cr_file_info *file_info, int do_not_restore) { cr_errbuf_t *eb = proc_req->req->errbuf; int retval = -ENOSYS; struct cr_dup cf_dup; struct file *cf_filp = proc_req->file; CR_KTRACE_FUNC_ENTRY(); /* read in the cr_dup struct */ retval = cr_kread(eb, cf_filp, &cf_dup, sizeof(cf_dup)); if (retval != sizeof(cf_dup)) { CR_ERR_PROC_REQ(proc_req, "open_dup: read returned %d", retval); goto out; } /* Validate type (the only field we've got) */ retval = -EINVAL; if (cf_dup.cr_type != cr_dup_obj) { CR_ERR_PROC_REQ(proc_req, "cr_restore_open_dup: Garbage in context file."); goto out; } /* ALWAYS honor dups so that overrides will catch all instances together */ if (fcheck(file_info->fd) != NULL) { sys_close(file_info->fd); } retval = cr_dup2(proc_req->req, file_info->orig_filp, file_info->fd); if (retval<0) { CR_ERR_PROC_REQ(proc_req, "cr_restore_open_dup: Could not cr_dup2(%p -> %d).", file_info->orig_filp, file_info->fd); goto out; } CR_KTRACE_LOW_LVL("cr_dup2(%p -> %d) successful", file_info->orig_filp, file_info->fd); retval = 0; out: return retval; } static int cr_restore_open_chkpt_req(cr_rstrt_proc_req_t *proc_req, struct cr_file_info *file_info, int do_not_restore) { int retval; struct file *filp; cr_pdata_t *priv; CR_KTRACE_FUNC_ENTRY(); retval = cr_restore_open_file(proc_req, file_info, do_not_restore); if (retval < 0) goto out; filp = fcheck(file_info->fd); if (!filp || IS_ERR(filp)) { CR_ERR_PROC_REQ(proc_req, "Bogus restore of ctrl descriptor"); retval = filp ? PTR_ERR(filp) : -EINVAL; goto out; } priv = filp->private_data; if (!priv || priv->chkpt_req) { CR_ERR_PROC_REQ(proc_req, "Unexpected/invalid private data in restored ctrl descriptor"); retval = -EINVAL; goto out; } priv->chkpt_req = CR_CHKPT_RESTARTED; out: return retval; } static int cr_end_of_file_restore(cr_rstrt_proc_req_t *proc_req, struct cr_file_info *file_info) { int retval = 0; CR_KTRACE_FUNC_ENTRY(); /* Nothing to do here yet */ return retval; } static int cr_restore_file_locks(cr_rstrt_proc_req_t *proc_req, struct cr_file_info *file_info) { int retval = -ENOSYS; CR_KTRACE_FUNC_ENTRY(); /* Nothing to do here yet */ return retval; } static int cr_finish_all_file_restores(cr_rstrt_proc_req_t *proc_req, int max_fds) { int retval = -ENOSYS; int fd; CR_KTRACE_FUNC_ENTRY(); spin_lock(¤t->files->file_lock); CR_KTRACE_LOW_LVL("current->files=%p", current->files); for(fd=0; fddentry=%p d_inode=%p", fd, filp, filp->f_dentry, filp->f_dentry->d_inode); } } spin_unlock(¤t->files->file_lock); return retval; } /* * cr_restore_all_files * * Main entry point for file recovery * * In the future, may want to set this so that it manipulates file "objects" * with load / restore methods */ static int cr_restore_all_files(cr_rstrt_proc_req_t *proc_req) { int do_not_restore_flag; int i, retval, max_fds; struct cr_file_info file_info; struct files_struct *files = current->files; struct file *filp; cr_fdtable_t *fdt; /* close-on-exec() of caller's fds before we start restoring */ CR_KTRACE_HIGH_LVL("close-on-exec of callers files"); spin_lock(&files->file_lock); fdt = cr_fdtable(files); for (i = 0; i < fdt->max_fds; ++i) { if (cr_read_close_on_exec(i, fdt)) { spin_unlock(&files->file_lock); sys_close(i); spin_lock(&files->file_lock); fdt = cr_fdtable(files); } } spin_unlock(&files->file_lock); /* load the files struct */ CR_KTRACE_HIGH_LVL("recovering fs_struct..."); retval = cr_restore_files_struct(proc_req); if (retval < 0) { CR_ERR_PROC_REQ(proc_req, "Unable to cr_restore_files_struct"); goto out; } max_fds = retval; file_info.cr_file_type = cr_bad_file_type; /* now do per file stuff */ while (1) { retval = cr_load_file_info(proc_req, &file_info); if (retval < 0) { CR_ERR_PROC_REQ(proc_req, "Error loading file_info."); goto out; } if (file_info.cr_file_type == cr_end_of_files) { /* finished */ retval = cr_end_of_file_restore(proc_req, &file_info); break; } /* Take first-cut at dnr flag. Note some cases will ignore this: * 1) dups always follow the dupped fd * 2) internal pipes (those w/ both a reader and writter in the checkpoint) * 3) normal files currently ignore dnr (for bug 1987) */ do_not_restore_flag = (fcheck(file_info.fd) != NULL); CR_KTRACE_LOW_LVL(" fd=%d dnr=%d", file_info.fd, do_not_restore_flag); switch(file_info.cr_file_type) { case cr_open_chkpt_req: retval = cr_restore_open_chkpt_req(proc_req, &file_info, do_not_restore_flag); break; case cr_open_file: retval = cr_restore_open_file(proc_req, &file_info, do_not_restore_flag); break; case cr_open_directory: retval = cr_restore_open_dir(proc_req, &file_info, do_not_restore_flag); break; case cr_open_link: retval = cr_restore_open_link(proc_req, &file_info, do_not_restore_flag); break; case cr_open_fifo: retval = cr_restore_open_fifo(proc_req, &file_info, do_not_restore_flag); break; case cr_open_socket: retval = cr_restore_open_socket(proc_req, &file_info, do_not_restore_flag); break; case cr_open_chr: retval = cr_restore_open_chr(proc_req, &file_info, do_not_restore_flag); break; case cr_open_blk: retval = cr_restore_open_blk(proc_req, &file_info, do_not_restore_flag); break; case cr_open_dup: retval = cr_restore_open_dup(proc_req, &file_info, do_not_restore_flag); break; case cr_bad_file_type: /* fall through */ default: CR_ERR_PROC_REQ(proc_req, "Unknown file type fd=%d type=%d", file_info.fd, file_info.cr_file_type); retval = -EBADF; goto out; break; } if (retval < 0) { CR_ERR_PROC_REQ(proc_req, "%s [%d]: Unable to restore fd %d (type=%d,err=%d)", __FUNCTION__, current->pid, file_info.fd, file_info.cr_file_type, retval); goto out; } /* Restore close-on-exec flag */ spin_lock(&files->file_lock); fdt = cr_fdtable(files); if (file_info.cloexec) { cr_set_close_on_exec(file_info.fd, fdt); } else { cr_clear_close_on_exec(file_info.fd, fdt); } spin_unlock(&files->file_lock); /* now acquire locks (unimplemented) */ cr_restore_file_locks(proc_req, &file_info); spin_lock(&files->file_lock); filp = fcheck(file_info.fd); spin_unlock(&files->file_lock); cr_insert_object(proc_req->req->map, file_info.orig_filp, filp, GFP_KERNEL); }; /* now for the second pass. The above restore routines should have taken * care of loading all the data. the easy work, now we do everything * that has to be deferred until we have all the data */ cr_finish_all_file_restores(proc_req, max_fds); out: return retval; } /* * cr_chdir * * Our own version of the chdir() system call. Differs in that it accepts * pathnames in kernel space, and performs lookup directly. * */ static int cr_chdir(const char *name) { int retval; struct path path; retval = cr_kern_path(name, LOOKUP_FOLLOW|LOOKUP_DIRECTORY, &path); if (retval) goto out; retval = cr_permission(path.dentry->d_inode, MAY_EXEC|MAY_CHDIR); if (retval) goto out_put; cr_set_pwd_path(current->fs, &path); out_put: path_put(&path); out: return retval; } /* * cr_restore_fs * * This function does the work of restoring the data in our fs_struct, i.e. * the current working directory, and the umask. * * In the future, this may be modified to also restore a process after a * chroot(), if desirable. * */ static int cr_restore_fs_struct(cr_rstrt_proc_req_t *proc_req) { cr_errbuf_t *eb = proc_req->req->errbuf; int retval; int umask; const char *name; struct file *cf_filp = proc_req->file; cr_rstrt_relocate_t reloc = proc_req->req->relocate; /* restore the umask */ retval = cr_kread(eb, cf_filp, &umask, sizeof(umask)); if (retval < sizeof(umask)) { CR_ERR_PROC_REQ(proc_req, "umask: read returned %d", retval); goto out_readerr; } /* read in root */ name = cr_getname(eb, reloc, cf_filp, 0); if (IS_ERR(name)) { CR_ERR_PROC_REQ(proc_req, "root: Bad file read!"); goto out_badname; } /* should change root directory here. */ /* cr_chroot() */ __putname(name); /* read in the current working directory */ name = cr_getname(eb, reloc, cf_filp, 0); if (IS_ERR(name)) { CR_ERR_PROC_REQ(proc_req, "pwd: Bad file read!"); goto out_badname; } /* now change the current working directory */ retval = cr_chdir(name); if (retval < 0) { CR_ERR_PROC_REQ(proc_req, "cr_chdir: Unable to change directory to %s", name); goto out_put; } out_put: __putname(name); return retval; out_badname: retval = PTR_ERR(name); out_readerr: return retval; } /* * This does half of a close. It removes the fd from a files_struct, but doesn't * actually close the fd. */ int cr_hide_filp(struct file *filp, struct files_struct *files) { cr_fdtable_t *fdt; int found; int fd; found = 0; spin_lock(&files->file_lock); fdt = cr_fdtable(files); for (fd = 0; fd < fdt->max_fds; ++fd) { if (filp == fdt->fd[fd]) { ++found; rcu_assign_pointer(fdt->fd[fd], NULL); cr_clear_close_on_exec(fd, fdt); break; } } spin_unlock(&files->file_lock); if (found) { put_unused_fd(fd); } else { CR_ERR("File descriptor closed unexpectedly!"); } return found; } static void cr_signal_rstrt_complete_barrier(cr_task_t *cr_task, int block) { cr_rstrt_proc_req_t *proc_req = cr_task->rstrt_proc_req; cr_rstrt_req_t *req = proc_req->req; CR_ASSERT_STEP_EQ(cr_task, CR_RSTRT_STEP_PRE_COMPLETE); CR_BARRIER_NOTIFY(cr_task, &proc_req->pre_complete_barrier); if (cr_barrier_once_interruptible(&proc_req->pre_complete_barrier, block) > 0) { struct task_struct *task = cr_task->task; int signal = 0; // close the temporary fd unless we are failing or called by watchdog if ((proc_req->tmp_fd >= 0) && !req->die && (task == current)) { int rc = sys_close(proc_req->tmp_fd); if (rc) { CR_ERR_PROC_REQ(proc_req, "Failed to close tmp_fd (err=%d)", rc); } } proc_req->tmp_fd = -1; // raise a signal if needed if (req->die) { signal = SIGKILL; } else if ((req->signal > 0) && (req->result >= 0)) { signal = req->signal; } else if (cr_task->stopped) { signal = SIGSTOP; } if (signal) { cr_kill_process(cr_task->task, signal); } } } // Must be called w/ req->lock held or when exclusive // access to the request list is otherwise guaranteed. static void cr_rstrt_advance_to(cr_task_t *cr_task, int end_step) { cr_rstrt_proc_req_t *proc_req = cr_task->rstrt_proc_req; cr_rstrt_req_t *req = proc_req->req; CR_ASSERT_STEP_LE(cr_task, end_step); switch (cr_task->step) { case CR_RSTRT_STEP_PRE_VMADUMP: if (cr_task->step == end_step) break; CR_BARRIER_NOTIFY(cr_task, &proc_req->pre_vmadump_barrier); // fall through... case CR_RSTRT_STEP_POST_VMADUMP: if (cr_task->step == end_step) break; CR_BARRIER_NOTIFY(cr_task, &proc_req->post_vmadump_barrier); // fall through... case CR_RSTRT_STEP_REQ_BARRIER: if (cr_task->step == end_step) break; CR_BARRIER_NOTIFY(cr_task, &req->barrier); // fall through... case CR_RSTRT_STEP_PRE_COMPLETE: if (cr_task->step == end_step) break; cr_signal_rstrt_complete_barrier(cr_task, /* block= */0); // fall through... case CR_RSTRT_STEP_POST_COMPLETE: if (cr_task->step == end_step) break; CR_BARRIER_NOTIFY(cr_task, &proc_req->post_complete_barrier); // fall through... case CR_RSTRT_STEP_DONE: break; default: CR_ERR_REQ(req, "Invalid cr_task->step %d", cr_task->step); } } // __delete_from_req(req, cr_task) // Remove a given task from the request lists, waking waiter(s) if needed. // // Must be called w/ cr_task_lock held for writing. // Must be called w/ req->lock held for writing. static void __delete_from_req(cr_rstrt_req_t *req, cr_task_t *cr_task) { list_del_init(&cr_task->req_list); list_del_init(&cr_task->proc_req_list); if (list_empty(&req->tasks)) { wake_up(&req->wait); } cr_task->rstrt_req = NULL; cr_task->rstrt_proc_req = NULL; cr_task->step = 0; __cr_task_put(cr_task); } // Must be called w/ cr_task_lock held for writing. // Must be called w/ req->lock held for writing. static void delete_dead_task(cr_rstrt_req_t *req, cr_task_t *cr_task) { cr_rstrt_advance_to(cr_task, CR_RSTRT_STEP_DONE); __delete_from_req(req, cr_task); release_rstrt_req(req); } // "lookup" a cr_task for current static cr_task_t * lookup_task(cr_rstrt_req_t *req) { cr_rstrt_proc_req_t *proc_req, *tmp; cr_task_t *result = NULL; const struct mm_struct *mm = current->mm; write_lock(&cr_task_lock); write_lock(&req->lock); // Find the corresponding proc_req proc_req = NULL; list_for_each_entry(tmp, &req->procs, list) { if (tmp->mm == mm) { proc_req = tmp; break; } else if (tmp->mm == NULL) { proc_req = tmp; // "wildcard" } } if (!proc_req) { CR_ERR_REQ(req, "%s: No rstrt_proc_req for this thread!", __FUNCTION__); result = ERR_PTR(-EINVAL); goto out; } proc_req->mm = mm; // In case match was the wildcard // Get an entry for the task result = __cr_task_get(current, 1); if (result == NULL) { result = ERR_PTR(-ENOMEM); goto out; } result->rstrt_proc_req = proc_req; result->self_exec_id = current->self_exec_id; // Close a race against checkpoint requests // AFTER setting result->rstrt_proc_req to prevent new requests // BEFORE adding to the task lists (which are also used by the chkpt req) if (result->chkpt_proc_req) { CR_KTRACE_LOW_LVL("Omitting restart child from checkpoint"); write_unlock(&req->lock); write_unlock(&cr_task_lock); cr_chkpt_abort(result, CR_CHECKPOINT_OMIT); CR_SIGNAL_LOCK(current); sigaddset(¤t->blocked, CR_SIGNUM); recalc_sigpending(); CR_SIGNAL_UNLOCK(current); write_lock(&cr_task_lock); write_lock(&req->lock); } // Add to the lists of tasks list_add_tail(&result->proc_req_list, &proc_req->tasks); list_add_tail(&result->req_list, &req->tasks); req->need_procs = 0; out: write_unlock(&req->lock); write_unlock(&cr_task_lock); return result; } // cr_rstrt_task_complete // // Cleanup int cr_rstrt_task_complete(cr_task_t *cr_task, int block, int need_lock) { cr_rstrt_proc_req_t *proc_req = cr_task->rstrt_proc_req; cr_rstrt_req_t *req = proc_req->req; cr_signal_rstrt_complete_barrier(cr_task, block); CR_BARRIER_NOTIFY(cr_task, &proc_req->post_complete_barrier); if (block) (void)cr_barrier_wait_interruptible(&proc_req->post_complete_barrier); CR_ASSERT_STEP_EQ(cr_task, CR_RSTRT_STEP_DONE); if (need_lock) { write_lock(&cr_task_lock); } write_lock(&req->lock); __delete_from_req(req, cr_task); write_unlock(&req->lock); if (need_lock) { write_unlock(&cr_task_lock); } release_rstrt_req(req); return 0; } static inline int cr_free_audit_context(void) { #if HAVE_CONFIG_AUDITSYSCALL #if HAVE_AUDIT_DUMMY_CONTEXT if (!audit_dummy_context()) #else if (current->audit_context) #endif { /* tell auditing that the ioctl() call is finished with. */ CR_KTRACE_LOW_LVL("Finishing audit entry."); /* This ioctl() is never supposed to return, so I don't think it * matters what return values we set here. (We report errors * through the request structure) We're just going to make up a * successful return code to go with the audit context. * * We do this early to avoid later calls to sys_linkat() from * invoking audit_getname() * * In the RHEL55 2.6.18 kernel, * we're causing a BUG() by overflowing the names[] entries * in the audit_context structure. getname() and audit_getname() * add name entries every time they're called. * This call to audit_syscall_exit() frees the names, and * tears down the audit context attached to our process. */ #if HAVE_2_6_17_AUDIT_SYSCALL_EXIT /* linux-2.6.17 through ... */ audit_syscall_exit(AUDITSC_RESULT(0), 0); #elif HAVE_2_6_12_AUDIT_SYSCALL_EXIT /* linux-2.6.12 through 2.6.16 */ audit_syscall_exit(current, AUDITSC_RESULT(0), 0); #elif HAVE_2_6_6_AUDIT_SYSCALL_EXIT /* linux-2.6.6 through 2.6.11 */ audit_syscall_exit(current, 0); #elif HAVE___AUDIT_SYSCALL_EXIT /* EL6 kernels */ if (unlikely(current->audit_context)) { __audit_syscall_exit(1, 0); } #else #error "Don't know how to call audit_syscall_exit()" #endif return 0; } #endif /* just return success, there's nothing to do */ return 0; } // cr_rstrt_child // // Invoked by a freshly created child process. // // The real "restart" part of reconstructing a process image happens here. // // Returns pid of cr_restart on success, or a negative on failure int cr_rstrt_child(struct file *filp) { cr_pdata_t *priv; cr_rstrt_req_t *req; cr_rstrt_proc_req_t *proc_req; cr_errbuf_t *eb; cr_task_t *cr_task = NULL; int retval; int old_pid = -1; cr_linkage_entry_t *my_linkage = NULL; unsigned long chkpt_flags = 0; CR_KTRACE_FUNC_ENTRY(); retval = -EINVAL; if (filp == NULL) { CR_ERR("%s: Called with NULL file structure", __FUNCTION__); goto out; } priv = filp->private_data; if (priv == NULL) { CR_ERR("%s: private_data is NULL!", __FUNCTION__); goto out; } req = priv->rstrt_req; if (req == NULL) { CR_ERR("%s: No rstrt_req attached to filp!", __FUNCTION__); goto out; } eb = req->errbuf; cr_task = lookup_task(req); if (IS_ERR(cr_task)) { retval = PTR_ERR(cr_task); goto out; } proc_req = cr_task->rstrt_proc_req; /* Forget any past registrations */ if (cr_task->filp) { cr_task->phase = CR_NO_PHASE; cr_task->filp = NULL; cr_task->fd = -1; memset(&cr_task->handler_sa, 0, sizeof(cr_task->handler_sa)); cr_task_put(cr_task); // The ref from the registration } atomic_inc(&req->ref_count); atomic_inc(&req->barrier.count); CR_ASSERT_STEP_EQ(cr_task, CR_RSTRT_STEP_PRE_VMADUMP); CR_BARRIER_NOTIFY(cr_task, &proc_req->pre_vmadump_barrier); down(&proc_req->serial_mutex); if (req->die) { up(&proc_req->serial_mutex); retval = 0; /* don't clobber error code from whoever set req->die */ goto out_release; } /* deallocate audit context */ if (cr_free_audit_context() < 0) { CR_ERR_PROC_REQ(proc_req, "Unable to deallocate audit context!"); retval = -EINVAL; req->die = 1; up(&proc_req->serial_mutex); goto out_release; } /* Initialize parts of req relevant to restoring task linkage */ if (!test_and_set_bit(0, &proc_req->done_linkage)) { /* First load the linkage */ retval = cr_load_linkage(proc_req); if (retval < 0) { CR_ERR_PROC_REQ(proc_req, "Error reading linkage structure! err=%d", retval); retval = -ENOMEM; req->die = 1; up(&proc_req->serial_mutex); goto out_release; } /* Now we reserve all the ids (pid, pgid, sid) we will need. * Note that this can get_zeroed_page(), and thus no locks are held yet. */ retval = cr_reserve_ids(proc_req); if (retval) { req->die = 1; up(&proc_req->serial_mutex); goto out_release; } /* Move this process's linkage to the global list */ write_lock(&req->lock); list_splice_init(&proc_req->linkage, &req->linkage); write_unlock(&req->lock); } up(&proc_req->serial_mutex); /* Before thaw can raise signals, make sure we've blocked them all. * The thaw step will replace this with the proper mask later. */ { sigset_t sig_blocked; siginitsetinv(&sig_blocked, sigmask(SIGKILL)|sigmask(SIGSTOP)); sigprocmask(SIG_SETMASK, &sig_blocked, NULL); } /* Must wait until all threads have safely left user space before thaw munmap()s. */ retval = cr_barrier_wait_interruptible(&proc_req->pre_vmadump_barrier); if (retval < 0) { req->die = 1; goto out_release; } /* Thaw thyself out (called by all threads) */ { /* Distinguish a single thread group leader (no race here) */ int i_am_leader = (thread_group_leader(current) && !test_and_set_bit(0, &proc_req->have_leader)); long err = cr_thaw_threads(proc_req, 0, i_am_leader); if (err < 0) { CR_ERR_PROC_REQ(proc_req, "thaw_threads returned error, aborting. %ld", err); if (req->result >= 0) req->result = err; req->die = 1; goto out_release; } else { old_pid = err; } /* Need a barrier here to ensure all threads read their regs * before the next read from the file. We notify here, and * will wait before the next read. */ CR_ASSERT_STEP_EQ(cr_task, CR_RSTRT_STEP_POST_VMADUMP); CR_BARRIER_NOTIFY(cr_task, &proc_req->post_vmadump_barrier); retval = 0; } /* Associate your old PID with your task in the linkage */ my_linkage = cr_linkage_find_by_old_pid(&req->linkage, old_pid); /* Map old->new task pointers for linkage restore (all threads) */ if (my_linkage == NULL) { CR_ERR_PROC_REQ(proc_req, "%s [%d]: ERROR: No linkage entry for my PID %d", __FUNCTION__, current->pid, old_pid); /* * NOTE: We DO NOT ABORT here. Instead, we wait for the linkage to be restored, * and rely on the cr_restore_linkage code to notice the problem (a NULL tl_task). */ cr_task->stopped = 0; } else { get_task_struct(current); cr_insert_object(req->map, my_linkage->link.myptr, current, GFP_KERNEL); my_linkage->tl_task = current; my_linkage->cr_task = cr_task; cr_task->stopped = my_linkage->link.cr_task.stopped; chkpt_flags = my_linkage->link.cr_task.chkpt_flags; } /* Log for debugging (or other use) */ CR_KTRACE_HIGH_LVL("Formerly %s PID %d", current->comm, old_pid); /* Finish the post_vmadump barrier here, before files code can read context file */ retval = cr_barrier_wait_interruptible(&proc_req->post_vmadump_barrier); if (retval < 0) { req->die = 1; goto out_release; } /* --- File recovery starts here --- */ /* Exactly one thread should close the rstrt_req file descriptor(s) * but they should all wait until this has been done. */ /* NOTE: Past this point, you must jump to out_close to abort. We are removing * our reference to the fd, which means do_exit() can't clean up after us. */ down(&proc_req->serial_mutex); if (req->die) { up(&proc_req->serial_mutex); goto out_put_task; } if (!test_and_set_bit(0, &proc_req->done_hide_cr_fds)) { /* Remove the rstrt_req descriptor from our open files. */ cr_hide_filp(filp, current->files); cr_hide_filp(proc_req->file, current->files); } /* restore fs_struct */ /* XXX: put the bit tests inside the restore routines when we do process * groups and sessions. This way, they can just decide they want to skip it. */ if (!test_and_set_bit(0, &proc_req->done_fs)) { retval = cr_restore_fs_struct(proc_req); if (retval < 0) { CR_ERR_PROC_REQ(proc_req, "%s [%d]: Unable to restore fs! (err=%d)", __FUNCTION__, current->pid, retval); if (req->result >= 0) req->result = retval; req->die = 1; goto out_close; // XXX: same concern } } /* restore special mmap()s (but not yet the pages) */ if (!test_and_set_bit(0, &proc_req->done_mmaps_maps)) { CR_KTRACE_LOW_LVL("%d: loading mmap()s table", current->pid); retval = cr_load_mmaps_maps(proc_req); if (retval < 0) { CR_ERR_PROC_REQ(proc_req, "%s [%d]: Unable to load mmap()s table! (err=%d)", __FUNCTION__, current->pid, retval); if (req->result >= 0) req->result = retval; req->die = 1; goto out_close; } } /* load POSIX interval timers (but don't yet activate) */ if (!test_and_set_bit(0, &proc_req->done_itimers)) { CR_KTRACE_HIGH_LVL("Reading POSIX interval timers..."); retval = cr_load_itimers(proc_req); if (retval < 0) { if (req->result >= 0) req->result = retval; req->die = 1; goto out_close; } } /* restore special mmap()ed pages */ if (!test_and_set_bit(0, &proc_req->done_mmaps_data)) { CR_KTRACE_HIGH_LVL("Reading mmap()ed pages (if any)..."); retval = cr_load_mmaps_data(proc_req); if (retval < 0) { CR_ERR_PROC_REQ(proc_req, "%s [%d]: Unable to load mmap()ed data! (err=%d)", __FUNCTION__, current->pid, retval); if (req->result >= 0) req->result = retval; req->die = 1; goto out_close; } } /* restore the open files */ if (!test_and_set_bit(0, &proc_req->done_files)) { retval = cr_restore_all_files(proc_req); if (retval < 0) { CR_ERR_PROC_REQ(proc_req, "%s [%d]: Unable to restore files! (err=%d)", __FUNCTION__, current->pid, retval); if (req->result >= 0) req->result = retval; req->die = 1; goto out_close; // XXX: same concern } } /* close the request descriptor */ /* XXX: Need to handle differently when we split to multiple files? */ out_close: if (!test_and_set_bit(0, &proc_req->done_close_cr_fds)) { int rc; /* don't overwrite error code w/ 0 */ CR_KTRACE_LOW_LVL("%d: closing request descriptor", current->pid); rc = filp_close(filp, current->files); if (rc < 0) { CR_ERR_PROC_REQ(proc_req, "Error closing checkpoint control descriptor! " "(err=%d)", rc); retval = rc; if (req->result >= 0) req->result = retval; req->die = 1; goto out_mutex; } CR_KTRACE_LOW_LVL("%d: closing context file descriptor", current->pid); rc = filp_close(proc_req->file, current->files); if (rc < 0) { CR_ERR_PROC_REQ(proc_req, "Error closing context file descriptor!" "(err=%d)", rc); retval = rc; if (req->result >= 0) req->result = retval; req->die = 1; goto out_mutex; } } retval = 0; out_mutex: up(&proc_req->serial_mutex); /* restore handlers (if any) (all threads) */ if (!req->die) { /* XXX: move to cr_rstrt_task_complete()? */ if ((my_linkage != NULL) && (my_linkage->link.cr_task.phase != CR_NO_PHASE)) { if (!cr_find_object(req->map, my_linkage->link.cr_task.orig_filp, (void **) &cr_task->filp)) { CR_ERR_PROC_REQ(proc_req, "unable to locate checkpoint control descriptor"); if (req->result >= 0) req->result = retval; req->die = 1; goto out_put_task; } cr_task->phase = my_linkage->link.cr_task.phase; cr_task->fd = my_linkage->link.cr_task.fd; cr_task->handler_sa = my_linkage->link.cr_task.handler_sa; atomic_inc(&cr_task->ref_count); } } out_put_task: if (my_linkage) { /* Balance the get_task_struct() call made when task was added to object map */ put_task_struct(current); } out_release: /* Signal any barriers we skipped due to error path gotos */ cr_rstrt_advance_to(cr_task, CR_RSTRT_STEP_REQ_BARRIER); /* On failure we need to ensure everyone fails, and inform the requester */ if ((req->result >= 0) && (retval < 0)) { req->result = retval; } if (retval == 0) { /* Return > zero for success restart. We return the pid of cr_restart, which we want anyway. */ retval = req->requester; } /* done reading the context file - release it back to the requester */ if (atomic_dec_and_test(&proc_req->final_counter)) { req->state = CR_RSTRT_STATE_REQUESTER; wake_up(&req->wait); } /* Wait for the requester and all tasks to reach end-of-file */ CR_ASSERT_STEP_EQ(cr_task, CR_RSTRT_STEP_REQ_BARRIER); CR_BARRIER_NOTIFY(cr_task, &req->barrier); if (!req->die) { cr_barrier_wait(&req->barrier); } // One task resumes the itimers (and "early" signals) if (!test_and_set_bit(0, &proc_req->done_resume_itimers)) { cr_resume_itimers(proc_req->itimers); if (req->signal < 0) { cr_kill_process(current, -(req->signal)); } } CR_ASSERT_STEP_EQ(cr_task, CR_RSTRT_STEP_PRE_COMPLETE); if (req->die || (chkpt_flags & _CR_CHECKPOINT_STUB)) { // task has no handlers, so finish up now. cr_rstrt_task_complete(cr_task, /* block = */ 1, /* need_lock = */ 1); } out: CR_KTRACE_FUNC_EXIT("Returning %d", retval); return retval; } int cr_rstrt_req_release(struct file *filp, cr_pdata_t *priv) { cr_rstrt_req_t *req; // If we are a requester, release the outstanding request. req = priv->rstrt_req; if (req) { (void)release_rstrt_req(req); } return 0; } int cr_rstrt_src(struct file *filp, char *ubuf) { cr_task_t *cr_task; cr_rstrt_proc_req_t *proc_req; cr_rstrt_req_t *req; char *buf; const char *path = NULL; int retval; CR_KTRACE_FUNC_ENTRY(); retval = -ENOMEM; buf = __getname(); if (!buf) { goto out_nobuf; } retval = -ESRCH; cr_task = cr_task_get(current); if (!cr_task) { goto out; } proc_req = cr_task->rstrt_proc_req; cr_task_put(cr_task); if (!proc_req) { goto out; } req = proc_req->req; if (!req) { goto out; } path = cr_location2path(&(req->src), buf, PATH_MAX); retval = 0; if (IS_ERR(path)) { retval = PTR_ERR(path); } else if (!path) { retval = -EBADF; } else if (copy_to_user(ubuf, path, 1+strlen(path))) { retval = -EFAULT; } out: __putname(buf); out_nobuf: return retval; } // rstrt_watchdog(req) // // Called periodically to cleanup after zombies in a restart request // static void rstrt_watchdog(cr_work_t *work) { cr_rstrt_req_t *req = container_of(work, cr_rstrt_req_t, work); cr_task_t *cr_task, *next; int finished; write_lock(&cr_task_lock); write_lock(&req->lock); list_for_each_entry_safe(cr_task, next, &req->tasks, req_list) { struct task_struct *task = cr_task->task; if ((task->self_exec_id - cr_task->self_exec_id) > 1) { CR_WARN_PROC_REQ(cr_task->rstrt_proc_req, "%s: tgid/pid %d/%d exec()ed '%s' during restart", __FUNCTION__, task->tgid, task->pid, task->comm); // Fall through to delete_dead_task() } else if (cri_task_dead(task)) { int signo = task->exit_code & 0x7f; CR_WARN_PROC_REQ(cr_task->rstrt_proc_req, "%s: '%s' (tgid/pid %d/%d) exited with " "%s %d during restart", __FUNCTION__, task->comm, task->tgid, task->pid, signo ? "signal" : "code", signo ? signo : (task->exit_code & 0xff00) >> 8); // Fall through to delete_dead_task() } else { continue; // DO NOT fall through to delete_dead_task } // Note that the watchdog and each restarted task // hold a reference, so this delete_dead_task() // can't destroy req. CRI_ASSERT(atomic_read(&req->ref_count) >= 2); delete_dead_task(req, cr_task); } // We are done if procs have arrived, but are all gone now finished = !req->need_procs && list_empty(&req->tasks); // We are also done if the requester died before spawning the procs finished |= (1 == atomic_read(&req->ref_count)); write_unlock(&req->lock); write_unlock(&cr_task_lock); if (finished) { __cr_wd_del(work); release_rstrt_req(req); } } /** * cr_rstrt_abort * @cr_task: The task requesting the abort * @flags: abort type * * Returns: 0 if restart successfully aborted. */ int cr_rstrt_abort(cr_task_t *cr_task, unsigned int flags) { cr_rstrt_proc_req_t *proc_req; cr_rstrt_req_t *req; int result; CR_KTRACE_FUNC_ENTRY("flags=0x%x", flags); /* Lookup the request */ result = -ESRCH; proc_req = cr_task->rstrt_proc_req; if (!proc_req || !proc_req->req) { CR_ERR("%s: No matching req found!", __FUNCTION__); goto out; } req = proc_req->req; if (!flags) { /* Ignore flags=0 case */ result = 0; goto out; } write_lock(&cr_task_lock); write_lock(&req->lock); result = req->result = -CR_ERSTRTABRT; req->die = 1; /* tell all procs to kill themselves */ send_sig_info(SIGKILL, NULL, current); /* kill self */ delete_dead_task(req, cr_task); write_unlock(&req->lock); write_unlock(&cr_task_lock); out: CR_KTRACE_FUNC_EXIT("Returning %d", result); return result; } static int do_rstrt_log(struct file *filp, char __user *buf, unsigned int len) { cr_pdata_t *priv; cr_rstrt_req_t *req; int retval; CR_KTRACE_FUNC_ENTRY(); retval = -EINVAL; if (filp == NULL) { CR_ERR("%s: Called with NULL file structure", __FUNCTION__); goto out; } priv = filp->private_data; if (priv == NULL) { CR_ERR("%s: private_data is NULL!", __FUNCTION__); goto out; } req = priv->rstrt_req; if (req == NULL) { CR_ERR("%s: No rstrt_req attached to filp!", __FUNCTION__); goto out; } retval = cr_errbuf_read(buf, len, req->errbuf); out: CR_KTRACE_FUNC_EXIT("Returning %d", retval); return retval; } /** * cr_rstrt_log * @filp: The filp for the restart request * @arg: Pointer to user's struct cr_log_args * * Copies up to arg->len bytes to arg->buf. * For any non-error return arg->buf is nul-terminated (even for the * case of an empty log). * * The caller can determine the space required by calling w/ arg->len * set to zero. * * Returns: Number of bytes required to retrieve full log. */ int cr_rstrt_log(struct file *filp, struct cr_log_args __user *arg) { unsigned int len; char __user *buf; int retval; CR_KTRACE_FUNC_ENTRY(); retval = -EFAULT; if (!access_ok(VERIFY_READ, arg, sizeof(*arg)) || __get_user(len, &arg->len) || __get_user(buf, &arg->buf)) { goto out; } retval = do_rstrt_log(filp, buf, len); out: CR_KTRACE_FUNC_EXIT("Returning %d", retval); return retval; } #ifdef CONFIG_COMPAT int cr_rstrt_request_restart32(struct file *file, struct cr_compat_rstrt_args __user *req) { struct cr_rstrt_args ureq; compat_uptr_t relocate; int retval; CR_KTRACE_FUNC_ENTRY(); retval = -EFAULT; if (!access_ok(VERIFY_READ, req, sizeof(*req)) || __get_user(ureq.cr_fd, &req->cr_fd) || __get_user(ureq.signal, &req->signal) || __get_user(relocate, &req->relocate) || __get_user(ureq.flags, &req->flags)) { goto out; } ureq.relocate = compat_ptr(relocate); retval = do_rstrt_request_restart(file, &ureq, cr_read_reloc32); out: CR_KTRACE_FUNC_EXIT("Returning %d", retval); return retval; } int cr_rstrt_procs32(struct file *filp, struct cr_compat_procs_tbl __user *arg) { struct cr_section_header cf_header; int retval; CR_KTRACE_FUNC_ENTRY(); retval = do_rstrt_procs(filp, &cf_header); if (retval == 1) { /* Copy the process-header info to user space */ if (!access_ok(VERIFY_WRITE, arg, sizeof(*arg)) || __put_user(cf_header.num_threads, &arg->threads) || __put_user(cf_header.clone_flags, &arg->clone_flags)) { retval = -EFAULT; } } CR_KTRACE_FUNC_EXIT("Returning %d", retval); return retval; } int cr_rstrt_log32(struct file *filp, struct cr_compat_log_args __user *arg) { unsigned int len; compat_uptr_t buf; int retval; CR_KTRACE_FUNC_ENTRY(); retval = -EFAULT; if (!access_ok(VERIFY_READ, arg, sizeof(*arg)) || __get_user(len, &arg->len) || __get_user(buf, &arg->buf)) { goto out; } retval = do_rstrt_log(filp, compat_ptr(buf), len); out: CR_KTRACE_FUNC_EXIT("Returning %d", retval); return retval; } #endif /* CONFIG_COMPAT */ int cr_rstrt_init(void) { int retval = 0; cr_linkage_cachep = CR_KMEM_CACHE(cr_linkage_s); if (!cr_linkage_cachep) { retval = -ENOMEM; } return retval; } void cr_rstrt_cleanup(void) { if (cr_linkage_cachep) kmem_cache_destroy(cr_linkage_cachep); } blcr-0.8.5/cr_module/cr_io.c0000664000000000000000000010247012071454304012553 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2008, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * 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 * * $Id: cr_io.c,v 1.77.4.6 2013/01/04 04:21:24 phargrov Exp $ */ /* * Implements basic read and write calls for kernel space */ #include "cr_module.h" #include #include #include #if CRI_DEBUG /* Rates (as in 1-in-X) for artificial I/O faults */ #include unsigned int cr_read_fault_rate = 0; unsigned int cr_write_fault_rate = 0; #endif /* Avoid requesting any I/O > 64 MB (prevents problems on busted kernels). * Also avoids accidentally negative return values on 32-bit */ #define _CR_DFLT_IO_MAX 0x4000000UL unsigned long cr_io_max = _CR_DFLT_IO_MAX; unsigned long cr_io_max_mask = ~(_CR_DFLT_IO_MAX - 1); #define CR_TRIM_XFER(_bytes) ((((_bytes) & cr_io_max_mask) ? cr_io_max : (_bytes))) /* [uk]{read,write} basically ripped off from vmadump */ /* Loops on short reads, but return -EIO if vfs_read() returns zero */ ssize_t cr_uread(cr_errbuf_t *eb, struct file *file, void *buf, size_t count) { ssize_t retval; ssize_t bytes_left = count; char *p = buf; while (bytes_left) { const ssize_t r = vfs_read(file, p, CR_TRIM_XFER(bytes_left), &file->f_pos); if (r <= 0) { CR_ERR_EB(eb, "vfs_read returned %ld", (long int)r); retval = r; if (!retval) retval = -EIO; /* Map zero -> EIO */ goto out; } bytes_left -= r; p += r; } retval = count; #if CRI_DEBUG if (cr_read_fault_rate) { unsigned int x; get_random_bytes(&x, sizeof(x)); if (!(x % cr_read_fault_rate)) { CR_INFO("injecting READ fault"); retval = -EFAULT; } } #endif out: return retval; } /* Loops on short writes, but return -EIO if vfs_write() returns zero */ ssize_t cr_uwrite(cr_errbuf_t *eb, struct file *file, const void *buf, size_t count) { ssize_t retval; ssize_t bytes_left = count; const char *p = buf; while (bytes_left) { const ssize_t w = vfs_write(file, p, CR_TRIM_XFER(bytes_left), &file->f_pos); if (w <= 0) { CR_ERR_EB(eb, "vfs_write returned %ld", (long int)w); retval = w; if (!retval) retval = -EIO; /* Map zero -> EIO */ goto out; } bytes_left -= w; p += w; } retval = count; #if CRI_DEBUG if (cr_write_fault_rate) { unsigned int x; get_random_bytes(&x, sizeof(x)); if (!(x % cr_write_fault_rate)) { CR_INFO("injecting WRITE fault"); retval = -EFAULT; } } #endif out: return retval; } ssize_t cr_kread(cr_errbuf_t *eb, struct file *file, void *buf, size_t count) { ssize_t retval; mm_segment_t oldfs = get_fs(); set_fs(KERNEL_DS); retval = cr_uread(eb, file, buf, count); set_fs(oldfs); return retval; } ssize_t cr_kwrite(cr_errbuf_t *eb, struct file *file, const void *buf, size_t count) { ssize_t retval; mm_segment_t oldfs = get_fs(); set_fs(KERNEL_DS); retval = cr_uwrite(eb, file, buf, count); set_fs(oldfs); return retval; } /* Skip unused data * XXX: Could/should we just seek when possible? */ int cr_skip(struct file *filp, loff_t len) { ssize_t r; void *buf; mm_segment_t oldfs; r = -ENOMEM; CR_NO_LOCKS(); buf = (void *) __get_free_page(GFP_KERNEL); if (!buf) goto out; oldfs = get_fs(); set_fs(KERNEL_DS); while (len) { r = vfs_read(filp, buf, (len > PAGE_SIZE) ? PAGE_SIZE : len, &filp->f_pos); if (r <= 0) break; len -= r; } set_fs(oldfs); free_page((unsigned long)buf); if (r == 0) r = -EIO; /* EOF */ out: return (int)r; } /* * cr_fgets * * Sort of like fgets. * Returns length (including '\0') on success, or <0 on error. * 0 return means string is NULL, 1 means empty string. */ int cr_fgets(cr_errbuf_t *eb, char *buf, int size, struct file *filp) { int ret; int len = 0; /* Argument checking */ ret = -EINVAL; if (!buf) { CR_ERR_EB(eb, "cr_fgets: NULL buffer pass as argument!"); goto out; } if (size <= 0) { CR_ERR_EB(eb, "cr_fgets: Bad buffer size %d.", size); goto out; } ret = cr_kread(eb,filp, &len, sizeof(len)); if (ret != sizeof(len)) { CR_ERR_EB(eb, "cr_fgets: read len returned %d", ret); goto out; } if ((len < 0) || (len > size)) { ret = -EINVAL; CR_ERR_EB(eb, "cr_fgets: Bad string length %d in file.", len); goto out; } if (len == 0) { /* old string was NULL. i.e. never initialized rather than a * pointer to an empty string */ goto out; } ret = cr_kread(eb, filp, buf, len); if (ret != len) { CR_ERR_EB(eb, "cr_fgets: read buf returned %d", ret); goto out; } out: return (ret < 0) ? ret : len; } /* * cr_fputs * * Slightly different than fputs, since it writes the '\0' also, and refuses to * write anything larger than a PATH_MAX * * Returns number of bytes written on success. */ int cr_fputs(cr_errbuf_t *eb, const char *buf, struct file *filp) { int ret; int wrote=0; int len; ret = -EIO; /* we actually want to know when someone wrote NULL to an area, so we * can restore the NULL on restart. */ if (!buf) { /* magic length of 0 for NULL buf */ len = 0; } else { /* we write out the length WITH the '\0' termination. */ len = strlen(buf)+1; } /* compare l+1 to avoid type issue wrt promotion of len+1 to unsigned * long in comparison against PATH_MAX */ if ((len < 0) || (len+1 > PATH_MAX+1)) { CR_ERR_EB(eb, "cr_fputs: String length (%d) out of bounds.", len); ret = -EINVAL; goto out; } ret = cr_kwrite(eb, filp, &len, sizeof(len)); wrote += ret; if (ret != sizeof(len)) { CR_ERR_EB(eb, "cr_fputs: write len returned %d", ret); goto out; } if (len) { ret = cr_kwrite(eb, filp, buf, len); wrote += ret; if (ret != len) { CR_ERR_EB(eb, "cr_fputs: write buf returned %d", ret); goto out; } } ret = wrote; out: return ret; } /* Read in a filename from the context file, obtaining memory from __getname */ const char *__cr_getname(cr_errbuf_t *eb, struct file *filp, int null_ok) { char *name; int err; name = __getname(); if (!name) { CR_ERR_EB(eb, "Couldn't allocate buffer for file name."); err = -ENOMEM; goto out; } /* now read out the name */ err = cr_fgets(eb, name, PATH_MAX, filp); if (err < 0) { CR_ERR_EB(eb, "Bad read of filename."); goto out_free; } else if (err == 0) { if (!null_ok) err = -EIO; goto out_free; } return name; out_free: __putname(name); out: return (err < 0) ? ERR_PTR(err) : NULL; } /* Read in a filename from the context file, obtaining memory from __getname. * In addition, relocation is applied to the filename. */ const char *cr_getname(cr_errbuf_t *eb, cr_rstrt_relocate_t reloc, struct file *filp, int null_ok) { const char *path = __cr_getname(eb, filp, null_ok); if (path && !IS_ERR(path) && reloc) { path = cr_relocate_path(reloc, path, 1); } return path; } /* * Copy the given number of bytes from one file to another. * Uses naive approach that should work for all types. * This is only used when a source file lacks a readpage method * (e.g. restart from a pipes or sockets). * XXX: Could we use non-blocking writes and double buffering? * * Note: Caller is responsible for checking count==0 or src_ppos==NULL. */ static loff_t cr_sendfile_buffered(cr_errbuf_t *eb, struct file *dst_filp, struct file *src_filp, loff_t *src_ppos, loff_t count) { const size_t maxsz = (4 << PAGE_SHIFT); mm_segment_t oldfs; loff_t retval = 0; loff_t bytes_left = count; char *buf; buf = vmalloc((count < maxsz) ? count : maxsz); retval = -ENOMEM; if (!buf) goto out_nobuf; retval = -EIO; oldfs = get_fs(); set_fs(KERNEL_DS); while (bytes_left) { ssize_t buffered; char *p = buf; /* Read as much as we can in a single call */ buffered = vfs_read(src_filp, p, (bytes_left < maxsz) ? bytes_left : maxsz, src_ppos); if (!buffered) goto out_eof; if (buffered < 0) { CR_ERR_EB(eb, "vfs_read returned %ld", (long int)buffered); retval = buffered; goto out_err; } /* Write as much as we read */ while (buffered) { ssize_t w = vfs_write(dst_filp, p, buffered, &dst_filp->f_pos); if (!w) goto out_eof; if (w < 0) { CR_ERR_EB(eb, "vfs_write returned %ld", (long int)w); retval = w; goto out_err; } bytes_left -= w; buffered -= w; p += w; } } out_eof: retval = count - bytes_left; out_err: set_fs(oldfs); vfree(buf); out_nobuf: return retval; } /* * sendfile for HUGETLBFS, via mmap */ #ifdef HPAGE_SIZE /* * Like cr_sendfile_buffered(), but for HUGETLBFS source file. * Uses temporary mmap()s of a chunk of len HPAGE_SIZE at a time. * * Note: Caller is responsible for checking count==0 or {dst,src}_ppos==NULL. */ static loff_t cr_sendfile_hugesrc(cr_errbuf_t *eb, struct file *dst_filp, struct file *src_filp, loff_t *src_ppos, loff_t count) { loff_t bytes_left = count; loff_t retval; struct mm_struct *mm = current->mm; unsigned long map_addr = 0; unsigned long map_pgoff = 0; unsigned long map_flags = MAP_SHARED; CRI_ASSERT((count & (HPAGE_SIZE-1)) == 0); CRI_ASSERT(*src_ppos == 0); for (bytes_left = count; bytes_left; bytes_left -= HPAGE_SIZE) { unsigned long tmp; down_write(&mm->mmap_sem); tmp = cr_mmap_pgoff(src_filp, map_addr, HPAGE_SIZE, PROT_READ, map_flags, map_pgoff); up_write(&mm->mmap_sem); if (IS_ERR((void*)tmp)) { CR_ERR_EB(eb, "mmap(HUGE src file) returned %ld", (long)tmp); retval = tmp; goto out_unmap; } map_addr = tmp; map_pgoff += (HPAGE_SIZE >> PAGE_SHIFT); map_flags |= MAP_FIXED; retval = cr_uwrite(eb, dst_filp, (void *)map_addr, HPAGE_SIZE); if (retval < 0) goto out_err; } retval = count; *src_ppos = count; out_unmap: if (map_addr) { (void)sys_munmap(map_addr, HPAGE_SIZE); // XXX: check for error (unless on error path already)? } out_err: return retval; } /* * Like cr_sendfile_buffered(), but for HUGETLBFS destination file. * Uses temporary mmap()s of a chunk of len HPAGE_SIZE at a time. * * Note: Caller is responsible for checking count==0 or {dst,src}_ppos==NULL. */ static loff_t cr_sendfile_hugedst(cr_errbuf_t *eb, struct file *dst_filp, struct file *src_filp, loff_t *src_ppos, loff_t count) { loff_t bytes_left = count; loff_t retval; struct mm_struct *mm = current->mm; unsigned long map_addr = 0; unsigned long map_pgoff = 0; unsigned long map_flags = MAP_SHARED; CRI_ASSERT((count & (HPAGE_SIZE-1)) == 0); CRI_ASSERT(dst_filp->f_pos == 0); CRI_ASSERT(src_ppos = &src_filp->f_pos); for (bytes_left = count; bytes_left; bytes_left -= HPAGE_SIZE) { unsigned long tmp; down_write(&mm->mmap_sem); tmp = cr_mmap_pgoff(dst_filp, map_addr, HPAGE_SIZE, PROT_READ|PROT_WRITE, map_flags, map_pgoff); up_write(&mm->mmap_sem); if (IS_ERR((void*)tmp)) { CR_ERR_EB(eb, "mmap(HUGE dst file) returned %ld", (long)tmp); retval = tmp; goto out_err; } map_addr = tmp; map_pgoff += (HPAGE_SIZE >> PAGE_SHIFT); map_flags |= MAP_FIXED; retval = cr_uread(eb, src_filp, (void *)map_addr, HPAGE_SIZE); if (retval < 0) goto out_unmap; } retval = count; dst_filp->f_pos = count; out_unmap: if (map_addr) { (void)sys_munmap(map_addr, HPAGE_SIZE); // XXX: check for error (unless on error path already)? } out_err: return retval; } #endif /* * sendfile via splice_direct_to_actor */ #if HAVE_SPLICE_DIRECT_TO_ACTOR #include static int cr_splice_actor(struct pipe_inode_info *pipe, struct splice_desc *sd) { struct file *file = sd->u.file; return file->f_op->splice_write(pipe, file, &file->f_pos, sd->total_len, sd->flags); } static loff_t cr_splice_direct(struct file *src_filp, loff_t *src_ppos, struct file *dst_filp, loff_t count) { struct splice_desc sd = { .len = count, .total_len = count, .flags = 0, .pos = *src_ppos, .u.file = dst_filp, }; long ret = splice_direct_to_actor(src_filp, &sd, cr_splice_actor); if (ret > 0) { *src_ppos += ret; } return ret; } #endif // HAVE_SPLICE_DIRECT_TO_ACTOR /* * sendfile via do_generic_file_read() */ #if HAVE_4_ARG_DO_GENERIC_FILE_READ #define cr_generic_file_read(_f,_p,_d,_a) do_generic_file_read((_f),(_p),(_d),(_a)) #elif HAVE_5_ARG_DO_GENERIC_FILE_READ /* RH9 and RHEL add a non-block flag */ #define cr_generic_file_read(_f,_p,_d,_a) do_generic_file_read((_f),(_p),(_d),(_a),0) #endif #ifdef cr_generic_file_read #if HAVE_READ_DESCRIPTOR_T_BUF #define CR_ACTOR_DATA(_desc) ((_desc)->buf) #elif HAVE_READ_DESCRIPTOR_T_ARG_DATA #define CR_ACTOR_DATA(_desc) ((_desc)->arg.data) #else #error #endif static int cr_sendfile_actor(read_descriptor_t *desc, struct page *page, unsigned long offset, unsigned long size) { struct file *dst_filp = (struct file *)CR_ACTOR_DATA(desc); unsigned long bytes_left; char *addr, *p; mm_segment_t oldfs; ssize_t w = 0; if (size > desc->count) { size = desc->count; } bytes_left = size; oldfs = get_fs(); set_fs(KERNEL_DS); addr = kmap(page); p = addr + offset; while (bytes_left) { w = vfs_write(dst_filp, p, bytes_left, &dst_filp->f_pos); if (w <= 0) break; p += w; bytes_left -= w; } kunmap(page); set_fs(oldfs); if (w < 0) { desc->error = w; w = 0; } else { w = size - bytes_left; desc->count -= w; desc->written += w; } return (int)w; } static loff_t cr_sendfile_generic_read(struct file *dst_filp, struct file *src_filp, loff_t *src_ppos, loff_t count) { read_descriptor_t desc; loff_t retval = 0; CR_ACTOR_DATA(&desc) = (char *)dst_filp; /* Yes, (char*) cast is needed */ #if BITS_PER_LONG == 32 while (count) { /* Max 1GB chunks to avoid overflow (negative values) in desc.written */ size_t chunk = ((count > 0x40000000) ? 0x40000000 : count); desc.count = chunk; desc.written = 0; desc.error = 0; cr_generic_file_read(src_filp, src_ppos, &desc, cr_sendfile_actor); if (!desc.written) return desc.error; if (desc.written != chunk) return -EIO; retval += chunk; count -= chunk; } #elif BITS_PER_LONG == 64 desc.count = count; desc.written = 0; desc.error = 0; cr_generic_file_read(src_filp, src_ppos, &desc, cr_sendfile_actor); retval = desc.written; if (!retval) { retval = desc.error; } else if (retval != count) { retval = -EIO; } #else #error "Unknown BITS_PER_LONG" #endif return retval; } #endif // cr_generic_file_read /* Copy the given number of bytes from one file to another. * Uses provided src_ppos for src_file (or src_file->f_pos if NULL). * "zerocopy" reads are used when the source has a readpage method. */ loff_t cr_sendfile(cr_errbuf_t *eb, struct file *dst_filp, struct file *src_filp, loff_t *src_ppos, loff_t count) { #ifdef cr_generic_file_read struct address_space *mapping; #endif if (!count) return 0; if (!src_ppos) src_ppos = &src_filp->f_pos; #ifdef HPAGE_SIZE /* The generic methods don't work on hugetlbfs files */ if (is_file_hugepages(src_filp)) { return cr_sendfile_hugesrc(eb, dst_filp, src_filp, src_ppos, count); } if (is_file_hugepages(dst_filp)) { return cr_sendfile_hugedst(eb, dst_filp, src_filp, src_ppos, count); } #endif #if HAVE_SPLICE_DIRECT_TO_ACTOR /* Our 1st choice is splice_direct_to_actor(), when available and allowed. */ if (src_filp->f_op && src_filp->f_op->splice_read && dst_filp->f_op && dst_filp->f_op->splice_write) { return cr_splice_direct(src_filp, src_ppos, dst_filp, count); } #endif #ifdef cr_generic_file_read /* Our 2nd choice algorithm is do_generic_file_read() + vfs_write() * But this is not available w/ kernel >= 2.6.25 (hence the ifdef) * nor is it available when the source is not mmap()able. */ mapping = src_filp->f_dentry->d_inode->i_mapping; if (mapping && mapping->a_ops && mapping->a_ops->readpage) { return cr_sendfile_generic_read(dst_filp, src_filp, src_ppos, count); } #endif /* Final option is vfs_read() + vfs_write() */ return cr_sendfile_buffered(eb, dst_filp, src_filp, src_ppos, count); } /* Caller is responsible for path_get()/path_put() */ static char * cr_getpath(struct path *path, char *buf, int size) { char *name = NULL; if (path->dentry == NULL) { CR_WARN("path->dentry is NULL!"); goto out; } if (path->mnt == NULL) { CR_WARN("path->vfsmnt is NULL!"); goto out; } #if HAVE_NAMEIDATA_DENTRY name = d_path(path->dentry, path->mnt, buf, size); #elif HAVE_NAMEIDATA_PATH name = d_path(path, buf, size); #else #error #endif out: return name; } const char * cr_location2path(cr_location_t *loc, char *buf, int size) { CR_PATH_DECL(path); char *name = NULL; CR_KTRACE_FUNC_ENTRY(); if (loc->filp) { /* It's a file */ CR_PATH_GET_FILE(path, loc->filp); name = cr_getpath(path, buf, size); path_put(path); } else if (loc->fs) { /* It's a directory */ CR_PATH_GET_FS(path, loc->fs->pwd); name = cr_getpath(path, buf, size - 2); path_put(path); if (name) { int len = strlen(buf); buf[len+0] = '/'; buf[len+1] = '.'; buf[len+2] = '\0'; } } else { /* I don't know what it is */ name = ""; } if (!name) { name = ERR_PTR(-EBADF); } return name; } /* Saves pathname, returning bytes written (or <0 on error), * NULL dentry yields saved string value of NULL (distinct from empty string). * Uses supplied buf, if any, or will alloc/free otherwise. */ int cr_save_pathname(cr_errbuf_t *eb, struct file *cr_filp, struct path *path, char *orig_buf, int size) { int retval; const char *name = NULL; char *buf = orig_buf; /* Short cut on NULL path or dentry */ if (!path || !path->dentry) { goto write; } /* Allocate buf if none was supplied */ if (!buf) { retval = -ENOMEM; buf = __getname(); if (!buf) { goto out; } size = PATH_MAX; } /* find the file name */ name = cr_getpath(path, buf, size); if (name == NULL) { CR_ERR_EB(eb, "Bad or non/existant name!"); retval = -EBADF; goto out_bad; } /* now write out the name */ write: retval = cr_fputs(eb, name, cr_filp); if (retval < 0) { CR_ERR_EB(eb, "cr_save_pathname - Bad file write! (cr_fputs returned %d)", retval); goto out_bad; } out_bad: if (buf && !orig_buf) { __putname(buf); } out: return retval; } int cr_save_filename(cr_errbuf_t *eb, struct file *cr_filp, struct file *filp, char *buf, int size) { int retval; if (!filp) { retval = cr_save_pathname(eb, cr_filp, NULL, buf, size); } else { CR_PATH_DECL(path); CR_PATH_GET_FILE(path, filp); retval = cr_save_pathname(eb, cr_filp, path, buf, size); path_put(path); } return retval; } int cr_kern_path(const char *name, unsigned int flags, struct path *path) { int retval; #if HAVE_KERN_PATH retval = kern_path(name, flags, path); #else struct nameidata nd; retval = path_lookup(name, flags, &nd); #if HAVE_NAMEIDATA_PATH path->dentry = nd.path.dentry; path->mnt = nd.path.mnt; #else path->dentry = nd.dentry; path->mnt = nd.mnt; #endif #endif return retval; } /* * cr_anonymous_rename * * Rewrite a filename to an anonymous value * * len is strlen and size is buffer size */ static char * cr_anonymous_rename(cr_errbuf_t *eb, const char *in_buf, unsigned long id) { size_t len; char *out_buf, *p; len = strlen(in_buf); if (len >= PATH_MAX) { /* XXX: probably not what we want to do */ len = PATH_MAX - 1; } /* strdup() */ out_buf = __getname(); if (out_buf == NULL) { goto out; } memcpy(out_buf, in_buf, len+1); /* dirname() */ p = out_buf + len; while ((p != out_buf) && (*p != '/')) { --p; } ++p; len = p - out_buf; #if BITS_PER_LONG == 32 if (len > PATH_MAX - 20) { CR_ERR_EB(eb, "cr_anonymous_rename - unlinked name too long for renaming"); goto out_free; } sprintf(p, ".blcr_%04x.%08lx", (unsigned int)current->pid, id); #elif BITS_PER_LONG == 64 if (len > PATH_MAX - 24) { CR_ERR_EB(eb, "cr_anonymous_rename - unlinked name too long for renaming"); goto out_free; } sprintf(p, ".blcr_%04x.%016lx", (unsigned int)current->pid, id); #else #error "No value for BITS_PER_LONG" #endif return out_buf; out_free: __putname(out_buf); out: return NULL; } /* Call dentry_open(). * Caller should path_get() (or dget() and mntget()) just as they would for dentry_open(). */ struct file * cr_dentry_open(struct path *path, int flags) { struct file *filp; #if !HAVE_TASK_CRED filp = dentry_open(path->dentry, path->mnt, flags); #elif HAVE_4_ARG_DENTRY_OPEN filp = dentry_open(path->dentry, path->mnt, flags, cr_current_cred()); #elif HAVE_3_ARG_DENTRY_OPEN filp = dentry_open(path, flags, cr_current_cred()); path_put(path); // dentry_open takes the ref count now #endif return filp; } /* Call both cr_permision() and cr_dentry_open(). */ struct file * cr_dentry_open_perm(struct path *path, int flags) { struct file *filp; int acc_mask = ("\004\002\006\006"[flags&O_ACCMODE]); /* ACC_MODE(open_to_namei_flags()) */ int err; err = cr_permission(path->dentry->d_inode, acc_mask); filp = ERR_PTR(err); if (!IS_ERR(filp)) { filp = cr_dentry_open(path, flags); } return filp; } /* cr_mknod * * Creates regular files or fifos (no devices) making them anonymous (unlinked) * if desired, populating the struct path appropriatly. * In the event of an error, no dput() or path_put() is required, * otherwise they are. * * In the event that an object exists with the given name, it will be * check for the proper mode prior to return, yielding -EEXIST on conflict. */ int cr_mknod(cr_errbuf_t *eb, struct path *path, const char *name, int mode, unsigned long unlinked_id) { mm_segment_t oldfs; int err; #if CRI_DEBUG /* first validate mode */ switch (mode & S_IFMT) { case S_IFREG: case S_IFIFO: break; default: CR_ERR_EB(eb, "Unknown/invalid type %d passed to cr_mknod %s.", (mode&S_IFMT), name); err = -EINVAL; goto out; } #endif if (unlinked_id) { /* Generate a replacement name which we will use instead of the original one. */ name = cr_anonymous_rename(eb, name, unlinked_id); if (!name) { CR_ERR_EB(eb, "cr_mknod - failed to rename unlinked object"); err = -ENOMEM; goto out; } } /* sys_mknod() */ oldfs = get_fs(); set_fs(KERNEL_DS); err = sys_mknod(name, mode, 0); set_fs(oldfs); if (err == -EEXIST) { /* Keep going, it may be the one we want */ } else if (err < 0) { goto out_free; } /* Now get the (struct path) for the newly-created object. * YES, there is a potential race, but we check below that we have the right object. */ err = cr_kern_path(name, LOOKUP_FOLLOW, path); if (err < 0) { CR_ERR_EB(eb, "cr_mknod: cr_kern_path(%s) returned %d after sys_mknod()", name, err); goto out_free; } /* Check that we have the desired object type. * Needed for sys_mknod() == -EEXIST and for the mknod-to-lookup race. */ if ((path->dentry->d_inode->i_mode ^ mode) & S_IFMT) { CR_ERR_EB(eb, "cr_mknod: cr_kern_path(%s) found conflicting object", name); err = -EEXIST; path_put(path); goto out_free; } /* unlink if required */ if (unlinked_id) { /* Note possibility of silent failure here: */ oldfs = get_fs(); set_fs(KERNEL_DS); (void) sys_unlink(name); set_fs(oldfs); } out_free: if (unlinked_id) { __putname(name); } out: return err; } /* Calls cr_mknod and then opens with the given flags, returning a (struct file *) */ struct file * cr_filp_mknod(cr_errbuf_t *eb, const char *name, int mode, int flags, unsigned long unlinked_id) { struct path path; struct file *filp; int err; /* mknod */ err = cr_mknod(eb, &path, name, mode, unlinked_id); if (err) { CR_KTRACE_UNEXPECTED("Failed to recreate %sfilesystem object %s, err=%d.", unlinked_id?"unlinked ":"", name, err); filp = (struct file *)ERR_PTR(err); goto out; } /* now open it */ path_get(&path); filp = cr_dentry_open_perm(&path, flags); if (IS_ERR(filp)) { CR_ERR_EB(eb, "Failed to reopen %sfilesystem object %s, err=%d.", unlinked_id?"unlinked ":"", name, (int)PTR_ERR(filp)); goto out_put; } /* check that we actually got the expected type */ if ((mode ^ filp->f_dentry->d_inode->i_mode) & S_IFMT) { CR_ERR_EB(eb, "Type conflict when recreating %sfilesystem object %s.", unlinked_id?"unlinked ":"", name); fput(filp); filp = ERR_PTR(-EEXIST); } out_put: path_put(&path); out: return filp; } int cr_filp_chmod(struct file *filp, mode_t mode) { int retval, fd; retval = get_unused_fd(); if (retval < 0) { goto out; } fd = retval; get_file(filp); fd_install(fd, filp); retval = sys_fchmod(fd, mode); (void)sys_close(fd); out: return retval; } /* Construct an unlinked file and read its data from the context file */ /* If the original file location doesn't work, try "/tmp/" */ struct file *cr_mkunlinked(cr_errbuf_t *eb, struct file *cr_filp, const char *name, int mode, int flags, loff_t size, unsigned long unlinked_id) { const char *tmpdir = "/tmp/"; /* XXX: Ick. Note trailing '/' is required */ struct file *filp; loff_t w; const int xmodes = (S_IRUSR | S_IWUSR); #if CRI_DEBUG filp = ERR_PTR(-EINVAL); if (!unlinked_id) { CR_ERR_EB(eb, "Zero 'unlinked_id' passed to %s", __FUNCTION__); goto out; } if ((mode&S_IFMT) && ((mode&S_IFMT) != S_IFREG)) { CR_ERR_EB(eb, "Bad mode %d passed to %s", mode, __FUNCTION__); goto out; } #endif /* make a new unlinked file, suitable for writting in the saved data */ filp = cr_filp_mknod(eb, name, mode|xmodes|S_IFREG, O_LARGEFILE|O_RDWR, unlinked_id); if (IS_ERR(filp)) { filp = cr_filp_mknod(eb, tmpdir, mode|xmodes|S_IFREG, O_LARGEFILE|O_RDWR, unlinked_id); } if (IS_ERR(filp)) { CR_ERR_EB(eb, "Failed to recreate unlinked file %s, err=%d.", name, (int)PTR_ERR(filp)); goto out; } /* and populate it with the saved data */ /* XXX: If/when we split the create from the populate, then we'll need to either * do an ftruncate() here, or else defer the llseek() until post-populate. */ w = cr_sendfile(eb, filp, cr_filp, NULL, size); if (w != size) { filp = ERR_PTR(w); if (w >= 0) filp = ERR_PTR(-EIO); goto out; } /* Now reopen with caller-requested flags, if different */ if (filp->f_flags != flags) { struct file *tmp = cr_filp_reopen(filp, flags); (void)filp_close(filp, current->files); filp = tmp; /* Even on error. */ } if (IS_ERR(filp)) goto out; /* If we forced S_I[RW]USR, then fix it so fstat() doesn't reveal any change. */ if ((mode & xmodes) != xmodes) { int err = cr_filp_chmod(filp, mode); if (err < 0) { filp_close(filp, current->files); filp = ERR_PTR(err); } } out: return filp; } /* Create a new link to an existing (but potentially unlinked) dentry. * If the target link already exists we return the dentry, but if the target * exists and is not a link to the desired object, we return -EEXIST. * * NOTE: We once tried to do this via vfs_link(), rather than sys_link(). * That was "better" in the sense that it was able to link to unlinked * targets (which this cannot). However, that was not working over NFS * for reasons I never did figure out. -PHH */ struct dentry * cr_link(cr_errbuf_t *eb, struct path *old_path, const char *name) { struct path path; char *buf, *old_name; struct dentry *new_dentry = NULL; int retval; mm_segment_t oldfs; /* Lookup the path to the "old" file. * This is the part that prevents us from linking to an unlinked target. */ retval = -ENOMEM; buf = __getname(); if (!buf) goto out; old_name = cr_getpath(old_path, buf, PATH_MAX); if (IS_ERR(old_name)) { retval = PTR_ERR(old_name); goto out_free; } /* Now sys_link() */ oldfs = get_fs(); set_fs(KERNEL_DS); retval = sys_link(old_name, name); set_fs(oldfs); if (retval == -EEXIST) { /* Keep going, it may be the one we want */ } else if (retval < 0) { CR_ERR_EB(eb, "cr_link: sys_link(%s,%s) returned %d", old_name, name, retval); goto out_free; } /* Now get the dentry for the newly-created object. * YES, there is a potential race, but we check below that we have the right object. */ retval = cr_kern_path(name, LOOKUP_FOLLOW, &path); if (retval < 0) { CR_ERR_EB(eb, "cr_link: cr_kern_path(%s) returned %d", name, retval); goto out_free; } new_dentry = dget(path.dentry); path_put(&path); /* Check that we have a link to the desired object. * Needed for sys_link() == -EEXIST and for the link-to-lookup race. */ if (new_dentry->d_inode != old_path->dentry->d_inode) { dput(new_dentry); retval = -EEXIST; goto out_free; } out_free: __putname(buf); out: return (retval < 0) ? ERR_PTR(retval) : new_dentry; } /* Reopen the same filesystem object as an exsiting filp. * Result is a distinct filp, with potentially different f_flags and f_mode. */ struct file * cr_filp_reopen(struct file *orig_filp, int new_flags) { struct file *result; CR_PATH_DECL(path); result = ERR_PTR(-EBADF); if (!orig_filp) goto out; CR_PATH_GET_FILE(path, orig_filp); result = cr_dentry_open_perm(path, new_flags); out: return result; } /* * cr_fd_claim * * Atomically checks and claims an fd * * returns < 0 on conflict w/ an existing fd */ int cr_fd_claim(int fd) { cr_fdtable_t *fdt; int retval; /* Mark the fd in use */ spin_lock(¤t->files->file_lock); fdt = cr_fdtable(current->files); if (cr_read_open_fd(fd, fdt)) { retval = -EBUSY; } else { retval = 0; cr_set_open_fd(fd, fdt); cr_clear_close_on_exec(fd, fdt); } spin_unlock(¤t->files->file_lock); return retval; } /* Install a given filp in a given files_struct, with CLOEXEC set. * Safe for files != current->files. * Mostly cut-and-paste from linux-2.6.0/fs/fcntl.c:locate_fd() */ int cr_dup_other(struct files_struct *files, struct file *filp) { unsigned int newfd; unsigned int start; unsigned int max_fds; int error; cr_fdtable_t *fdt; spin_lock(&files->file_lock); repeat: fdt = cr_fdtable(files); start = CR_NEXT_FD(files, fdt); newfd = start; max_fds = CR_MAX_FDS(fdt); if (start < max_fds) { newfd = find_next_zero_bit(CR_OPEN_FDS_BITS(fdt), max_fds, start); } /* XXX: Really shouldn't be using current here. * However, I haven't bothered to figure out the locking * requirements for using anything else. * XXX: Probably could just pass the limit in. * XXX: Later kernels push this into expand_files() */ error = -EMFILE; if (newfd >= CR_RLIM(current)[RLIMIT_NOFILE].rlim_cur) { goto out; } error = expand_files(files, newfd); if (error < 0) { goto out; } else if (error) { /* grew - search again (also reacquires fdt) */ goto repeat; } CR_NEXT_FD(files, fdt) = newfd + 1; /* Claim */ cr_set_open_fd(newfd, fdt); cr_set_close_on_exec(newfd, fdt); /* Install */ get_file(filp); rcu_assign_pointer(fdt->fd[newfd], filp); error = newfd; out: spin_unlock(&files->file_lock); return error; } /* Wrapper for vfs_getattr() to ensure we have the most * up-to-date inode info if working on a network filesystem. */ int cr_fstat(cr_objectmap_t map, struct file *filp) { struct dentry *dentry = filp->f_dentry; struct inode *inode = dentry->d_inode; char *map_key = 1 + (char *)dentry; int retval = 0; if (!inode->i_op->getattr) { /* Not a special fs, so trivially nothing to do */ } else if (map && cr_find_object(map, map_key, NULL)) { /* Attrs up-to-date, so nothing to do */ } else { struct kstat stat; retval = vfs_getattr(filp->f_vfsmnt, dentry, &stat); if (map && !retval) { cr_insert_object(map, map_key, (void *)1UL, GFP_KERNEL); } } return retval; } blcr-0.8.5/cr_module/cr_chkpt_req.c0000664000000000000000000013455612064133245014136 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2008, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * 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 * * $Id: cr_chkpt_req.c,v 1.264.6.5 2012/12/18 18:32:05 phargrov Exp $ */ #include "cr_module.h" #include #include // release_request() // // Release a request structure, free if reference count drops to zero. // // Returns non-zero if the request has actually been freed. // // No locks needed static int release_request(cr_chkpt_req_t *req) { int result; CRI_ASSERT(atomic_read(&req->ref_count)); result = atomic_dec_and_test(&req->ref_count); if (result) { CRI_ASSERT(list_empty(&req->procs)); cr_loc_free(&req->dest); cr_release_objectmap(req->map); fput(req->ctrl_file); cr_errbuf_free(req->errbuf); kmem_cache_free(cr_chkpt_req_cachep, req); CR_MODULE_PUT(); CR_KTRACE_ALLOC("Free cr_chkpt_req_t %p", req); } return result; } // release_proc_req() // // Try to free a proc_req and associated resources // // Must be called w/ (parent) req->lock held for writing or when // exclusive access to the proc_req is otherwise guaranteed. // TODO: atomic ref_count instead of locking parent? static void release_proc_req(cr_chkpt_proc_req_t *proc_req) { proc_req->ref_count -= 1; if (proc_req->ref_count == 0) { CRI_ASSERT(list_empty(&proc_req->tasks)); list_del_init(&proc_req->list); if (proc_req->mmaps_tbl) { vfree(proc_req->mmaps_tbl); } #if CRI_DEBUG if (proc_req->tmp_fd >= 0) { CR_ERR("Leaking tmp_fd"); } #endif kmem_cache_free(cr_chkpt_proc_req_cachep, proc_req); } } // __delete_from_req(req, cr_task) // // Remove a given task from the request list and try to free resources. // // Must be called w/ cr_task_lock held for writing. // Must be called w/ req->lock held for writing or when exclusive // access to the request list is otherwise guaranteed. static void __delete_from_req(cr_chkpt_req_t *req, cr_task_t *cr_task) { list_del_init(&cr_task->req_list); list_del_init(&cr_task->proc_req_list); if (list_empty(&req->tasks)) { wake_up(&req->wait); } release_proc_req(cr_task->chkpt_proc_req); cr_task->chkpt_req = NULL; cr_task->chkpt_proc_req = NULL; cr_task->step = 0; __cr_task_put(cr_task); } // delete_from_req(req, cr_task) // // Remove a given task from the request list and try to free resources. // // Call w/o holding locks static void delete_from_req(cr_chkpt_req_t *req, cr_task_t *cr_task) { write_lock(&cr_task_lock); write_lock(&req->lock); __delete_from_req(req, cr_task); write_unlock(&req->lock); write_unlock(&cr_task_lock); } // delete_dead_task(req, cr_task) // // Remove a dead (or dying) task from the request // // Must be called w/ cr_task_lock held for writing. // Must be called w/ req->lock held for writing or when exclusive // access to the request list is otherwise guaranteed. // // We don't (yet) raise any error flags here because it is legal // for us to lose a race against an exiting process/thread. // The reap path will catch the case in which ALL tasks died. static void delete_dead_task(cr_chkpt_req_t *req, cr_task_t *cr_task) { cr_chkpt_advance_to(cr_task, CR_CHKPT_STEP_DONE, 1); __delete_from_req(req, cr_task); (void)release_request(req); } // check_done(req) // // Returns non-zero if the request can be reaped. // // Call w/o holding the locks static int check_done(cr_chkpt_req_t *req) { int retval; write_lock(&req->lock); retval = list_empty(&req->tasks); write_unlock(&req->lock); // Try to remove from watchdog list if done // This is only an optimization, not a correctness requirement if (retval && cr_wd_del(&req->work)) { // Release watchdog's ref_count. // The current task (the requester) must hold an additional reference. CRI_ASSERT(atomic_read(&req->ref_count) >= 2); (void)release_request(req); } return retval; } // chkpt_watchdog(req) // // Called periodically to cleanup after zombies and to enforce // the time limit on a checkpoint request. // // XXX: no time limit yet static void chkpt_watchdog(cr_work_t *work) { cr_chkpt_req_t *req = container_of(work, cr_chkpt_req_t, work); cr_task_t *cr_task, *next; int empty; write_lock(&cr_task_lock); write_lock(&req->lock); list_for_each_entry_safe(cr_task, next, &req->tasks, req_list) { struct task_struct *task = cr_task->task; if (task->self_exec_id != cr_task->self_exec_id) { CR_WARN_PROC_REQ(cr_task->rstrt_proc_req, "%s: tgid/pid %d/%d exec()ed '%s' during checkpoint", __FUNCTION__, task->tgid, task->pid, task->comm); // fall through to delete_dead_task() } else if (cri_task_dead(task)) { int signo = task->exit_code & 0x7f; CR_WARN_PROC_REQ(cr_task->chkpt_proc_req, "%s: '%s' (tgid/pid %d/%d) exited with " "%s %d during checkpoint", __FUNCTION__, task->comm, task->tgid, task->pid, signo ? "signal" : "code", signo ? signo : (task->exit_code & 0xff00) >> 8); // Raise an error if we killed it // XXX: this is now unlikely, given that we check // for the signal handler at request time. Remove? if (signo == CR_SIGNUM) { req->result = -CR_ENOSUPPORT; } // fall through to delete_dead_task() } else { #if CRI_DEBUG CR_SIGNAL_LOCK(task); if (sigismember(&task->blocked, CR_SIGNUM) && sigismember(&task->pending.signal, CR_SIGNUM)) { CR_ERR("Task %d (%s) has CR_SIGNUM blocked", task->pid, task->comm); } // XXX: Need 1-arg recalc_sigpending() or equivalent //sigdelset(&task->blocked, CR_SIGNUM); //cr_recalc_sigpending_tsk(task) CR_SIGNAL_UNLOCK(task); #endif continue; // DO NOT fall through to delete_dead_task } // Note that the watchdog and each target task // hold a reference, so this delete_dead_task() // can't destroy req. CRI_ASSERT(atomic_read(&req->ref_count) >= 2); delete_dead_task(req, cr_task); } empty = list_empty(&req->tasks); if (!empty && req->has_expiration && time_after_eq(jiffies, req->expiration)) { CR_INFO("%s: timeout detected", __FUNCTION__); // XXX: handle timeout case here #if 1 // XXX: temporary alternative req->has_expiration = 0; #endif } write_unlock(&req->lock); write_unlock(&cr_task_lock); if (empty) { __cr_wd_del(work); release_request(req); } } // alloc_request() // // Allocate and initialize a request structure // // No locks needed static cr_chkpt_req_t * alloc_request(struct file *ctrl_file) { static struct lock_class_key lock_key; cr_chkpt_req_t *req = NULL; cr_objectmap_t map; if (!CR_MODULE_GET()) { CR_ERR("Checkpoint request after rmmod!"); req = ERR_PTR(-EINVAL); goto out_rmmod; } map = cr_alloc_objectmap(); if (!map) { goto out_modput; } CR_NO_LOCKS(); req = cr_kmem_cache_zalloc(*req, cr_chkpt_req_cachep, GFP_KERNEL); if (req) { CR_KTRACE_ALLOC("Alloc cr_chkpt_req_t %p", req); atomic_set(&req->ref_count, 1); atomic_set(&req->completed, 0); INIT_LIST_HEAD(&req->tasks); INIT_LIST_HEAD(&req->procs); init_waitqueue_head(&req->wait); req->requester = current->tgid; rwlock_init(&req->lock); lockdep_set_class(&req->lock, &lock_key); req->result = 0; req->has_expiration = 0; req->map = map; req->die = 0; init_MUTEX(&req->serial_mutex); CR_INIT_WORK(&req->work, &chkpt_watchdog); cr_barrier_init(&req->preshared_barrier, 0); cr_barrier_init(&req->postdump_barrier, 0); req->ctrl_file = cr_filp_reopen(ctrl_file, O_WRONLY); req->errbuf = cr_errbuf_alloc(); } else { goto out_freemap; } return req; out_freemap: cr_release_objectmap(map); out_modput: CR_MODULE_PUT(); out_rmmod: return req; } #define CR_PTRACED_FLAG_MASK ( CR_CHKPT_PTRACED_ALLOW | \ CR_CHKPT_PTRACED_SKIP) #define CR_PTRACER_FLAG_MASK CR_CHKPT_PTRACER_SKIP static int cr_is_ptrace_child(struct task_struct *task) { #if HAVE_TASK_PTRACE return (task->ptrace & PT_PTRACED); #elif HAVE_TASK_PTRACEES struct utrace_attached_engine *engine; rcu_read_lock(); engine = utrace_attach(task, UTRACE_ATTACH_MATCH_OPS, &ptrace_utrace_ops, 0); rcu_read_unlock(); return (!IS_ERR(engine)); #else return 0; // XXX: No ptrace support!? Should this be a build-time error? #endif } static int cr_is_ptrace_parent(struct task_struct *task) { #if HAVE_TASK_PTRACEES return !list_empty(&task->ptracees); #elif HAVE_TASK_PTRACED return !list_empty(&task->ptraced); #elif HAVE_TASK_PTRACE struct task_struct *child; CR_DO_EACH_CHILD(child, task) { struct task_struct *thread = child; if (!thread_group_leader(child)) continue; do { if (thread->ptrace & PT_PTRACED) { return 1; } } while_each_thread(child, thread); } CR_WHILE_EACH_CHILD(child, task); return 0; #else return 0; // XXX: No ptrace support!? Should this be a build-time error? #endif } // "lookup" a proc (thread group) by task->mm // req->lock required unless otherwise serialized // alloction is GFP_ATOMIC because tasklist lock is normally held static cr_chkpt_proc_req_t * lookup_proc_req(cr_chkpt_req_t *req, struct task_struct *task) { cr_chkpt_proc_req_t *result = NULL; cr_chkpt_proc_req_t *tmp; const struct mm_struct *mm = task->mm; list_for_each_entry(tmp, &req->procs, list) { if (tmp->mm == mm) { result = tmp; break; } } if (!result) { result = cr_kmem_cache_zalloc(*result, cr_chkpt_proc_req_cachep, GFP_ATOMIC); // XXX: should handle NULL! result->mm = mm; result->req = req; INIT_LIST_HEAD(&result->tasks); cr_barrier_init(&result->phase_barrier, 0); cr_barrier_init(&result->predump_barrier, 0); cr_barrier_init(&result->vmadump_barrier, 0); cr_barrier_init(&result->pre_complete_barrier, 0); cr_barrier_init(&result->post_complete_barrier, 0); init_MUTEX(&result->serial_mutex); list_add_tail(&result->list, &req->procs); init_waitqueue_head(&result->wait); result->saved_sa.sa.sa_handler = SIG_ERR; result->forced_sa.sa.sa_handler = SIG_ERR; result->ctrl_fd = -1; result->tmp_fd = -1; } result->ref_count++; return result; } // cr_is_dumpable(task) #if HAVE_MM_DUMPABLE #define __cr_mm_get_dumpable(mm) ((mm)->dumpable) #elif defined(CR_KCODE_get_dumpable) #define __cr_mm_get_dumpable(mm) get_dumpable(mm) #else #error #endif #define cr_is_dumpable(t) \ (((t)->mm) && (__cr_mm_get_dumpable((t)->mm) == 1)) // bad_perms(task) // // Verify that the 'current' task is permitted to checkpoint the // indicated task. The checks are based on ensuring that the // invoking user "owns" the task and will not expose sensitive data. // // Must call w/ tasklist_lock held to prevent task from disappearing. // // Returns 0 if OK. // Returns non-zero error code if permission should be denied. // static int bad_perms(struct task_struct *task) { cr_cred_t cred = cr_current_cred(), tcred; int result = 0; // We are always supposed to check capable/suser last. task_lock(task); tcred = cr_task_cred(task); if ((!cr_is_dumpable(task) || ((cred->euid != tcred->suid) && (cred->euid != tcred->uid) && (cred->uid != tcred->suid) && (cred->uid != tcred->uid))) && !cr_capable(CAP_KILL)) { result = -EPERM; } task_unlock(task); return result; } // add_task(req, task) // // This function first verfies permissions to checkpoint the task. // This function next records the req->task and task->chkpt_req associations. // The req->task association in kept by the task_list field of the req. // The task->chkpt_req association is kept by searching the list of requests, // but could be put in a hash later. // // req->lock is not needed here because we are sole user. // cr_task_lock must be held for the lookups. // // Returns 0 in the normal case. // Returns non-zero error code on failure, such as out-of-memory. // static int add_task(cr_chkpt_req_t *req, struct task_struct *task) { cr_chkpt_proc_req_t *proc_req = lookup_proc_req(req, task); cr_task_t *cr_task; int result; CR_KTRACE_FUNC_ENTRY("task=%p (%d)", task, task->pid); result = 0; /* XXX: Now that we check in add_proc(), these checks might be redundant */ if (cri_task_zombie(task)) { CR_WARN_REQ(req, "Skipped zombie task %d - a post-restart wait() will not find this task", task->pid); goto out; } else if (cri_task_dead(task)) { goto out; } result = bad_perms(task); if (result) { CR_ERR_REQ(req, "Bad permissions to checkpoint task %d", task->pid); // Bad permissions goto out; } // Check for ptrace CHILD if (cr_is_ptrace_child(task)) { int flags = (req->flags & CR_PTRACED_FLAG_MASK); if (!flags) { // Ptraced procs not allowed result = -CR_EPTRACED; goto out; } else if (flags == CR_CHKPT_PTRACED_SKIP) { // Note that result==0 goto out; } } // Check for ptrace PARENT if (cr_is_ptrace_parent(task)) { int flags = (req->flags & CR_PTRACER_FLAG_MASK); result = (flags == CR_CHKPT_PTRACER_SKIP) ? 0 : -CR_EPTRACER; goto out; } cr_task = __cr_task_get(task, 1); result = -ENOMEM; if (!cr_task) { // No memory goto out; } if ((cr_task->chkpt_req == req) || ((proc_req->req == req) && proc_req->omit)) { if (proc_req->duplicate_flag != 1) { /* * This should NEVER happen */ CR_ERR("Tried to add_task %d twice!", task->pid); result = -EINVAL; } else { // Move task from the original list to the new list // This is only required for build_req_tree(), but is always safe. // NOTE: If (!cr_task->chkpt_req) then we'll filter it off of // the list before triggers are sent. list_move_tail(&cr_task->req_list, &req->tasks); CR_KTRACE_LOW_LVL("Confirmed duplicate task %d", task->pid); result = 0; } __cr_task_put(cr_task); goto out; } else if (cr_task->chkpt_req || cr_task->rstrt_proc_req) { result = -EBUSY; // Overlapping request CR_KTRACE_LOW_LVL("Request overlap when checkpointing task %d", task->pid); __cr_task_put(cr_task); goto out; } /* XXX: This is a good spot to check the task for proper * checkpointing support (i.e. the signal handler). * However, when we move away from the signal this will * need to go away. */ if (cr_task->fd < 0) { __sighandler_t handler; CR_SIGNAL_LOCK(task); handler = CR_SIGNAL_HAND(task, CR_SIGNUM); CR_SIGNAL_UNLOCK(task); if ((handler == SIG_DFL) || (handler == SIG_IGN)) { result = -CR_ENOSUPPORT; __cr_task_put(cr_task); goto out; } } else { // Identify our saved handler, in case user has overwritten. proc_req->forced_sa = cr_task->handler_sa; proc_req->ctrl_fd = cr_task->fd; } result = 0; if (cr_task->phase == CR_PHASE1) { atomic_inc(&proc_req->phase_barrier.count); } ++proc_req->thread_count; atomic_inc(&proc_req->predump_barrier.count); atomic_inc(&proc_req->vmadump_barrier.count); atomic_inc(&proc_req->pre_complete_barrier.count); atomic_inc(&proc_req->post_complete_barrier.count); atomic_inc(&req->preshared_barrier.count); atomic_inc(&req->postdump_barrier.count); cr_task->chkpt_req = req; cr_task->chkpt_proc_req = proc_req; list_add_tail(&cr_task->req_list, &req->tasks); list_add_tail(&cr_task->proc_req_list, &proc_req->tasks); atomic_inc(&req->ref_count); proc_req->ref_count++; out: release_proc_req(proc_req); return result; } // add_proc(req, task) // // loop over add_task for all threads in the proc // // Returns 0 in the normal case. // Returns non-zero error code on failure, such as out-of-memory. // static int add_proc(cr_chkpt_req_t *req, struct task_struct *proc) { struct task_struct *task; int result = 0; CR_KTRACE_LOW_LVL("Add proc pid=%d", proc->pid); if (cri_task_zombie(proc)) { /* XXX: W/ NPTL the non-main threads could still be live */ CR_WARN_REQ(req, "Skipped zombie process %d - a post-restart wait() will not find this process", proc->tgid); goto out; } else if (cri_task_dead(proc)) { goto out; } if (!proc->mm || !proc->signal) { result = -EPERM; /* tried to checkpoint a kernel thread or something ?? */ } else { CR_DO_EACH_TASK_TGID(proc->tgid, task) { result = add_task(req, task); if (result) { break; } } CR_WHILE_EACH_TASK_TGID(proc->tgid, task); } out: return result; } // build_req_proc(req, target) // // Locates the tasks which comprise a potentially multi-threaded // process and verifies that the current task has permissions // necessary to checkpoint them. // A multi-threaded process may be named by the pid of any thread. // // Returns 0 if the tasks have been located and permissions verified. // Returns non-zero error code otherwise. // static int build_req_proc(cr_chkpt_req_t *req, pid_t target) { struct task_struct *proc; int result = -ESRCH; read_lock(&tasklist_lock); proc = target ? cr_find_task_by_pid(target) : current; // Default target is self if (proc) { /* Get all the tasks in the process */ result = add_proc(req, proc); } read_unlock(&tasklist_lock); return result; } // build_req_pgrp(req, target) // // Locates the tasks with a given process group id and verifies that the // current task has permissions necessary to checkpoint them. // // Returns 0 if the tasks have been located and permissions verified. // Returns non-zero error code otherwise. // static int build_req_pgrp(cr_chkpt_req_t *req, pid_t target) { struct task_struct *proc; int result = -ESRCH; if (!target) { // Default target is own pgrp target = cr_task_pgrp(current); } read_lock(&tasklist_lock); CR_DO_EACH_TASK_PGID(target, proc) { result = add_proc(req, proc); if (result) { break; } } CR_WHILE_EACH_TASK_PGID(target, proc); read_unlock(&tasklist_lock); return result; } // build_req_sess(req, target) // // Locates the tasks with a given session id and verifies that the // current task has permissions necessary to checkpoint them. // // Returns 0 if the tasks have been located and permissions verified. // Returns non-zero error code otherwise. // static int build_req_sess(cr_chkpt_req_t *req, pid_t target) { struct task_struct *proc; int result = -ESRCH; if (!target) { // Default target is own session target = cr_task_session(current); } read_lock(&tasklist_lock); CR_DO_EACH_TASK_SID(target, proc) { result = add_proc(req, proc); if (result) { break; } } CR_WHILE_EACH_TASK_SID(target, proc); read_unlock(&tasklist_lock); return result; } // build_req_tree(req, target) // // Locates the tasks which comprise a process tree (a process and // all of its decendents). // Note that if a parent-grandchild relation exists, but the child // has exited, then this grandchild is excluded. // // Returns 0 if the tasks have been located and permissions verified. // Returns non-zero error code otherwise. // // Implements a breadth-first-search "in-place" using the req's own // task list. // // Note: Depending on LinuxThreads vs NPTL the members of the root // task's thread group may either be its children or its siblings. // So, we unconditionally add the entire thread group of the root. // All other tasks are found via the lists of children, taking care // not to revisit the members of the root task's thread group. // static int build_req_tree(cr_chkpt_req_t *req, pid_t target) { struct task_struct *task; int result = -ESRCH; CR_KTRACE_LOW_LVL("in build_req_tree"); read_lock(&tasklist_lock); task = target ? cr_find_task_by_pid(target) : current; // Default target is self if (task) { cr_task_t *cr_task; struct mm_struct *root_mm = task->mm; /* Add "root" and all of its thread group */ result = add_proc(req, task); if (result) { goto out_fail; } CR_KTRACE_LOW_LVL("scanning children"); list_for_each_entry(cr_task, &req->tasks, req_list) { struct task_struct *child; task = cr_task->task; CR_KTRACE_LOW_LVL("found child %d", task->pid); /* Add all the children - we get their children in the list_for_each() */ CR_DO_EACH_CHILD(child, task) { struct task_struct *thread = child; if (!thread_group_leader(child)) continue; do { if (thread->mm == root_mm) continue; /* Already visited */ result = add_task(req, thread); if (result) { goto out_fail; } } while_each_thread(child, thread); } CR_WHILE_EACH_CHILD(child, task); } } out_fail: read_unlock(&tasklist_lock); return result; } static int build_req(cr_chkpt_req_t *req, cr_scope_t scope, pid_t target) { int result = -EINVAL; switch(scope) { case CR_SCOPE_PROC: result = build_req_proc(req, target); break; case CR_SCOPE_PGRP: result = build_req_pgrp(req, target); break; case CR_SCOPE_SESS: result = build_req_sess(req, target); break; case CR_SCOPE_TREE: result = build_req_tree(req, target); break; } // Validate the task list if (result) { // Keep existing failure } else if (req->flags & CR_CHKPT_PROHIBIT_SELF) { cr_task_t *cr_task; // If the request says to prohibit "self", then scan // the list for the requester, returning EDEADLK if found. list_for_each_entry(cr_task, &req->tasks, req_list) { if (cr_task->task->tgid == req->requester) { result = -EDEADLK; break; } } } return result; } static int cr_log_request(cr_chkpt_req_t *req, const char *verb, cr_scope_t scope, pid_t target, int signal) { #if CR_KERNEL_TRACING pid_t orig_target = target; #endif const char *scope_msg = ""; int result = 0; switch (scope) { case CR_SCOPE_PROC: if (!target) target = current->tgid; scope_msg = "process"; break; case CR_SCOPE_PGRP: if (!target) target = cr_task_pgrp(current); scope_msg = "process group"; break; case CR_SCOPE_SESS: if (!target) target = cr_task_session(current); scope_msg = "session"; break; case CR_SCOPE_TREE: if (!target) target = current->tgid; scope_msg = "process tree"; break; default: CR_ERR_REQ(req, "invalid scope value: %d", scope); result = -EINVAL; goto out; } if (!valid_signal(signal) && !valid_signal(-signal)) { CR_ERR_REQ(req, "invalid signal value: %d", signal); result = -EINVAL; } if (signal) { CR_KTRACE_HIGH_LVL("%s %s%s %d with signal %d", verb, orig_target ? "" : "its own ", scope_msg, target, signal); } else { CR_KTRACE_HIGH_LVL("%s %s%s %d", verb, orig_target ? "" : "its own ", scope_msg, target); } out: return result; } static int do_chkpt_req(struct file *filp, struct cr_chkpt_args *ureq) { cr_pdata_t *priv; cr_chkpt_req_t *req; int result = 0; int did_retry = 0; CR_KTRACE_FUNC_ENTRY(); // Check that we don't have a request on this fd already result = -EAGAIN; priv = filp->private_data; if (priv->chkpt_req) { goto out; } CR_KTRACE_LOW_LVL(" checkpoint params: secs= %u, fd=%d", ureq->cr_secs, ureq->cr_fd); retry: // Allocate the kernel's structure to track the request req = alloc_request(filp); if (!req) { result = -ENOMEM; goto out; } else if (IS_ERR(req)) { result = PTR_ERR(req); goto out; } if (did_retry) { CR_WARN_REQ(req, "Retry request on -CR_ENOSUPPORT"); } // XXX: Also copy the options if not NULL req->dump_format = ureq->dump_format; req->signal = ureq->signal; req->flags = ureq->flags; req->target = ureq->cr_target; req->checkpoint_scope = ureq->cr_scope; // Write simple syslog message while checking scope and signal arguments result = cr_log_request(req, "checkpointing", ureq->cr_scope, ureq->cr_target, ureq->signal); if (result) { goto out_release; } // Validate the destination file descriptor result = cr_loc_init(req->errbuf, &req->dest, ureq->cr_fd, filp, /* is_write= */ 1); if (result) { CR_ERR_REQ(req, "Failed to initialize destination file descriptor"); goto out_release; } // Hold the lock needed to ensure the request is constructed // atomically w.r.t. registration of Phase[12] checkpoint tasks // and other checkpoint requests. write_lock(&cr_task_lock); // Build the list of tasks result = build_req(req, ureq->cr_scope, ureq->cr_target); // Either cleanup or finalize if (result) { cr_task_t *cr_task, *next; // XXX: is this enough cleanup? // // req->lock not needed because we are sole user of req list_for_each_entry_safe(cr_task, next, &req->tasks, req_list) { __delete_from_req(req, cr_task); // Note that we (the requester) and each target task // hold a reference, so this release_request() can't // destroy req. CRI_ASSERT(atomic_read(&req->ref_count) >= 2); (void)release_request(req); } write_unlock(&cr_task_lock); // Retry *ONCE* on result = -CR_ENOSUPPORT // We sleep 0.5s and then try again in the hope that the // CR_ENOSUPPORT was due to a "new born" process that // had not yet registered the signal handler. if ((result == -CR_ENOSUPPORT) && !did_retry) { DECLARE_WAIT_QUEUE_HEAD_ONSTACK(dummy); release_request(req); (void)wait_event_interruptible_timeout(dummy, 0, HZ/2); did_retry = 1; goto retry; } goto out_release; } else { // Send the triggers cr_trigger_phase1(req); // Release the lock write_unlock(&cr_task_lock); // add watchdog timer, which constitutes one reference: if (ureq->cr_secs #if BITS_PER_LONG == 32 && (ureq->cr_secs < (MAX_JIFFY_OFFSET / HZ)) #endif ) { req->expiration = jiffies + HZ * ureq->cr_secs; req->has_expiration = 1; } else { // Either the requester specified no expiration or // the requested expiration is too large to handle. req->has_expiration = 0; } // watchdog gets its own reference atomic_inc(&req->ref_count); cr_wd_add(&req->work); priv->chkpt_req = req; } out: return result; out_release: if (ureq->flags & CR_CHKPT_ASYNC_ERR) { // Save the error for later reporting at REAP req->result = result; priv->chkpt_req = req; result = 0; } else { release_request(req); } goto out; } // cr_chkpt_req(user_req) // // Processes a checkpoint request received from user space. // Dispatches to build_req_*() to build a list of tasks. // Calls cr_trigger_phase1() to trigger the checkpoint. // // Returns 0 on success, or a negative error code on failure. int cr_chkpt_req(struct file *filp, struct cr_chkpt_args __user *arg) { struct cr_chkpt_args ureq; int result; CR_KTRACE_FUNC_ENTRY(); // Copy the user's request result = -EFAULT; if (copy_from_user(&ureq, arg, sizeof(ureq))) { goto out; } result = do_chkpt_req(filp, &ureq); out: CR_KTRACE_FUNC_EXIT("Returning %d", result); return result; } static void duplicate_set(cr_chkpt_req_t *req, int val) { cr_chkpt_proc_req_t *proc_req; list_for_each_entry(proc_req, &req->procs, list) { proc_req->duplicate_flag = val; } } static int do_chkpt_fwd(struct file *filp, pid_t target, cr_scope_t scope) { cr_task_t *my_cr_task; cr_chkpt_req_t *req = NULL; int result = 0; int did_retry = 0; LIST_HEAD(old_req_tasks); CR_KTRACE_FUNC_ENTRY(); // Lookup this task and find the matching request result = -ESRCH; my_cr_task = cr_task_get(current); if (!my_cr_task) { goto out; } req = my_cr_task->chkpt_req; cr_task_put(my_cr_task); if (!req) { goto out; } // Write simple syslog message while validating scope argument result = cr_log_request(req, "forwarding to", scope, target, 0); if (result) { goto out; } retry: // Hold the lock needed to ensure the request is constructed // atomically w.r.t. registration of Phase[12] checkpoint tasks // and other checkpoint requests. write_lock(&cr_task_lock); write_lock(&req->lock); /* Move existing list to a safe place */ list_splice_init(&req->tasks, &old_req_tasks); /* * Mark all proc_req's with the duplicate flag */ duplicate_set(req, 1); // Build the list of (additonal) tasks result = build_req(req, scope, target); // Send the triggers or clean up if (result) { cr_task_t *cr_task, *next; /* clean up code. We aborted (possibly part way) while adding * processes to the request. We now want to undo everything * that we may have set up earlier, and restore the req to * it's state before any of this forwarding ever occurred. */ list_for_each_entry_safe(cr_task, next, &req->tasks, req_list) { CR_KTRACE_LOW_LVL("cleaning up task: %d", cr_task->task->pid); // duplicates will move back to the orginal list below if (cr_task->chkpt_proc_req->duplicate_flag) continue; // undo barriers, remove from req, and release the req. // Note that the requester and each target task // hold a reference, so this delete_dead_task() // can't destroy req. CRI_ASSERT(atomic_read(&req->ref_count) >= 2); delete_dead_task(req, cr_task); } } else { cr_chkpt_proc_req_t *proc_req; cr_task_t *cr_task, *next; // Filter omitted tasks that were on list only for build_req_tree() list_for_each_entry_safe(cr_task, next, &req->tasks, req_list) { if (!cr_task->chkpt_req) { list_del_init(&cr_task->req_list); } } #if CRI_DEBUG /* dump the tasks out */ list_for_each_entry(cr_task, &old_req_tasks, req_list) { CR_KTRACE_LOW_LVL("old task: %d", cr_task->task->pid); } list_for_each_entry(cr_task, &req->tasks, req_list) { int is_dup = cr_task->chkpt_proc_req->duplicate_flag; CR_KTRACE_LOW_LVL("%s task: %d", (is_dup ? "dup" : "new"), cr_task->task->pid); } #endif // Send the triggers to non-duplicates read_lock(&tasklist_lock); list_for_each_entry(proc_req, &req->procs, list) { if (proc_req->duplicate_flag) continue; __cr_trigger_phase1(proc_req); } read_unlock(&tasklist_lock); } /* clear the duplicate flag */ duplicate_set(req, 0); /* Merge the new task list back with the original. */ list_splice_init(&old_req_tasks, &req->tasks); write_unlock(&req->lock); write_unlock(&cr_task_lock); // Retry *ONCE* on result = -CR_ENOSUPPORT // We sleep 0.5s and then try again in the hope that the // CR_ENOSUPPORT was due to a "new born" process that // had not yet registered the signal handler. if ((result == -CR_ENOSUPPORT) && !did_retry) { DECLARE_WAIT_QUEUE_HEAD_ONSTACK(dummy); CR_WARN_REQ(req, "Retry forwarding on -CR_ENOSUPPORT"); (void)wait_event_interruptible_timeout(dummy, 0, HZ/2); did_retry = 1; goto retry; } out: CR_KTRACE_FUNC_EXIT("Returning %d", result); return result; } // cr_chkpt_fwd(user_req) // // Propagates a checkpoint request to a different target. int cr_chkpt_fwd(struct file *filp, struct cr_fwd_args __user *arg) { pid_t target; cr_scope_t scope; int result; CR_KTRACE_FUNC_ENTRY(); // Collect the user's args result = -EFAULT; if (!access_ok(VERIFY_READ, arg, sizeof(*arg)) || __get_user(target, &arg->cr_target) || __get_user(scope, &arg->cr_scope)) { goto out; } result = do_chkpt_fwd(filp, target, scope); out: CR_KTRACE_FUNC_EXIT("Returning %d", result); return result; } // need_lock: non-zero means we must acquire req->lock. zero means we already hold it. void cr_signal_phase_barrier(cr_task_t *cr_task, int block, int need_lock) { CR_ASSERT_STEP_EQ(cr_task, CR_CHKPT_STEP_PHASE); cr_task->step++; if (cr_task->phase == CR_PHASE1) { cr_chkpt_proc_req_t *proc_req = cr_task->chkpt_proc_req; cr_barrier_notify(&proc_req->phase_barrier); //step++ outside of if() if (cr_barrier_once(&proc_req->phase_barrier, block)) { cr_chkpt_req_t *req = cr_task->chkpt_req; if (need_lock) read_lock(&req->lock); read_lock(&tasklist_lock); __cr_trigger_phase2(proc_req); read_unlock(&tasklist_lock); if (need_lock) read_unlock(&req->lock); } } } // cr_signal_predump_barrier() // Signal the per-process predump barrier // performing the associated per-process fixups int cr_signal_predump_barrier(cr_task_t *cr_task, int block) { cr_chkpt_proc_req_t *proc_req = cr_task->chkpt_proc_req; struct task_struct *task = cr_task->task; int once; CR_ASSERT_STEP_EQ(cr_task, CR_CHKPT_STEP_PREDUMP); CR_BARRIER_NOTIFY(cr_task, &proc_req->predump_barrier); once = cr_barrier_once_interruptible(&proc_req->predump_barrier, block); /* XXX: Do we need more care w.r.t. dead/dying tasks? Might we race here? */ if (cri_task_dead(task)) { // Don't check 'once' - if proc is already dead cleanup is pointless (and possibly unsafe) } else if (once > 0) { // restore any saved signal handler if (proc_req->saved_sa.sa.sa_handler != SIG_ERR) { CR_SIGNAL_LOCK(task); CR_SIGACTION(task, CR_SIGNUM) = proc_req->saved_sa; CR_SIGNAL_UNLOCK(task); // NOTE: We don't reverse our forced unblocking of CR_SIGNUM // here because the signal return path would just undo it. } } return once; } // cr_signal_chkpt_complete_barrier() // Signal the per-process pre_complete barrier // performing the associated per-process fixups static void cr_signal_chkpt_complete_barrier(cr_task_t *cr_task, int block) { cr_chkpt_proc_req_t *proc_req = cr_task->chkpt_proc_req; cr_chkpt_req_t *req = cr_task->chkpt_req; CR_ASSERT_STEP_EQ(cr_task, CR_CHKPT_STEP_PRE_COMPLETE); CR_BARRIER_NOTIFY(cr_task, &proc_req->pre_complete_barrier); if (cr_barrier_once_interruptible(&proc_req->pre_complete_barrier, block) > 0) { struct task_struct *task = cr_task->task; int signal = 0; // close the temporary fd unless called from the watchdog if ((proc_req->tmp_fd >= 0) && (task == current)) { int rc = sys_close(proc_req->tmp_fd); if (rc) { CR_ERR_REQ(req, "Failed to close tmp_fd (err=%d)", rc); } proc_req->tmp_fd = -1; } // raise a signal if needed if (req->die) { signal = SIGKILL; } else if ((req->signal > 0) && !proc_req->omit) { signal = req->signal; } else if (cr_task->stopped) { signal = SIGSTOP; } if (signal) { cr_kill_process(task, signal); } } } /** * cr_chkpt_abort * @cr_task: The task requesting the abort * @flags: abort type * * Returns: 0 if checkpoint successfully aborted. */ int cr_chkpt_abort(cr_task_t *cr_task, unsigned int flags) { cr_chkpt_proc_req_t *proc_req; cr_chkpt_req_t *req; int user_flags = ((flags >> 16) & 0xffff); int result; int block = 0; CR_KTRACE_FUNC_ENTRY("flags=0x%x", flags); /* Lookup the request */ result = -ESRCH; proc_req = cr_task->chkpt_proc_req; if (!proc_req || !proc_req->req) { CR_ERR("%s: No matching req found!", __FUNCTION__); goto out; } req = proc_req->req; result = 0; write_lock(&cr_task_lock); write_lock(&req->lock); /* Set status flag of checkpoint to aborted: causes other tasks in * checkpoint (either globally or locally) to abort by end of predump barrier. */ switch (flags & 0xffff) { case CR_CHECKPOINT_PERM_FAILURE: proc_req->omit = 1; /* for bug2526's race w/ forwarding */ result = user_flags ? -user_flags : -CR_EPERMFAIL; req->result = result; req->die = 1; /* tell peers to kill themselves */ send_sig_info(SIGKILL, NULL, current); /* kill self */ break; case CR_CHECKPOINT_TEMP_FAILURE: proc_req->omit = 1; /* for bug2526's race w/ forwarding */ req->signal = 0; /* suppress post-checkpoint signal delivery */ result = user_flags ? -user_flags : -CR_ETEMPFAIL; req->result = result; break; case CR_CHECKPOINT_OMIT: proc_req->omit = 1; /* tell same-proc peers not to checkpoint */ result = -CR_EOMITTED; /* We need to block for our process to complete checkpoint. * However, need to do so *after* dropping the locks. * These ensure req and proc_req are not destroyed. */ atomic_inc(&req->ref_count); proc_req->ref_count++; block = 1; break; case 0: /* Do nothing */ CR_WARN("%s: called w/ pointless zero argument", __FUNCTION__); goto out_no_delete; break; default: CR_ERR("%s: called w/ invalid argument", __FUNCTION__); result = -EINVAL; goto out_no_delete; } delete_dead_task(req, cr_task); out_no_delete: write_unlock(&req->lock); write_unlock(&cr_task_lock); if (block) { CR_KTRACE_LOW_LVL("blocking for proces to complete (count=%d)", atomic_read(&proc_req->predump_barrier.count)); CR_ASSERT_STEP_EQ(cr_task, 0); // Was reset by delete_dead_task cr_barrier_wait_interruptible(&proc_req->predump_barrier); write_lock(&req->lock); release_proc_req(proc_req); write_unlock(&req->lock); (void)release_request(req); } out: CR_KTRACE_FUNC_EXIT("Returning %d", result); return result; } // cr_chkpt_task_complete(cr_task, block) // // Routine to release a given cr_ckpt_req_t. // Called when a task has completed checkpointing itself (or aborts). int cr_chkpt_task_complete(cr_task_t *cr_task, int block) { cr_chkpt_req_t *req = cr_task->chkpt_req; cr_chkpt_proc_req_t *proc_req = cr_task->chkpt_proc_req; cr_signal_chkpt_complete_barrier(cr_task, block); CR_BARRIER_NOTIFY(cr_task, &proc_req->post_complete_barrier); if (block) (void)cr_barrier_wait_interruptible(&proc_req->post_complete_barrier); CR_ASSERT_STEP_EQ(cr_task, CR_CHKPT_STEP_DONE); delete_from_req(req, cr_task); release_request(req); return 0; } // cr_chkpt_req_release(filp, priv) // // Routine to release checkpoint request structures // when a task closes the file (or exits). // // Must be called BEFORE cr_phase[12]_release void cr_chkpt_req_release(struct file *filp, cr_pdata_t *priv) { cr_chkpt_req_t *req; // If we are a requester, release the outstanding request. req = priv->chkpt_req; if (req && (req != CR_CHKPT_RESTARTED)) { (void)release_request(req); } } // poll method for file w/ associated checkpoint request unsigned int cr_chkpt_poll(struct file *filp, poll_table *wait) { cr_pdata_t *priv; cr_chkpt_req_t *req; priv = filp->private_data; if (!priv) { return POLLERR; } req = priv->chkpt_req; if (!req) { return POLLERR; } else if (req == CR_CHKPT_RESTARTED) { return POLLIN | POLLRDNORM; } poll_wait(filp, &req->wait, wait); return check_done(req) ? (POLLIN | POLLRDNORM) : 0; } // cr_chkpt_reap() // // Reap a completed checkpoint. // Returns: // req->result on success // -EINVAL if no un-reaped checkpoint request is associated w/ this fd // -EAGAIN if the request is not completed // -ESRCH if no task was checkpointed (possibly because they all exited on us) // -CR_ERESTARTED if task has restarted from a checkpoint of itself int cr_chkpt_reap(struct file *filp) { cr_pdata_t *priv; cr_chkpt_req_t *req; int retval; retval = -EINVAL; priv = filp->private_data; if (priv) { req = priv->chkpt_req; if (req == CR_CHKPT_RESTARTED) { retval = -CR_ERESTARTED; } else if (req) { retval = -EAGAIN; if (check_done(req)) { priv->chkpt_req = NULL; retval = req->result; // req->result might be zero because nobody was actually checkpointed if (!retval && !atomic_read(&req->completed)) { retval = -ESRCH; } (void)release_request(req); } } } return retval; } static cr_chkpt_req_t *do_chkpt_info(struct file *filp, char __user *ubuf) { cr_chkpt_req_t *req = NULL; cr_task_t *cr_task; char *buf; const char *path = NULL; int retval; CR_KTRACE_FUNC_ENTRY(); retval = -ESRCH; cr_task = cr_task_get(current); if (!cr_task) { goto out; } req = cr_task->chkpt_req; cr_task_put(cr_task); if (!req) { goto out; } retval = -ENOMEM; buf = __getname(); if (!buf) { goto out; } path = cr_location2path(&(req->dest), buf, PATH_MAX); retval = 0; if (IS_ERR(path)) { retval = PTR_ERR(path); } else if (!path) { retval = -EBADF; } else if (copy_to_user(ubuf, path, 1+strlen(path))) { retval = -EFAULT; } __putname(buf); out: CR_KTRACE_FUNC_EXIT("Returning %d", retval); return retval ? ERR_PTR(retval) : req; } int cr_chkpt_info(struct file *filp, struct cr_chkpt_info __user *arg) { cr_chkpt_req_t *req; char __user *ubuf; int retval; CR_KTRACE_FUNC_ENTRY(); retval = -EFAULT; if (get_user(ubuf, &(arg->dest))) { goto out; } req = do_chkpt_info(filp, ubuf); retval = PTR_ERR(req); if (IS_ERR(req)) { goto out; } retval = -EFAULT; if (!access_ok(VERIFY_WRITE, arg, sizeof(*arg)) || __put_user(req->requester, &arg->requester) || __put_user(req->target, &arg->target) || __put_user(req->checkpoint_scope, &arg->scope) || __put_user(req->signal, &arg->signal)) { goto out; } retval = 0; out: CR_KTRACE_FUNC_EXIT("Returning %d", retval); return retval; } // Last arg indicates if we hold the req->lock. void cr_chkpt_advance_to(cr_task_t *cr_task, int end_step, int hold_lock) { cr_chkpt_req_t *req = cr_task->chkpt_req; cr_chkpt_proc_req_t *proc_req = cr_task->chkpt_proc_req; CR_ASSERT_STEP_LE(cr_task, end_step); switch (cr_task->step) { case CR_CHKPT_STEP_PRESHARED: if (cr_task->step == end_step) break; CR_BARRIER_NOTIFY(cr_task, &req->preshared_barrier); // fall through... case CR_CHKPT_STEP_PHASE: if (cr_task->step == end_step) break; cr_signal_phase_barrier(cr_task, /* block= */0, /* need_lock= */ !hold_lock); // fall through... case CR_CHKPT_STEP_PREDUMP: if (cr_task->step == end_step) break; cr_signal_predump_barrier(cr_task, /* block= */0); // fall through... case CR_CHKPT_STEP_VMADUMP: if (cr_task->step == end_step) break; CR_BARRIER_NOTIFY(cr_task, &proc_req->vmadump_barrier); // fall through... case CR_CHKPT_STEP_POSTDUMP: if (cr_task->step == end_step) break; CR_BARRIER_NOTIFY(cr_task, &req->postdump_barrier); // fall through... case CR_CHKPT_STEP_PRE_COMPLETE: if (cr_task->step == end_step) break; cr_signal_chkpt_complete_barrier(cr_task, /* block= */0); // fall through... case CR_CHKPT_STEP_POST_COMPLETE: if (cr_task->step == end_step) break; CR_BARRIER_NOTIFY(cr_task, &proc_req->post_complete_barrier); // fall through... case CR_CHKPT_STEP_DONE: break; default: CR_ERR("Invalid cr_task->step %d", cr_task->step); } } static int do_chkpt_log(struct file *filp, char __user *buf, unsigned int len) { cr_pdata_t *priv; cr_chkpt_req_t *req; int retval; CR_KTRACE_FUNC_ENTRY(); retval = -EINVAL; if (filp == NULL) { CR_ERR("%s: Called with NULL file structure", __FUNCTION__); goto out; } priv = filp->private_data; if (priv == NULL) { CR_ERR("%s: private_data is NULL!", __FUNCTION__); goto out; } req = priv->chkpt_req; if (req == NULL) { CR_ERR("%s: No chkpt_req attached to filp!", __FUNCTION__); goto out; } else if (req == CR_CHKPT_RESTARTED) { return 0; } retval = cr_errbuf_read(buf, len, req->errbuf); out: CR_KTRACE_FUNC_EXIT("Returning %d", retval); return retval; } /** * cr_chkpt_log * @filp: The filp for the checkpoint request * @arg: Pointer to user's struct cr_log_args * * Copies up to arg->len bytes to arg->buf. * For any non-error return arg->buf is nul-terminated (even for the * case of an empty log). * * The caller can determine the space required by calling w/ arg->len * set to zero. * * Returns: Number of bytes required to retrieve full log. */ int cr_chkpt_log(struct file *filp, struct cr_log_args __user *arg) { unsigned int len; char __user *buf; int retval; CR_KTRACE_FUNC_ENTRY(); retval = -EFAULT; if (!access_ok(VERIFY_READ, arg, sizeof(*arg)) || __get_user(len, &arg->len) || __get_user(buf, &arg->buf)) { goto out; } retval = do_chkpt_log(filp, buf, len); out: CR_KTRACE_FUNC_EXIT("Returning %d", retval); return retval; } #ifdef CONFIG_COMPAT int cr_chkpt_req32(struct file *file, struct cr_compat_chkpt_args __user *req) { struct cr_chkpt_args ureq; int retval; CR_KTRACE_FUNC_ENTRY(); retval = -EFAULT; if (!access_ok(VERIFY_READ, req, sizeof(*req)) || __get_user(ureq.cr_target, &req->cr_target) || __get_user(ureq.cr_scope, &req->cr_scope) || __get_user(ureq.cr_fd, &req->cr_fd) || __get_user(ureq.cr_secs, &req->cr_secs) || __get_user(ureq.dump_format, &req->dump_format) || __get_user(ureq.signal, &req->signal) || __get_user(ureq.flags, &req->flags)) { goto out; } retval = do_chkpt_req(file, &ureq); out: CR_KTRACE_FUNC_EXIT("Returning %d", retval); return retval; } int cr_chkpt_fwd32(struct file *filp, struct cr_compat_fwd_args __user *arg) { pid_t target; cr_scope_t scope; int result; CR_KTRACE_FUNC_ENTRY(); // Collect the user's args result = -EFAULT; if (!access_ok(VERIFY_READ, arg, sizeof(*arg)) || __get_user(target, &arg->cr_target) || __get_user(scope, &arg->cr_scope)) { goto out; } result = do_chkpt_fwd(filp, target, scope); out: CR_KTRACE_FUNC_EXIT("Returning %d", result); return result; } int cr_chkpt_info32(struct file *filp, struct cr_compat_chkpt_info __user *arg) { cr_chkpt_req_t *req; compat_uptr_t ubuf; int retval; CR_KTRACE_FUNC_ENTRY(); retval = -EFAULT; if (get_user(ubuf, &(arg->dest))) { goto out; } req = do_chkpt_info(filp, compat_ptr(ubuf)); retval = PTR_ERR(req); if (IS_ERR(req)) { goto out; } retval = -EFAULT; if (!access_ok(VERIFY_WRITE, arg, sizeof(*arg)) || __put_user(req->requester, &arg->requester) || __put_user(req->target, &arg->target) || __put_user(req->checkpoint_scope, &arg->scope) || __put_user(req->signal, &arg->signal)) { goto out; } retval = 0; out: CR_KTRACE_FUNC_EXIT("Returning %d", retval); return retval; } int cr_chkpt_log32(struct file *filp, struct cr_compat_log_args __user *arg) { unsigned int len; compat_uptr_t buf; int retval; CR_KTRACE_FUNC_ENTRY(); retval = -EFAULT; if (!access_ok(VERIFY_READ, arg, sizeof(*arg)) || __get_user(len, &arg->len) || __get_user(buf, &arg->buf)) { goto out; } retval = do_chkpt_log(filp, compat_ptr(buf), len); out: CR_KTRACE_FUNC_EXIT("Returning %d", retval); return retval; } #endif /* CONFIG_COMPAT */ blcr-0.8.5/cr_module/kbuild/0000755000000000000000000000000012102072122012625 500000000000000blcr-0.8.5/cr_module/kbuild/Makefile.in0000664000000000000000000000110411021120107014604 00000000000000# Here are the configuration bits SUBDIR := cr_module TARGET := blcr IMPORTS_FROM := @TOP_BUILDDIR@/blcr_imports/kbuild # Extract source and includes/defines from non-kbuild Makefile.am _SOURCES := $(shell make --no-print-directory -C @TOP_BUILDDIR@/$(SUBDIR) echoval VARNAME=cr_sources) SOURCES := $(filter-out %.h,$(_SOURCES)) _INCLUDES := $(shell make --no-print-directory -C @TOP_BUILDDIR@/$(SUBDIR) echoval VARNAME=INCLUDES) EXTRA_CFLAGS = -Wall -I$(srcdir) -I$(top_builddir) $(subst -I.,-I$(builddir)/../.,$(_INCLUDES)) # Here is all the "real" stuff include @KBUILD_MAK@ blcr-0.8.5/cr_module/cr_pipes.c0000664000000000000000000006335712071454304013276 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2007, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * 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 * * $Id: cr_pipes.c,v 1.225.8.9 2013/01/04 04:21:24 phargrov Exp $ */ #include "cr_module.h" #include "cr_context.h" #include #if HAVE_PIPE_INODE_INFO_BASE #define CR_ALLOC_PIPEBUF(_sz) kmalloc((_sz),GFP_KERNEL) #define CR_FREE_PIPEBUF(_buf) kfree(_buf) #else #define CR_ALLOC_PIPEBUF(_sz) vmalloc(_sz) #define CR_FREE_PIPEBUF(_buf) vfree(_buf) #if HAVE_PIPE_INODE_INFO_BUFFERS static __inline__ unsigned int cr_pipe_buffers(struct pipe_inode_info *p) { return p->buffers; } #else static __inline__ unsigned int cr_pipe_buffers(struct pipe_inode_info *p) { return PIPE_BUFFERS; } #endif #endif #if HAVE_INODE_SEM #define cr_pipe_lock(_i) down(PIPE_SEM(*(_i))) #define cr_pipe_lock_interruptible(_i) down_interruptible(PIPE_SEM((*_i))) #define cr_pipe_unlock(_i) up(PIPE_SEM(*(_i))) #elif HAVE_INODE_MUTEX #define cr_pipe_lock(_i) mutex_lock(&(_i)->i_mutex) #define cr_pipe_lock_interruptible(_i) mutex_lock_interruptible(&(_i)->i_mutex) #define cr_pipe_unlock(_i) mutex_unlock(&(_i)->i_mutex) #else #error "Unknown pipe lock type" #endif /* * f_flags - same as in user space * f_mode - funny kernel thing (can reconstruct from f_flags) * 00 - no permissions needed * 01 - read permission needed * 10 - write permission needed * 11 - read/write permissions needed */ static int cr_posix_flags_to_f_mode(int posix_flags) { return ((posix_flags+1) & O_ACCMODE); } /* * This is more or less the same thing as open(), with the major exception * that we DO NOT BLOCK. (Normal open() does block in certain cases.) * We take the approach of first openning read-write. Then a second * open is done with the real flags. The presence of the first open * ensures the second will not block for lack of readers or writers. */ static int cr_open_named_fifo(cr_errbuf_t *eb, int fd, struct path *path, int flags) { int retval = 0; struct file *filp, *rw_filp; /* First we open R/W unconditionally. * * Note, since dentry_open() assumes caller has checked permissions, we * know this "extra" RDWR open will work regardless of true access rights. * THIS IS ALSO WHY WE MUST CLOSE rw_filp WHEN DONE WITH IT. */ path_get(path); rw_filp = cr_dentry_open(path, O_RDWR); retval = PTR_ERR(rw_filp); if (IS_ERR(rw_filp)) goto out; /* Now we open again w/ the desired permissions. * Note we don't short-cut on (flags==O_RDWR) because we want * the permission check that occurs in cr_filp_reopen(). */ filp = cr_filp_reopen(rw_filp, flags); filp_close(rw_filp, current->files); retval = PTR_ERR(filp); if (IS_ERR(filp)) goto out; /* Install it */ retval = cr_fd_claim(fd); if (retval < 0) { CR_ERR_EB(eb, "File descriptor %d in use.", fd); goto out; } fd_install(fd, filp); out: return retval; } /* Set up a new file pointer to an existing fifo */ static int cr_couple_named_fifo(cr_rstrt_req_t *req, struct cr_file_info *file_info, struct cr_fifo *cf_fifo, struct file *first_filp, const char *name) { cr_errbuf_t *eb = req->errbuf; struct dentry *dentry = first_filp->f_dentry; struct vfsmount *mnt = first_filp->f_vfsmnt; struct dentry *new_dentry = NULL; int retval = -EINVAL; /* * Note that the following logic is certain to work if either ALL or NONE * of the original hard links existed at checkpoint time, and again either * ALL or NONE exist at restart time. * If only SOME links exist at either point in time, then this logic may * still work, depending on ordering. However, even case in which this logic * fails to restart, it does so with an EEXIST or ENOENT, not a kernel Oops! */ if (file_info->unlinked || vmad_dentry_unlinked(dentry)) { /* We currently can't link to an unlinked file (cr_link() limitation). Also, * we don't currently bother to create a new link that we immediately unlink, * since only /proc//fd will show the difference. */ new_dentry = dget(dentry); } else if (!cr_find_object(req->map, cf_fifo->fifo_dentry, (void **) &new_dentry)) { /* We are first to use this name, so ensure the link exists (and is correct). * The link ensures that any post-restart open()s of this name will get * the correct FIFO. */ CR_PATH_DECL(path); CR_PATH_GET_FILE(path, first_filp); new_dentry = cr_link(eb, path, name); path_put(path); if (IS_ERR(new_dentry)) { retval = PTR_ERR(new_dentry); CR_ERR_REQ(req, "cr_couple_named_fifo: unable to link named fifo: %s", name); goto out; } cr_insert_object(req->map, cf_fifo->fifo_dentry, new_dentry, GFP_KERNEL); } else { /* This name is already created, so just open it again */ dget(new_dentry); } /* Now open it */ if (!new_dentry->d_inode) { CR_ERR_REQ(req, "cr_couple_named_fifo: NULL new_dentry->d_inode"); retval = -EIO; goto out_dput; } { struct path path; path.dentry = new_dentry; path.mnt = mnt; retval = cr_open_named_fifo(eb, file_info->fd, &path, cf_fifo->fifo_flags); } out_dput: dput(new_dentry); out: return retval; } /* Set up a new file pointer to an existing pipe */ static int cr_couple_unnamed_pipe(cr_rstrt_req_t *req, struct cr_file_info *file_info, struct cr_fifo *cf_fifo, struct file *first_filp) { int retval; struct file *filp; CR_KTRACE_LOW_LVL("Opening FIFO ID %p", cf_fifo->fifo_id); /* i_writecount is not incremented in do_pipe(), but is decremented below close(). * The value is never checked, so there is not a problem with letting that field * just become negative when one end of a pipe is closed. However, if we call * cr_filp_reopen() asking for write permissions, there *is* a check of i_writecount * that count fail (returning -ETXTBUSY of all things). So, we zero it here and * let its value assume a bogus positive value rather than a bogus negative one. */ atomic_set(&first_filp->f_dentry->d_inode->i_writecount, 0); filp = cr_filp_reopen(first_filp, cf_fifo->fifo_flags); retval = PTR_ERR(filp); if (IS_ERR(filp)) { goto out; } /* install the fd */ retval = cr_fd_claim(file_info->fd); if (retval) { /* this should never happen. */ CR_ERR_REQ(req, "File descriptor %d in use.", file_info->fd); goto out; } fd_install(file_info->fd, filp); out: return retval; } static int cr_creat_named_fifo(cr_errbuf_t *eb, struct cr_file_info *file_info, const struct cr_fifo *cf_fifo, const char *name) { int retval; struct path path; /* make a new FIFO, or find the existing one */ retval = cr_mknod(eb, &path, name, cf_fifo->fifo_perms, file_info->unlinked ? file_info->fd+1 : 0); if (retval) { CR_ERR_EB(eb, "Failed to create named fifo %s. err=%d.", name, retval); goto out; } /* open it */ retval = cr_open_named_fifo(eb, file_info->fd, &path, cf_fifo->fifo_flags); if (retval < 0) { CR_ERR_EB(eb, "Couldn't open %s. err=%d.", name, retval); goto out_put; } retval = 0; out_put: path_put(&path); out: return retval; } static int cr_creat_unnamed_pipe(cr_errbuf_t *eb, struct cr_file_info *file_info, const struct cr_fifo *cf_fifo) { int retval; int pipe_fds[2]; int tmp_fd; int keep; retval = cr_do_pipe(pipe_fds); if (retval < 0) { CR_ERR_EB(eb, "do_pipe() failed (%d).", retval); goto out; } /* now have two pipe objects, close one of them. */ switch (cr_posix_flags_to_f_mode(cf_fifo->fifo_flags)) { case FMODE_READ: keep = 0; break; case FMODE_WRITE: keep = 1; break; default: CR_ERR_EB(eb, "Bad access mode for pipe."); goto out; } sys_close(pipe_fds[!keep]); tmp_fd = pipe_fds[keep]; /* put the fd into the right place */ if (tmp_fd != file_info->fd) { retval = sys_dup2(tmp_fd, file_info->fd); (void)sys_close(tmp_fd); /* we ignore any error from close here. */ if (retval < 0) { CR_ERR_EB(eb, "sys_dup2(%d,%d) failed.", tmp_fd, file_info->fd); goto out; } } out: return retval; } static int cr_restore_pipe_buf(cr_errbuf_t *eb, struct file *cf_filp, struct inode *p_inode, int buf_len, int do_not_restore_flag) { struct pipe_inode_info *pipe; int retval; void *buf; if (!buf_len) { CR_KTRACE_LOW_LVL("Skipping empty pipe buffer %p", p_inode); retval = 0; goto out; } buf = (void *)CR_ALLOC_PIPEBUF(buf_len); if (!buf) { CR_ERR_EB(eb, "Unable to allocate memory for pipe buffer!"); retval = -ENOMEM; goto out; } // XXX: need eb arg for kread retval = cr_kread(eb, cf_filp, buf, buf_len); if (retval != buf_len) { CR_ERR_EB(eb, "pipe fifo: read buf returned %d", retval); goto out_free; } if (do_not_restore_flag) { CR_KTRACE_LOW_LVL("Unrestored pipe buffer %p length = %d", p_inode, buf_len); retval = 0; goto out_free; } if (cr_pipe_lock_interruptible(p_inode)) { retval = -ERESTARTSYS; goto out_free; } pipe = p_inode->i_pipe; #if HAVE_PIPE_INODE_INFO_BASE if (PIPE_LEN(*p_inode)) { /* someone put data in here already -- bail */ retval = -EBUSY; goto out_up; } if ((buf_len) > PIPE_SIZE) { /* should never happen */ retval = -ENOSPC; goto out_up; } if (buf_len) { memcpy((void *)PIPE_BASE(*p_inode), buf, buf_len); PIPE_LEN(*p_inode) = buf_len; CR_KTRACE_LOW_LVL("Pipe buffer %p length = %d inode = %lu", p_inode, buf_len, p_inode->i_ino); retval = 0; } #else { struct pipe_inode_info *pipe = p_inode->i_pipe; char * p; int nrbufs; if (pipe->nrbufs != 0) { /* someone put data in here already -- bail */ retval = -EBUSY; goto out_up; } if (buf_len > cr_pipe_buffers(pipe)*PAGE_SIZE) { /* cr_restore_open_fifo should have done this already. */ retval = -ENOSPC; goto out_up; /* Do this here instead of calling pipe_fcntl? * pipe_set_size(pipe, nr_pages); */ } nrbufs = 0; p = buf; while (buf_len) { size_t count = buf_len; struct pipe_buffer *buf = pipe->bufs + nrbufs; struct page *page = alloc_page(GFP_HIGHUSER); if (count > PAGE_SIZE) count = PAGE_SIZE; memcpy(kmap(page), p, count); kunmap(page); buf->page = page; buf->offset = 0; buf->len = count; buf->ops = &anon_pipe_buf_ops; ++nrbufs; buf_len -= count; p += count; } pipe->curbuf = 0; pipe->nrbufs = nrbufs; } #endif out_up: cr_pipe_unlock(p_inode); out_free: CR_FREE_PIPEBUF(buf); out: return retval; } /* * pipe was instantiated already, so we connect our file descriptor * to the pipe inode. */ static int cr_couple_fifo(cr_rstrt_req_t *req, struct cr_file_info *file_info, struct cr_fifo *cf_fifo, const char *name, int do_not_restore_flag) { int retval; struct file *first_filp = NULL; retval = -EINVAL; if (do_not_restore_flag) { /* The only reason we don't return right here is validation of name */ } else if (!cr_find_object(req->map, cf_fifo->fifo_id, (void **) &first_filp)) { CR_ERR_REQ(req, "cr_couple_fifo - unable to find previously restored fifo (id=%p)", cf_fifo->fifo_id); goto out; } CR_KTRACE_LOW_LVL("%s: phase 2: connecting second end.", name); /* no obvious way to distinguish named pipes from unnamed besides * filename. anything with a '/' at the beginning is a named fifo, * and anything with a 'p' is a pipe. */ retval = 0; switch (name[0]) { case '/': /* named fifo */ if (!do_not_restore_flag) { retval = cr_couple_named_fifo(req, file_info, cf_fifo, first_filp, name); if (retval < 0) { CR_ERR_REQ(req, "cr_couple_fifo: unable to open named fifo: %s", name); } } break; case 'p': /* unnamed pipe */ if (!do_not_restore_flag) { retval = cr_couple_unnamed_pipe(req, file_info, cf_fifo, first_filp); if (retval < 0) { CR_ERR_REQ(req, "cr_couple_fifo: unable to open unnamed pipe: %s", name); } } break; default: /* garbage */ retval = -EINVAL; CR_ERR_REQ(req, "bogus pipe filename in context file: %s", name); goto out; } out: return retval; } /* Returns a flip that caller must fput() */ static struct file * cr_make_new_pipe(cr_rstrt_req_t *req, struct cr_file_info *file_info, struct cr_fifo *cf_fifo, const char *name, int do_not_restore_flag) { cr_errbuf_t *eb = req->errbuf; struct file *p_filp = NULL; int err = 0; CR_KTRACE_LOW_LVL("%s: Phase 1: Making new pipe.", name); switch (name[0]) { case '/': /* named fifo */ if (do_not_restore_flag) goto out; err = cr_creat_named_fifo(eb, file_info, cf_fifo, name); break; case 'p': /* unnamed pipe */ if (do_not_restore_flag) goto out; err = cr_creat_unnamed_pipe(eb, file_info, cf_fifo); break; default: /* garbage */ err = -EINVAL; CR_ERR_REQ(req, "Bogus pipe filename in context file: %s", name); } if (err < 0) goto out; /* Might be the new pipe fd, or might be the fd protected by do-not-restore */ p_filp = fget(file_info->fd); if (!p_filp) { goto out; } /* now do the easy stuff (I'm not sure we should touch these -PHH) */ p_filp->f_pos = cf_fifo->fifo_pos; p_filp->f_version = cf_fifo->fifo_version; /* p_filp->f_fop and f_flags initialized correctly by do_pipe/mknod */ /* Map fifo_id (the pre-checkpoint inode) to the new file* for subsequent open(s) */ cr_insert_object(req->map, cf_fifo->fifo_id, p_filp, GFP_KERNEL); /* And one to distinguish multiple hard links */ cr_insert_object(req->map, cf_fifo->fifo_dentry, p_filp->f_dentry, GFP_KERNEL); out: return (err < 0) ? ERR_PTR(err) : p_filp; } #if HAVE_PIPE_FCNTL static long cr_pipe_size_init(cr_errbuf_t *eb, struct file *pipe_filp, long new_size) { static long filp_size; /* check the current size */ filp_size = pipe_fcntl(pipe_filp, F_GETPIPE_SZ, 0); if (filp_size != new_size) { /* resize the thing, this can shrink the pipe, as well as grow it */ filp_size = pipe_fcntl(pipe_filp, F_SETPIPE_SZ, new_size); if (filp_size < 0) { CR_ERR_EB(eb, "pipe_fcntl: failed with err=%ld", filp_size); } else if (filp_size < new_size) { CR_ERR_EB(eb, "Unable to set pipe size"); filp_size = -ENOSPC; } } return filp_size; } #endif extern int cr_restore_open_fifo(cr_rstrt_proc_req_t *proc_req, struct cr_file_info *file_info, int do_not_restore_flag) { cr_errbuf_t *eb = proc_req->req->errbuf; int retval = -ENOSYS; cr_rstrt_req_t *req = proc_req->req; struct file *cf_filp = proc_req->file; struct cr_fifo cf_fifo; const char *name; CR_KTRACE_FUNC_ENTRY(); /* read fifo struct */ retval = cr_kread(eb, cf_filp, &cf_fifo, sizeof(cf_fifo)); if (retval != sizeof(cf_fifo)) { CR_ERR_REQ(req, "pipe fifo: read failed"); goto out; } CR_KTRACE_LOW_LVL(" Open fifo: id == %p.", cf_fifo.fifo_id); if (cf_fifo.cr_type != cr_fifo_obj) { CR_ERR_REQ(req, "cr_restore_open_fifo. Garbage found in context file. Wrong object type."); retval = -EINVAL; goto out; } /* Force do_not_restore_flag OFF for "internal" pipes and ON for "external" ones */ if (cf_fifo.fifo_internal) { do_not_restore_flag = 0; if (fcheck(file_info->fd) != NULL) { sys_close(file_info->fd); } } else if (!do_not_restore_flag) { /* Deal with a dangling pipe by dup()ing dpipe_{in,out} */ struct file *filp; retval = -EBADF; switch (cf_fifo.fifo_flags & O_ACCMODE) { case O_RDONLY: filp = req->dpipe_in; if (!filp) { CR_ERR_REQ(req, "No alternate input file when restoring an external pipe"); goto out; } if (!(filp->f_mode & FMODE_READ)) { CR_ERR_REQ(req, "Alternate input file non-readable when restoring an external pipe"); goto out; } break; case O_WRONLY: filp = req->dpipe_out; if (!filp) { CR_ERR_REQ(req, "No alternate output file when restoring an external pipe"); goto out; } if (!(filp->f_mode & FMODE_WRITE)) { CR_ERR_REQ(req, "Alternate output file non-writable when restoring an external pipe"); goto out; } break; default: CR_ERR_REQ(req, "Invalid access mode %d while restoring external pipe", (cf_fifo.fifo_flags & O_ACCMODE)); retval = -EINVAL; goto out; } CRI_ASSERT(filp != NULL); get_file(filp); retval = cr_fd_claim(file_info->fd); if (retval < 0) { CR_ERR_REQ(req, "File descriptor %d in use.", file_info->fd); goto out; } fd_install(file_info->fd, filp); do_not_restore_flag = 1; } /* read file name */ name = cr_getname(eb, req->relocate, cf_filp, 0); if (IS_ERR(name)) { CR_ERR_REQ(req, "pipe_name - Bad pathname read!"); retval = PTR_ERR(name); goto out; } /* now, actually rebuild the thing. */ if (cf_fifo.fifo_len == ((unsigned int)-1)) { retval = cr_couple_fifo(req, file_info, &cf_fifo, name, do_not_restore_flag); if (retval < 0) { goto out_free; } /* * the pipe buffer should have been restored when we first built the pipe */ } else { struct file *p_filp; p_filp = cr_make_new_pipe(req, file_info, &cf_fifo, name, do_not_restore_flag); retval = PTR_ERR(p_filp); if (IS_ERR(p_filp) || !p_filp) { goto out_free; } #if HAVE_PIPE_FCNTL /* resize the pipe buffers while it's still easy. */ if (cf_fifo.pipe_sz < cf_fifo.fifo_len) { /* should never ever happen, abort */ CR_ERR_REQ(req, "bad pipe info: (pipe_sz < fifo_len)!"); goto out_free; } retval = cr_pipe_size_init(eb, p_filp, cf_fifo.pipe_sz); if ((retval < cf_fifo.pipe_sz) || (retval < 0)) { CR_ERR_REQ(req, "failed to resize pipe buffers"); goto out_free; } #endif /* now read the pipe buffer data, and optionally restore it */ retval = cr_restore_pipe_buf(eb, cf_filp, p_filp->f_dentry->d_inode, cf_fifo.fifo_len, do_not_restore_flag); fput(p_filp); if (retval < 0) { CR_ERR_REQ(req, "could not restore pipe buffer"); goto out_free; } } out_free: __putname(name); out: return retval; } /* Deterimine if a given FIFO is "internal", defined has having * at least one reader and one writer in the checkpoint set. * * XXX: This is almost certainly the worst possible way to do this. * Alas, I don't have a better way in mind that can be implemented * w/o need to move file saves/restores to the end (after memory of * all processes). */ static int cr_fifo_is_internal(cr_chkpt_req_t *req, struct inode *inode) { cr_chkpt_proc_req_t *proc_req; int have_reader = 0; int have_writer = 0; unsigned long retval = 0; /* For size match w/ void* in object map */ char *map_key = 1 + (char *)inode; read_lock(&req->lock); /* Look for cached value first. Note "creative" use of key. */ if (cr_find_object(req->map, map_key, (void **) &retval)) { goto out_cached; } list_for_each_entry(proc_req, &req->procs, list) { int max_fds, fd; cr_fdtable_t *fdt; struct task_struct *task = NULL; cr_task_t *cr_task; /* Find a non-dead task in proc_req, if any. * XXX: Race against exits? What lock should we hold here? */ list_for_each_entry(cr_task, &proc_req->tasks, proc_req_list) { if (!cri_task_dead(cr_task->task)) { task = cr_task->task; break; } } if (!task) continue; spin_lock(&task->files->file_lock); rcu_read_lock(); fdt = cr_fdtable(task->files); max_fds = fdt->max_fds; /* Never shrinks, right? */ rcu_read_unlock(); for (fd = 0; !retval && (fd < max_fds); ++fd) { struct file *filp = fcheck_files(task->files, fd); if (!filp) continue; get_file(filp); if (filp->f_dentry->d_inode == inode) { if (filp->f_mode & FMODE_WRITE) have_writer = 1; if (filp->f_mode & FMODE_READ) have_reader = 1; } fput(filp); retval = (have_reader && have_writer); } spin_unlock(&task->files->file_lock); if (retval) break; } cr_insert_object(req->map, map_key, (void *)retval, GFP_ATOMIC /* we hold req->lock */); out_cached: read_unlock(&req->lock); CR_KTRACE_FUNC_EXIT("Return '%sternal'", retval ? "in" : "ex"); return (int)retval; } extern int cr_save_open_fifo(cr_chkpt_proc_req_t *proc_req, struct file *filp) { cr_errbuf_t *eb = proc_req->req->errbuf; struct file *cf_filp = proc_req->file; struct cr_fifo cf_fifo; struct inode *inode; void *buf = NULL; int retval; retval = -EINVAL; if (!filp) goto out; inode = filp->f_dentry->d_inode; cf_fifo.cr_type = cr_fifo_obj; cf_fifo.fifo_id = inode; cf_fifo.fifo_dentry = filp->f_dentry; cf_fifo.fifo_len = -1; cf_fifo.pipe_sz = -1; cf_fifo.fifo_internal = cr_fifo_is_internal(proc_req->req, inode); /* Note: cf_fifo.fifo_internal check makes us skip the pipebuf save for external pipes * since we currently don't even try to read the data back in for this case. */ if (!cr_insert_object(proc_req->req->map, inode, inode, GFP_KERNEL) && cf_fifo.fifo_internal) { /* We are first to save: suck the data out of the pipe while holding the pipe semaphore */ retval = -ERESTARTSYS; if (cr_pipe_lock_interruptible(inode)) { goto out; } #if HAVE_PIPE_INODE_INFO_BASE { cf_fifo.fifo_len = PIPE_LEN(*inode); buf = CR_ALLOC_PIPEBUF(cf_fifo.fifo_len); if (!buf) { retval = -ENOMEM; cr_pipe_unlock(inode); goto out; } memcpy(buf, (void*)PIPE_BASE(*inode)+PIPE_START(*inode), cf_fifo.fifo_len); } #else { struct pipe_inode_info *pipe = inode->i_pipe; int i, curbuf; char *p; buf = CR_ALLOC_PIPEBUF(cr_pipe_buffers(pipe)*PAGE_SIZE); if (!buf) { retval = -ENOMEM; cr_pipe_unlock(inode); goto out; } p = buf; cf_fifo.fifo_len = 0; curbuf = pipe->curbuf; for (i = 0; i < pipe->nrbufs; ++i) { struct pipe_buffer *pbuf = pipe->bufs + curbuf; const struct pipe_buf_operations *ops = pbuf->ops; char *addr; #if HAVE_PIPE_BUF_OPERATIONS_PIN int error = ops->pin(pipe, pbuf); if (error) { retval = error; cr_pipe_unlock(inode); goto out_free; } addr = ops->map(pipe, pbuf, 0); memcpy(p, addr + pbuf->offset, pbuf->len); ops->unmap(pipe, pbuf, addr); #elif HAVE_2_ARG_PIPE_OPS_UNMAP addr = ops->map(filp, pipe, pbuf); memcpy(p, addr + pbuf->offset, pbuf->len); ops->unmap(pipe, pbuf); #elif HAVE_3_ARG_PIPE_OPS_UNMAP addr = ops->map(pipe, pbuf, 0); memcpy(p, addr + pbuf->offset, pbuf->len); ops->unmap(pipe, pbuf, addr); #else #error "Unknown pipe buf operations" #endif p += pbuf->len; cf_fifo.fifo_len += pbuf->len; curbuf = (curbuf + 1) & (cr_pipe_buffers(pipe)-1); } } #endif cr_pipe_unlock(inode); } else { /* We've saved this fifo previously */ /* cf_fifo.fifo_len == -1 will identify this case at restart time. */ } /* pipe perms - for FIFOs, need to know what to pass to mknod() */ cf_fifo.fifo_perms = inode->i_mode; /* posix flags (for open) */ cf_fifo.fifo_pos = filp->f_pos; cf_fifo.fifo_flags = filp->f_flags; cf_fifo.fifo_version = filp->f_version; /* write out the pipe size, for fcntl(F_SETPIPE_SZ). Do this without * holding the mutex, since pipe_fcntl tries to acquire it. */ #if HAVE_PIPE_FCNTL cf_fifo.pipe_sz = pipe_fcntl(filp, F_GETPIPE_SZ, 0); #else cf_fifo.pipe_sz = cf_fifo.fifo_len; #endif /* write out fifo structure */ retval = cr_kwrite(eb, cf_filp, &cf_fifo, sizeof(cf_fifo)); if (retval != sizeof(cf_fifo)) { CR_ERR_PROC_REQ(proc_req, "pipe fifo: write failed"); goto out_free; } /* write the filename out */ retval = cr_save_filename(eb, cf_filp, filp, NULL, 0); if (retval < 0) { CR_ERR_PROC_REQ(proc_req, "Error saving pipe filename. (err=%d)", retval); goto out_free; } /* write out pipe data last (unless saved previously) */ if (cf_fifo.fifo_len != ((unsigned int)-1)) { retval = cr_kwrite(eb, cf_filp, buf, cf_fifo.fifo_len); if (retval != cf_fifo.fifo_len) { CR_ERR_PROC_REQ(proc_req, "pipe fifo: write buf failed"); goto out_free; } } retval = 0; out_free: CR_FREE_PIPEBUF(buf); /* NULL ok */ out: return retval; } blcr-0.8.5/cr_module/cr_barrier.c0000664000000000000000000000704611062535504013576 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2008, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * 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 * * $Id: cr_barrier.c,v 1.16 2008/09/12 18:56:04 phargrov Exp $ */ #include "cr_module.h" // Helpers #define CR_BARRIER_WAIT_COND(b) ((atomic_read(&((b)->count)) <= 0) || (b)->interrupted) static inline int do_barrier_once(cr_barrier_t *barrier) { smp_rmb(); return !test_and_set_bit(0, &barrier->once); } // Initializer void cr_barrier_init(cr_barrier_t *barrier, int count) { init_waitqueue_head(&barrier->wait); atomic_set(&barrier->count, count); barrier->once = 0; barrier->interrupted = 0; } // Called to signal a barrier, possibly waking any waiters. // Can be called by a third party if somebody dies unexpectedly. void __cr_barrier_notify(cr_barrier_t *barrier) { smp_wmb(); if (atomic_dec_and_test(&barrier->count)) { wake_up(&barrier->wait); } } // Called to wait on a barrier int __cr_barrier_wait(cr_barrier_t *barrier) { #if CRI_DEBUG DECLARE_WAIT_QUEUE_HEAD_ONSTACK(dummy); const int interval = 60; int sum = 0; do { wait_event_timeout(barrier->wait, CR_BARRIER_WAIT_COND(barrier), interval * HZ); if (CR_BARRIER_WAIT_COND(barrier)) break; sum += interval; CR_ERR("cr_barrier warning: tgid/pid %d/%d still blocked after %d seconds, with signal_pending=%d.", current->tgid, current->pid, sum, signal_pending(current)); } while (1); smp_rmb(); if (barrier->interrupted) { CR_ERR("cr_barrier error: interrupt on non-interruptible barrier"); } #else wait_event(barrier->wait, CR_BARRIER_WAIT_COND(barrier)); #endif return do_barrier_once(barrier); } // Called to interruptible wait on a barrier int __cr_barrier_wait_interruptible(cr_barrier_t *barrier) { int retval = wait_event_interruptible(barrier->wait, CR_BARRIER_WAIT_COND(barrier)); if (retval != 0) { /* Interrupted. Wake others. */ barrier->interrupted = 1; smp_wmb(); wake_up(&barrier->wait); retval = -EINTR; } else { retval = do_barrier_once(barrier); } return retval; } // Called to signal a barrier, blocking for all others to do so too. // See cr_barrier.h for more information. int __cr_barrier_enter(cr_barrier_t *barrier) { __cr_barrier_notify(barrier); return __cr_barrier_wait(barrier); } int __cr_barrier_enter_interruptible(cr_barrier_t *barrier) { __cr_barrier_notify(barrier); return __cr_barrier_wait_interruptible(barrier); } // Called to test a barrier int __cr_barrier_test(cr_barrier_t *barrier) { return CR_BARRIER_WAIT_COND(barrier) && do_barrier_once(barrier); } blcr-0.8.5/cr_module/cr_vmadump.c0000664000000000000000000000704611114626174013623 00000000000000/*------------------------------------------------------------------------- * cr_vmadump.c: Multithread wrapper for VMADump's freeze/thaw routines * * 2007, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * 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 * * $Id: cr_vmadump.c,v 1.17 2008/12/01 00:14:52 phargrov Exp $ * * This file handles thread-management for dumps of multithreaded processes. *-----------------------------------------------------------------------*/ #include "cr_module.h" /* Let exactly one thread-group leader do a full undump, and * ensure everyone else does REGSONLY. * This and the matching logic at dump time together ensure that we * preserve the thread-group structure that was spawned in user-space. * * Returns original pid (>0), or <0 on error */ long cr_thaw_threads(cr_rstrt_proc_req_t *proc_req, int flags, int i_am_leader) { struct pt_regs *regs = get_pt_regs(current); long retval = 0; if (i_am_leader) { down(&proc_req->serial_mutex); retval = vmadump_thaw_proc(proc_req, proc_req->file, regs, flags); if (retval < 0) { proc_req->thaw_error = retval; } proc_req->done_leader = 1; wake_up(&proc_req->wait); up(&proc_req->serial_mutex); } else if (wait_event_interruptible(proc_req->wait, proc_req->done_leader) < 0) { retval = -EINTR; } else if (proc_req->thaw_error) { retval = proc_req->thaw_error; } else { down(&proc_req->serial_mutex); retval = vmadump_thaw_proc(proc_req, proc_req->file, regs, flags | VMAD_DUMP_REGSONLY); if (retval < 0) { proc_req->thaw_error = retval; } up(&proc_req->serial_mutex); } return retval; } /* Let exactly one thread-group leader do a full dump, and * ensure everyone else does REGSONLY. * This and the matching logic at undump time together ensure that we * preserve the thread-group structure that was spawned in user-space. * * Returns bytes written (>0), or <0 on error */ loff_t cr_freeze_threads(cr_chkpt_proc_req_t *proc_req, int flags, int i_am_leader) { struct pt_regs *regs = get_pt_regs(current); loff_t retval = 0; if (i_am_leader) { down(&proc_req->serial_mutex); retval = vmadump_freeze_proc(proc_req, proc_req->file, regs, flags | VMAD_DUMP_NOSHANON); proc_req->done_leader = 1; wake_up(&proc_req->wait); up(&proc_req->serial_mutex); } else if (wait_event_interruptible(proc_req->wait, proc_req->done_leader) < 0) { retval = -EINTR; } else { down(&proc_req->serial_mutex); retval = vmadump_freeze_proc(proc_req, proc_req->file, regs, flags | VMAD_DUMP_REGSONLY); up(&proc_req->serial_mutex); } return retval; } blcr-0.8.5/cr_module/cr_mmaps.c0000664000000000000000000003455012065520265013267 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2008, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * 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 * * $Id: cr_mmaps.c,v 1.36.8.8 2012/12/23 06:12:05 phargrov Exp $ * * This file handles special memory mappings * */ #include "cr_module.h" #include // Descriptor for a special mapping // Used both in-memory and on-disk struct cr_mmaps_desc { /* What is mapped: */ void * mmaps_id; /* The (struct inode *) at checkpoint time */ loff_t i_size; int type; /* Where and how is it mapped: */ unsigned long start, end; unsigned long flags; unsigned long pgoff; /* units of PAGE_SIZE */ }; // Vales for desc->type enum { CR_SHANON_FILE, CR_SHANON_SHMEM, CR_SHANON_HUGETLB, CR_PSE, }; /* Read the mapping metadata from the context file * * Returns 0 on success, or <0 on error */ long cr_load_mmaps_maps(cr_rstrt_proc_req_t *proc_req) { cr_errbuf_t *eb = proc_req->req->errbuf; struct cr_mmaps_desc *desc_tbl = NULL; size_t size = 0; int count = 0; int retval; /* Read size (in bytes) of table */ retval = cr_kread(eb, proc_req->file, &size, sizeof(size)); if (retval != sizeof(size)) { CR_ERR_PROC_REQ(proc_req, "mmaps_maps: read of size failed"); goto err; } if (!size) goto out_notbl; count = size / sizeof(struct cr_mmaps_desc); #if CRI_DEBUG if (size != count * sizeof(struct cr_mmaps_desc)) { CR_ERR_PROC_REQ(proc_req, "read invalid mmaps tbl size: %ld is not a multiple of %ld bytes", (long)size, (long)sizeof(struct cr_mmaps_desc)); retval = -EINVAL; goto err; } #endif /* Allocate space */ desc_tbl = vmalloc(size); if (!desc_tbl) { CR_ERR_PROC_REQ(proc_req, "Failed to allocate %ld bytes for mmaps table", (long)size); retval = -ENOMEM; goto err; } /* Read the table */ retval = cr_kread(eb, proc_req->file, desc_tbl, size); if (retval != size) { CR_ERR_PROC_REQ(proc_req, "mmaps_maps: read of table failed"); goto err; } /* Install */ out_notbl: proc_req->mmaps_cnt = count; proc_req->mmaps_tbl = desc_tbl; err: return retval; } static struct file * cr_regenerate(cr_rstrt_proc_req_t *proc_req, const struct cr_mmaps_desc *desc, loff_t size) { cr_rstrt_relocate_t reloc = proc_req->req->relocate; cr_errbuf_t *eb = proc_req->req->errbuf; struct file *cr_filp = proc_req->file; int mode, flags; struct file *filp; const char *name; mode = (desc->flags & VM_MAYSHARE) ? (S_IWUSR | S_IRUSR) : 0; if (desc->flags & VM_MAYREAD) mode |= S_IRUSR; if (desc->flags & VM_MAYWRITE) mode |= S_IWUSR; if (desc->flags & VM_MAYEXEC) mode |= S_IXUSR; if (desc->flags & VM_MAYSHARE) flags = O_RDWR; else switch (desc->flags & (VM_MAYREAD|VM_MAYWRITE)) { case VM_MAYREAD: flags = O_RDONLY; break; case VM_MAYWRITE: flags = O_WRONLY; break; default: flags = O_RDWR; break; } /* read original filename from context file */ name = cr_getname(eb, reloc, cr_filp, 0); if (IS_ERR(name)) { filp = (struct file *)name; goto out_nopage; } filp = cr_mkunlinked(eb, cr_filp, name, mode, flags, size, (unsigned long)desc->mmaps_id); if (IS_ERR(filp)) { CR_ERR_PROC_REQ(proc_req, "cr_mkunlinked returned error %d", (int)PTR_ERR(filp)); } __putname(name); out_nopage: return filp; } /* Read the data from the context file * * Returns 0 on success, or <0 on error */ long cr_load_mmaps_data(cr_rstrt_proc_req_t *proc_req) { cr_errbuf_t *eb = proc_req->req->errbuf; const int count = proc_req->mmaps_cnt; const struct cr_mmaps_desc *desc = proc_req->mmaps_tbl; struct mm_struct *mm = current->mm; struct vmadump_vma_header mapheader; int retval, i; loff_t r; retval = 0; for (i=0; iend - desc->start; unsigned long map_addr; int found, prot = 0; prot = 0; flags = MAP_FIXED | ((desc->flags & VM_MAYSHARE) ? MAP_SHARED : MAP_PRIVATE); if (desc->flags & VM_READ) prot |= PROT_READ; if (desc->flags & VM_WRITE) prot |= PROT_WRITE; if (desc->flags & VM_EXEC) prot |= PROT_EXEC; if (desc->flags & VM_GROWSDOWN) flags |= MAP_GROWSDOWN; #ifdef VM_EXECUTABLE if (desc->flags & VM_EXECUTABLE) flags |= MAP_EXECUTABLE; #endif /* "mmaps_id" was checkpoint-time inode, but we map to the first-restored filp */ found = cr_find_object(proc_req->req->map, desc->mmaps_id, (void **)&filp); if (found) { /* Nothing to prepare */ } else if (desc->type != CR_SHANON_SHMEM) { /* create before mmap() */ filp = cr_regenerate(proc_req, desc, desc->i_size); if (IS_ERR(filp)) { retval = PTR_ERR(filp); CR_ERR_PROC_REQ(proc_req, "cr_regenerate returned %d", retval); goto err; } } else { const int mmap_prot = PROT_READ|PROT_WRITE|PROT_EXEC; struct vm_area_struct *map; /* mmap() at offset 0, even if it needs to move later */ down_write(&mm->mmap_sem); map_addr = cr_mmap_pgoff(NULL, desc->start, len, mmap_prot, flags, 0); map = find_vma(mm, desc->start); filp = (map && (map->vm_start == desc->start)) ? map->vm_file : NULL; up_write(&mm->mmap_sem); if (!filp) { goto fail; } /* Populate *after* mmap() */ r = cr_sendfile(eb, filp, proc_req->file, NULL, desc->i_size); if (r != desc->i_size) { CR_ERR_PROC_REQ(proc_req, "read returned %d on copy-in of mmap()ed data", (int)r); retval = (r < 0) ? r : -EIO; goto err; } /* Fall through to 2nd mmap to ensure correct offset and protection */ get_file(filp); /* So (re)mmap doesn't drop it */ } down_write(&mm->mmap_sem); map_addr = cr_mmap_pgoff(filp, desc->start, len, prot|PROT_WRITE, flags, desc->pgoff); up_write(&mm->mmap_sem); if (!found) { (void)cr_insert_object(proc_req->req->map, desc->mmaps_id, (void *)filp, GFP_KERNEL); fput(filp); } if (!filp || (map_addr != desc->start)) { fail: CR_ERR_PROC_REQ(proc_req, "Failed to locate newborn mmap()ed space"); if ((map_addr != desc->start) && IS_ERR((void *) map_addr)) { retval = map_addr; } else { retval = -EINVAL; } goto err; } } /* Load dirty pages of maps if any */ r = cr_kread(eb, proc_req->file, &mapheader, sizeof(mapheader)); while (r == sizeof(mapheader) && (mapheader.start != ~0 || mapheader.end != ~0)) { unsigned long dirty_pages_prot=0; if (mapheader.flags & VM_READ) dirty_pages_prot |= PROT_READ; if (mapheader.flags & VM_WRITE) dirty_pages_prot |= PROT_WRITE; if (mapheader.flags & VM_EXEC) dirty_pages_prot |= PROT_EXEC; r = vmadump_load_page_list(proc_req, proc_req->file, (dirty_pages_prot & PROT_EXEC)); if (r) { CR_ERR_PROC_REQ(proc_req, "Error in vmadump_load_page_list"); goto err; } if (sys_mprotect(mapheader.start,mapheader.end - mapheader.start, dirty_pages_prot)) { CR_WARN_PROC_REQ(proc_req, "mprotect failed. (ignoring)"); } r = cr_kread(eb, proc_req->file, &mapheader, sizeof(mapheader)); } if (r != sizeof(mapheader)) { CR_ERR_PROC_REQ(proc_req, "mmaps_data: read header returned %d", (int)r); } err: return retval; } /* Save the mappings metadata for the current mm. * They are both written to the context file, and saved in the proc_req * for later use. * * Returns bytes written (>=0), or <0 on error */ long cr_save_mmaps_maps(cr_chkpt_proc_req_t *proc_req) { cr_errbuf_t *eb = proc_req->req->errbuf; int flags = proc_req->req->flags; struct mm_struct *mm = current->mm; struct vm_area_struct *map, *next_map; struct cr_mmaps_desc *desc_tbl = NULL; struct file **file_tbl = NULL; unsigned long next_addr; size_t size = 0; int i, count = 0; int retval; down_read(&mm->mmap_sem); /* First pass just counts maps ... */ next_map = mm->mmap; next_addr = next_map ? next_map->vm_start : 0; while (next_map) { /* Some contortions here to allow us to release mmap_sem */ map = find_vma(mm, next_addr); if (map != next_map) break; /* Should this be an error? */ next_map = map->vm_next; next_addr = next_map ? next_map->vm_start : 0; if (!map->vm_file) continue; up_read(&mm->mmap_sem); /* Ensure up-to-date inode information (e.g. on a network fs) */ retval = cr_fstat(proc_req->req->map, map->vm_file); if (retval) { CR_ERR_PROC_REQ(proc_req, "mmaps_maps: fstat of mapped file failed"); goto err; } count += !!vmad_is_special_mmap(map, flags); down_read(&mm->mmap_sem); } /* ... then we allocate the table ... */ if (!count) goto out_notbl; size = count * sizeof(struct cr_mmaps_desc); desc_tbl = vmalloc(size); file_tbl = vmalloc(count*sizeof(*file_tbl)); retval = -ENOMEM; if (!desc_tbl || !file_tbl) { up_read(&mm->mmap_sem); vfree(desc_tbl); goto err; } /* ... and the second pass fills the table. */ for (i = 0, map = mm->mmap; (i < count) && map ; map = map->vm_next) { if (map->vm_file && vmad_is_special_mmap(map, flags)) { struct file *filp = map->vm_file; desc_tbl[i].mmaps_id = filp->f_dentry->d_inode; desc_tbl[i].i_size = i_size_read(filp->f_dentry->d_inode); desc_tbl[i].start = map->vm_start; desc_tbl[i].end = map->vm_end; desc_tbl[i].flags = map->vm_flags; desc_tbl[i].pgoff = map->vm_pgoff; file_tbl[i] = filp; if (is_vm_hugetlb_page(map)) { desc_tbl[i].type = CR_SHANON_HUGETLB; if (!(map->vm_flags & VM_MAYSHARE)) { desc_tbl[i].i_size = 0; } } else if (!vmad_dentry_unlinked(filp->f_dentry)) { desc_tbl[i].type = CR_PSE; #if defined(CONFIG_SHMEM) || defined(CR_KDATA_shmem_file_operations) } else if (filp->f_op == &shmem_file_operations) { desc_tbl[i].type = CR_SHANON_SHMEM; #endif #if defined(CONFIG_TINY_SHMEM) } else if (filp->f_op == &ramfs_file_operations) { desc_tbl[i].type = CR_SHANON_SHMEM; #endif } else { desc_tbl[i].type = CR_SHANON_FILE; } ++i; } } out_notbl: proc_req->mmaps_cnt = count; proc_req->mmaps_tbl = desc_tbl; up_read(&mm->mmap_sem); /* write the size in bytes */ retval = cr_kwrite(eb, proc_req->file, &size, sizeof(size)); if (retval != sizeof(size)) { CR_ERR_PROC_REQ(proc_req, "mmaps_maps: write of size failed"); goto err; } /* write the table (if any) */ if (size) { long w = cr_kwrite(eb, proc_req->file, desc_tbl, size); if (w != size) { CR_ERR_PROC_REQ(proc_req, "mmaps_maps: write of table failed"); goto err; } retval += w; } /* We've saved the (struct inode *) as the "mmaps_id", because only it * is unique in the case of multiple open()s of the same file. * However, we need the (struct file *) later to help us save the data. * So, we replace the in-memory mmaps_id field w/ the filp. */ for (i = 0; i < count; ++i) { desc_tbl[i].mmaps_id = file_tbl[i]; } err: vfree(file_tbl); return retval; } /* Save the mapped data for the current mm. * * Returns bytes written (>=0), or <0 on error */ loff_t cr_save_mmaps_data(cr_chkpt_proc_req_t *proc_req) { cr_errbuf_t *eb = proc_req->req->errbuf; const int count = proc_req->mmaps_cnt; const struct cr_mmaps_desc *desc = proc_req->mmaps_tbl; loff_t w, retval; struct vmadump_vma_header head; int i; retval = 0; for (i = 0; i < count; ++i, ++desc) { struct file *filp = (struct file *)desc->mmaps_id; struct inode *inode = filp->f_dentry->d_inode; loff_t size = desc->i_size; loff_t src_pos = 0; /* NOTE: we currently rely on the restore order matching the save order */ if (cr_insert_object(proc_req->req->map, inode, (void *)1UL, GFP_KERNEL)) { /* Somebody dumped this one already */ continue; } if (desc->type != CR_SHANON_SHMEM) { w = cr_save_filename(eb, proc_req->file, filp, NULL, 0); if (w < 0) { retval = w; goto err; } retval += w; } w = cr_sendfile(eb, proc_req->file, filp, &src_pos, size); if (w != size) { CR_ERR_PROC_REQ(proc_req, "write returned %d on copy-out of mmap()ed data", (int)w); retval = (w < 0) ? w : -EIO; goto err; } retval += w; } /* Save any dirty pages now */ desc = proc_req->mmaps_tbl; for (i = 0; i < count; ++i, ++desc) { if ((desc->type != CR_PSE) && (desc->type != CR_SHANON_HUGETLB)) continue; if (desc->flags & VM_SHARED) continue; /* any dirty pages were saved w/ file */ /* generate the header */ head.start = desc->start; head.end = desc->end; head.flags = desc->flags; head.namelen = 0; head.pgoff = desc->pgoff; w = cr_kwrite(eb, proc_req->file, &head, sizeof(head)); if (w != sizeof(head)) goto bad_write; retval += w; /* dump the dirty pages */ if (desc->type == CR_PSE) { w = vmadump_store_dirty_page_list(proc_req, proc_req->file, desc->start, desc->end); } else { w = vmadump_store_page_list(proc_req, proc_req->file, desc->start, desc->end); } if (w < 0) goto err; retval += w; } /* Terminate maps list */ head.start = head.end = ~0L; w = cr_kwrite(eb, proc_req->file, &head, sizeof(head)); if (w != sizeof(head)) goto bad_write; retval += w; err: return retval; bad_write: CR_ERR_PROC_REQ(proc_req, "mmaps_data: write header returned %d", (int)w); return w; } blcr-0.8.5/cr_module/cr_objects.c0000664000000000000000000001417612066216440013603 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2003, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * 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 * * $Id: cr_objects.c,v 1.11.8.1 2012/12/25 03:27:28 phargrov Exp $ */ #include "cr_module.h" #define MAP_SIZE 64 #define MAP_SHIFT 6 /* doubly linked list of key=val pairs */ struct cr_objectmap_pair { /* No "_s" suffix to fit kmem_cache naming requirements */ struct list_head list; void *key; void *val; }; /* Map is an array of lock+list pairs */ struct cr_objectmap_s { struct cr_objectmap_entry_s { rwlock_t lock; struct list_head list; } table[MAP_SIZE]; }; static cr_kmem_cache_ptr cr_objmap_cachep = NULL; static cr_kmem_cache_ptr cr_object_cachep = NULL; int cr_object_init(void) { cr_objmap_cachep = CR_KMEM_CACHE(cr_objectmap_s); if (!cr_objmap_cachep) goto no_objmap_cachep; cr_object_cachep = CR_KMEM_CACHE(cr_objectmap_pair); if (!cr_object_cachep) goto no_object_cachep; return 0; no_object_cachep: kmem_cache_destroy(cr_objmap_cachep); no_objmap_cachep: return -ENOMEM; } void cr_object_cleanup(void) { if (cr_objmap_cachep) kmem_cache_destroy(cr_objmap_cachep); if (cr_object_cachep) kmem_cache_destroy(cr_object_cachep); } static int hash_it(void *x) { unsigned long tmp = (unsigned long)x; tmp = tmp ^ (tmp >> MAP_SHIFT) ^ (tmp >> (MAP_SHIFT*2)); return (int)(tmp % MAP_SIZE); } cr_objectmap_t cr_alloc_objectmap(void) { static struct lock_class_key lock_key; struct cr_objectmap_s *map = kmem_cache_alloc(cr_objmap_cachep, GFP_KERNEL); if (map) { int i; struct cr_objectmap_entry_s *entry; for (i=0, entry=&map->table[0]; ilock)); lockdep_set_class(&(entry->lock), &lock_key); INIT_LIST_HEAD(&(entry->list)); } } return map; } void cr_release_objectmap(cr_objectmap_t map) { int i; struct cr_objectmap_entry_s *entry; for (i=0, entry=&map->table[0]; ilist), list) { kmem_cache_free(cr_object_cachep, pair); } } kmem_cache_free(cr_objmap_cachep, map); } /* * returns int rather than void * to allow NULL key's to be placed into table * * 1 - found * 0 - not found (but *val_p still may be written) */ int cr_find_object(cr_objectmap_t map, void *key, void **val_p) { int retval = 0; /* result is NULL by default, use return value to distinguish good NULL from evil NULL */ if (val_p != NULL) { *val_p = NULL; } if (key == NULL) { /* special cased to avoid confusion with not present */ // CR_KTRACE_LOW_LVL("map %p: Asked for NULL, returning NULL.", map); retval = 1; } else { int h = hash_it(key); struct cr_objectmap_entry_s *entry = &map->table[h]; struct cr_objectmap_pair *pair; read_lock(&(entry->lock)); list_for_each_entry(pair, &(entry->list), list) { if (pair->key == key) { // CR_KTRACE_LOW_LVL("map %p: Found object %p in slot %d", map, key, h); if (val_p != NULL) *val_p = pair->val; retval = 1; break; } else if (pair->key > key) { /* Sorted order would have placed pair here */ break; } } read_unlock(&(entry->lock)); // if (!retval) CR_KTRACE_LOW_LVL("map %p: Object %p not found", map, key); } return retval; } /* * 1 if it's in there already * 0 if we insert it */ int cr_insert_object(cr_objectmap_t map, void *key, void *val, gfp_t flags) { struct cr_objectmap_pair *new_pair, *pair; int retval = -1; int h = hash_it(key); struct cr_objectmap_entry_s *entry = &map->table[h]; /* If not GFP_ATOMIC, we'd better not hold any locks */ if (flags != GFP_ATOMIC) CR_NO_LOCKS(); /* special case NULL -> NULL */ if (key == NULL) { retval = 1; return retval; } /* assume it's not there yet to move alloc outside of lock and keep a single pass */ new_pair = kmem_cache_alloc(cr_object_cachep, flags); new_pair->key = key; new_pair->val = val; write_lock(&(entry->lock)); list_for_each_entry(pair, &(entry->list), list) { if (pair->key == key) { /* return 1 if it's in there already */ // CR_KTRACE_LOW_LVL("map %p: Object %p already inserted into slot %d", map, key, h); retval = 1; break; } else if (pair->key > key) { /* Sorted order places new pair here */ break; } } if (retval != 1) { // CR_KTRACE_LOW_LVL("map %p: Inserting object %p into slot %d", map, key, h); list_add_tail(&new_pair->list, &pair->list); retval = 0; } write_unlock(&(entry->lock)); if (retval) { kmem_cache_free(cr_object_cachep, new_pair); } return retval; } /* * 0 if we remove it * -1 if it's not in there */ int cr_remove_object(cr_objectmap_t map, void *key) { struct cr_objectmap_pair *pair, *next; struct cr_objectmap_entry_s *entry = &map->table[hash_it(key)]; int retval=-1; write_lock(&(entry->lock)); list_for_each_entry_safe(pair, next, &(entry->list), list) { if (pair->key == key) { list_del(&pair->list); kmem_cache_free(cr_object_cachep, pair); retval = 1; break; } } write_unlock(&(entry->lock)); return retval; } blcr-0.8.5/cr_module/cr_barrier.h0000664000000000000000000001305611030560771013600 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2008, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * 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 * * $Id: cr_barrier.h,v 1.19 2008/06/26 00:25:29 phargrov Exp $ */ #ifndef _CR_BARRIER_H #define _CR_BARRIER_H 1 #include #include #include // Single-use barrier which can be "notified" by a "third party" (such // as when a task dies). // // A call to cr_barrier_{wait,enter}() will not return until the barrier // has been signalled "count" times. The term "signalling the barrier" // is taken to mean either a call to cr_barrier_enter() or to // cr_barrier_notify(). // // Exactly one call to cr_barrier_{wait,enter,test}{,interruptible}() will return > 0. typedef struct cr_barrier_s { wait_queue_head_t wait; atomic_t count; // How many remain unsigned long once; int interrupted; } cr_barrier_t; extern void cr_barrier_init(cr_barrier_t *barrier, int count); extern int __cr_barrier_enter(cr_barrier_t *barrier); /* split-phase treatment */ extern void __cr_barrier_notify(cr_barrier_t *barrier); extern int __cr_barrier_wait(cr_barrier_t *barrier); extern int __cr_barrier_test(cr_barrier_t *barrier); /* interruptible variants (returns if *any* waiter is interrupted). * Upon interruption returns -EINTR to the interrupted task only. * The other tasks will wake w/ the normal 0 or 1 return. * Not to be mixed w/ non-interruptible variants on the same barrier. */ extern int __cr_barrier_enter_interruptible(cr_barrier_t *barrier); extern int __cr_barrier_wait_interruptible(cr_barrier_t *barrier); /* Debugging wrapper that detects underflow */ #if CRI_DEBUG #define _cr_barrier_uflow_wrap_void(_name, b) do { \ cr_barrier_t *_b = (b); \ __##_name(_b); \ if (atomic_read(&_b->count) < 0) \ CR_KTRACE_DEBUG(#_name ": underflow on " #b); \ } while(0) #define _cr_barrier_uflow_wrap_int(_name, b) ({ \ cr_barrier_t *_b = (b); \ int _res = __##_name(_b); \ if (atomic_read(&_b->count) < 0) \ CR_KTRACE_DEBUG(#_name ": underflow on " #b); \ (_res); \ }) #else #define _cr_barrier_uflow_wrap_void(_name, b) __##_name(b) #define _cr_barrier_uflow_wrap_int(_name, b) __##_name(b) #endif /* Tracing wrappers * Note that CR_KTRACE_BARRIER(...) preprocesses to empty when not tracing. */ #define cr_barrier_notify(b) (void)({ \ _cr_barrier_uflow_wrap_void(cr_barrier_notify, b);\ CR_KTRACE_BARRIER("NOTIFY(" #b ")");\ }) #define cr_barrier_enter(b) ({ \ int _res; \ CR_KTRACE_BARRIER("ENTER(" #b ") begin");\ _res = _cr_barrier_uflow_wrap_int(cr_barrier_enter, b);\ CR_KTRACE_BARRIER("ENTER(" #b ") returning %d", _res);\ (_res); \ }) #define cr_barrier_enter_interruptible(b) ({ \ int _res; \ CR_KTRACE_BARRIER("ENTER_INTERRUPTIBLE(" #b ") begin");\ _res = _cr_barrier_uflow_wrap_int(cr_barrier_enter_interruptible, b);\ CR_KTRACE_BARRIER("ENTER_INTERRUPTIBLE(" #b ") returning %d", _res);\ (_res); \ }) #define cr_barrier_wait(b) ({ \ int _res; \ CR_KTRACE_BARRIER("WAIT(" #b ") begin");\ _res = __cr_barrier_wait(b);\ CR_KTRACE_BARRIER("WAIT(" #b ") returning %d", _res);\ (_res); \ }) #define cr_barrier_wait_interruptible(b) ({ \ int _res; \ CR_KTRACE_BARRIER("WAIT_INTERRUPTIBLE(" #b ") begin");\ _res = __cr_barrier_wait_interruptible(b);\ CR_KTRACE_BARRIER("WAIT_INTERRUPTIBLE(" #b ") returning %d", _res);\ (_res); \ }) #define cr_barrier_test(b) ({ \ int _res = __cr_barrier_test(b);\ CR_KTRACE_BARRIER("TEST(" #b ") returning %d", _res);\ (_res); \ }) /* Macro wrapper to help keep cr_task->step accurate */ #define _cr_barrier_step_wrap(_name, _t, _b) ((_t)->step++, _name(_b)) #define CR_BARRIER_NOTIFY(_t,_b) _cr_barrier_step_wrap(cr_barrier_notify,_t,_b) #define CR_BARRIER_ENTER(_t,_b) _cr_barrier_step_wrap(cr_barrier_enter,_t,_b) #define CR_BARRIER_ENTER_INTERRUPTIBLE(_t,_b) _cr_barrier_step_wrap(cr_barrier_enter_interruptible,_t,_b) /* Macros for optionally blocking "read" of a barrier */ #define cr_barrier_once(b, block) ({ \ cr_barrier_t *_b = (b); \ int _res, _block = (block); \ if (_block) CR_KTRACE_BARRIER("ONCE(" #b ", 1) begin");\ _res = _block ? __cr_barrier_wait(_b) : __cr_barrier_test(_b); \ CR_KTRACE_BARRIER("ONCE(" #b ", %d) returning %d", _block, _res);\ (_res); \ }) #define cr_barrier_once_interruptible(b, block) ({ \ cr_barrier_t *_b = (b); \ int _res, _block = (block); \ if (_block) CR_KTRACE_BARRIER("ONCE_INTERRUPTIBLE(" #b ", 1) begin");\ _res = _block ? __cr_barrier_wait_interruptible(_b) : __cr_barrier_test(_b); \ CR_KTRACE_BARRIER("ONCE_INTERRUPTIBLE(" #b ", %d) returning %d", _block, _res);\ (_res); \ }) #endif blcr-0.8.5/cr_module/cr_async.c0000664000000000000000000001364511053175651013272 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2003, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * 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 * * $Id: cr_async.c,v 1.31 2008/08/21 05:22:49 phargrov Exp $ * * * This file deals with Phase1 threads/tasks. * The filename "cr_async.c" is legacy from when these were * known as "asynchronous threads/tasks". */ #include "cr_module.h" #include // cr_phase1_release(filp, priv) // // Remove Phase1 tasks from the task list when the file is closed. // Note that the close might be implictly at exit and could also // come from a task other than the one originally registered. // // XXX: could keep a hash mapping phase1_filp -> cr_task rather than // walking the entire list each time. void cr_phase1_release(struct file *filp, cr_pdata_t *priv) { cr_task_t *cr_task, *next; write_lock(&cr_task_lock); list_for_each_entry_safe(cr_task, next, &cr_task_list, task_list) { if ((cr_task->filp == filp) && (cr_task->phase == CR_PHASE1)) { cr_task->phase = CR_NO_PHASE; cr_task->filp = NULL; cr_task->fd = -1; __cr_task_put(cr_task); } } write_unlock(&cr_task_lock); } static int do_suspend(struct file *filp, struct timeval *tvp) { cr_task_t *cr_task; unsigned long timeout; int retval = 0; DECLARE_WAIT_QUEUE_HEAD_ONSTACK(dummy); CR_KTRACE_FUNC_ENTRY(); cr_task = cr_task_get(current); if (!cr_task) { retval = -EINVAL; CR_KTRACE_FUNC_EXIT("due to -EINVAL"); goto out; } // Decode the optional timeout timeout = tvp ? timeval_to_jiffies(tvp) : MAX_SCHEDULE_TIMEOUT; // Block until signal is pending or timeout // NOTE: Condition is checked only to ensure we don't sleep if already pending timeout = wait_event_interruptible_timeout(dummy, cr_task->chkpt_req, timeout); if (tvp) { jiffies_to_timeval(timeout, tvp); } if (!cr_task->chkpt_req && timeout) { // caught a signal other than the checkpoint trigger retval = -EINTR; CR_KTRACE_FUNC_EXIT("with pending signal"); } else if (cr_task->chkpt_req) { CR_KTRACE_FUNC_EXIT("with pending checkpoint"); } else if (!timeout) { CR_KTRACE_FUNC_EXIT("with expired timeout"); } else { CR_KTRACE_FUNC_EXIT("for unknown reason"); } cr_task_put(cr_task); out: return retval; } // cr_suspend(timeval) // // Wait for a checkpoint request to arrive. // Argument is a struct timeval for a bounded wait, or NULL to block forever. // // Returns: // <0 on errors (including interrupted sleep) // 0 otherwise // int cr_suspend(struct file *filp, struct timeval __user *arg) { struct timeval timeval; int retval; CR_KTRACE_FUNC_ENTRY(); retval = -EFAULT; if (arg && copy_from_user(&timeval, arg, sizeof(timeval))) { goto out; } retval = do_suspend(filp, arg ? &timeval : NULL); if (arg) { // like select() we fail silently if user timeval is R/O (void)put_user(timeval.tv_sec, &arg->tv_sec); (void)put_user(timeval.tv_usec, &arg->tv_usec); } out: CR_KTRACE_FUNC_EXIT("Returning %d", retval); return retval; } // cr_phase1_register(file, arg) // // Registers the calling task as having a Phase1 checkpoint handler. // Returns: // 0 on success // -EAGAIN if a checkpoint is pending for this task // -EEXIST if this task is already registered // other < 0 on other error conditions int cr_phase1_register(struct file *filp, int arg) { cr_task_t *cr_task; int retval; CR_KTRACE_FUNC_ENTRY(); write_lock(&cr_task_lock); cr_task = __cr_task_get(current, 1); retval = -ENOMEM; if (!cr_task) { // Can't create the task list entry. goto out_noput; } retval = -EAGAIN; if (cr_task->chkpt_req || cr_task->rstrt_req) { // Can't register a Phase1 handler task // while a checkpoint or restart is in progress. goto out; } retval = -EEXIST; if (cr_task->phase == CR_PHASE1) { // Duplicate registration goto out; } retval = -EINVAL; if (cr_task->phase == CR_PHASE2) { // Conflicting registration goto out; } retval = 0; cr_task->phase = CR_PHASE1; cr_task->filp = filp; cr_task->fd = arg; atomic_inc(&cr_task->ref_count); // We assume our proper signal handler is registered at this time. // So, we save it for later use in case the user has overwitten it. CR_SIGNAL_LOCK(current); cr_task->handler_sa = CR_SIGACTION(current, CR_SIGNUM); CR_SIGNAL_UNLOCK(current); out: __cr_task_put(cr_task); out_noput: write_unlock(&cr_task_lock); return retval; } #ifdef CONFIG_COMPAT int cr_suspend32(struct file *filp, struct compat_timeval __user *arg) { struct timeval timeval; int retval; CR_KTRACE_FUNC_ENTRY(); retval = -EFAULT; if (arg && (!access_ok(VERIFY_READ, arg, sizeof(*arg)) || __get_user(timeval.tv_sec, &arg->tv_sec) || __get_user(timeval.tv_usec, &arg->tv_usec))) { goto out; } retval = do_suspend(filp, arg ? &timeval : NULL); if (arg) { // like select() we fail silently if user timeval is R/O (void)put_user(timeval.tv_sec, &arg->tv_sec); (void)put_user(timeval.tv_usec, &arg->tv_usec); } out: CR_KTRACE_FUNC_EXIT("Returning %d", retval); return retval; } #endif // CONFIG_COMPAT blcr-0.8.5/cr_module/cr_ktrace.h0000664000000000000000000001601111052401647013415 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2008, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * 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 * * $Id: cr_ktrace.h,v 1.17 2008/08/18 23:20:07 phargrov Exp $ * * * Tracing and error/warning output for checkpoint/restart kernel code. */ #ifndef _CR_KTRACE_H #define _CR_KTRACE_H #include "cr_module.h" /* * Error/warning message generation * For problems (mostly) that indicate BLCR-internal problems such as * bad assumptions about data structures, or bad usage of the internal * interfaces. * * By default, regular messages (CR_INFO, CR_WARN, CR_ERR) are always on: * #define CR_QUIET to turn off. */ #ifdef CR_QUIET # define CR_ERR(fmt, args...) # define CR_WARN(fmt, args...) # define CR_INFO(fmt, args...) #else # define CR_ERR(fmt, args...) printk(KERN_ERR "blcr: " fmt "\n", ## args) # define CR_WARN(fmt, args...) printk(KERN_WARNING "blcr: " fmt "\n", ## args) # define CR_INFO(fmt, args...) printk(KERN_INFO "blcr: " fmt "\n", ## args) #endif /* * For reporting problems w/ a specific user request */ #define _CR_EB_OUT(lvl, eb, fmt, args...) \ cr_errbuf_printf(lvl, eb, fmt "\n", ## args) /* Error/warning to specific errbuf */ #define CR_ERR_EB(eb, fmt, args...) \ _CR_EB_OUT(KERN_ERR, eb, fmt, ## args) #define CR_WARN_EB(eb, fmt, args...) \ _CR_EB_OUT(KERN_WARNING, eb, fmt, ## args) /* Error/warning to errbuf of given req */ /* NOTE: macro works same for chkpt or rstrt req */ #define _cr_req_eb(_req) ({ \ typeof(_req) _tmp = (_req); \ _tmp ? _tmp->errbuf : NULL; \ }) #define CR_ERR_REQ(req, fmt, args...) \ CR_ERR_EB(_cr_req_eb(req), fmt, ## args) #define CR_WARN_REQ(req, fmt, args...) \ CR_WARN_EB(_cr_req_eb(req), fmt, ## args) /* Error/warning to errbuf of given proc_req */ /* NOTE: macro works same for chkpt or rstrt proc_req */ #define _cr_proc_req_eb(_proc_req) ({ \ typeof(_proc_req) _tmp = (_proc_req); \ _tmp ? _tmp->req->errbuf : NULL; \ }) #define CR_ERR_PROC_REQ(proc_req, fmt, args...) \ CR_ERR_EB(_cr_proc_req_eb(proc_req), fmt, ## args) #define CR_WARN_PROC_REQ(proc_req, fmt, args...) \ CR_WARN_EB(_cr_proc_req_eb(proc_req), fmt, ## args) /* Opaque type */ struct cr_errbuf_s; typedef struct cr_errbuf_s cr_errbuf_t; extern cr_errbuf_t *cr_errbuf_alloc(void); extern void cr_errbuf_free(cr_errbuf_t *eb); extern int cr_errbuf_read(char /*__user*/ *buf, unsigned int len, cr_errbuf_t *eb); extern int cr_errbuf_printf(const char *lvl, cr_errbuf_t *eb, const char * fmt, ...) __attribute__((format (printf, 3, 4))); /* * Tracing messages: by default, turned off. #define CR_USE_KTRACE to turn * on tracing, and set what types of tracing msgs to see by setting * cr_ktrace_mask (default is all tracing msgs). */ #if CR_KERNEL_TRACING /* for debugging ONLY: remove calls before checking in */ # define CR_KTRACE_MARK() printk(KERN_ERR "@ %s:%d\n", __FILE__, __LINE__) # define CR_KTRACE_DEBUG(args...) \ CR_KTRACE(CR_KTRACETYPE_DEBUG, args) /* for major high-level events ex: "phase 2 entered" */ # define CR_KTRACE_HIGH_LVL(args...) \ CR_KTRACE(CR_KTRACETYPE_HIGH_LVL, args) /* more detailed events ex: "woke up thread 4" */ # define CR_KTRACE_LOW_LVL(args...) \ CR_KTRACE(CR_KTRACETYPE_LOW_LVL, args) /* entering function */ # define CR_KTRACE_FUNC_ENTRY(args...) \ CR_KTRACE(CR_KTRACETYPE_FUNC_ENTRY, "entering " args) /* exiting function */ # define CR_KTRACE_FUNC_EXIT(args...) \ CR_KTRACE(CR_KTRACETYPE_FUNC_EXIT, "leaving " args) /* refcounting */ # define CR_KTRACE_REFCNT(args...) \ CR_KTRACE(CR_KTRACETYPE_REFCNT, args) /* resource (de)allocation */ # define CR_KTRACE_ALLOC(args...) \ CR_KTRACE(CR_KTRACETYPE_ALLOC, args) /* fixed limit reached */ # define CR_KTRACE_LIMIT(args...) \ CR_KTRACE(CR_KTRACETYPE_LIMIT, args) /* bad parameter recv'd */ # define CR_KTRACE_BADPARM(args...) \ CR_KTRACE(CR_KTRACETYPE_BADPARM, "EINVAL: " args) /* unusual case encountered: */ # define CR_KTRACE_UNEXPECTED(args...) \ CR_KTRACE(CR_KTRACETYPE_UNEXPECTED, args) /* barrier operations: */ # define CR_KTRACE_BARRIER(args...) \ CR_KTRACE(CR_KTRACETYPE_BARRIER, args) /* Tracing flags: * - Flags that are normally on go in lowest 2 bytes, * and less commonly used ones in upper 2 bytes */ # define CR_KTRACETYPE_DEBUG 0x00000001 # define CR_KTRACETYPE_HIGH_LVL 0x00000002 # define CR_KTRACETYPE_LIMIT 0x00000004 # define CR_KTRACETYPE_BADPARM 0x00000008 # define CR_KTRACETYPE_UNEXPECTED 0x00000010 # define CR_KTRACETYPE_LOW_LVL 0x00010000 # define CR_KTRACETYPE_FUNC_ENTRY 0x00020000 # define CR_KTRACETYPE_FUNC_EXIT 0x00040000 # define CR_KTRACETYPE_REFCNT 0x00080000 # define CR_KTRACETYPE_ALLOC 0x00100000 # define CR_KTRACETYPE_BARRIER 0x00200000 /* Common combinations, and default tracing setting */ # define CR_KTRACE_NONE 0x00000000 # define CR_KTRACE_ALL 0xFFFFFFFF # define CR_KTRACE_FUNCS (CR_KTRACETYPE_FUNC_ENTRY|CR_KTRACETYPE_FUNC_EXIT) # define CR_KTRACE_USUAL_SUSPECTS 0x0000ffff # define CR_KTRACE_DEFAULT CR_KTRACE_USUAL_SUSPECTS # define CR_KTRACE(type, args...) \ if (cr_ktrace_mask & (type)) { \ cr_print_trace(__FILE__, __LINE__, __FUNCTION__, args); \ } extern unsigned int cr_ktrace_mask; extern void cr_print_trace(const char *file, int line, const char *func, const char *fmt, ...) __attribute__((format (printf, 4, 5))); #else # define CR_KTRACE_MARK() # define CR_KTRACE(args...) # define CR_KTRACE_HIGH_LVL(args...) # define CR_KTRACE_LOW_LVL(args...) # define CR_KTRACE_FUNC_ENTRY(args...) # define CR_KTRACE_FUNC_EXIT(args...) # define CR_KTRACE_REFCNT(args...) # define CR_KTRACE_ALLOC(args...) # define CR_KTRACE_LIMIT(args...) # define CR_KTRACE_BADPARM(args...) # define CR_KTRACE_UNEXPECTED(args...) # define CR_KTRACE_BARRIER(args...) #endif /* CR_KERNEL_TRACING */ /* Not quite tracing, but this is as good a place as any for this */ #if CRI_DEBUG #define CRI_ASSERT(cond) BUG_ON(!(cond)) #else #define CRI_ASSERT(cond) do {} while (0) #endif #endif /* _CR_KTRACE_H */ blcr-0.8.5/cr_module/cr_trigger.c0000664000000000000000000001563311116333007013606 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2003, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * 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 * * $Id: cr_trigger.c,v 1.39 2008/12/05 23:15:19 phargrov Exp $ */ #include "cr_module.h" // // Private functions // // do_trigger(cr_task, proc_req) // // Sends a trigger (currently just signal 63 or 64) to the given task. // If the task is STOPPED, we also wake it so it can receive the // signal. // Must be called with tasklist_lock held for reading to prevent task from exiting. // // XXX: Should (probably) never fail, but could return -EAGAIN if the // kernel can't queue anymore RT signals at this time. // XXX: When we finally move away from the signal, the trigger will // need to invoke the cr_task->handler, or the default trigger if NULL. static int do_trigger(cr_task_t *cr_task, cr_chkpt_proc_req_t *proc_req) { struct task_struct *task = cr_task->task; struct siginfo info; int retval = 0; if (cri_task_dead(task)) { CR_KTRACE_LOW_LVL("not triggering dead task pid %d (%s)", task->pid, task->comm); goto out; } retval = proc_req->ctrl_fd; if (retval < 0) { retval = proc_req->tmp_fd; if (retval < 0) { /* Force an instance of the ctrl fd into the target's file table * (exactly once per process regardless of thread count). * XXX: Ideally we'd be smarter about this: * STOP other tasks before doing this to avoid racing against * anything they might be doing with their own files. */ retval = cr_dup_other(task->files, proc_req->req->ctrl_file); if (retval < 0) goto out; proc_req->tmp_fd = retval; } } CR_ASSERT_STEP_EQ(cr_task, 0); memset(&info, 0, sizeof(info)); /* security */ info.si_signo = CR_SIGNUM; info.si_errno = 0; info.si_code = SI_KERNEL; info.si_pid = retval; /* Note that we don't recalc_sigpending. It is not needed, because bad things would have happened if CR_SIGNUM was already pending. */ CR_SIGNAL_LOCK(task); if ((proc_req->saved_sa.sa.sa_handler == SIG_ERR) && (proc_req->forced_sa.sa.sa_handler != SIG_ERR)) { // Force our saved handler (if any), in case user has overwritten. // Yes, there is a very small race before we actually send the signal. proc_req->saved_sa = CR_SIGACTION(task, CR_SIGNUM); CR_SIGACTION(task, CR_SIGNUM) = proc_req->forced_sa; } sigdelset(&task->blocked, CR_SIGNUM); CR_SIGNAL_UNLOCK(task); retval = send_sig_info(CR_SIGNUM, &info, task); CR_KTRACE_LOW_LVL("triggered pid %d (%s) w/ retval=%d", task->pid, task->comm, retval); /* Save the "stoppedness" of the task for later restore */ cr_task->stopped = (task->state == TASK_STOPPED); if (!retval && (cr_task->stopped)) { wake_up_process(task); } cr_task->self_exec_id = task->self_exec_id; out: return retval; } // // __cr_trigger_phase1_only(req) // // Sends a trigger for phase1: // All Phase1 tasks (if any) are sent the trigger. // The caller must ensure that Phase2 triggers are sent // Must hold tasklist_lock for reading // int __cr_trigger_phase1_only(cr_chkpt_proc_req_t *proc_req) { cr_task_t *cr_task; int found = 0; list_for_each_entry(cr_task, &proc_req->tasks, proc_req_list) { if (cr_task->phase == CR_PHASE1) { found = 1; do_trigger(cr_task, proc_req); // XXX: check error conditions } } return found; } // // __cr_trigger_phase1(proc_req) // // Sends a trigger for phase1: // All Phase1 tasks (if any) are sent the trigger. // If no Phase1 tasks exist then skip to Phase2. // Must hold req->lock, or otherwise ensure exclusive access to req->tasks // Must hold tasklist_lock for reading // // XXX: Should (probably) never fail, thus currently always returns 0. // int __cr_trigger_phase1(cr_chkpt_proc_req_t *proc_req) { int found; found = __cr_trigger_phase1_only(proc_req); // If no Phase1 tasks were found in this proc, then skip to Phase2 if (!found) { __cr_trigger_phase2(proc_req); } return 0; } // // cr_trigger_phase1(req) // // Sends a trigger for phase1: // All Phase1 tasks (if any) are sent the trigger. // If no Phase1 tasks exist then skip to Phase2. // // XXX: Should (probably) never fail, thus currently always returns 0. // int cr_trigger_phase1(cr_chkpt_req_t *req) { cr_chkpt_proc_req_t *proc_req; int retval = 0; read_lock(&req->lock); read_lock(&tasklist_lock); // Send trigger to all of the Phase1 tasks on the list list_for_each_entry(proc_req, &req->procs, list) { retval = __cr_trigger_phase1(proc_req); if (retval) break; } read_unlock(&tasklist_lock); read_unlock(&req->lock); return retval; } // // __cr_trigger_phase2(proc_req) // // Sends the trigger the Phase2 (ie normal/application) tasks. // Must hold req->lock, or otherwise ensure exclusive access to req->tasks // Must hold tasklist_lock for reading // // XXX: Should (probably) never fail, thus currently always returns 0. // int __cr_trigger_phase2(cr_chkpt_proc_req_t *proc_req) { cr_task_t *cr_task; // Send trigger to all of the Phase2 (and "undeclared") tasks. list_for_each_entry(cr_task, &proc_req->tasks, proc_req_list) { if (cr_task->phase != CR_PHASE1) { do_trigger(cr_task, proc_req); // XXX: check error conditions } } return 0; } // // cr_trigger_phase2(req, proc_req) // // Sends the trigger the Phase2 (ie normal/application) tasks. // // XXX: Should (probably) never fail, thus currently always returns 0. // int cr_trigger_phase2(cr_chkpt_req_t *req, cr_chkpt_proc_req_t *proc_req) { int retval; read_lock(&req->lock); read_lock(&tasklist_lock); retval = __cr_trigger_phase2(proc_req); read_unlock(&tasklist_lock); read_unlock(&req->lock); return retval; } blcr-0.8.5/cr_module/license.txt0000664000000000000000000000143707755231442013511 00000000000000This 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 If you are recieving this as part of BLCR, you will find the GNU GPL in the file COPYING in the top-level BLCR directory. blcr-0.8.5/cr_module/cr_proc.c0000664000000000000000000000437311026407455013116 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2008, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * 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 * * $Id: cr_proc.c,v 1.19 2008/06/19 07:47:57 phargrov Exp $ */ #include "cr_module.h" #include #include /* * Our proc_fs entries */ static struct proc_dir_entry *proc_checkpoint; static struct proc_dir_entry *proc_ctrl; /** * cr_proc_init - Initialization code * * DESCRIPTION: * This function registers /proc/checkpoint and /proc/checkpoint/ctrl */ int __init cr_proc_init(void) { CR_KTRACE_FUNC_ENTRY(); proc_checkpoint = create_proc_entry("checkpoint", S_IFDIR, cr_proc_root); if (proc_checkpoint == NULL) { CR_ERR("proc_create_entry(/proc/checkpoint/) failed"); return -ENOMEM; } proc_ctrl = create_proc_entry("ctrl", S_IFREG | S_IRUGO | S_IWUGO, proc_checkpoint); if (proc_ctrl == NULL) { CR_ERR("proc_create_entry(/proc/checkpoint/ctrl) failed"); return -ENOMEM; } proc_ctrl->proc_fops = &cr_ctrl_fops; return 0; } /** * cr_proc_cleanup - Initialization code * * DESCRIPTION: * This function removes /proc/checkpoint and /proc/checkpoint/ctrl */ void cr_proc_cleanup(void) { CR_KTRACE_FUNC_ENTRY(); remove_proc_entry("ctrl", proc_checkpoint); remove_proc_entry("checkpoint", cr_proc_root); } blcr-0.8.5/cr_module/cr_watchdog.c0000664000000000000000000000522111527275214013746 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2007, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * 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 * * $Id: cr_watchdog.c,v 1.7.8.1 2011/02/17 19:44:12 phargrov Exp $ */ #include "cr_module.h" #include #include // Interval for the watchdog to wakeup HZ = 1s #define CR_WD_INTERVAL (HZ) #if HAVE_STRUCT_DELAYED_WORK && defined(DECLARE_DELAYED_WORK) typedef struct work_struct * cr_work_arg_t; #define CR_DECLARE_DELAYED_WORK DECLARE_DELAYED_WORK #else /* struct work_struct */ typedef void *cr_work_arg_t; #define CR_DECLARE_DELAYED_WORK(_a,_b) DECLARE_WORK((_a),(_b),NULL) #endif static void cr_wd_run(cr_work_arg_t arg); static CR_DECLARE_DELAYED_WORK(cr_wd_work, cr_wd_run); static DECLARE_MUTEX(cr_wd_sem); static LIST_HEAD(cr_wd_list); static int cr_wd_live = 0; static void cr_wd_run(cr_work_arg_t arg) { cr_work_t *work, *next; down(&cr_wd_sem); list_for_each_entry_safe(work, next, &cr_wd_list, list) { (work->f)(work); } if (list_empty(&cr_wd_list)) { cr_wd_live = 0; } else { schedule_delayed_work(&cr_wd_work, CR_WD_INTERVAL); } up(&cr_wd_sem); } void cr_wd_add(cr_work_t *work) { down(&cr_wd_sem); list_add_tail(&work->list, &cr_wd_list); if (!cr_wd_live) { cr_wd_live = 1; schedule_delayed_work(&cr_wd_work, CR_WD_INTERVAL); } up(&cr_wd_sem); } /* Returns * - non-zero IFF actually removed * - zero if was not on the work list yet/anymore */ int cr_wd_del(cr_work_t *work) { int retval; down(&cr_wd_sem); retval = !list_empty(&work->list); if (retval) __cr_wd_del(work); up(&cr_wd_sem); return retval; } void cr_wd_flush(void) { cancel_delayed_work(&cr_wd_work); flush_scheduled_work(); } blcr-0.8.5/cr_module/cr_task.c0000664000000000000000000001162311154274344013112 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2003, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * 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 * * $Id: cr_task.c,v 1.21.6.1 2009/03/06 19:26:28 phargrov Exp $ */ #include "cr_module.h" // As a simple convention, the routines here which start w/ '__' // assume you hold the proper locks, while others are to be called // without holding the locks. // List of all tasks for which the C/R module has information. // This is a place to keep all the data that one would consider // adding to (struct task_struct) if C/R were a patch rather // than a module. // TODO: use a hash rather than a list. LIST_HEAD(cr_task_list); // Read/write spinlock to protect cr_task_list. // // This lock nests OUTSIDE the kernel's tasklist_lock. // // This lock nests OUTSIDE any request-specific locks which // are linked off the cr_task_t. CR_DEFINE_RWLOCK(cr_task_lock); // __cr_task_get(task, create) // // Finds an entry for the given task is one exists. // If (create != 0) will create one when none exists. // // Note that even if (create != 0) we could return NULL if // unable to allocate the memory. This is because calling // cr_kmem_cache_zalloc() w/ other than GFP_ATOMIC might sleep while // holding the spinlock. Since we cannot know in this routine what // other locks the caller might hold, it is the caller's problem // to deal with a NULL return. // XXX: can we fix this problem? // // XXX: This could be implemented w/ a hash rather than a linear search. // // Must be called w/ cr_task_lock held (for writing if create != 0). cr_task_t *__cr_task_get(struct task_struct *task, int create) { cr_task_t *cr_task; list_for_each_entry(cr_task, &cr_task_list, task_list) { if (cr_task->task == task) { atomic_inc(&cr_task->ref_count); return cr_task; } } cr_task = NULL; if (create) { #if CRI_DEBUG if (!CR_MODULE_GET()) { CR_ERR("Checkpoint API call after rmmod!"); cr_task = ERR_PTR(-EINVAL); goto out; } #endif cr_task = cr_kmem_cache_zalloc(*cr_task, cr_task_cachep, GFP_ATOMIC); if (cr_task) { atomic_set(&cr_task->ref_count, 1); cr_task->task = task; cr_task->fd = -1; cr_task->self_exec_id = task->self_exec_id; INIT_LIST_HEAD(&cr_task->req_list); INIT_LIST_HEAD(&cr_task->proc_req_list); get_task_struct(task); list_add_tail(&cr_task->task_list, &cr_task_list); #if CRI_DEBUG CR_KTRACE_REFCNT("Alloc cr_task_t %p for pid %d", cr_task, task->pid); } else { CR_MODULE_PUT(); #endif } } #if CRI_DEBUG out: #endif return cr_task; } // __cr_task_put(cr_task) // // Drop one reference to a cr_task. // If this is the last reference then free the resources. // // Must be called w/ cr_task_lock held for writing. void __cr_task_put(cr_task_t *cr_task) { CRI_ASSERT(atomic_read(&cr_task->ref_count)); if (atomic_dec_and_test(&cr_task->ref_count)) { list_del(&cr_task->task_list); put_task_struct(cr_task->task); kmem_cache_free(cr_task_cachep, cr_task); #if CRI_DEBUG CR_MODULE_PUT(); CR_KTRACE_REFCNT("Free cr_task_t %p", cr_task); #endif } else if (atomic_read(&cr_task->ref_count) <= 0) { CR_WARN("%s [%d]: WARNING: Unbalanced __cr_task_put on cr_task_t %p", __FUNCTION__, current->pid, cr_task); } } // cr_task_get(task) // // Routine to find the request corresponding to a given task // Called when a task begins checkpointing itself. // Can also be called to see if any request is outstanding for // the given task. // // Called w/o holding the cr_task_lock. cr_task_t *cr_task_get(struct task_struct *task) { cr_task_t *cr_task; read_lock(&cr_task_lock); cr_task = __cr_task_get(task, 0); read_unlock(&cr_task_lock); return cr_task; } // cr_task_put(cr_task) // // Drop one reference to a cr_task. // If this is the last reference then free the resources. // // Called w/o holding the cr_task_lock. void cr_task_put (cr_task_t *cr_task) { write_lock(&cr_task_lock); __cr_task_put(cr_task); write_unlock(&cr_task_lock); } blcr-0.8.5/cr_module/cr_compat.c0000664000000000000000000000767111051416205013431 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2003, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 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 * Library 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * $Id: cr_compat.c,v 1.29 2008/08/16 00:17:09 phargrov Exp $ * * This file is for calls to 64-bit kernels from 32-bit apps. */ #include #if defined(CONFIG_COMPAT) /* File empty otherwise */ #include /* Wrapper for 32bit callers */ long cr_compat_ctrl_ioctl(struct file *file, unsigned op, unsigned long arg) { CR_KTRACE_FUNC_ENTRY("op=%08x arg=0x%lx", op, arg); switch(CR_IOCTL32_UNMAP(op)) { // // Calls from libcr: // case CR_OP_HAND_CHKPT: return cr_dump_self(file, arg); case CR_OP_HAND_ABORT: return cr_hand_abort(file, arg); case CR_OP_HAND_SUSP: return cr_suspend32(file, (struct compat_timeval __user *)compat_ptr(arg)); case CR_OP_HAND_PHASE1: return cr_phase1_register(file, arg); case CR_OP_HAND_PHASE2: return cr_phase2_register(file, arg); case CR_OP_HAND_SRC: return cr_rstrt_src(file, (char __user *)compat_ptr(arg)); case CR_OP_HAND_CHKPT_INFO: return cr_chkpt_info32(file, (struct cr_compat_chkpt_info __user *)compat_ptr(arg)); case CR_OP_HAND_DONE: return cr_hand_complete(file, arg); // // Calls from cr_checkpoint: // case CR_OP_CHKPT_REQ: return cr_chkpt_req32(file, (struct cr_compat_chkpt_args __user *)compat_ptr(arg)); case CR_OP_CHKPT_REAP: return cr_chkpt_reap(file); case CR_OP_CHKPT_FWD: return cr_chkpt_fwd32(file, (struct cr_compat_fwd_args __user *)compat_ptr(arg)); case CR_OP_CHKPT_LOG: return cr_chkpt_log32(file, (struct cr_compat_log_args __user *)compat_ptr(arg)); // // Calls from cr_restart: // case CR_OP_RSTRT_REQ: return cr_rstrt_request_restart32(file, (struct cr_compat_rstrt_args __user *)compat_ptr(arg)); case CR_OP_RSTRT_REAP: return cr_rstrt_reap(file); case CR_OP_RSTRT_CHILD: return cr_rstrt_child(file); case CR_OP_RSTRT_PROCS: return cr_rstrt_procs32(file, (struct cr_compat_procs_tbl __user *)compat_ptr(arg)); case CR_OP_RSTRT_LOG: return cr_rstrt_log32(file, (struct cr_compat_log_args __user *)compat_ptr(arg)); // // General calls // case CR_OP_VERSION: { // Simple enough to do here // User-space must have equal MAJOR and MINOR <= kernel // If we supported multiple major versions then this is // where we could do the "personallity switching". unsigned long major = (arg >> 16); unsigned long minor = (arg & 0xffff); // If major==0, must match minor; otherwise user-MINOR <= kernel-MINOR int match = (major == CR_MODULE_MAJOR) && (major ? (minor <= CR_MODULE_MINOR) : (minor == CR_MODULE_MINOR)); if (!match) { CR_WARN("request from pid %d for unsupported version %d.%d", (int)current->pid, (int)major, (int)minor); } return match ? 0 : -CR_EVERSION; } default: CR_KTRACE_BADPARM("unknown op %x", _IOC_NR(op)); return -ENOTTY; } } #endif /* CONFIG_COMPAT */ blcr-0.8.5/doc/0000755000000000000000000000000012102072126010153 500000000000000blcr-0.8.5/doc/Makefile.am0000664000000000000000000000022411011155650012131 00000000000000# List of files to distribute EXTRA_DIST=README \ html/index.html \ html/BLCR_Admin_Guide.html \ html/BLCR_Users_Guide.html \ html/FAQ.html blcr-0.8.5/doc/Makefile.in0000664000000000000000000002541712102070007012147 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ 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 = doc DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/blcr_config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CONFIGURE_ARGS = @CONFIGURE_ARGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CR_ARCH = @CR_ARCH@ CR_CLIENT_LDADD = @CR_CLIENT_LDADD@ CR_CPU = @CR_CPU@ CR_FTB_INCLUDES = @CR_FTB_INCLUDES@ CR_FTB_LDADD = @CR_FTB_LDADD@ CR_FTB_LDFLAGS = @CR_FTB_LDFLAGS@ CR_KARCH = @CR_KARCH@ CR_KERNEL = @CR_KERNEL@ CR_KERNEL_BASE = @CR_KERNEL_BASE@ CR_LIBARCH = @CR_LIBARCH@ CR_LIBCR_CFLAGS = @CR_LIBCR_CFLAGS@ CR_MODULE_DIR = @CR_MODULE_DIR@ CR_MODULE_MAJOR = @CR_MODULE_MAJOR@ CR_MODULE_MINOR = @CR_MODULE_MINOR@ CR_MODULE_PATCH = @CR_MODULE_PATCH@ CR_MODULE_VERSION = @CR_MODULE_VERSION@ CR_NDEBUG = @CR_NDEBUG@ CR_RELEASE_MAJOR = @CR_RELEASE_MAJOR@ CR_RELEASE_MINOR = @CR_RELEASE_MINOR@ CR_RELEASE_PATCH = @CR_RELEASE_PATCH@ CR_RELEASE_VERSION = @CR_RELEASE_VERSION@ CR_SIGNUM = @CR_SIGNUM@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GMAKE_ELSE = @GMAKE_ELSE@ GMAKE_ENDIF = @GMAKE_ENDIF@ GMAKE_IFEQ = @GMAKE_IFEQ@ GMAKE_IFNEQ = @GMAKE_IFNEQ@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KBUILD_MAK = @KBUILD_MAK@ KBUILD_MAKE_ARGS = @KBUILD_MAKE_ARGS@ KCC = @KCC@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBCR_MAJOR = @LIBCR_MAJOR@ LIBCR_MINOR = @LIBCR_MINOR@ LIBCR_PATCH = @LIBCR_PATCH@ LIBCR_VERSION = @LIBCR_VERSION@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_AGE = @LIBTOOL_AGE@ LIBTOOL_INTERFACE = @LIBTOOL_INTERFACE@ LIBTOOL_REVISION = @LIBTOOL_REVISION@ LINUX_OBJ = @LINUX_OBJ@ LINUX_SRC = @LINUX_SRC@ LINUX_SYMTAB_CMD = @LINUX_SYMTAB_CMD@ LINUX_SYMTAB_CONF = @LINUX_SYMTAB_CONF@ LINUX_SYMTAB_FILE = @LINUX_SYMTAB_FILE@ LINUX_VER = @LINUX_VER@ LINUX_VERSION_H = @LINUX_VERSION_H@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKE = @MAKE@ MAKEINFO = @MAKEINFO@ 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_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PWD_PROG = @PWD_PROG@ RANLIB = @RANLIB@ RPMBUILD = @RPMBUILD@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TOP_BUILDDIR = @TOP_BUILDDIR@ TOP_SRCDIR = @TOP_SRCDIR@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ 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@ lt_ECHO = @lt_ECHO@ 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@ # List of files to distribute EXTRA_DIST = README \ html/index.html \ html/BLCR_Admin_Guide.html \ html/BLCR_Users_Guide.html \ html/FAQ.html all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign doc/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign doc/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 tags: TAGS TAGS: ctags: CTAGS CTAGS: 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 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am 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: blcr-0.8.5/doc/README0000664000000000000000000000272212064450415010770 00000000000000The html subdirectory contains versions of the documentation on the BLCR website (http://ftg.lbl.gov/checkpoint) which were current at the time this BLCR distribution was packaged: html/BLCR_Admin_Guide.html Installation and configuration information html/BLCR_Users_Guide.html General Users' Guide html/FAQ.html Frequently Asked Questions with answers You may find more up-to-date versions on the web, but should take care that the information obtained from the website may not pertain to this specific BLCR distribution. You may also wish to consult the following BLCR man pages for information on using the BLCR utilities: cr_checkpoint Checkpoint a running process (or group of processes) cr_restart Restart processes from a checkpoint cr_run Run a program with BLCR support added via LD_PRELOAD For API documentation for libcr, you must currently rely on the comments in libcr.h. More formal/useful documentation is planned when the API is more complete. For reporting bugs (or finding the status of known bugs), please visit our Bugzilla at http://mantis.lbl.gov/bugzilla Additionally, answers to your questions may exist in our mailing list archives at https://hpcrdm.lbl.gov/pipermail/checkpoint/index.html or, for posts prior to May, 2010: http://mantis.lbl.gov/hypermail/checkpoint/index.html Feel free to e-mail any questions not answered by the documentation to our mailing list: checkpoint@lbl.gov blcr-0.8.5/doc/html/0000755000000000000000000000000012102072126011117 500000000000000blcr-0.8.5/doc/html/BLCR_Users_Guide.html0000664000000000000000000006225712102047013014760 00000000000000 Berkeley Lab Checkpoint/Restart User's Guide - version 0.8.5

Berkeley Lab Checkpoint/Restart (BLCR) User's Guide

This guide describes how to use Berkeley Lab Checkpoint/Restart (BLCR) for Linux. For information on installation, configuration, and maintenance of BLCR, please see the companion BLCR Administrator's Guide.

1. About Berkeley Lab Checkpoint/Restart

Checkpoint/Restart allows you to save one or more processes to a file and later restart them from that file. There are three main uses for this:
  1. Scheduling: Checkpointing a program allows a program to be safely stopped at any point in its execution, so that some other program can run in its place. The original program can then be run again later.
  2. Process Migration: If a compute node appears to be likely to crash, or there is some other reason for shutting it down (routine maintenance, hardware upgrade, etc.), checkpoint/restart allows any processes running on it to be moved to a different node (or saved until the original node is available again).
  3. Failure recovery: A long running program can be checkpointed periodically, so that if it crashes due to hardware, system software, or some other non-deterministic cause, it can be restarted from a point in its execution more recent that starting from the beginning.
Berkeley Lab Checkpoint/Restart (BLCR) provides checkpoint/restart on Linux systems. BLCR can be used either with processes on a single computer, or on parallel jobs (such as MPI applications) which may be running across multiple machines on a cluster of Linux nodes.
Note: Checkpointing parallel jobs requires a library which has integrated BLCR support. At the present time, many MPI implementations are known to support checkpoint/restart with BLCR. Consult the corresponding BLCR FAQ entry for the current list.

2. Checkpoint/restarting within a BLCR-aware batch control system

One way to use BLCR is with a batch scheduler system (a.k.a. "job controller", "queue manager", etc.) that knows how to use the BLCR tools to checkpoint and restart the jobs under its control. You can simply tell such a system to "suspend" or "checkpoint" a job, and then later to "resume" or "restart" it.

BLCR has been integrated with several batch systems, to differing degrees. Please see the corresponding BLCR FAQ entry for the current list.

The rest of this document assumes that your batch scheduler does not have built-in support for BLCR. In this case you will manually run the BLCR commands needed to checkpoint/restart your jobs.

Note: this does not mean that you cannot checkpoint/restart your applications if you use a batch system without built-in support for BLCR. It simply means that you have to do your checkpoints/restarts manually as described in the remainder of this document. To the batch system, a job that is checkpointed and terminated manually simply looks like a job that has "completed". A restart of an application looks like a "new" job.

3. Checkpointing Jobs with the BLCR command-line tools

3.1 Make sure BLCR is installed and loaded

This guide assumes that BLCR has already been successfully built, installed, and configured on your system (presumably by you or your system administrator). One easy way to test this is to use the 'lsmod' command to see if the BLCR kernel module is loaded on the node(s) that your program will run on:

    % /sbin/lsmod | grep blcr
    blcr                   47508   0
    blcr_imports            7808   1 blcr
If you don't see these two modules in the output of 'lsmod', then BLCR is not yet running on your system. Consult the BLCR Administrators Guide for instructions on building and installing BLCR.

3.2 Make sure your environment is set up correctly

You must ensure that the BLCR commands, libraries and manual pages can be found in your shell.

Try running

    % cr_checkpoint --help
If 'cr_checkpoint' cannot be found, you need to modify your 'PATH' to include the directory where 'cr_checkpoint' lives. You will probably also want to modify your 'LD_LIBRARY_PATH' variable to contain the directory where 'libcr.so' lives, and add the BLCR man directory to your 'MANPATH'.

Setting up your environment with 'modules'

If your system uses the Environment Modules system to manage software packages, you may be able to get all of your needed environment settings simply by entering something like

    % module add blcr
However, there is no requirement that 'blcr' is the name of the module you'll need; your administrator may have given it a different name ('checkpoint', etc.). Or s/he may have neglected to add BLCR to the set of packages managed by modules, in which case you'll need to use the 'manual' technique below.

Manually setting up your environment

Note that this is generally only required if your system administrator has neither installed BLCR in a well-known location nor modified the system-wide defaults for environment variables. However, if your shell startup files override the system-wide defaults, this step may still be necessary.

To manually set up your environment for BLCR, the first thing you need to know is where it has been installed. By default, BLCR installs into the '/usr/local' directory tree, but your system administrator may have put it elsewhere by passing '--prefix=PREFIX' when BLCR was built (where PREFIX can be any arbitrary directory). See your system documents, or try commands such as 'locate cr_checkpoint' or 'find'.

Once you have determined where BLCR is installed, enter the following commands (depending on which type of shell you are using), replacing PREFIX with the value specified for the '--prefix' option used when configuring BLCR.

To configure a bourne-type shell (such as 'bash' or 'ksh'):

    $ PATH=$PATH:PREFIX/bin
    $ MANPATH=$MANPATH:PREFIX/man
    $ LD_LIBRARY_PATH=$LD_LIBRARY_PATH:PREFIX/lib:PREFIX/lib64
    $ export PATH MANPATH LD_LIBRARY_PATH

To configure a csh-type shell (such as 'csh' or 'tcsh'):

    % setenv PATH ${PATH}:PREFIX/bin
    % setenv MANPATH ${MANPATH}:PREFIX/man
    % setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:PREFIX/lib:PREFIX/lib64

These example assume a "multilib" system with both /lib and /lib64 directories. If your system lacks one of these two directories, the corresponding colon-separated entry may be omitted from the value of LD_LIBRARY_PATH.

The above examples set the PATH, MANPATH and LD_LIBRARY_PATH variables in your current shell only. It is strongly recommended that you make these settings permanent, to make these settings affect future sessions or windows. To do this, you must add the example commands to your shell's start up files. For a single user of BLCR, you should add the appropriate set of commands to the shell startup files in your home directory ('.bashrc' for bash, '.profile' for other bourne-type shells, or '.cshrc' for csh-type shells). For a system-wide installation, add the bourne shell commands to '/etc/bashrc' and '/etc/profile' and the csh commands to '/etc/cshrc'.

4. Checkpointing/restarting applications on a single machine

4.1Types of applications supported

BLCR currently supports:
  • Single threaded applications
  • Multithreaded applications using the NPTL implementation of pthreads (NOTE: BLCR 0.7.0 dropped support for the older LinuxThreads implementation)
  • Process trees, meaning a process and all its "reachable" descendants (excluding those who's parent has exited)
  • Process groups (as defined by POSIX), which typically means a command pipeline launched by a shell (e.g. "cat foo bar | sort")
  • POSIX sessions, which typically means a login shell and all its descendants or a batch job
However, certain applications are not supported because they use resources not restored by BLCR:
  • Applications which use sockets (regardless of address family). If a checkpoint is taken of a process with open sockets, they will not be restored when the process is restarted.  Applications or libraries may register a checkpoint callback to manage socket connections to re-open them at restart time (this is how MPI libraries typically work with BLCR), but the core BLCR checkpointer does not directly support restoring sockets. In releases prior to 0.5.0 would fail at checkpoint time if sockets were open.
  • Applications which use character or block devices (e.g. serial ports or raw partitions).  At restart time any devices will appear to have been closed.  As with sockets, code that is BLCR-aware may choose to take its own measures to deal with devices.
  • Applications which use SystemV IPC mechanisms including shared memory, semaphores and message queues.  As with sockets, code that is BLCR-aware may choose to take its own measures to deal with these resources.
  • Others - this list is not exhaustive.  If you have questions about specific resources, see the section "For more information" for contact information.

4.2 Making an application checkpointable

To be checkpointed successfully with BLCR, an application must contain some library code that BLCR provides. There are several ways of ensuring this. Note: in the examples that follow we will use "BLCR_LIBDIR" to denote the directory where the BLCR appropriate libraries are installed. If PREFIX is the root of your BLCR install, then this will typically be either "PREFIX/lib" or "PREFIX/lib64" depending on various conditions.
  1. Start your executable via the with the 'cr_run' command:
            % cr_run your_executable [arguments]
    'cr_run' loads the BLCR library into your application at startup time. You do not need to modify an application to have it work with 'cr_run'.  However, 'cr_run' is limited to dynamically linked executables; statically linked executables will need to use one of the approaches listed below.
  2. Link your application with BLCR's 'libcr_run'. For instance, you could make a simple 'hello world' C program checkpointable via
            % gcc -o hello hello.c -LBLCR_LIBDIR -lcr_run -u cr_run_link_me
    Your application will now look for the BLCR library whenever it starts up, but note that this does not mean it will automatically be found: you may also need to set your 'LD_LIBRARY_PATH' environment variable as described earlier (or read the 'ld' man page for information on '-rpath'). If using this approach, please read the "Cautionary linker notes", below.
  3. Link your application with BLCR's 'libcr'. While linking libcr_run (see above) works for simple 'hello world' applications, it doesn't allow the application any sort of control over what gets checkpointed. To get such control, link to 'libcr' with a command such as
            % gcc -o my_app my_app.c -LBLCR_LIBDIR -lcr
    As with the libcr_run example above, you may need to ensure correct settings in you environment to allow the library to be found when the application starts. Note that '-ldl' and '-lpthread' might also be required to satisfy dependencies in libcr.
  4. Link your application with some library which uses BLCR. For instance, if your MPI library has been made BLCR-aware, it will cause libcr to be loaded, and so simply linking with mpicc is enough to make your application checkpointable.
  5. Use run-time loading to dynamically link 'libcr' or 'libcr_run' (see the 'dlopen' man page).  This mechanism can be used for building applications or libraries that must work both with and without BLCR present on a system.
  6. Force the 'libcr_run.so' dynamic library to do loaded at startup by adding it's full pathname to the 'LD_PRELOAD' environment variable (or just the filename if the directory is listed in 'LD_LIBRARY_PATH'). We do not recommend setting this in your environment in general (via 'export' or 'setenv'), since certain programs may interact poorly with the BLCR library logic. Instead, we recommend that you use a command like
            % env LD_PRELOAD=BLCR_LIBDIR/libcr_run.so.0 your_executable [arguments ]
    This is essentially how 'cr_run' works.
  7. Finally there exists the option to link an application in such a way that it will simply disappear from a checkpoint. While this case may sound odd, there are actual instances of "helper" processes that can be omitted from a multi-process checkpoint and re-fork()ed when restarting. For this purpose, one can link libcr_omit. The link command is identical to that for libcr_run, changing the two instances of "run" to "omit":
            % gcc -o goodbye goodbye.c -LBLCR_LIBDIR -lcr_omit -u cr_omit_link_me

If you your application does not link in BLCR's library via one of the mechanisms listed above, then any attempt to checkpoint it will fail gracefully  In BLCR releases prior to 0.5.0 this situation would cause the program to die unless you handled BLCR's real-time signal explicitly.

Cautionary linker notes

The ELF linker for Linux will normally include ELF DT_NEEDED tags for all dynamic libraries given on the link command line. However, one can pass the --as-needed linker option to generate such tags only for those libraries that supply some symbol referenced elsewhere. However, the intended use of libcr_run and libcr_omit is linking with executables that have not been modified to reference any BLCR symbols. It is for this reason that the instructions above contain "-u cr_run_link_me" and "-u cr_omit_link_me". These each serve to artificially create an undefined reference to a symbol which we've supplied in the BLCR libraries for exactly this purpose, thus ensuring the appropriate BLCR library is linked.

BLCR does not currently build static libraries (e.g. libcr.a) by default. However, if your installation was configured to do so, then a link command that includes -static will encounter the same problem detailed above for the --as-needed linker flag (and for the same reason: libraries are not linked unless they satisfy an undefined symbol reference.) Since the problem is the same, it should come as no surprise that the solution is too: pass the appropriate "-u symbol" linker flags. If your installation has gone so far as to install only static libraries (not shared), then you will face this problem even without the -static flag.

As a result of the issues above, we strongly recommend that authors of Makefiles that link libcr_run or libcr_omit uniformly use "-lcr_run -u cr_run_link_me" and -lcr_omit -u cr_omit_link_me". This will guard against the possibility of user-provided LDFLAGS (or equivalent) that could trigger (silently) the omission of the desired BLCR library from the generated executable.

While one would not normally link libcr without referencing any functions in it, libcr does provide the symbol cr_link_me for completeness.

Finally, note that the symbol you specify after -u is also a good way to check that you've linked in BLCR. Assuming you've not stripped your executable, the following command should find the symbol:

        % nm my_app | grep _link_me
If you don't see any output then you've probably not linked in BLCR's library. Recheck your link command, especially the value you used for BLCR_LIBDIR,

4.3 Checkpointing the process

To checkpoint a process, simply run
    % cr_checkpoint PID
where PID is the application's process ID.

By default, 'cr_checkpoint' saves a checkpoint, and then lets your application continue running, which is useful for saving the state of a process in case it later fails.  However, you may terminate the process after it has been checkpointed by passing the '--term' flag:

    % cr_checkpoint --term PID
This causes a 'SIGTERM' signal to be sent to the process at the end of the checkpoint. To send a different signal to your process at the end of the checkpoint, you can pass any arbitrary signal number using the '--signal=N' flag or one of the related arguments documented in the manpage for cr_checkpoint.

By default BLCR interprets the final argument (PID in the examples above) as the process id of a (potentially multi-threaded) process to checkpoint, along with all of its children (and their children, etc.).  However, there are options to request a checkpoint of a different scope for the checkpoint:

    % cr_checkpoint --pgid PGID
% cr_checkpoint --sid SID
% cr_checkpoint --tree PID
% cr_checkpoint --pid PID
These four examples request, respectively, checkpoints over the scope of a process group, a session, a process tree (the default), and a single process.  The PGID is a process group identifier and SID is a session identifier. Here we take the terms "process group" and "session" to mean the set of processes having the given pgid or sid.  In most cases the pgid or sid is just the pid of the process group leader or session leader. When in doubt, try using the '-j' option to 'ps' to show PGID and SID columns. The '--tree' flag to 'cr_checkpoint' requests a checkpoint of the process with the given pid, and all its descendants (excluding those who's parent has exited and thus become children of the 'init' process). This is the same as the grouping shown by the output of the 'pstree' command.
In BLCR releases prior to 0.6.0 the --pid option was the default.

When checkpointing multiple processes using one of the scope arguments other then --pid, all the pipes among the processes are saved and restored. Pipes to/from processes not within the checkpoint scope are not saved (these will be replaced at restart time by the stdin or stdout of the 'cr_restart' process).

While 'cr_checkpoint' will accept a process group or session identifier as a scope argument, BLCR does not currently restore the pgid or sid of restarted processes.  Instead restored processes inherit the pgid and sid of the 'cr_restart' process.  This is considered a sane default because an unmodified parent (such as a shell) of 'cr_restart' would lose job control over the processes if these identifiers are restored.  A future BLCR release will include the ability to request restore of these identifiers.

Files that contain checkpoints are called context files. By default, they are named 'context.ID', where ID is the pid, pgid or sid that was checkpointed, and are stored in the current working directory of the 'cr_checkpoint' process. You may specify an alternate name and location of the context file via the '--file' option.

There are a number of other options that 'cr_checkpoint' provides. See the man page (or 'cr_checkpoint --help') for details.

4.4 Restarting the process

To successfully restart from a context file, certain conditions must be met:

  • The PIDs of processes in the context file must not be in use, OR you may specify --no-restore-pid to obtain new pids (but see the cr_restart man page for limitations of this approach).
  • The original executable must be available: either it must exist with its contents unchanged, OR you may specify any of of the options --save-exe, --save-private or --save-all to cr_checkpoint to include the executable in the context file.
  • All shared libraries used by the executable must be available: either they must exist with their contents unchanged, OR you may specify either of of the options --save-private or --save-all to cr_checkpoint to include the shared libraries in the context file.
  • Because BLCR saves and restore most open files "by reference" (storing pathnames rather than file contents), the following should be true of files that were open() or mmap()ed when the checkpoint was taken, though certain applications may be more tolerant than these rules imply:
    • Files must exist at their original paths, OR you may use the --relocate option to cr_restart to specify alternative location(s) for files. It is permissible to use a copy of the original file (for instance when performing migration).
    • File and directories must have permissions that permit them to be opened for the original access modes.
    • Files open for reading should not be modified relative to their contents when the checkpoint was taken in any way observable by the application.
    • Files that are open for writing which are written in an append-only manner (regardless of the O_APPEND flag) may have data appended after the checkpoint was taken. Such data will be truncated away when the application is restarted.
    • Files that are open for both reading and writing should be restored to exactly their state at the time of the checkpoint.
  • An exception to the open/mmaped files rules above exists for files already unlinked (deleted) at the time the checkpoint is taken. When BLCR encounters such a file, its entire contents is saved in the checkpoint context file and is later restored as a new (also unlinked) file.
  • You may specify --save-all to cr_checkpoint to include all mmap()ed file in the context file and thus eliminate the requirements above with respect to mmap()ed files only -- this option does not do anything for files that have been open()ed.
Of these requirements, BLCR is only able to verify the availability of the PIDs and the existence and permissions of the executable, libraries and open files.  Failure to satisfy those constraints will lead to an explicit failure from BLCR.  Violation of the rules against modification to any files will not be detected by BLCR and the resulting effects on the restarted application are unpredictable.

You may restart a program on a different machine than the one it was checkpointed on if all of these conditions are met (they often are on cluster systems, especially if you are using a shared network filesystem), and the kernels are the same.  The restriction on executables and their shared libraries being the same can be a problem for systems using prelinking; see the BLCR FAQ for information on dealing with systems that prelink.

You can restart a process by using 'cr_restart' on its context file:

    % cr_restart context.15005
The original process will be restored, and resume running in the exact state it was in at checkpoint time. Note that this includes restoring its process ID, so you cannot restart a program unless the original copy of it has exited (otherwise 'cr_restart' will fail with a message that the PID is already in use). You may restart a process from a particular context file as many times as you wish. The context file is not automatically removed at any point, so you should delete it if/when it is no longer useful to you.

5. Checkpointing/restarting an MPI application

The best source of information on dealing with any BLCR-aware MPI implementation is the documentation provided with the MPI, or the mailing lists for the MPI.

6. For more information

For more information on Checkpoint/Restart for Linux, visit the project home page: http://ftg.lbl.gov/checkpoint, and/or check out our answers to Frequently Asked Questions about BLCR.  When those resources don't answer your questions, you may e-mail checkpoint@lbl.gov for help. blcr-0.8.5/doc/html/index.html0000664000000000000000000000207311011155604013041 00000000000000 BLCR Documentation

Table of Contents

Berkeley Lab Checkpoint/Restart (BLCR) Administrator's Guide
This guide describes how to install, configure, and maintain Berkeley Lab Checkpoint/Restart (BLCR) for Linux.
Berkeley Lab Checkpoint/Restart User's Guide
This guide describes how to use Berkeley Lab Checkpoint/Restart (BLCR) for Linux.
Frequently Asked Questions about BLCR
This document is the "FAQ" for Berkeley Lab Checkpoint/Restart (BLCR) for Linux.

For more information on Checkpoint/Restart for Linux, visit the project home page at http://ftg.lbl.gov/checkpoint, or e-mail checkpoint@lbl.gov for help. blcr-0.8.5/doc/html/FAQ.html0000664000000000000000000013010012102047013012326 00000000000000 BLCR Frequently Asked Questions (for version 0.8.5)

BLCR Frequently Asked Questions (for version 0.8.5)

General Questions

Build/Install Questions

Usage Questions

Additional Resources


General Questions

What is BLCR?

BLCR (Berkeley Lab Checkpoint/Restart) allows programs running on Linux to be "checkpointed" (written entirely to a file), and then later "restarted". BLCR can be found at http://ftg.lbl.gov/checkpoint.

How is checkpoint/restart different than SIGSTOP/SIGCONT?

Putting a process to sleep (via the SIGSTOP signal) implies stopping its execution. Taking a checkpoint writes a snapshot of a process to disk: the process may either be allowed to continue running after the checkpoint is complete, or you can kill the process to release all of its resources .

With sleep, a process's resources are not all fully released (such as virtual memory, network connections, process id, etc.). Checkpointing then killing a process fully releases all system resources.

Restarts from checkpoint files can be used across machine reboots, and/or even on different machines than the one that the checkpoint was taken on. This is not true for SIGCONT.

How is BLCR different than "user-level" checkpointing libraries like Condor, etc.?

BLCR performs checkpointing and restarting inside the linux kernel. While this makes it less portable than solutions that use user-level libraries, it also means that it has full access to all kernel resources, and can thus restore resources (like process IDs) that user-level libraries cannot. This also allows BLCR to checkpoint/restart groups of processes (such as shell scripts and their subprocesses), together with the pipes that connect them.

What kinds of Linux systems does BLCR support?

BLCR runs on x86 and x86_64 (Opteron/EM64T) systems running Linux 2.6.x and 3.x.y kernels. With the 0.8.5 release, we believe the following to work:
  • 2.6.0 through 3.7.1 on x86 and x86_64.

BLCR 0.7.0 added experimental support for PPC (32-bit), and 0.6.0 added experimental support for PPC64 and ARM. These three architectures have been tested as follows:

  • 2.6.14 and newer on PPC
  • 2.6.12 and newer on PPC64
  • 2.6.17 and newer on ARM
We are interested to hear of your success or failure with these three experimental architectures, especially on kernels older than those we have tested.

Note that 0.6.x was the last release series to support 2.4.x kernels.

What Linux distributions does BLCR work with?

BLCR uses a set of configure-based tests to determine which kernel features are available, and so in principle, BLCR should work with any distribution that uses a supported CPU/kernel combination (see above).

Historically, BLCR has been tested with kernels from numerous versions of SuSE, RHEL (and clones such as CentOS and Scientific Linux), Fedora, Debian, Ubuntu, and many vanilla Linux kernels (from kernel.org) from 2.6.0 on up. We have not tested every single version of the kernel from every vendor, nor is each BLCR release retested against all distributions tested in the past. However, we believe that BLCR should work on most distributions using kernels in the ranges given above (except where vendors may have applied patches that bring in problematic changes from kernels outside that range).

If after reading this question and the one above you believe your platform should be supported but cannot get BLCR to work, then please consult our bug database for possible solutions and then report the problem if you don't find it already reported. We can't try every possible platform ourselves and count on user's bug reports to let us know when our testing has missed something.

Can BLCR checkpoint/restart multithreaded programs?

Yes, BLCR can checkpoint both single- and multithreaded (pthreads) programs linked with the NPTL implementation of pthreads. Since with the 0.7.0 release, BLCR no longer provides full support for the older LinuxThreads implementation of pthreads. Please contact us if you are able to devote some effort to restoring/maintaining such support in the future.

BLCR has not been tested with other threading packages, such as those used by some Java runtimes. We are interested in hearing of both success and failure with other threading packages.

Can BLCR checkpoint/restart multi-process applications?

Yes, starting with version 0.5.0 BLCR is able to save and restore groups of related processes together with the pipes that connect them. To do this, BLCR must be given a single request that covers all the processes involved. Currently there are three ways to specify a group request to BLCR:
  • A process "tree", consisting of a process and all its non-orphaned descendants. (An orphaned process is one who's parent has exited, leaving it as a child of the init process).
  • A POSIX process group, consisting of all processes with a given PGID (including orphaned processes, if any).
  • A POSIX session, consisting of all processes with a given SID (including orphaned processes, if any).

While BLCR can save and restore the pipes used for IPC among processes in these groups, it is unable at this time to deal with most other IPC mechanisms (see next FAQ).

Are there limits to the types of programs can BLCR checkpoint?

Yes. BLCR does not support checkpointing certain process resources. While the following list is not exhaustive, it lists the most significant issues we are aware of.
  • BLCR will not checkpoint and/or restore open sockets (TCP/IP, Unix domain, etc.). At restart time any sockets will appear to have been closed.
  • BLCR will not checkpoint and/or restore open character or block devices (e.g. serial ports or raw partitions). At restart time any devices will appear to have been closed.
  • BLCR does not handle SysV IPC objects (man 5 ipc). Such resources are silently ignored at checkpoint time and are not restored.
  • If a checkpoint is taken of a process with any "zombie" children, then these children will not be recreated at restart time. A "zombie" is defined as a process that has exited, but who's exit status has not yet been reaped by its parent (via wait() or a related function). This means that a wait()-family call made after a restart will never return a status for such a child.

If needed, applications can arrange to save any information necessary to recreate/reacquire such resources at restart time (see next FAQ).

What if I want to checkpoint a program that uses resources that BLCR can't checkpoint?

BLCR supports adding 'callbacks' to user-level code, which are called when a checkpoint is about to be performed, and when it is restarted (or continues on after the checkpoint). This is how MPI communication can be handled (see next FAQ).

Full documentation of the callback interface has not yet been written because some of the interfaces are still subject to change. However, the comments in the file libcr.h should provide enough to get started.

Does BLCR support checkpointing parallel/distributed applications?

Not by itself. But by using checkpoint callbacks (see previous FAQ). many MPI implementations have made themselves checkpointable by BLCR. You can checkpoint/restart an MPI application running across an entire cluster of machines with BLCR, without any application code modifications, if you use one of these MPI implementations (listed alphabetically):
  • Cray MPI for their current x86-64 systems
  • Intel MPI 4.1 or later
  • LAM/MPI 7.x or later
  • MPICH-V 1.0.x
  • MPICH2-1.3a2 or later, including MPICH v3.x
  • MVAPICH2 0.9.8 or later
  • Open MPI 1.3 or later
  • SGI MPT since September 2010
See the documentation of your specific MPI for usage instructions. In almost all cases you will need to use a tool provided by the MPI implementation to request a checkpoint or restart, rather then using BLCR's cr_checkpoint and cr_restart utilities.

At this time we are not aware of other MPI implementations that are working on BLCR support, but surprisingly our information is not always the latest. If in doubt, check the support channels of your favorite MPI implementation

Note that any questions about using these MPI implementations with BLCR is more likely to receive a useful response if directed to the support channels of the specific MPI implementation than to the checkpoint@lbl.gov list.

Do I need root access in order to use BLCR?

Root access is needed to install the BLCR kernel modules. However, once these are installed, any user can checkpoint and restart their own programs without needing root permission.

Is BLCR integrated with any batch systems?

We are aware of the following, but we are not always informed of new efforts to integrate with BLCR. For the most up-to-date information you should consult the support channels of your favorite batch system.
TORQUE version 2.3 and later
Support for serial and parallel jobs, including periodic checkpoints and qhold/qrls.
SLURM version 2.0 and later
Support for automatic (periodic) and manually requested checkpoints.
SGE (aka Sun Grid Engine)
Information on configuring SGE to use BLCR can be found here. There is also a thread on the checkpoint@lbl.gov list about modifications to those instructions. The thread begins with this posting.
LSF
Information on configuring LSF to use BLCR can be found in this posting on the checkpoint@lbl.gov list.
Condor
Information on configuring Condor to use BLCR to checkpoint "Vanilla Universe" jobs with the help of Parrot can be found here.
Work is ongoing by third parties to integrate BLCR into other batch systems. If you are interested in adding BLCR support to a job launcher/scheduler, please contact us!

Note that any questions about using these batch systems with BLCR is more likely to receive a useful response if directed to the support channels of the specific batch system than to the checkpoint@lbl.gov list.

How hard is it to port BLCR to an architecture that isn't currently supported?

Most of the architecture-specific code in BLCR is confined to small set of logic to save and restore the CPU-specific register set (vmadump) and some gcc inline assembly for atomic operations and special system calls. The majority of BLCR's code base is entirely processor-independent.

If you are interested in seeing BLCR run on other chips, and are able to devote programmer resources, please contact us! The Alpha platform is likely to be the easiest since vmadump already supports this architecture for Linux 2.6 kernels.


Build/Install Questions

Does BLCR require a kernel patch?

No. All of the kernel logic used by BLCR is implemented within kernel modules. You can thus compile BLCR and load it into a running kernel (with modprobe or insmod) without needing to recompile your kernel or reboot.

What do I need in order to build and use BLCR?

A machine that is running a supported architecture (x86 and x86_64 are fully supported and PPC/PPC64 and ARM are "Experimental") and Linux kernel 2.6.x or 3.x.y.

A set of configured kernel headers that matches the kernel you wish to build against. By configured, we mean that include/linux/version.h and the files in include/linux/modules/ match the target kernel. For many distributions a kernel-devel or linux-headers package is often enough if using the vendor's kernel. For a custom kernel, the actual kernel build directory is often required.

The kernel's symbol table. Normally the file /boot/System.map, or equivalent will serve this purpose.

What if I my kernel sources are unconfigured?

BLCR needs to be able to examine a linux kernel source tree that has been configured, and this configuration must match the kernel that you will run BLCR against.

If you do not have a configured linux kernel source tree, you may be able to create one fairly easily. Many distributions provide a 'config' file that is all you need to easily produce a configured kernel source tree. Good places to look for a config file include /boot/config-2.6.5-1.358 or /config-2.6.5-1.358. In some distributions, the kernel is actually setup to include its configuration in /proc/config.gz (or /proc/config.bz2). If you can find any one of these files then we can proceed with the following steps:

  1. Make a copy of the unconfigured source for the linux kernel you are using, and copy in the file you located:
      $ cp -a /usr/src/kernel-source-2.6.5 /tmp/linux-2.6.5-1.358
      $ cd /tmp/linux-2.6.5-1.358
      $ cp [CONFIG_FILE] .config
    
  2. Configure it using one of the following:
    • For kernels 2.6.6 and newer:
        $ make modules_prepare
      
    • For 2.6.x kernels prior to 2.6.6:
        $ make prepare-all scripts
      
  3. Once that is done, you should be able to configure BLCR using the newly configured kernel source. You should continue to use the System.map file from your running kernel. What you want is probably something like
      $ ./configure --with-system-map=/boot/System.map-2.6.5-1.358 --with-linux=/tmp/linux-2.6.5-1.358.
    

How do I get past the error "linux/modversions.h: No such file or directory"?

Please try rebuilding blcr after commenting out the following six lines near the top of the files vmadump/vmadump.c and blcr_imports/imports.c:

   #if defined(CONFIG_MODVERSIONS) && ! defined(MODVERSIONS)
     #define MODVERSIONS
   #endif
   #if defined(MODVERSIONS)
     #include <linux/modversions.h>
   #endif
Let us know if your compilation still doesn't work.

What if I get an error about my System.map file?

To build, BLCR needs to read the System.map file that corresponds to the kernel you will use BLCR with. Generally, BLCR will find this file "automagically" during ./configure, but some distributions do not provide it, and/or you may not keep yours in a standard place.

If you know where the correct System.map file is, use

  $ ./configure --with-system-map=PATH_TO_YOUR_SYSTEM.MAP

If your System.map is absent, it may still be available as an optional RPM. For instance you may be able to get it by installing (depending on the release) either the kernel-source or kernel-devel RPMs for the kernel you will use BLCR with.

However, Fedora Core 2 and some of its derivatives are shipping a "stripped-down" System.map file. If this is the case, BLCR will abort during configuration with an error stating that the System.map cannot be used. You must install an additional RPM which contains a full System.map in order to build BLCR. In Fedora Core 2 the 'kernel-debuginfo' RPM contains a full System.map file, which it will install into the /usr/lib/debug/boot directory. BLCR's configure script will search this directory, but just to be certain you may still wish to pass '--with-system-map' to point configure at the correct System.map file.

Important Note: If you need to install the kernel-debuginfo RPM, make sure the correct version is installed. Specifically, the 'arch' type must be the same. If your kernel was built for the 'i386' (or 'i586', or 'i686'), the kernel-debuginfo RPM must have the same value. Thus, for an i586 kernel, install 'kernel-debuginfo-2.6.5-1.358.i586.rpm'. To determine which kernel version you have, use
  $ rpm -q kernel --qf '%{version}-%{release}.%{arch}\n'
To make sure that you have installed compatible kernel and kernel-debuginfo RPMs, use
  $ rpm -q kernel kernel-debuginfo --qf '%{version}-%{release}.%{arch}\n'
(replace 'kernel' with 'kernel-smp' if you are using an SMP kernel). You should see the same string, repeated twice.

If you try to use BLCR with the wrong System.map, BLCR will build without complaints, but will probably detect the problem when the blcr.o kernel module is loaded (it does this by comparing some well-known exported kernel symbols' addresses to those provided by the System.map file), and the module load will be aborted.

Why do I get "Invalid module format" when loading BLCR's kernel modules?

Kernels from 2.6.0 through 2.6.18 check at module load time that the same compiler version (major and minor numbers) were used to build both the module and the kernel. This is the error you will see if they don't match. When this happens, you will need to reconfigure and build BLCR with the correct compiler. When a module fails to load due to a version mismatch, you should be able to find a message in the system logs indicating the required compiler version:
  blcr_imports: version magic '2.6.17 SMP mod_unload PENTIUM4 gcc-3.4' should be '2.6.17 SMP mod_unload PENTIUM4 gcc-3.2'
Alternatively, the following should find the "signature" in existing kernel modules:
  $ find /lib/modules/`uname -r` -name '*.ko' -print | head -1 | xargs strings | grep gcc
  vermagic=2.6.17 SMP mod_unload PENTIUM4 gcc-3.2
In this case a gcc-3.2.X version is required.

Regardless of which method is used to find the correct version, you will need to reconfigure BLCR to use the correct compiler. To do so, rerun configure with the addition of "KCC=/path/to/the/correct/gcc" to the command line to set the compiler used for building BLCR's kernel modules.


Usage Questions

Why do I get this error: "Restart failed: Device or resource busy"?

This is because a resource needed into order to restart the process is already in use. The most common problem is that another process already exists with the same pid (process ID)--the operating system will not allow you to create two programs with the same pid. Very frequently this is because a user is trying to 'restart' a process from a checkpoint, when the original process they took the checkpoint of is still running!

If you are unlucky enough that some other, unrelated process has grabbed the PID of your application, you must figure out some way to get rid of that process. If you own the process, you can of course simply kill it (or checkpoint it!). Otherwise, consider becoming root, or consulting your system administrator. BLCR will not kill another process for you (this 'feature' would raise certain security issues).

Why can I restart jobs on the original machine they ran on, but not a different node in my cluster?

You should be able to restart a BLCR-checkpointed job on a different node (or set of nodes, for a parallel job), provided that all the nodes involved provide the exact same libraries and other files that your executable needs. By default BLCR does not save the contents of shared libraries that your program uses, nor does it save the contents of any files your program has open()'ed. But so long as all of these libraries and/or files exist on another node, your program should restart fine.

Note that libraries must be exactly the same for a restart to work; if they are not the same size, for instance, restart will not work. If you've installed the same version of the operating system to all of your nodes (and you've updated them all the same way), you would think things would be fine. However, some Linux distributions are using "prelinking", which is a method for assigning fixed addresses for shared libraries to load into executables. Prelinking is a feature which enables applications that use many shared libraries to load faster. The fixed address used by the same library on different nodes is often deliberately randomized (in order to defeat buffer overflow attacks that could otherwise rely on standard libraries being loaded at the same address on every machine with the same OS version). Alas, if the prelinked addresses are different, you will not be able to restart BLCR checkpoints on another node.

The solution for this problem is to disable prelinking on both the source and destination nodes of any process migration before starting any process you may wish to migrate. For most cluster environments, that means disabling it on all nodes before using BLCR for migration. Prelinking is a systemwide setting, so you will need to be root. On Fedora Core 2, at least, the fix is to edit /etc/sysconfig/prelink and set 'PRELINKING=no'. The comments claim that this will cause prelinking to be undone automatically the next night. We've never been patient, and instead "undo" prelinking immediately by running (as root)

  # /usr/sbin/prelink --undo --all
Automating this process for an entire cluster depends on your specific environment.

BLCR 0.7.0 introduced the --save-* family of options to cr_checkpoint to cause the executable and/or shared libraries to be included in the context file. This may significantly increase the size of the context files. Therefore we recommend this approach only if you cannot ensure uniform library versions (w/o prelinking) across the machines you wish to migrate among.

Some versions of glibc use mmap() to load locale data. CentOS 5 and Scientific Linux 5, for example, store the locale information in the file /usr/lib/locale/locale-archive. This file is generated when glibc (specifically, the glibc-common RPM) is installed, and contains archived versions of all of the localization databases. Since the locale-archive file is not included in the RPM, but is generated at install time, the contents of this file can differ between your compute nodes. This causes problems migrating programs that use glibc's locale support, bash being the most notable. If you see problems migrating bash scripts between nodes, you might have this problem.

You can fix this problem in one of three ways. First, you can use the --save-all option to cr_checkpoint to ensure that the correct localization data is loaded at restart time. Second, you can disable localization support completely by using export LANG=C in your shell environment. Finally, we've been successful in copying one version of the /usr/lib/locale/locale-archive across all of your compute nodes. You'll need to update this file every time you update your glibc-common RPM.

Why do I get the error "Restart failed: No such file or directory"?

This error normally means that a file that was open at the time the checkpoint was taken is no longer present (it is either completely gone, or perhaps just not present at the same pathname as it was previously). You should examine your system logs (such as /var/log/messages or dmesg) for an indication of the file that caused the problem. You will probably find a message like one of the following:
    vmadump: mmap failed: /tmp/hsperfdata_[user]/[pid]
Failed to open file '/tmp/foobar'
In the case of files in a directory of the form /tmp/hsperfdata_[user] see the hsperfdata FAQ entry. For other files, there are a a couple of things you might try.

If the file is a temporary created by your application, it is possible that it has been removed when the application terminated. For instance, if you checkpoint an application with the --term option to the cr_checkpoint utility, then SIGTERM was sent to the application, causing it to cleanup before terminating. If this is the case, then passing --kill will cause the uncatchable signal SIGKILL to be sent, thus preventing any cleanups by the application. Of course, if your application ran to completion and removed its temporary file at its normal conclusion, then you are on your own as to how to recover the file.

If you are trying to perform migration of a process from one machine to another, then it is possible that the file exists, but not at the full pathname that was saved by BLCR. This is especially true if network filesystem mountpoints differ between machines. You may be able to work around such issues with symbolic links among directories, but BLCR provides a --relocate option to cr_restart that can easily deal with such situations.

Future versions of BLCR will make it possible to capture the contents of all open files, thus providing a mechanism to eliminate problems of this sort (at the cost of increased context file size, of course).

Why do I get the error "Restart failed: permission denied"?

There are multiple reasons why a restart would fail with this message, but the most common is filesystem permissions. You should examine your system logs (such as /var/log/messages or dmesg) for an indication of the file that caused the problem. You will probably find a message like one of the following:
    vmadump: mmap failed: /var/db/nscd/hosts
Failed to open file '/tmp/foobar'
You should verify that our user has permission to access the file. In the case of files in the directory /var/db/nscd see the NSCD FAQ entry.

Why do I get the error "ERROR: ld.so: object 'libcr_run.so.0' from LD_PRELOAD cannot be preloaded: ignored"?

This error is almost always a symptom that BLCR's shared libraries are not located for one of two reasons:
  • The libraries have been installed in a "standard" directory, but the utility ldconfig has not been run as root to update the loader cache.
  • The libraries have been installed in a "non-standard" directory and the directory has not been added to the LD_LIBRARY_PATH environment variable.
Please see, respectively, the sections "Updating ld.so.cache" and "Configuring Users' environments" in the BLCR Admin Guide for information on resolving these installation issues.

Why do I get "vmadump: mmap failed: /var/db/nscd/[something]" in the system logs?

The files in the directory /var/db/nscd/ are created by the Name Service Cache Daemon (NSCD, for short) and are protected against normal file accesses. When the NSCD is enabled, certain C library operations talk to the daemon which uses filedescriptor passing to allow the application to mmap() these files. Unfortunately, BLCR cannot replay the filedescriptor passing (there is no way to know that a given filedescriptor was obtained in this way). This leaves BLCR to rely on normal filesystem permissions when trying to reestablish the mmap(), which in this case finds insufficient permissions.

C library functions that may use NSCD include host database lookups (such as gethostbyname()), user database lookups (such as getpwuid()) and other database lookup functions. Since use of NSCD may speed these lookups relative to network-based lookups such as NIS, LDAP or DNS, this is generally a good thing.

If you are experiencing the "mmap failed: /var/db/nscd/..." error, you have at least the following three options:

  • You may choose to disable NSCD or remove it from you system entirely. If you choose this option then consult the documentation for your specific Linux distribution for instructions on disabling services or removing packages.
  • You may choose to keep NSCD enabled, but disable the mmap() mechanism. This will still allow NSCD to cache lookups, but the interaction between the application and NSCD will be slower. If the database lookups are primarily resolved by network services such as NIS, LDAP and DNS then this is still a net win when compared to disabling or removing NSCD entirely.
    To disable the mmap() mechanism add the following lines (or modify similar ones) in the file /etc/nscd.conf:
    	shared	passwd	no
    	shared	group	no
    	shared	hosts	no
    
    You will need to restart NSCD for the change to take effect (consult the documentation for your specific Linux distribution for instructions on restarting services).
  • Since 0.8.3, BLCR has the option to disable NSCD per-process when libcr is initialized. This option has the benefit of avoiding this error in many cases, while allowing the full benefit of NSCD for applications that run without libcr. To enable this behavior set the environment variable LIBCR_DISABLE_NSCD to any non-empty value. Unlike the previous two options, this approach does not require one to have root permission. However there is one weakness: if NSCD is used by a process prior to libcr's initialization, then one could still experience this problem. If this happens to you then you will need to apply one of the other two options.
Our thanks to Guy Coates <gmpc AT sanger DOT ac DOT uk> for information on the /etc/nscd.conf settings.
Our thanks to Hongjia Cao <hjcao AT nudt DOT edu DOT cn> for information leading to the implementation of LIBCR_DISABLE_NSCD.

Why do I get "vmadump: mmap failed: /tmp/hsperfdata_[user]/[pid]" in the system logs?

Directories of the form /tmp/hsperfdata_[user]/ are created by Sun's Java runtime environment (JRE), and the individual files in this directory are removed when the application exits. This includes exits due to catchable fatal signals, so if a checkpointed Java application is terminated by such a signal these files will be unavailable for a subsequent restart. You have several options to deal with this issue:
  • If you are trying to perform migration of a process from one machine to another, then you may try manually copying the file from one machine to another. While this is not a safe practice in general, we have had reports of success from users who have tried this.
  • If you experiencing this problem when running Matlab but don't need the Java features, you can avoid this issue entirely by passing --nojre when launching Matlab.
  • You may disable creation of hsperfdata files by passing -XX:-UsePerfData when starting the Java application. Note, however, that certain performance monitoring or debugging tools may require the hsperfdata files.
  • If the signal causing termination of the Java application is due to the --term option to the cr_checkpoint utility, passing --kill instead will cause the uncatchable signal SIGKILL to be sent, thus preventing any cleanups by the JRE.
  • If the signal is due to the cr_signal value in the arguments to the cr_request_checkpoint() function, then use of SIGKILL will prevent cleanups, as above.
Our thanks to Guy Coates <gmpc AT sanger DOT ac DOT uk> for information on the -XX:-UsePerfData JRE option.

Why does my application dies with "Real-time signal 31" (or 32, etc.) when I try to checkpoint it?

This error was possible in older releases of BLCR when an application was not checkpointable. This should not happen in release 0.5.0 or newer and should be reported as a bug if seen.

Why can't I checkpoint my statically linked application?

If you can checkpoint and restart a dynamically linked application correctly, but cannot do so with the same application linked statically, this FAQ entry is for you. There are multiple reasons why BLCR may have problems with statically executables.
  • The cr_run utility only supports dynamic executables
    If you wish to checkpoint an unmodified executable, the typical recipe is
      $ cr_run my_app my_args
    
    However, the cr_run utility does its work using the "LD_PRELOAD" environment variable to force loading of BLCR's support code into the address space the applications. That mechanism is only functional for dynamically linked executables. There is no magic we can perform today that will resolve this (though in the future we'd like to replace our use of LD_PRELOAD with a kernel-side mechanism). So, you'll need to relink any statically linked executables to include BLCR support.
  • Linking BLCR's libraries statically takes special care
    OK, we've told you why cr_run doesn't work and told you to relink. You tried linking with -lcr_run and/or -lcr and still can't get a checkpoint to work. What went wrong?

    Please reread the "Cautionary linker notes" section of the BLCR Users Guide. You need a -u option in addition the the -l or the static linking will simply ignore BLCR's library.

  • BLCR doesn't support LinuxThreads
    Ok, what else could go wrong? You've followed the guidance given in the "Cautionary linker notes" section of the BLCR Users Guide when you linked your application. You even ran
      $ nm my_app | grep link_me
    
    to be sure the symbol you specified with -u is linked in. However, you are seeing weird crashes of your application when you try to checkpoint.

    The culprit might be LinuxThreads. Why? Because at the time this FAQ entry is being written, there are many Linux distributions that install the static libs for LinuxThreads in the default library search path, and with the NPTL static libs elsewhere. The resolution could be as simple as linking your application with -L/usr/lib/nptl or -L/usr/lib64/nptl, perhaps by setting an "LDFLAGS" variable (though it is possible that your distribution has picked some other location).

    While it is not strictly required due to binary compatibility between LinuxThreads and NPTL, we'd recommend that you at least consider a recompile with -I/usr/include/nptl in CFLAGS.

    Note, of course, that if BLCR's utilities are statically linked to LinuxThreads, then they need to be rebuilt too. See the BLCR Admin Guide for more information on that.

Can I use Linux kernel auditing support with BLCR?

We recommend that you avoid auditing when using BLCR. In particular, we've seen odd restart failures (on return to user space) when migrating processes between nodes where auditing is enabled (with /sbin/auditctl -e1) to nodes where auditing is disabled. The migrating processes themselves were not being audited, neither at checkpoint time nor during restart. In some cases, but not all, these restart failures produce warning messages about leaked audit contexts.

More importantly, BLCR does not generate audit records during checkpoint or restart. As far as the auditing code is concerned, all of the BLCR kernel calls are described by ioctl() records. You don't see audit records describing the creation of the context file, the mmap() established during restart, or the file descriptors that are restored. Please contact the mailing list if you need auditing support during checkpoint/restart calls.

Prior to version 0.8.4, the linked_fifo test caused a kernel BUG when audited during restart. If you encounter any other problems, please report a bug to the mailing list.


Additional Resources

Where can I download BLCR?
Where can I find more information?

To download the BLCR software, or for links to all the available information about BLCR, please visit http://ftg.lbl.gov/checkpoint.

Is there a mailing list for BLCR?

There is a mailing list of BLCR developers and some of the users at checkpoint@lbl.gov and which is archived:

This list is managed by Mailman. So, to subscribe (or unsubscribe) visit https://hpcrdm.lbl.gov/cgi-bin/mailman/listinfo/checkpoint.

Where can I report BLCR bugs?

If you think you've found a bug in BLCR, please do let us know about it. There are many kernel-dependencies in BLCR and we could easily have missed testing on a system like yours. We count on user's bug reports to help ensure wide testing coverage.

The BLCR bug database is managed by a Bugzilla, located at http://mantis.lbl.gov/bugzilla.

Before reporting a bug, you are encouraged to search the database to see if a bug report exists for your problem. For some issues a solution can be found in just a day. So, a patch to fix your problem may already be attached to an existing bug report. BLCR is just one of a group of projects managed on this server, so be sure to select product "BLCR" in your queries.

blcr-0.8.5/doc/html/BLCR_Admin_Guide.html0000664000000000000000000005764712102047013014716 00000000000000 BLCR Admin Guide - version 0.8.5

Berkeley Lab Checkpoint/Restart (BLCR) Administrator's Guide

This guide describes how to install, configure, and maintain Berkeley Lab Checkpoint/Restart (BLCR) for Linux. For usage instructions please see the companion BLCR User's Guide.

1. System Requirements

BLCR consists of two kernel modules, some user-level libraries, and several command-line executables. No kernel patching is required.

BLCR has been engineered to work with a wide range of Linux kernels:

  • Many major vendor distributions of Linux. Those tested historically have included SuSE, RHEL (and clones such as CentOS and Scientific Linux), Fedora, Debian and Ubuntu (and this list is NOT exhaustive).
  • Many "vanilla" Linux 2.6.x and 3.x.y kernels (from kernel.org) have also been tested with many glibc versions (2.2 and up).
    We believe vanilla versions 2.6.0 through 3.7.1 all work.
  • BLCR uses a set of autoconf-based feature tests to probe the kernels it builds against. It is thus likely that a custom kernel based on one of the above kernel sources will work with BLCR, provided that patches applied to the kernel don't invalidate assumptions BLCR has made.
BLCR uses assembly code to save some program state (most notably the CPU registers). This means that the BLCR kernel modules are not portable across CPU architectures "out of the box". BLCR has long supported the x86 and x86_64 architectures.  The 0.6.0 release was the first to include experimental support for PowerPC64 and for ARM, while the 0.7.0 release added experimental support for 32-bit PowerPC.  Currently x86 and x86_64 systems are the most fully tested with BLCR, with the other architectures tested heavily only at release time. Porting BLCR to a different CPU is not a large software effort if one has sufficient Linux kernel experience and knowledge of the target CPU's ABI and instructions.  Please contact us if you are interested in contributing a port. We are especially interested in somebody with the time and equipment to complete the unfinished port to SPARC64.

2. Installing/Configuring BLCR

To build checkpoint/restart, you need the following files:
  • The source code for the configured kernel you are building against.
  • linux/version.h (a generated file from the kernel sources).
  • either the System.map or the vmlinux file for the kernel you are building against.
  • A copy of the BLCR source (blcr-X.Y.Z.tar.gz: see http://ftg.lbl.gov/checkpoint for a link to the latest version).
If you run into trouble when following the instructions below, make sure to check both our FAQ (especially the "Build/Install Questions" section), and our bug database, located at http://mantis.lbl.gov/bugzilla/. Your install problem may have already been solved!

2.1 Configuring BLCR

BLCR builds and installs much like any other autotools-based distribution:

    % tar zxf blcr-<VERSION>.tar.gz
    % cd blcr-<VERSION>
    % mkdir builddir
    % cd builddir
    % ../configure [ options ]
    % make
    % make install
Depending on which kernel you are building against, and where you wish to put the BLCR libraries, there are a number of options to configure that you need to consider. The most common of these are described in the paragraphs that follow.

We strongly recommend that you configure and build BLCR in a directory other than the one containing the BLCR source code (use of some options to configure actually require this). In the example above the build is conducted in a subdirectory, named 'builddir', of the source directory. Any writable location is fine, but you will need to invoke configure by the correct path in place of '../configure' used in the example.

If you run into issues building BLCR on your system, check the Platform-specific notes section of this document and the FAQ.

Choosing an installation directory

By default BLCR will install into /usr/local. To choose a different directory tree to install into, pass the '--prefix' flag to configure:
  • --prefix=[the directory you wish to install into]
However, be aware that using a location other than /usr/local or /usr may require additions to the PATH, MANPATH and LD_LIBRARY_PATH environment variables of users (more details below).

Building against a kernel other than the one that's running

By default, BLCR builds against the kernel that is running on the system at configure time, and looks in a number of standard locations for the required files that correspond to it. However, if you're building for a kernel other than the kernel that is running at the time of the build, then you'll need to pass configure one of the following two options:

  • --with-linux=[kernel version such as 2.6.24.3-34.fc8-i686]
  • --with-linux=[full path to the kernel build directory]
If no --with-linux is passed, the default is equivalent to --with-linux=`uname -r`.

Building with files in locations unknown to BLCR

In most standard installations, either the default settings or a manual --with-linux option should be enough to find all the required files. However, in some cases configure will need additional help. For instance, if the sources are not in a well known directory, the --with-linux-src=[full path] option can be used to tell configure where they are. Similarly, BLCR needs either the System.map or vmlinux files. So if neither are found in well known locations, you'll need to pass configure one of the following two options:

  • --with-system-map=[full path to the System.map file]
  • --with-vmlinux=[full path to the kernel executable]
Note that the vmlinuz file (note the final character 'z') cannot be used as a replacement for System.map or vmlinux.

Separate compilers for user-space and kernel

Historically, the Linux kernel sources have not always been kept current as gcc versions have advanced. As a result, there have been Linux distributions that have shipped two gcc versions: a current one for user-space code and an older one for compiling the kernel and kernel modules. There are also distributions that have a 64-bit kernel, but build (nearly) all of user-space as 32-bit. In that case, there might be a single gcc version installed with a default of building 32-bit objects, which therefore won't work as-is to compile the kernel modules.

In either of these cases it may be required to have BLCR build its user-space and kernel module portions with different compilers (or the same compiler with different flags). Just as most other configure-based packages, BLCR can be configured to use a specific C compiler by setting the "CC" variable at configure time. In addition, BLCR's configure honors a "KCC" variable to specify the C compiler to use for the kernel modules. For our first motivating example (a distribution with a distinct "kgcc"), you could use the following:

    % configure [ options ] KCC=kgcc
For our second motivating example (64-bit kernel with 32-bit user-space and gcc defaulting to 32-bit objects), you could use the following:
    % configure [ options ] KCC='gcc -m64'

If not set explicitly, KCC defaults to the value configure finds for CC.

Building 32-bit application support on a 64-bit platform

BLCR's build logic is capable of building both 64-bit and 32-bit libraries at the same time on most 64-bit platforms it supports.  However, because this feature does not work well with certain setups, it is disabled by default.  To enable it you'll want to pass configure the following option:

  • --enable-multilib
This option assumes "CC" generates 64-bit objects, and may instruct you to try again with the addition of an option like CC='gcc -m64' if that is not the case.

If configuration fails with this option specified, you can still configure without it to get only 64-bit application support.

BLCR does not currently support any mechanism to build 32-bit utilities and 64-bit libraries at the same time. If you want 64-bit libraries, you currently have to settle for 64-bit utilities as well.

Building static libraries (optional)

By default, BLCR does not build static versions of its libraries. If you want/need static libraries, you may enable the with:

  • --enable-static
However, do not pass --disable-shared unless you are certain you know what you are doing. Without the dynamic shared libraries, the cr_run utility will not function.

Building static executables (discouraged)

BLCR's utilities (cr_run, cr_checkpoint and cr_restart) are normally build with the default linker flags. This will, for most installations, result in dynamically linked executables. You may force BLCR to build statically linked utilities by passing configure the following two options:

  • --enable-static --enable-all-static
You might also get statically linked BLCR utilities by default if your system has no dynamic libraries installed.

If you configure with --enable-all-static (or have no dynamic libraries on your system), you should be aware that you may unknowingly be linking in the LinuxThreads implementation of pthreads, which BLCR does not support. This happens because currently many Linux distributions install the LinuxThreads static libraries in the default library search path, and the BLCR-supported NPTL libraries are installed elsewhere. If this happens to you, then configure will fail. The solution is to provide the proper "CPPFLAGS" and "LDFLAGS" when you configure BLCR. Appending something like the following to the configure command line may work:

  • CPPFLAGS='-I/usr/include/nptl' LDFLAGS='-L/usr/lib/nptl -L/usr/lib64/nptl'
Though you could/should leave out one of the two "LDFLAGS" options if not performing a --enable-multilib build.

Building an installable BLCR testsuite (optional)

If you pass configure the following option:
  • --enable-testsuite
then BLCR's tests will not only be built for testing via "make check", but will also be installed via "make install". The testsuite is installed in PREFIX/libexec/blcr-testsuite, and can be executed by running RUN_ME in that directory (once the environment variables are setup correctly).

2.2 Compiling BLCR

Just type 'make':
    % make
If you get errors, first check the FAQ and then contact us for help.

2.3 Testing your build (optional, but recommended)

As with many autotools-based packages, BLCR includes a 'check' make target.  However, it cannot run the tests until the kernel modules are loaded (and will tell you so if you forget).  Since the not-yet-installed kernel modules are located throughout the BLCR build directory, an 'insmod' make target is provided to automate this task.  If you are not running as root, "make insmod" will try to use the 'sudo' utility to perform the insmod operations as root.  However, it is not necessary (or recommended) to run the tests themselves as root.  So, we recommend run the following as a non-root user if 'sudo' is installed and configured to allow your user:
    % make insmod check
Which may prompt for a password, depending on how 'sudo' is configured.  If the 'sudo' utility is not installed (or not configured for your user), the following steps are equivalent:
    % su
    Password:[type root password here]
    # make insmod
    # exit
    % make check
If the modules fail to load, then your kernel may not be supported and you'll need to report this as a bug to the BLCR team, after first checking the bug database to ensure the problem isn't already known (or even fixed).  Similarly, if one or more tests fail, we'll want to know that too.  However, if the only failures are one or two tests that say "restart/timeout" then you should first try increasing the timeout as follows (assuming the kernel modules have already been loaded):
    % make check CRUT_TIMEOUT=120
The 'CRUT_TIMEOUT' is a value in seconds, with a default of 60  (CRUT is an acronym for Checkpoint/Restart Unit Test).

Tests marked 'SKIP' are neither a 'PASS', nor a 'FAIL' - instead they indicate a test that was not actually run. So don't be alarmed if you see one or more tests marked 'SKIP'. This happens when a given test is not applicable to your system (for instance the hugetlbfs test is skipped when no writable mountpoint for hugetlbfs is found).

Note that BLCR's testsuite intentionally tries to do "bad" things and many lines of output are expected in the system logs as a result. Do not be alarmed by them, but be prepared to provide them with any failures you report to us.

We do not advise continuing to install BLCR if any tests 'FAIL' (other than timeouts correctable by raising CRUT_TIMEOUT sufficiently).

2.4 Installing BLCR

Use the standard 'install' make target to install the BLCR utilities and libraries, and to place the kernel modules in the standard location for your kernel:

    % make install
or, if you prefer stripped binaries:
    % make install-strip

2.5 Loading the Kernel Modules

Before you can checkpoint/restart applications, the kernel modules need to be loaded into your kernel. The kernel modules are placed into a subdirectory of the lib/blcr (or lib64/blcr) branch of the installation directory. In this example, we'll assume the installation prefix was the default /usr/local and that your kernel is version 2.6.12-1.234 for an x86. Thus, for this example the kernel modules are in the directory /usr/local/lib/blcr/2.6.12-1.234/. There are two kernel modules in this directory which must be loaded (in the correct order) for BLCR to function.

As root, load the kernel modules in this order:

    # /sbin/insmod /usr/local/lib/blcr/2.6.12-1.234/blcr_imports.ko
    # /sbin/insmod /usr/local/lib/blcr/2.6.12-1.234/blcr.ko

You may wish to set up your system to load these modules by default at boot time. The exact mechanism for doing so differs between Linux distributions, and thus requires an experienced system administrator. However, a template init script is provided as etc/blcr.rc in the BLCR source directory.

2.6 Updating ld.so.cache

Nearly all Linux distributions use a caching mechanism for resolving dynamic library dependencies. If you have installed BLCR's shared library in a directory that is cached by the mechanism, then you will need to update this cache. To do so, run the ldconfig command as root; no command-line arguments are needed.

It should always be safe to run the ldconfig command, even if BLCR did not install its library in a directory managed in the cache. However, if you wish to avoid this step when unnecessary, you can know that BLCR's shared library is in a cached directory if you configured with --prefix= or --libdir= options that cause BLCR's shared library (libcr.so) to be installed in:

  • /lib or /usr/lib
  • any directory listed in /etc/ld.so.conf
  • any directory listed in a file under /etc/ld.so.conf.d/
Note that if you passed no --prefix= or --libdir= options to BLCR's configure script, then you should check /etc/ld.so.conf and /etc/ld.so.conf.d/ for /usr/local/lib (the default location) to determine if you actually need to run the ldconfig command.

2.7 Configuring Users' environments

Finally, you may wish to add the appropriate BLCR directories to the default PATH, LD_LIBRARY_PATH, and MANPATH environment variables for your users. You may either modify the /etc/profile and/or /etc/cshrc files, or add new files in the /etc/profile.d directory. Alternatively, you may provide modules that accomplish the same thing. You should replace PREFIX by the installation prefix (such as /usr/local) in the following examples:

For Bourne-style shells:

    $ PATH=$PATH:PREFIX/bin
    $ MANPATH=$MANPATH:PREFIX/man
    $ LD_LIBRARY_PATH=$LD_LIBRARY_PATH:PREFIX/lib:PREFIX/lib64
    $ export PATH MANPATH LD_LIBRARY_PATH

For csh-style shells:

    % setenv PATH ${PATH}:PREFIX/bin
    % setenv MANPATH ${MANPATH}:PREFIX/man
    % setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:PREFIX/lib:PREFIX/lib64

These example assume a "multilib" system with both /lib and /lib64 directories. If your system lacks one of these two directories, the corresponding colon-separated entry may be omitted from the value of LD_LIBRARY_PATH.

It is worth noting that if the BLCR libraries are installed in a directory named in /etc/ld.so.conf or /etc/ld.so.conf.d/, then you do not need to add it to LD_LIBRARY_PATH. Similarly, you may find it unnecessary to add to PATH and/or MANPATH if BLCR has been installed in a location that is already searched.

2.8 Uninstalling BLCR

If you preserve the BLCR build tree, then there is a standard 'uninstall' make target available to remove the files copied by the 'install' target.

3. Making RPMs from the BLCR sources

An alternate way to install BLCR is to build a binary RPM for your system, which you can then install. This has certain advantages (such as making upgrading easier, especially if you maintain BLCR on multiple systems).

3.1 Building binary RPMs from the source tarball

Once you've configured BLCR with any options your system requires, the simplest method for building RPMs is to just
    % make rpms
If successful, the new RPM packages will be in the rpm/RPMS subdirectory of the build tree. The resulting packages will be for whatever kernel you configured for.

3.2 Building a binary RPM from source RPMS

You may also with start from a source RPM (with a .src.rpm suffix) rather than the .tar.gz version of the BLCR distribution. Source RPMs are available on our website. These source RPMs are configured to build for the running kernel, with --prefix=/usr and to configure with --enable-multilib on 64-bit platforms. Alternatively, the 'make rpms' step above will create a source RPM in the rpm/SRPMS subdirectory of the build tree, valid for the configured kernel.

If building as root, built RPMs will be placed in a subdirectory of /usr/src/redhat/RPMS. However, if you are not root, you may need to see this page at IBM for information on configuring an output location before proceeding.  Personally, we prefer not to build as root.

To build binary RPMs from the source RPM, use

    % rpmbuild --rebuild blcr-X.Y.Z-N.src.rpm --target ARCH
replacing blcr-X.Y.Z-N.src.rpm with the correct filename, and ARCH with a specific target CPU. If you don't know your target, try "uname -p" to determine it. If you don't specify a --target, the default will depend on the version of rpmbuild and may be i386 (which will be rejected). See the documentation for rpmbuild for more information on building binary RPMs from source RPMs.

If you are on a 64-bit platform and do not wish to build the 32-bit libraries (or lack the required toolchain), then you can disable the default --enable-multilib behavior of the source RPM by adding --define 'with_multilib 0' to the rpmbuild command line.

The RPMs should build without error. However, if not building for the running kernel, you may see a warning about this. You will see the location of the binary RPMs in the last few lines of output from rpmbuild - something like this:

    Wrote: /usr/src/redhat/RPMS/i686/blcr-0.8.5-1.i686.rpm
    Wrote: /usr/src/redhat/RPMS/i686/blcr-libs-0.8.5-1.i686.rpm
    Wrote: /usr/src/redhat/RPMS/i686/blcr-devel-0.8.5-1.i686.rpm
    Wrote: /usr/src/redhat/RPMS/i686/blcr-modules_2.6.12_1.234-0.8.5-1.i686.rpm
    Wrote: /usr/src/redhat/RPMS/i686/blcr-testsuite-0.8.5-1.i686.rpm
You should note that the kernel version 2.6.12-1.234 has become 2.6.12_1.234 in the name of the blcr-modules package (a change of a hyphen to an underscore).

In most cases, you will want to install the blcr, blcr-libs and blcr-modules binary RPMS. The blcr-devel is only required on machines on which you will compiling/linking source code against BLCR's libraries. So, for a cluster you may want to install blcr-devel only on the front-end node(s).

The blcr-testsuite RPM is optional. You may install and run the testsuite (/usr/libexec/blcr-testsuite/RUN_ME) if you wish to verify correct operation of BLCR. You may be asked to do this if you report bugs to us.

4. Platform-specific notes

  • PowerPC (32- and 64-bit)
    • There is a known problem with signal handling in some PowerPC kernel versions 2.6.15 and older that can cause restart failures with BLCR. Therefore, for effected kernels one must configure with '--with-bug2524' to enable a work-around in BLCR (with a very small performance penalty).
      If you are configuring for a kernel 2.6.15 or older on a PowerPC, BLCR's configure script will require either '--with-bug2524' or '--without-bug2524'. If you are uncertain, configure using '--with-bug2524', which is always safe. If you make an incorrect choice at configure time, then when you run 'make check' the test 'bug2524' will let you know.
  • ARM
    • Kernel versions 2.6.11 and older lack true atomic compare-and-swap support, which BLCR require. Therefore, one must use a 2.6.12 kernel or later on ARM plarforms.

5. For more information

For more information on Berkeley Lab Checkpoint/Restart for Linux, visit the project home page: http://ftg.lbl.gov/checkpoint
To report bugs (or look for bug fixes prior to reporting new ones), visit http://mantis.lbl.gov/bugzilla

blcr-0.8.5/blcr_imports/0000755000000000000000000000000012102072124012103 500000000000000blcr-0.8.5/blcr_imports/imports.c.in0000664000000000000000000000274210760721537014321 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2003, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * 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 * * $Id: imports.c.in,v 1.3 2008/02/26 05:27:59 phargrov Exp $ */ #ifndef EXPORT_SYMTAB #define EXPORT_SYMTAB #endif #include "blcr_config.h" #include "blcr_imports.h" #include "blcr_ksyms.h" /* BEGIN AUTO-GENERATED FRAGMENT */ @CR_KSYM_IMPORT_CALLS@ /* END AUTO-GENERATED FRAGMENT */ const char *blcr_config_timestamp = BLCR_CONFIG_TIMESTAMP; EXPORT_SYMBOL_GPL(blcr_config_timestamp); blcr-0.8.5/blcr_imports/Makefile.am0000664000000000000000000000104310761154012014065 00000000000000# Additional dependence for file generated via AC_SUBST_FILE() all-local: imports.c imports.c: $(top_builddir)/.import_calls # Vars needed by kbuild SOURCES = imports.c module.c INCLUDES = -I$(top_builddir)/include \ -I$(top_srcdir)/include # echo an arbitrary make/environment variable (needed by kbuild glue) echoval: @echo $($(VARNAME)) | sed 's/"/\\"/'g .PHONY: echoval EXTRA_DIST = license.txt module.c # Must visit . first, to keep generated source file imports.c up to date SUBDIRS = . kbuild dist-hook: rm -f $(distdir)/imports.c blcr-0.8.5/blcr_imports/Makefile.in0000664000000000000000000004502112102070007014072 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ 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 = blcr_imports DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/imports.c.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/blcr_config.h CONFIG_CLEAN_FILES = imports.c CONFIG_CLEAN_VPATH_FILES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-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 uninstall-recursive RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir 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@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CONFIGURE_ARGS = @CONFIGURE_ARGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CR_ARCH = @CR_ARCH@ CR_CLIENT_LDADD = @CR_CLIENT_LDADD@ CR_CPU = @CR_CPU@ CR_FTB_INCLUDES = @CR_FTB_INCLUDES@ CR_FTB_LDADD = @CR_FTB_LDADD@ CR_FTB_LDFLAGS = @CR_FTB_LDFLAGS@ CR_KARCH = @CR_KARCH@ CR_KERNEL = @CR_KERNEL@ CR_KERNEL_BASE = @CR_KERNEL_BASE@ CR_LIBARCH = @CR_LIBARCH@ CR_LIBCR_CFLAGS = @CR_LIBCR_CFLAGS@ CR_MODULE_DIR = @CR_MODULE_DIR@ CR_MODULE_MAJOR = @CR_MODULE_MAJOR@ CR_MODULE_MINOR = @CR_MODULE_MINOR@ CR_MODULE_PATCH = @CR_MODULE_PATCH@ CR_MODULE_VERSION = @CR_MODULE_VERSION@ CR_NDEBUG = @CR_NDEBUG@ CR_RELEASE_MAJOR = @CR_RELEASE_MAJOR@ CR_RELEASE_MINOR = @CR_RELEASE_MINOR@ CR_RELEASE_PATCH = @CR_RELEASE_PATCH@ CR_RELEASE_VERSION = @CR_RELEASE_VERSION@ CR_SIGNUM = @CR_SIGNUM@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GMAKE_ELSE = @GMAKE_ELSE@ GMAKE_ENDIF = @GMAKE_ENDIF@ GMAKE_IFEQ = @GMAKE_IFEQ@ GMAKE_IFNEQ = @GMAKE_IFNEQ@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KBUILD_MAK = @KBUILD_MAK@ KBUILD_MAKE_ARGS = @KBUILD_MAKE_ARGS@ KCC = @KCC@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBCR_MAJOR = @LIBCR_MAJOR@ LIBCR_MINOR = @LIBCR_MINOR@ LIBCR_PATCH = @LIBCR_PATCH@ LIBCR_VERSION = @LIBCR_VERSION@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_AGE = @LIBTOOL_AGE@ LIBTOOL_INTERFACE = @LIBTOOL_INTERFACE@ LIBTOOL_REVISION = @LIBTOOL_REVISION@ LINUX_OBJ = @LINUX_OBJ@ LINUX_SRC = @LINUX_SRC@ LINUX_SYMTAB_CMD = @LINUX_SYMTAB_CMD@ LINUX_SYMTAB_CONF = @LINUX_SYMTAB_CONF@ LINUX_SYMTAB_FILE = @LINUX_SYMTAB_FILE@ LINUX_VER = @LINUX_VER@ LINUX_VERSION_H = @LINUX_VERSION_H@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKE = @MAKE@ MAKEINFO = @MAKEINFO@ 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_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PWD_PROG = @PWD_PROG@ RANLIB = @RANLIB@ RPMBUILD = @RPMBUILD@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TOP_BUILDDIR = @TOP_BUILDDIR@ TOP_SRCDIR = @TOP_SRCDIR@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ 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@ lt_ECHO = @lt_ECHO@ 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@ # Vars needed by kbuild SOURCES = imports.c module.c INCLUDES = -I$(top_builddir)/include \ -I$(top_srcdir)/include EXTRA_DIST = license.txt module.c # Must visit . first, to keep generated source file imports.c up to date SUBDIRS = . kbuild 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 blcr_imports/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign blcr_imports/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): imports.c: $(top_builddir)/config.status $(srcdir)/imports.c.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ 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. $(RECURSIVE_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; 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" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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 CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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" 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 \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ 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 check-am: all-am check: check-recursive all-am: Makefile all-local 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 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: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am all-local check check-am clean clean-generic \ clean-libtool ctags ctags-recursive dist-hook 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-recursive uninstall uninstall-am # Additional dependence for file generated via AC_SUBST_FILE() all-local: imports.c imports.c: $(top_builddir)/.import_calls # echo an arbitrary make/environment variable (needed by kbuild glue) echoval: @echo $($(VARNAME)) | sed 's/"/\\"/'g .PHONY: echoval dist-hook: rm -f $(distdir)/imports.c # 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: blcr-0.8.5/blcr_imports/kbuild/0000755000000000000000000000000012102072122013353 500000000000000blcr-0.8.5/blcr_imports/kbuild/Makefile.in0000664000000000000000000000103110671355125015355 00000000000000# Here are the configuration bits SUBDIR := blcr_imports TARGET := blcr_imports # Extract source and includes/defines from non-kbuild Makefile.am _SOURCES := $(shell make --no-print-directory -C @TOP_BUILDDIR@/$(SUBDIR) echoval VARNAME=SOURCES) SOURCES := $(filter-out %.h,$(_SOURCES)) _INCLUDES := $(shell make --no-print-directory -C @TOP_BUILDDIR@/$(SUBDIR) echoval VARNAME=INCLUDES) EXTRA_CFLAGS = -Wall -I$(srcdir) -I$(top_builddir) $(subst -I.,-I$(builddir)/../.,$(_INCLUDES)) # Here is all the "real" stuff include @KBUILD_MAK@ blcr-0.8.5/blcr_imports/module.c0000664000000000000000000000765112065505122013476 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2008, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * 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 * * $Id: module.c,v 1.2.32.6 2012/12/23 04:36:34 phargrov Exp $ */ #include "blcr_config.h" #ifdef CR_NEED_AUTOCONF_H #include #endif #if defined(CONFIG_SMP) && ! defined(__SMP__) #define __SMP__ #endif #if defined(CONFIG_MODVERSIONS) && ! defined(MODVERSIONS) #define MODVERSIONS #endif #include #include #include #include #include #include #include MODULE_AUTHOR("Lawrence Berkeley National Lab " PACKAGE_BUGREPORT); MODULE_DESCRIPTION("Berkeley Lab Checkpoint/Restart symbol imports kernel module"); #ifdef MODULE_LICENSE MODULE_LICENSE("GPL"); #endif #include #if HAVE_INIT_UTSNAME #define cr_utsname() init_utsname() #elif HAVE_SYSTEM_UTSNAME #define cr_utsname() (&system_utsname) #endif #include #ifndef UTS_RELEASE #if HAVE_LINUX_UTSRELEASE_H #include #elif HAVE_GENERATED_UTSRELEASE_H #include #endif #endif #if HAVE_LINUX_COMPILE_H #include #endif static int __init blcr_imports_init(void) { /* Check current kernel against UTS_RELEASE/VERSION from configure time */ { struct new_utsname *tmp = cr_utsname(); if (0 != strcmp(tmp->release, UTS_RELEASE)) { printk(KERN_ERR "Running kernel UTS_RELEASE (%s) does not match that used to build BLCR (" UTS_RELEASE ")\n", tmp->release); return -EINVAL; } #ifdef UTS_VERSION /* Often NOT available in configured kernel headers */ if (0 != strcmp(tmp->version, UTS_VERSION)) { printk(KERN_ERR "Running kernel UTS_VERSION (%s) does not match that used to build BLCR (" UTS_VERSION ")\n", tmp->version); return -EINVAL; } #endif } /* Check current kernel against System.map used at configure time */ { #if defined(CR_EXPORTED_KCODE_register_chrdev) volatile unsigned long offset1 = CR_EXPORTED_KCODE_register_chrdev - (unsigned long)®ister_chrdev; #elif defined(CR_EXPORTED_KCODE___register_chrdev) volatile unsigned long offset1 = CR_EXPORTED_KCODE___register_chrdev - (unsigned long)&__register_chrdev; #else #error "No register_chrdev symbol for validation of System.map" #endif volatile unsigned long offset2 = CR_EXPORTED_KCODE_register_blkdev - (unsigned long)®ister_blkdev; if ( #if defined(CONFIG_RELOCATABLE) && defined(CONFIG_PHYSICAL_ALIGN) /* Check that relocation offset is valid and constant */ ((offset1 & (CONFIG_PHYSICAL_ALIGN - 1)) || (offset1 != offset2)) #else /* No relocation */ (offset1 || offset2) #endif ) { printk(KERN_ERR "Running kernel does not match the System.map used to build BLCR\n"); return -EINVAL; } } return 0; } static void __exit blcr_imports_cleanup(void) { ; } module_init(blcr_imports_init); module_exit(blcr_imports_cleanup); blcr-0.8.5/blcr_imports/license.txt0000664000000000000000000000143710316053741014226 00000000000000This 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 If you are recieving this as part of BLCR, you will find the GNU GPL in the file COPYING in the top-level BLCR directory. blcr-0.8.5/examples/0000755000000000000000000000000012102072125011223 500000000000000blcr-0.8.5/examples/pipe_counting/0000755000000000000000000000000012102072125014066 500000000000000blcr-0.8.5/examples/pipe_counting/Makefile.am0000664000000000000000000000066510661162075016067 00000000000000noinst_PROGRAMS = pipe_counting if CR_INSTALLED_LIBCR libcr_ldflag = -L$(libdir) else libcr_ldflag = -L$(top_builddir)/libcr pipe_counting_DEPENDENCIES = $(top_builddir)/libcr/libcr.la $(top_builddir)/libcr/libcr.la: FORCE @$(MAKE) $(AM_MAKEFLAGS) --no-print-directory -C $(top_builddir)/libcr libcr.la .PHONY: FORCE FORCE: endif LDADD = $(libcr_ldflag) -lcr -lpthread @CR_CLIENT_LDADD@ AM_CFLAGS = -Wall MOSTLYCLEANFILES = context.* blcr-0.8.5/examples/pipe_counting/pipe_counting.c0000664000000000000000000000532111057407316017034 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2007, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * 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 * * $Id: pipe_counting.c,v 1.4 2008/09/03 04:13:02 phargrov Exp $ */ #include #include #include #include #include #include #include #include static int limit = 120; /* default */ int do_read(int fd, char *p, size_t len) { int rc; while (len) { rc = read(fd, p ,len); if (rc < 0 && errno == EINTR) continue; if (rc <= 0) return rc; len -= rc; p += rc; } return 1; } int main(int argc, char *argv[]) { int exitcode = 0; int fds[2]; pid_t pid; int i; printf("Counting demo starting with pid %d, pgid %d\n", (int)getpid(), (int)getpgrp()); if (argc > 1) { limit = (i = atoi(argv[1])) > 0 ? i : limit; } (void)pipe(fds); pid = fork(); if (pid == 0) { /* CHILD */ int value; close(fds[1]); while (do_read(fds[0], (char*)&value, sizeof(int))) { printf("Count = %d\n", value); fflush(stdout); } if (value != (limit-1)) { fprintf(stderr, "FAILED: premature EOF at value = %d\n", value); exitcode = 1; } } else if (pid > 0) { /* PARENT */ int i, status; close(fds[0]); for (i=0; i #include #include #include #include #include #include #include #include #include #include "libcr.h" #ifndef min #define min(_x,_y) ((_x)<(_y)?(_x):(_y)) #endif static cr_checkpoint_handle_t my_handle; static cr_checkpoint_args_t my_args; void request_it(int fd) { int ret; cr_initialize_checkpoint_args_t(&my_args); my_args.cr_fd = fd; my_args.cr_scope = CR_SCOPE_PROC; /* issue the request */ ret = cr_request_checkpoint(&my_args, &my_handle); if (ret < 0) { perror("cr_request_checkpoint"); exit(1); } } void poll_it(struct stat *s) { int ret; do { ret = cr_poll_checkpoint(&my_handle, NULL); if (ret < 0) { if ((ret == CR_POLL_CHKPT_ERR_POST) && (errno == CR_ERESTARTED)) { /* restarting -- not an error */ return; } else if (errno == EINTR) { /* poll was interrupted by a signal -- retry */ } else { perror("cr_poll_checkpoint"); exit(1); } } else if (ret == 0) { fprintf(stderr, "cr_poll_checkpoint returned unexpected 0\n"); ret = -1; exit(1); } } while (ret < 0); ret = fstat(my_args.cr_fd, s); if (ret < 0) { printf("ERROR: stat() failed\n"); exit(-1); } (void)fdatasync(my_args.cr_fd); (void)close(my_args.cr_fd); } extern uint64_t gettimeofday_us(void) { uint64_t retval; struct timeval tv; gettimeofday(&tv, NULL); retval = ((uint64_t)tv.tv_sec) * 1000000 + (uint64_t)tv.tv_usec; return retval; } int work(int argc, const char **argv) { size_t remain; int mb; if (argc != 2) { printf("ERROR: %s requires 1 argument, the memory size in megabytes\n", argv[0]); return 0; } mb = atoi(argv[1]); if (mb <= 0) { printf("ERROR: '%s' is not a positive integer\n", argv[1]); return 0; } remain = (size_t)mb * 1024 * 1024; while (remain) { size_t try; for (try = min(remain,2UL*1024*1024*1024); try != 0; try /= 2) { volatile char *ptr = malloc(try); if (ptr != NULL) { size_t i; /* Touch each page (more than once if page size > 4k */ for (i = 0; i < try; i += 4096) { ptr[i] = (char)1; } remain -= try; break; } } if (try == 0) { printf("ERROR: failed to allocate %d megabytes of memory\n", mb); return 0; } } return mb; } int main(int argc, const char **argv) { char filename[40]; cr_client_id_t my_id; uint64_t start_time, elapsed; int rc, fd, mb; int do_unlink = 1; struct stat s; setlinebuf(stdout); /* "-k" is undocumented way to suppress the unlink() */ if (argc >= 2 && !strcmp(argv[1], "-k")) { do_unlink = 0; --argc; ++argv; } snprintf(filename, sizeof(filename), "context.%d", (int)getpid()); fd = open(filename, O_WRONLY|O_CREAT|O_NOCTTY|O_NONBLOCK|O_TRUNC, 0400); if (fd < 0) { printf("ERROR: open(%s) failed: %s\n", filename, strerror(errno)); exit(-1); } my_id = cr_init(); if (my_id < 0) { printf("ERROR: cr_init() failed, returning %d\n", my_id); exit(-1); } cr_enter_cs(my_id); mb = work(argc, argv); if (!mb) { cr_leave_cs(my_id); if (do_unlink) (void)unlink(filename); // may fail silently return -1; } request_it(fd); // Issues request, which will be blocked by the critical section rc = cr_status(); if (rc != CR_STATE_PENDING) { printf("ERROR: cr_status() unexpectedly returned 0x%x\n", rc); exit(-1); } start_time = gettimeofday_us(); cr_leave_cs(my_id); // should cause checkpoint NOW poll_it(&s); // Reap the checkpoint request elapsed = gettimeofday_us() - start_time; if (do_unlink) (void)unlink(filename); // may fail silently rc = cr_status(); if (rc != CR_STATE_IDLE) { printf("ERROR: cr_status() unexpectedly returned 0x%x\n", rc); exit(-1); } printf("Checkpoint w/ %d MB heap took %ld us (%#.2f MB/s total)\n", mb, (long)elapsed, ((double)s.st_size) / (1.048576 * elapsed)); return 0; } blcr-0.8.5/examples/io_bench/Makefile.am0000664000000000000000000000105410661162073014761 00000000000000noinst_PROGRAMS = io_bench if CR_INSTALLED_LIBCR libcr_ldflag = -L$(libdir) libcr_includes = -I$(includedir) else libcr_ldflag = -L$(top_builddir)/libcr libcr_includes = -I$(top_srcdir)/include -I$(top_builddir)/include io_bench_DEPENDENCIES = $(top_builddir)/libcr/libcr.la $(top_builddir)/libcr/libcr.la: FORCE @$(MAKE) $(AM_MAKEFLAGS) --no-print-directory -C $(top_builddir)/libcr libcr.la .PHONY: FORCE FORCE: endif LDADD = $(libcr_ldflag) -lcr -lpthread @CR_CLIENT_LDADD@ INCLUDES = $(libcr_includes) AM_CFLAGS = -Wall MOSTLYCLEANFILES = context.* blcr-0.8.5/examples/io_bench/Makefile.in0000664000000000000000000003767412102070010014770 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ noinst_PROGRAMS = io_bench$(EXEEXT) @CR_INSTALLED_LIBCR_TRUE@io_bench_DEPENDENCIES = \ @CR_INSTALLED_LIBCR_TRUE@ $(am__DEPENDENCIES_1) subdir = examples/io_bench DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/blcr_config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = PROGRAMS = $(noinst_PROGRAMS) io_bench_SOURCES = io_bench.c io_bench_OBJECTS = io_bench.$(OBJEXT) io_bench_LDADD = $(LDADD) am__DEPENDENCIES_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/./config/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = io_bench.c DIST_SOURCES = io_bench.c ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CONFIGURE_ARGS = @CONFIGURE_ARGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CR_ARCH = @CR_ARCH@ CR_CLIENT_LDADD = @CR_CLIENT_LDADD@ CR_CPU = @CR_CPU@ CR_FTB_INCLUDES = @CR_FTB_INCLUDES@ CR_FTB_LDADD = @CR_FTB_LDADD@ CR_FTB_LDFLAGS = @CR_FTB_LDFLAGS@ CR_KARCH = @CR_KARCH@ CR_KERNEL = @CR_KERNEL@ CR_KERNEL_BASE = @CR_KERNEL_BASE@ CR_LIBARCH = @CR_LIBARCH@ CR_LIBCR_CFLAGS = @CR_LIBCR_CFLAGS@ CR_MODULE_DIR = @CR_MODULE_DIR@ CR_MODULE_MAJOR = @CR_MODULE_MAJOR@ CR_MODULE_MINOR = @CR_MODULE_MINOR@ CR_MODULE_PATCH = @CR_MODULE_PATCH@ CR_MODULE_VERSION = @CR_MODULE_VERSION@ CR_NDEBUG = @CR_NDEBUG@ CR_RELEASE_MAJOR = @CR_RELEASE_MAJOR@ CR_RELEASE_MINOR = @CR_RELEASE_MINOR@ CR_RELEASE_PATCH = @CR_RELEASE_PATCH@ CR_RELEASE_VERSION = @CR_RELEASE_VERSION@ CR_SIGNUM = @CR_SIGNUM@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GMAKE_ELSE = @GMAKE_ELSE@ GMAKE_ENDIF = @GMAKE_ENDIF@ GMAKE_IFEQ = @GMAKE_IFEQ@ GMAKE_IFNEQ = @GMAKE_IFNEQ@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KBUILD_MAK = @KBUILD_MAK@ KBUILD_MAKE_ARGS = @KBUILD_MAKE_ARGS@ KCC = @KCC@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBCR_MAJOR = @LIBCR_MAJOR@ LIBCR_MINOR = @LIBCR_MINOR@ LIBCR_PATCH = @LIBCR_PATCH@ LIBCR_VERSION = @LIBCR_VERSION@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_AGE = @LIBTOOL_AGE@ LIBTOOL_INTERFACE = @LIBTOOL_INTERFACE@ LIBTOOL_REVISION = @LIBTOOL_REVISION@ LINUX_OBJ = @LINUX_OBJ@ LINUX_SRC = @LINUX_SRC@ LINUX_SYMTAB_CMD = @LINUX_SYMTAB_CMD@ LINUX_SYMTAB_CONF = @LINUX_SYMTAB_CONF@ LINUX_SYMTAB_FILE = @LINUX_SYMTAB_FILE@ LINUX_VER = @LINUX_VER@ LINUX_VERSION_H = @LINUX_VERSION_H@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKE = @MAKE@ MAKEINFO = @MAKEINFO@ 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_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PWD_PROG = @PWD_PROG@ RANLIB = @RANLIB@ RPMBUILD = @RPMBUILD@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TOP_BUILDDIR = @TOP_BUILDDIR@ TOP_SRCDIR = @TOP_SRCDIR@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ 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@ lt_ECHO = @lt_ECHO@ 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@ @CR_INSTALLED_LIBCR_FALSE@libcr_ldflag = -L$(top_builddir)/libcr @CR_INSTALLED_LIBCR_TRUE@libcr_ldflag = -L$(libdir) @CR_INSTALLED_LIBCR_FALSE@libcr_includes = -I$(top_srcdir)/include -I$(top_builddir)/include @CR_INSTALLED_LIBCR_TRUE@libcr_includes = -I$(includedir) @CR_INSTALLED_LIBCR_FALSE@io_bench_DEPENDENCIES = $(top_builddir)/libcr/libcr.la LDADD = $(libcr_ldflag) -lcr -lpthread @CR_CLIENT_LDADD@ INCLUDES = $(libcr_includes) AM_CFLAGS = -Wall MOSTLYCLEANFILES = context.* all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign examples/io_bench/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign examples/io_bench/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-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list io_bench$(EXEEXT): $(io_bench_OBJECTS) $(io_bench_DEPENDENCIES) @rm -f io_bench$(EXEEXT) $(LINK) $(io_bench_OBJECTS) $(io_bench_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/io_bench.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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 CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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" 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 $(PROGRAMS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) 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-noinstPROGRAMS \ 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 all all-am check check-am clean clean-generic \ clean-libtool clean-noinstPROGRAMS ctags 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 uninstall uninstall-am @CR_INSTALLED_LIBCR_FALSE@$(top_builddir)/libcr/libcr.la: FORCE @CR_INSTALLED_LIBCR_FALSE@ @$(MAKE) $(AM_MAKEFLAGS) --no-print-directory -C $(top_builddir)/libcr libcr.la @CR_INSTALLED_LIBCR_FALSE@.PHONY: FORCE @CR_INSTALLED_LIBCR_FALSE@FORCE: # 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: blcr-0.8.5/examples/Makefile.in0000664000000000000000000004407212102070007013216 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ 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 = examples DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/blcr_config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-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 uninstall-recursive RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir 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@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CONFIGURE_ARGS = @CONFIGURE_ARGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CR_ARCH = @CR_ARCH@ CR_CLIENT_LDADD = @CR_CLIENT_LDADD@ CR_CPU = @CR_CPU@ CR_FTB_INCLUDES = @CR_FTB_INCLUDES@ CR_FTB_LDADD = @CR_FTB_LDADD@ CR_FTB_LDFLAGS = @CR_FTB_LDFLAGS@ CR_KARCH = @CR_KARCH@ CR_KERNEL = @CR_KERNEL@ CR_KERNEL_BASE = @CR_KERNEL_BASE@ CR_LIBARCH = @CR_LIBARCH@ CR_LIBCR_CFLAGS = @CR_LIBCR_CFLAGS@ CR_MODULE_DIR = @CR_MODULE_DIR@ CR_MODULE_MAJOR = @CR_MODULE_MAJOR@ CR_MODULE_MINOR = @CR_MODULE_MINOR@ CR_MODULE_PATCH = @CR_MODULE_PATCH@ CR_MODULE_VERSION = @CR_MODULE_VERSION@ CR_NDEBUG = @CR_NDEBUG@ CR_RELEASE_MAJOR = @CR_RELEASE_MAJOR@ CR_RELEASE_MINOR = @CR_RELEASE_MINOR@ CR_RELEASE_PATCH = @CR_RELEASE_PATCH@ CR_RELEASE_VERSION = @CR_RELEASE_VERSION@ CR_SIGNUM = @CR_SIGNUM@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GMAKE_ELSE = @GMAKE_ELSE@ GMAKE_ENDIF = @GMAKE_ENDIF@ GMAKE_IFEQ = @GMAKE_IFEQ@ GMAKE_IFNEQ = @GMAKE_IFNEQ@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KBUILD_MAK = @KBUILD_MAK@ KBUILD_MAKE_ARGS = @KBUILD_MAKE_ARGS@ KCC = @KCC@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBCR_MAJOR = @LIBCR_MAJOR@ LIBCR_MINOR = @LIBCR_MINOR@ LIBCR_PATCH = @LIBCR_PATCH@ LIBCR_VERSION = @LIBCR_VERSION@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_AGE = @LIBTOOL_AGE@ LIBTOOL_INTERFACE = @LIBTOOL_INTERFACE@ LIBTOOL_REVISION = @LIBTOOL_REVISION@ LINUX_OBJ = @LINUX_OBJ@ LINUX_SRC = @LINUX_SRC@ LINUX_SYMTAB_CMD = @LINUX_SYMTAB_CMD@ LINUX_SYMTAB_CONF = @LINUX_SYMTAB_CONF@ LINUX_SYMTAB_FILE = @LINUX_SYMTAB_FILE@ LINUX_VER = @LINUX_VER@ LINUX_VERSION_H = @LINUX_VERSION_H@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKE = @MAKE@ MAKEINFO = @MAKEINFO@ 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_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PWD_PROG = @PWD_PROG@ RANLIB = @RANLIB@ RPMBUILD = @RPMBUILD@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TOP_BUILDDIR = @TOP_BUILDDIR@ TOP_SRCDIR = @TOP_SRCDIR@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ 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@ lt_ECHO = @lt_ECHO@ 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 = counting pthread_counting pthread_misc file_counting io_bench pipe_counting MOSTLYCLEANFILES = context.* EXTRA_DIST = license.txt README 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 examples/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign examples/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. $(RECURSIVE_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; 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" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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 CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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" 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 \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ 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 all-local 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) 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: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am all-local check check-am clean clean-generic \ clean-libtool ctags ctags-recursive 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-recursive uninstall uninstall-am all-local: if test -d $(top_builddir)/libcr32/examples; then $(MAKE) $(AM_MAKEFLAGS) -C $(top_builddir)/libcr32/examples all; 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: blcr-0.8.5/examples/pthread_misc/0000755000000000000000000000000012102072125013665 500000000000000blcr-0.8.5/examples/pthread_misc/Makefile.am0000664000000000000000000000110010661162101015635 00000000000000noinst_PROGRAMS = pthread_misc if CR_INSTALLED_LIBCR libcr_ldflag = -L$(libdir) libcr_includes = -I$(includedir) else libcr_ldflag = -L$(top_builddir)/libcr libcr_includes = -I$(top_srcdir)/include -I$(top_builddir)/include pthread_misc_DEPENDENCIES = $(top_builddir)/libcr/libcr.la $(top_builddir)/libcr/libcr.la: FORCE @$(MAKE) $(AM_MAKEFLAGS) --no-print-directory -C $(top_builddir)/libcr libcr.la .PHONY: FORCE FORCE: endif LDADD = $(libcr_ldflag) -lcr -lpthread @CR_CLIENT_LDADD@ INCLUDES = $(libcr_includes) -D_REENTANT AM_CFLAGS = -Wall MOSTLYCLEANFILES = context.* blcr-0.8.5/examples/pthread_misc/Makefile.in0000664000000000000000000004003012102070010015640 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ noinst_PROGRAMS = pthread_misc$(EXEEXT) @CR_INSTALLED_LIBCR_TRUE@pthread_misc_DEPENDENCIES = \ @CR_INSTALLED_LIBCR_TRUE@ $(am__DEPENDENCIES_1) subdir = examples/pthread_misc DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/blcr_config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = PROGRAMS = $(noinst_PROGRAMS) pthread_misc_SOURCES = pthread_misc.c pthread_misc_OBJECTS = pthread_misc.$(OBJEXT) pthread_misc_LDADD = $(LDADD) am__DEPENDENCIES_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/./config/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = pthread_misc.c DIST_SOURCES = pthread_misc.c ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CONFIGURE_ARGS = @CONFIGURE_ARGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CR_ARCH = @CR_ARCH@ CR_CLIENT_LDADD = @CR_CLIENT_LDADD@ CR_CPU = @CR_CPU@ CR_FTB_INCLUDES = @CR_FTB_INCLUDES@ CR_FTB_LDADD = @CR_FTB_LDADD@ CR_FTB_LDFLAGS = @CR_FTB_LDFLAGS@ CR_KARCH = @CR_KARCH@ CR_KERNEL = @CR_KERNEL@ CR_KERNEL_BASE = @CR_KERNEL_BASE@ CR_LIBARCH = @CR_LIBARCH@ CR_LIBCR_CFLAGS = @CR_LIBCR_CFLAGS@ CR_MODULE_DIR = @CR_MODULE_DIR@ CR_MODULE_MAJOR = @CR_MODULE_MAJOR@ CR_MODULE_MINOR = @CR_MODULE_MINOR@ CR_MODULE_PATCH = @CR_MODULE_PATCH@ CR_MODULE_VERSION = @CR_MODULE_VERSION@ CR_NDEBUG = @CR_NDEBUG@ CR_RELEASE_MAJOR = @CR_RELEASE_MAJOR@ CR_RELEASE_MINOR = @CR_RELEASE_MINOR@ CR_RELEASE_PATCH = @CR_RELEASE_PATCH@ CR_RELEASE_VERSION = @CR_RELEASE_VERSION@ CR_SIGNUM = @CR_SIGNUM@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GMAKE_ELSE = @GMAKE_ELSE@ GMAKE_ENDIF = @GMAKE_ENDIF@ GMAKE_IFEQ = @GMAKE_IFEQ@ GMAKE_IFNEQ = @GMAKE_IFNEQ@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KBUILD_MAK = @KBUILD_MAK@ KBUILD_MAKE_ARGS = @KBUILD_MAKE_ARGS@ KCC = @KCC@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBCR_MAJOR = @LIBCR_MAJOR@ LIBCR_MINOR = @LIBCR_MINOR@ LIBCR_PATCH = @LIBCR_PATCH@ LIBCR_VERSION = @LIBCR_VERSION@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_AGE = @LIBTOOL_AGE@ LIBTOOL_INTERFACE = @LIBTOOL_INTERFACE@ LIBTOOL_REVISION = @LIBTOOL_REVISION@ LINUX_OBJ = @LINUX_OBJ@ LINUX_SRC = @LINUX_SRC@ LINUX_SYMTAB_CMD = @LINUX_SYMTAB_CMD@ LINUX_SYMTAB_CONF = @LINUX_SYMTAB_CONF@ LINUX_SYMTAB_FILE = @LINUX_SYMTAB_FILE@ LINUX_VER = @LINUX_VER@ LINUX_VERSION_H = @LINUX_VERSION_H@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKE = @MAKE@ MAKEINFO = @MAKEINFO@ 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_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PWD_PROG = @PWD_PROG@ RANLIB = @RANLIB@ RPMBUILD = @RPMBUILD@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TOP_BUILDDIR = @TOP_BUILDDIR@ TOP_SRCDIR = @TOP_SRCDIR@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ 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@ lt_ECHO = @lt_ECHO@ 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@ @CR_INSTALLED_LIBCR_FALSE@libcr_ldflag = -L$(top_builddir)/libcr @CR_INSTALLED_LIBCR_TRUE@libcr_ldflag = -L$(libdir) @CR_INSTALLED_LIBCR_FALSE@libcr_includes = -I$(top_srcdir)/include -I$(top_builddir)/include @CR_INSTALLED_LIBCR_TRUE@libcr_includes = -I$(includedir) @CR_INSTALLED_LIBCR_FALSE@pthread_misc_DEPENDENCIES = $(top_builddir)/libcr/libcr.la LDADD = $(libcr_ldflag) -lcr -lpthread @CR_CLIENT_LDADD@ INCLUDES = $(libcr_includes) -D_REENTANT AM_CFLAGS = -Wall MOSTLYCLEANFILES = context.* all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign examples/pthread_misc/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign examples/pthread_misc/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-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list pthread_misc$(EXEEXT): $(pthread_misc_OBJECTS) $(pthread_misc_DEPENDENCIES) @rm -f pthread_misc$(EXEEXT) $(LINK) $(pthread_misc_OBJECTS) $(pthread_misc_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pthread_misc.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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 CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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" 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 $(PROGRAMS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) 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-noinstPROGRAMS \ 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 all all-am check check-am clean clean-generic \ clean-libtool clean-noinstPROGRAMS ctags 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 uninstall uninstall-am @CR_INSTALLED_LIBCR_FALSE@$(top_builddir)/libcr/libcr.la: FORCE @CR_INSTALLED_LIBCR_FALSE@ @$(MAKE) $(AM_MAKEFLAGS) --no-print-directory -C $(top_builddir)/libcr libcr.la @CR_INSTALLED_LIBCR_FALSE@.PHONY: FORCE @CR_INSTALLED_LIBCR_FALSE@FORCE: # 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: blcr-0.8.5/examples/pthread_misc/pthread_misc.c0000664000000000000000000001273211055341416016432 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2003, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * 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 * * $Id: pthread_misc.c,v 1.13 2008/08/27 21:11:42 phargrov Exp $ */ #define _LARGEFILE64_SOURCE 1 /* For O_LARGEFILE */ #include #include #include #include #include #include #include #include #include #include #include #include "libcr.h" /* Take a blocking checkpoint of my own process */ int checkpoint_self(void) { int ret; cr_checkpoint_args_t my_args; cr_checkpoint_handle_t my_handle; char filename[64]; /* build the filename */ snprintf(filename, sizeof(filename), "context.%d", (int)getpid()); /* remove existing context file, if any */ (void)unlink(filename); /* open the context file */ ret = open(filename, O_WRONLY | O_CREAT | O_TRUNC | O_LARGEFILE, 0600); if (ret < 0) { perror("open"); goto out; } cr_initialize_checkpoint_args_t(&my_args); my_args.cr_fd = ret; /* still holds the return from open() */ my_args.cr_scope = CR_SCOPE_PROC; /* issue the request */ ret = cr_request_checkpoint(&my_args, &my_handle); if (ret < 0) { perror("cr_request_checkpoint"); goto out; } /* wait for the request to complete */ do { ret = cr_poll_checkpoint(&my_handle, NULL); if (ret < 0) { if ((ret == CR_POLL_CHKPT_ERR_POST) && (errno == CR_ERESTARTED)) { /* restarting -- not an error */ ret = 1; /* Signal RESTART to caller */ } else if (errno == EINTR) { /* poll was interrupted by a signal -- retry */ } else { perror("cr_poll_checkpoint"); goto out; } } else if (ret == 0) { fprintf(stderr, "cr_poll_checkpoint returned unexpected 0\n"); ret = -1; goto out; } else { ret = 0; /* Signal CONTINUE to caller */ } } while (ret < 0); close(my_args.cr_fd); out: return ret; } #define THREADS 2 static int count = 0; static pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER; static pthread_cond_t cond = PTHREAD_COND_INITIALIZER; static pthread_t main_tid = (pthread_t)-1; #define DATELEN 80 static char date[DATELEN]; static char * now(void) { struct timeb when; ftime(&when); return ctime(&when.time); } static int my_callback(void* arg) { int * rc_ptr = (int *)arg; int rc; if (pthread_self() == main_tid) { strncpy(date, now(), DATELEN); } rc = cr_checkpoint(0); if (rc_ptr != NULL) { *rc_ptr = rc; } return 0; } static void advance(void) { pthread_mutex_lock(&lock); count++; pthread_cond_broadcast(&cond); pthread_mutex_unlock(&lock); } static void wait_for(int want) { pthread_mutex_lock(&lock); while (count < want) { pthread_cond_wait(&cond, &lock); } pthread_mutex_unlock(&lock); } static void * thread(void * arg) { int tid = (int)pthread_self(); int rc; printf("STARTING thread w/ tid %d\n", tid); rc = (int)cr_init(); if (rc < 0) { exit(-1); } (void)cr_register_callback(my_callback, &rc, CR_SIGNAL_CONTEXT); advance(); wait_for(THREADS + 1); if (rc) { printf("RESTARTING tid %d, from checkpoint taken %s", tid, date); } else { printf("CONTINUING tid %d, after taking checkpoint\n", tid); } printf("EXITING tid %d at %s", tid, now()); return NULL; } int main(void) { pthread_t th[THREADS]; int rc; int i; printf("Starting main process w/ pid %d\n", (int)getpid()); main_tid = pthread_self(); rc = (int)cr_init(); if (rc < 0) { exit(-1); } (void)cr_register_callback(my_callback, &rc, CR_SIGNAL_CONTEXT); // Start one or more threads for (i = 0; i < THREADS; ++i) { pthread_create(&th[i], NULL, thread, NULL); } // Wait for them to initialize wait_for(THREADS); rc = checkpoint_self(); // should cause a checkpoint NOW if (rc < 0) { exit(-1); } if (rc) { printf("RESTARTING main thread, from checkpoint taken %s", date); } else { printf("CONTINUING main thread, after taking checkpoint\n"); } advance(); for (i = 0; i < THREADS; ++i) { rc = pthread_join(th[i], NULL); if (rc < 0) { perror("pthread_join()"); exit(-1); } } printf("EXITING main thread (pid %d) at %s", (int)getpid(), now()); return 0; } blcr-0.8.5/examples/pthread_counting/0000755000000000000000000000000012102072125014560 500000000000000blcr-0.8.5/examples/pthread_counting/Makefile.am0000664000000000000000000000072210661162077016555 00000000000000noinst_PROGRAMS = pthread_counting if CR_INSTALLED_LIBCR libcr_ldflag = -L$(libdir) else libcr_ldflag = -L$(top_builddir)/libcr pthread_counting_DEPENDENCIES = $(top_builddir)/libcr/libcr.la $(top_builddir)/libcr/libcr.la: FORCE @$(MAKE) $(AM_MAKEFLAGS) --no-print-directory -C $(top_builddir)/libcr libcr.la .PHONY: FORCE FORCE: endif LDADD = $(libcr_ldflag) -lcr -lpthread @CR_CLIENT_LDADD@ INCLUDES = -D_REENTANT AM_CFLAGS = -Wall MOSTLYCLEANFILES = context.* blcr-0.8.5/examples/pthread_counting/pthread_counting.c0000664000000000000000000000521410617700372020220 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2003, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * 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 * * $Id: pthread_counting.c,v 1.5 2007/05/07 19:41:46 phargrov Exp $ */ #include #include #include #include #include #include #include #define THREADS 3 static int limit = 120; /* default */ static int count = 0; static pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER; static pthread_cond_t cond = PTHREAD_COND_INITIALIZER; static void delay(void) { struct timespec ts = {tv_sec: 1, tv_nsec: 0}; int rc; do { rc = nanosleep(&ts, &ts); } while ((rc <0) && (errno == EINTR) && (ts.tv_sec || ts.tv_nsec)); } static void advance(void) { pthread_mutex_lock(&lock); count++; pthread_cond_broadcast(&cond); pthread_mutex_unlock(&lock); } static void wait_for(int i) { pthread_mutex_lock(&lock); while ((count % THREADS) != i) { pthread_cond_wait(&cond, &lock); } pthread_mutex_unlock(&lock); } static void * thread(void * arg) { int id = (int)(uintptr_t)arg; int local; do { wait_for(id); local = count; printf("Thread %d says count = %d\n", id, local); delay(); advance(); } while (local < limit); return NULL; /* Not reached */ } int main(int argc, char *argv[]) { pthread_t th[THREADS]; int i; printf("Starting main process w/ pid %d\n", (int)getpid()); if (argc > 1) { limit = (i = atoi(argv[1])) > 0 ? i : limit; } // Start one or more threads for (i = 1; i < THREADS; ++i) { pthread_create(&th[i], NULL, thread, (void *)(uintptr_t)i); } thread((void *)0); return 0; } blcr-0.8.5/examples/pthread_counting/Makefile.in0000664000000000000000000003767712102070010016562 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ noinst_PROGRAMS = pthread_counting$(EXEEXT) @CR_INSTALLED_LIBCR_TRUE@pthread_counting_DEPENDENCIES = \ @CR_INSTALLED_LIBCR_TRUE@ $(am__DEPENDENCIES_1) subdir = examples/pthread_counting DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/blcr_config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = PROGRAMS = $(noinst_PROGRAMS) pthread_counting_SOURCES = pthread_counting.c pthread_counting_OBJECTS = pthread_counting.$(OBJEXT) pthread_counting_LDADD = $(LDADD) am__DEPENDENCIES_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/./config/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = pthread_counting.c DIST_SOURCES = pthread_counting.c ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CONFIGURE_ARGS = @CONFIGURE_ARGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CR_ARCH = @CR_ARCH@ CR_CLIENT_LDADD = @CR_CLIENT_LDADD@ CR_CPU = @CR_CPU@ CR_FTB_INCLUDES = @CR_FTB_INCLUDES@ CR_FTB_LDADD = @CR_FTB_LDADD@ CR_FTB_LDFLAGS = @CR_FTB_LDFLAGS@ CR_KARCH = @CR_KARCH@ CR_KERNEL = @CR_KERNEL@ CR_KERNEL_BASE = @CR_KERNEL_BASE@ CR_LIBARCH = @CR_LIBARCH@ CR_LIBCR_CFLAGS = @CR_LIBCR_CFLAGS@ CR_MODULE_DIR = @CR_MODULE_DIR@ CR_MODULE_MAJOR = @CR_MODULE_MAJOR@ CR_MODULE_MINOR = @CR_MODULE_MINOR@ CR_MODULE_PATCH = @CR_MODULE_PATCH@ CR_MODULE_VERSION = @CR_MODULE_VERSION@ CR_NDEBUG = @CR_NDEBUG@ CR_RELEASE_MAJOR = @CR_RELEASE_MAJOR@ CR_RELEASE_MINOR = @CR_RELEASE_MINOR@ CR_RELEASE_PATCH = @CR_RELEASE_PATCH@ CR_RELEASE_VERSION = @CR_RELEASE_VERSION@ CR_SIGNUM = @CR_SIGNUM@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GMAKE_ELSE = @GMAKE_ELSE@ GMAKE_ENDIF = @GMAKE_ENDIF@ GMAKE_IFEQ = @GMAKE_IFEQ@ GMAKE_IFNEQ = @GMAKE_IFNEQ@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KBUILD_MAK = @KBUILD_MAK@ KBUILD_MAKE_ARGS = @KBUILD_MAKE_ARGS@ KCC = @KCC@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBCR_MAJOR = @LIBCR_MAJOR@ LIBCR_MINOR = @LIBCR_MINOR@ LIBCR_PATCH = @LIBCR_PATCH@ LIBCR_VERSION = @LIBCR_VERSION@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_AGE = @LIBTOOL_AGE@ LIBTOOL_INTERFACE = @LIBTOOL_INTERFACE@ LIBTOOL_REVISION = @LIBTOOL_REVISION@ LINUX_OBJ = @LINUX_OBJ@ LINUX_SRC = @LINUX_SRC@ LINUX_SYMTAB_CMD = @LINUX_SYMTAB_CMD@ LINUX_SYMTAB_CONF = @LINUX_SYMTAB_CONF@ LINUX_SYMTAB_FILE = @LINUX_SYMTAB_FILE@ LINUX_VER = @LINUX_VER@ LINUX_VERSION_H = @LINUX_VERSION_H@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKE = @MAKE@ MAKEINFO = @MAKEINFO@ 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_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PWD_PROG = @PWD_PROG@ RANLIB = @RANLIB@ RPMBUILD = @RPMBUILD@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TOP_BUILDDIR = @TOP_BUILDDIR@ TOP_SRCDIR = @TOP_SRCDIR@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ 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@ lt_ECHO = @lt_ECHO@ 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@ @CR_INSTALLED_LIBCR_FALSE@libcr_ldflag = -L$(top_builddir)/libcr @CR_INSTALLED_LIBCR_TRUE@libcr_ldflag = -L$(libdir) @CR_INSTALLED_LIBCR_FALSE@pthread_counting_DEPENDENCIES = $(top_builddir)/libcr/libcr.la LDADD = $(libcr_ldflag) -lcr -lpthread @CR_CLIENT_LDADD@ INCLUDES = -D_REENTANT AM_CFLAGS = -Wall MOSTLYCLEANFILES = context.* all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign examples/pthread_counting/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign examples/pthread_counting/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-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list pthread_counting$(EXEEXT): $(pthread_counting_OBJECTS) $(pthread_counting_DEPENDENCIES) @rm -f pthread_counting$(EXEEXT) $(LINK) $(pthread_counting_OBJECTS) $(pthread_counting_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pthread_counting.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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 CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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" 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 $(PROGRAMS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) 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-noinstPROGRAMS \ 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 all all-am check check-am clean clean-generic \ clean-libtool clean-noinstPROGRAMS ctags 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 uninstall uninstall-am @CR_INSTALLED_LIBCR_FALSE@$(top_builddir)/libcr/libcr.la: FORCE @CR_INSTALLED_LIBCR_FALSE@ @$(MAKE) $(AM_MAKEFLAGS) --no-print-directory -C $(top_builddir)/libcr libcr.la @CR_INSTALLED_LIBCR_FALSE@.PHONY: FORCE @CR_INSTALLED_LIBCR_FALSE@FORCE: # 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: blcr-0.8.5/examples/file_counting/0000755000000000000000000000000012102072125014050 500000000000000blcr-0.8.5/examples/file_counting/file_counting.c0000664000000000000000000000326410614557011017000 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2003, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * 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 * * $Id: file_counting.c,v 1.2 2007/04/28 05:39:21 phargrov Exp $ */ #include #include #include #include static int limit = 120; /* default */ int main(int argc, char *argv[]) { int i; FILE *fp; const char *filename = "outfile"; printf("Counting demo starting with pid %d, sending to '%s'\n", (int)getpid(), filename); fp = fopen(filename, "w"); if (argc > 1) { limit = (i = atoi(argv[1])) > 0 ? i : limit; } for (i=0; i #include #include #include static int limit = 120; /* default */ int main(int argc, char *argv[]) { int i; printf("Counting demo starting with pid %d\n", (int)getpid()); if (argc > 1) { limit = (i = atoi(argv[1])) > 0 ? i : limit; } for (i=0; i/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; \ list='$(SOURCES) $(HEADERS) blcr_config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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 CTAGS: ctags-recursive $(HEADERS) $(SOURCES) blcr_config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) blcr_config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags 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 \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ 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__remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 $(am__remove_distdir) dist-lzma: distdir tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma $(am__remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz $(am__remove_distdir) dist-tarZ: distdir tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__remove_distdir) dist-shar: distdir shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__remove_distdir) dist dist-all: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__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.lzma*) \ lzma -dc $(distdir).tar.lzma | $(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 a+w $(distdir) mkdir $(distdir)/_build mkdir $(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" \ $(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__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: @$(am__cd) '$(distuninstallcheck_dir)' \ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ || { 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-local check: check-recursive all-am: Makefile blcr_config.h all-local 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 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 clean-local mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-generic distclean-hdr \ distclean-libtool distclean-local distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-data-local install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-exec-local install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-local .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all check-am \ ctags-recursive install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am all-local am--refresh check check-am check-local \ clean clean-generic clean-libtool clean-local ctags \ ctags-recursive dist dist-all dist-bzip2 dist-gzip dist-hook \ dist-lzma dist-shar dist-tarZ dist-xz dist-zip distcheck \ distclean distclean-generic distclean-hdr distclean-libtool \ distclean-local distclean-tags distcleancheck distdir \ distuninstallcheck dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am \ install-data-local install-dvi install-dvi-am install-exec \ install-exec-am install-exec-local 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-recursive uninstall uninstall-am \ uninstall-local # Clean out CVS droppings dist-hook: find $(distdir) -depth -name CVS -type d -exec rm -Rf '{}' \; find $(distdir) -name .#\* -type f -exec rm -f '{}' \; # PHH 07_Dec_2004: disabled, since our dist_blcr script does even more # We want to check that our RPM building works #distcheck-hook: # $(MAKE) $(AM_MAKEFLAGS) -C rpm $@ # Target to build the source rpm for distribution, creating the # source tarball (blcr-X.Y.Z.tar.gz) as a prereq. dist-srpm: $(MAKE) $(AM_MAKEFLAGS) -C rpm srpm # Target to build source and binary rpms rpms: $(MAKE) $(AM_MAKEFLAGS) -C rpm all # Target to build the kernel modules @CR_BUILD_MODULES_TRUE@modules: $(CONFIG_HEADER) @CR_BUILD_MODULES_TRUE@ $(MAKE) $(AM_MAKEFLAGS) --no-print-directory -C include @CR_BUILD_MODULES_TRUE@ for dir in $(module_dirs); do \ @CR_BUILD_MODULES_TRUE@ $(MAKE) $(AM_MAKEFLAGS) --no-print-directory -C $$dir || exit 1; \ @CR_BUILD_MODULES_TRUE@ done # Target to build and check the kernel modules against System.map @CR_BUILD_MODULES_TRUE@_depmod: # No rebuild of modules @CR_BUILD_MODULES_TRUE@ @@LINUX_SYMTAB_CMD@ | env NM='$(NM)' @PERL@ -- $(srcdir)/contrib/cr_depmod $(module_imports) $(module_blcr) >.depmod.err 2>&1; \ @CR_BUILD_MODULES_TRUE@ rc=$$?; \ @CR_BUILD_MODULES_TRUE@ if test $$rc '!=' 0; then \ @CR_BUILD_MODULES_TRUE@ echo "ERROR: 'depmod' check FAILED (rc=$$rc)"; \ @CR_BUILD_MODULES_TRUE@ cat .depmod.err; \ @CR_BUILD_MODULES_TRUE@ else \ @CR_BUILD_MODULES_TRUE@ echo "'depmod' check PASSED"; \ @CR_BUILD_MODULES_TRUE@ fi >&2; \ @CR_BUILD_MODULES_TRUE@ rm -f .depmod.err; \ @CR_BUILD_MODULES_TRUE@ exit $$rc @CR_BUILD_MODULES_TRUE@depmod: modules @CR_BUILD_MODULES_TRUE@ @$(MAKE) $(AM_MAKEFLAGS) _$@ # For strong dependency ordering w/ -j # Targets to (un)load the kernel modules # NOTE: we rmmod blcr_vmadump in case of upgrade from 0.7.X @CR_BUILD_MODULES_TRUE@rmmod: @CR_BUILD_MODULES_TRUE@ if /sbin/lsmod | grep '^blcr ' > /dev/null 2>&1; then $(SUDO) /sbin/rmmod blcr; fi @CR_BUILD_MODULES_TRUE@ if /sbin/lsmod | grep '^blcr_vmadump ' > /dev/null 2>&1; then $(SUDO) /sbin/rmmod blcr_vmadump; fi @CR_BUILD_MODULES_TRUE@ if /sbin/lsmod | grep '^blcr_imports ' > /dev/null 2>&1; then $(SUDO) /sbin/rmmod blcr_imports; fi @CR_BUILD_MODULES_TRUE@_insmod: rmmod # No rebuild of modules or depmod check @CR_BUILD_MODULES_TRUE@ $(SUDO) /sbin/insmod $(module_imports) $(insmod_imports_args) @CR_BUILD_MODULES_TRUE@ $(SUDO) /sbin/insmod $(module_blcr) $(insmod_blcr_args) @CR_BUILD_MODULES_TRUE@insmod: depmod @CR_BUILD_MODULES_TRUE@ @$(MAKE) $(AM_MAKEFLAGS) _$@ # For strong dependency ordering w/ -j # Convenience util libcr examples: $(MAKE) $(AM_MAKEFLAGS) -C $@ all tests: $(MAKE) $(AM_MAKEFLAGS) -C $@ all $@ if test -d libcr32/$@; then $(MAKE) $(AM_MAKEFLAGS) -C libcr32/$@ all $@; fi bonus-tests: $(MAKE) $(AM_MAKEFLAGS) -C tests all $@ bonus-check: $(MAKE) $(AM_MAKEFLAGS) all $(MAKE) $(AM_MAKEFLAGS) -C tests bonus-check if test -d libcr32/tests; then $(MAKE) $(AM_MAKEFLAGS) -C libcr32 check; fi @CR_INSTALLED_UTIL_TRUE@symlinks: @CR_INSTALLED_UTIL_TRUE@ mkdir -p bin @CR_INSTALLED_UTIL_TRUE@ for f in cr_checkpoint cr_restart cr_run $(cr_info); do \ @CR_INSTALLED_UTIL_TRUE@ test -h bin/$$f || ln -s $(bindir)/$$f bin/; \ @CR_INSTALLED_UTIL_TRUE@ done @CR_INSTALLED_UTIL_FALSE@symlinks: @CR_INSTALLED_UTIL_FALSE@ mkdir -p bin @CR_INSTALLED_UTIL_FALSE@ for f in cr_checkpoint cr_restart cr_run $(cr_info); do \ @CR_INSTALLED_UTIL_FALSE@ test -h bin/$$f || ln -s @TOP_BUILDDIR@/util/$$f/$$f bin/; \ @CR_INSTALLED_UTIL_FALSE@ done # Local hooks/extensions clean-local: @for dir in $(NOAUTO_DIRS); do \ test -f $$dir/Makefile && $(MAKE) $(AM_MAKEFLAGS) -C $$dir clean; \ done; true if test -d libcr32; then $(MAKE) $(AM_MAKEFLAGS) -C libcr32 clean; fi all-local: symlinks if test -d libcr32; then $(MAKE) $(AM_MAKEFLAGS) -C libcr32 all; fi if test -n "$(all_local_depmod)"; then $(MAKE) $(AM_MAKEFLAGS) $(all_local_depmod); fi check-local: if test -d libcr32; then $(MAKE) $(AM_MAKEFLAGS) libcr util; fi if test -d libcr32; then $(MAKE) $(AM_MAKEFLAGS) -C libcr32 check; fi install-data-local: if test -d libcr32; then $(MAKE) $(AM_MAKEFLAGS) -C libcr32 install-data; fi install-exec-local: if test -d libcr32; then $(MAKE) $(AM_MAKEFLAGS) -C libcr32 install-exec; fi uninstall-local: if test -d libcr32; then $(MAKE) $(AM_MAKEFLAGS) -C libcr32 uninstall; fi -if test -d "$(DESTDIR)@CR_MODULE_DIR@"; then rmdir "$(DESTDIR)@CR_MODULE_DIR@"; fi distclean-local: rm -rf libcr32 bin echoval: @echo $($(VARNAME)) | sed 's/"/\\"/'g .PHONY: dist-srpm dist-oscar rpms examples util libcr tests bonus-check echoval $(module_phony) # 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: blcr-0.8.5/NEWS0000664000000000000000000010465412102067772010054 00000000000000This file lists the significant user-visible changes between releases of BLCR, including main features and bug fixes. 0.8.5 ----------- January 29, 2013 Bug fix and expanded-support release. - This release fixes the following user-visible bugs and "issues" + This release adds support for "vanilla" Linux kernels up to 3.7.x + Fixes "vdso remap failed" errors on x86 platforms. + Fixes support for Xeon Phi + Fixes support for ARMv7 CPUs and for ARM THUMB2 kernels + Fixes to work with more recent autotools, glibc, rpmbuild, etc... + Fixes for memory regions larger than 4G + Numerous other minor bugs - RPM packaging improvements + Now supports "rpmbuild --define 'with_multilib 0' ..." to disable building of 32-bit libs on 64-bit targets. + "make rpms" now works correctly when run in non-English locales - This release is known NOT to work with 3.8.x kernels 0.8.4 ----------- October 11, 2011 Bug fix and expanded-support release. - This release fixes the following user-visible bugs and "issues" + This release adds support for "vanilla" Linux kernels up to 2.6.38. + This release adds support for recent RHEL5 kernels. + Occasional "random" failures on x86 have been identified and fixed. 0.8.3 ----------- August 15, 2011 Bug fix and expanded-support release. - This release fixes the following user-visible bugs and "issues" + More options for dealing with BLCR-vs-NSCD conflicts. See the BLCR FAQ entry 'Why do I get "vmadump: mmap failed: /var/db/nscd/[something]" in the system logs?' for a list of one's options. + This release adds support for "vanilla" Linux kernels up to 2.6.34. + bug 2594 - dpipe.ct and forward.ct fail "while restoring external pipe" - This release has known issues some RHEL5-derived kernels. Specifically, + auditing cr_restart can cause a kernel BUG() message to be issued + the vdso page is misidentified during restart of 32-bit processes on x86_64 kernels. You'll see the following error: do_mmap(0, ffffe000, 00001000, ...) = 0xfffffffffffffff4 (failed) + --save-all is not supported for restart of 32-bit processes on x86_64 kernels. If you try to restore such a process, you'll see cr_restart will fail with the error: Failed to locate newborn mmap()ed space A patch for the RHEL5 kernels that addresses these issues is available on the web site: https://upc-bugs.lbl.gov/blcr-dist/blcr-0.8.3+kernel-2.6.18.el5.patch01 We haven't fully tested the rhel5 patch on non-el5 kernels (that's why it's not in the release), so we recommend you apply the RHEL5 patch ONLY if you are running a 2.6.18 el5 kernel. The next release, BLCR 0.8.4, will merge support for RHEL5 kernels, and add support for 2.6.35 kernels. 0.8.2 ----------- June 16, 2009 Bug fix and expanded-support release. - This release adds support for 2.6.30 kernels - This release fixes the following user-visible bugs and "issues" + "waitpid(0)" error when restarting a process that was a child of init + A race that would infrequently cause an abnormal restart to hang 0.8.1 ----------- March 25, 2009 Bug fix and expanded-support release. - This release adds support for 2.6.29 kernels. - The final known xen-specific bug (2457) has been found to be a Xen bug. Xen 3.1.2 or newer is recomended when using BLCR. - This release makes the following libcr API additions/changes: + Increase CR_MAX_CALLBACK from 32 to 32 million. - This release adds additional error checking and improved documentation for error cases for the following libcr functions: + cr_register_callback() + cr_replace_callback() + cr_register_hook() - This release fixes the following user-visible bugs and "issues" + 2508 - inconsistent metadata from a networked file system + 2520 - possible deadlock when using some functions with critical sections + 2524 - restart-time SEGV on powerpc with 2.6.15 or older kernel + 2525 - process deadlock on checkpoint after restart + 2526 - process deadlock between omit and forward operations + C++ scoping problem for "struct cr_rstrt_relocate_pair" + Correct a bug that would reset the persist count across checkpoints + Prevent "stuck" tests when TOSTOP bit is set in termios.c_lflag. + Correct flaws in tests "prctl" and "stage0002" that could yield false failures under certain conditions 0.8.0 ----------- January 12, 2009 Enhanced functionality and expanded-support release. - This release adds support for 2.6.26, .27 and .28 kernels. - In this release support for Xen is no longer considered experimental. However, there is still one known xen-specific bug (2457) in which the FPU state may become corrupted w/ paravirtualized kernels. - In this release the majority of checkpoint I/O is performed using O_DIRECT when available, significantly reducing the cost of checkpointing any process which uses a large fraction of the physical memory. - This release includes an unfinished port to SPARC64, contributed by Vincentius Robby and Andrea Pellegrini . Anyone willing/able to help complete this port should contact checkpoint@lbl.gov. - As previously announced, this release removes support for 2.4.x kernels that contain backported NPTL support (e.g. RH9 and RHEL kernels). Support for all other 2.4.x kernels was removed in 0.7.0. - This release merges the blcr_vmadump kernel module into the blcr module. - This release adds preliminary support for the "Fault Tolerance Backplane" (FTB). See README.FTB for more information. - This release adds the following features to the cr_checkpoint utility: + --kmsg-{none,error,warning} options to control reporting of kernel-level errors and warnings messages when taking a checkpoint. - This release adds the following features to the cr_restart utility: + --kmsg-{none,error,warning} options to control reporting of kernel-level errors and warnings messages when restarting from a checkpoint. + --[no-]restore-{pid,pgid,sid} options to control restore of the process id, process group id, and session id. The default remains as in prior releases: restore only pid. - This release makes the following libcr API additions/changes: + The following functions were announced in May 2008 as scheduled for removal in 0.8.0. They have not been removed, but have been marked with gcc's "deprecated" attribute to produce a compiler warning if used. * cr_request() * cr_request_file() * cr_request_fd() + These functions have been added for controlling checkpoint requests: * cr_wait_checkpoint() * cr_reap_checkpoint() * cr_log_checkpoint() * cr_poll_checkpoint_msg() The wait and reap functions expose independently the two steps taken in the existing cr_poll_checkpoint() function. The log function collects kernel-level error or warning messages if called between wait and reap. The poll...msg() function is a convenience function, documented and implemented in terms of the wait, log and reap functions. The cr_poll_checkpoint() function will remain in libcr, but is now documented and implemented in terms of cr_poll_checkpoint_msg(). + A new CR_CHKPT_ASYNC_ERR flag to cr_request_checkpoint() defers the reporting of almost all errors in a call to cr_request_checkpoint() until the call to cr_reap_checkpoint() or cr_poll_checkpoint[_msg](). + The following functions have been added for making restart requests via library calls, rather than using the cr_restart utility. These are all marked "EXPERIMENTAL" as there might be significant changes to these calls in the future. * cr_initialize_restart_args_t() * cr_request_restart() * cr_wait_restart() * cr_reap_restart() * cr_log_restart() * cr_poll_restart_msg() * cr_poll_restart() + The struct members "old" and "new" in struct cr_rstrt_relocate_pair have been renamed to "oldpath" and "newpath". This change was required because "new" is a C++ reserved word. See the comments in include/libcr.h for API documentation. - This release makes the following additions/changes to the BLCR test suite: + Add tests of many of the features new to this release + Add new tests, or cases to existing tests, for reproducing several of the bugs fixed in this release. + Fix command lines used in several tests to function correctly when "POSIXLY_CORRECT" is set in the environment + Recode crut_wrapper and seq_wrapper in C, rather than perl, to allow running the full testsuite in environments without perl (such as embedded ARM platforms). - This release fixes the following user-visible bugs and "issues" + 2021 - Provide extended error reporting mechanism + 2056 - Eliminate perl wrappers + 2287/2437 - Xen segment selector problems + 2292 - --restore-ids does not work correctly for multithreaded processes. + 2317 - implement "async" request errors + 2318 - checkpoint hangs after SEGV + 2322/2446 - Failure when stack limit is too big + 2344 - bad cr_restart usage causes kernel oops + 2453 - loss of sigaltstack across restart + 2454 - Oops in FPU restore + Address bug 2448 - there may have been a race with cr_close_other() + Fix ENOMEM when checkpointing processes with no supplementary group IDs + i386 FPU restore code would fail to notice corrupt i387 state + Fix a bug in the ARM atomics + Fix several issues with restart of 64-bit processes with a 32-bit requester, as exposed by the addition of cr_request_restart() to libcr. 0.7.3 -------- August 12, 2008 Bug fix release - Fix a kernel Oops on a rarely run error path. - Fix a in-kernel memory leak when restoring unlinked files. - Fix a file descriptor leak when cr_request_checkpoint() failed. - Fix fsync() handling to allow checkpoints to /dev/null - Fix bug 2309: cr_enter_cs() fails because of previous cri_info_free(). This bug was resolved by adding two new functions: cr_inc_persist() and cr_dec_persist() See comments in libcr.h for a description and usage. - Fix bug 2311: vmadump_thaw_proc() returns -513. - Fix bug 2315: ENOMEM with processes with zero supplementary group IDs. - Fix bug 2316: "mkdir: file exists" module installation problem. 0.7.2 -------- July 28, 2008 Bug fix release - Fix a logic error in use of kernel-level synchronization primitives. - Fix a 32-bit VDSO restore bug on x86-64 2.6.23 and 2.6.24 kernels. - Fix a kernel Oops seen with RH9 2.4.x kernels - Fix bug 2298: compile error cr_io.o on SLES10sp2 - Fix bug 2300: restart fails for open file >2GB - Fix bug 2302: block all signals in internal thread 0.7.1 -------- June 25, 2008 Bug fix and expanded-support release - Fix (part of) bug 2263, allowing nested use of cr_run. - Fix bug 2251, allowing use of HUGETLB_MORECORE=y with libhugetlbfs. - Fix bug 2295 (restart failure w/ heap > 4GB). - Fix sporadic EPERM failures when checkpointing encounters a zombie proc. - Add support for 2.6.26-rc7 kernel. While we don't officially support -rc kernels, it is hoped that these changes will be sufficient to support the final 2.6.26. - Add cr_hold_ctrl(), allowing control over the thread hold behavior. This is required to restore the 0.6.X behavior for at least one application that would deadlock with the 0.7.X default behavior. 0.7.0 -------- May 30, 2008 Enhanced functionality and expanded-support release. - This release adds support for 2.6.25 kernels. - This release adds EXPERIMENTAL support for 32-bit PPC platforms. - This release adds EXPERIMENTAL support for Xen-enabled kernels (both dom0 and domU). In our testing so far it either works great or not at all, depending on the installation. We have not yet identified what distinguishes the working systems from the broken ones, and would appreciate feedback on your success or failure using BLCR with Xen-enabled Linux kernels. - As previously announced, this release removes support for 2.4.x kernels with the current exception of the RH9 and RHEL kernels (and derivatives) that contain backported NPTL support. These too may be removed in the not too distant future. - As previously announced, this release begins the removal of support for LinuxThreads. If you are using LinuxThreads you may experience random failures in the BLCR testsuite and with your own multithreaded apps. New interest in using BLCR with non-GNU libc may lead to a return of LinuxThreads support. Please contact us if you have interest it this. - This release adds the following features to the cr_checkpoint utility: + --quiet option to suppress output from cr_checkpoint + --noclobber option (don't disturb existing files) + Options for treatment of ptrace() child and parent processes: --ptraced-{error,skip,allow} --ptracer-{error,skip} + Options to save/restore executables and libraries in context files: --save-{exe,private,shared,all,none} See the cr_checkpoint manpage for more details on each of these. - This release adds the following features to the cr_restart utility: + --quiet option to suppress output from cr_restart Previously there was no way to do so without also losing the output of the restarted process(es). + Add --run-on-* family of options to provide user-specified error handling hooks. Previously there was no way to automatically/safely distinguish a failure of cr_restart from a non-zero exit from the restarted application. This resolves bug 1974. + Add --relocate option to enable restart-time replacement of file and and directory paths saved in the context file. + Add --fd option to restore from an open fd, rather than a file. See the cr_restart manpage for more details on each of these. - This release adds the following feature to the cr_run utility: + --omit option to run a process with BLCR support such that the process (and its descendants) will be omitted from checkpoints. - This release makes the following libcr API additions/changes: + cr_forward_checkpoint() is fully tested and thus no longer labeled as "use at your own risk". Its documentation in libcr.h is now complete as well. + cr_register_hook() is fully tested and thus no longer labeled as "use at your own risk". + As anticipated in previous releases, the error code returned from cr_poll_checkpoint() has CHANGED for the case of restarting from a checkpoint of oneself. This may break existing code that will not be prepared for the new errno value. However, the previous value of EINVAL could have masked actual invalid-argument errors. The alternative of returning 0 (success) was considered, but was discarded because it was deemed valuable to be able to reliably distinguish whether one was continuing or restarting from a checkpoint of oneself. + As alternatives to CR_ETEMPFAIL and CR_PERMFAIL, authors of BLCR callbacks can now specify the errno values to be returned to the checkpoint requester on a case-by-case basis. + cr_tryenter_cs() has been added as a non-blocking alternative to the cr_enter_cs() function. + Several functions that would previously respond to usage errors with an abort() or an undefined behavior now return -1 with one of two new values of errno: * CR_ENOINIT - caller has not made the required call to cr_init() * CR_ENOTCB - call is only valid from a checkpoint callback + The following functions are marked as deprecated: * cr_request() * cr_request_file() * cr_request_fd() They do not provide any mechanism to specify the checkpoint scope or to detect errors. They are currently implemented as (awkward) wrappers around cr_request_checkpoint() and cr_poll_checkpoint(). They are scheduled to be removed in 0.8.0. See the comments in include/libcr.h for API documentation. - This release introduces two "stub" libraries: libcr_run and libcr_omit. They differ from the "full" libcr library in that they contain only a BLCR signal handler and the initialization code to register it. They do not include any of the entry points declared in libcr.h, and the handler code does not run any callbacks. The cr_run utility now uses these libraries in LD_PRELOAD variable, rather than the full libcr.so used in previous releases. See the BLCR User's Guide for information on using these libs. - This release makes several additions to the BLCR test suite, including tests of most of the features new to this release and some motivated by bugs fixed in this release. Many existing tests have been expanded to exercise additional corner cases. - This release makes the following changes to "configure" behavior: + The --with-linux= option now accepts a kernel revision (the output or "uname -r") as a value, causing configure and search for that revision in some standard locations. This is intended to make it easier and less error prone to specify for which kernel to build. In most modern distributions, this single option will be sufficient to configure BLCR for any installed kernel. + Previously --with-linux= would be used to specify a kernel source directory, and if needed --with-linux-obj= could be given to help find the corresponding build directory. With this release the role of --with-linux= as changed to be that of a build directory and the option --with-linux-src= is available if the sources can't be found automatically. + The configure-time probes of the kernel headers and configuration are now performed using the full CFLAGS/CPPFLAGS from the Linux kbuild infrastructure. This ensures proper configuration with Xen-enabled kernels that prepend Xen-specific components to the include path. + At configure time one can set KCC to specify that the kernel modules are to be built with a different C compiler than the user-space components of BLCR. - On the ARM platform, the "good enough for LinuxThreads" implementation of atomic operations has been replaced with truly atomic ops based on the kernel-level support added for NPTL. - As a temporary work-around for bug 2251, BLCR will currently refuse to checkpoint processes with files on hugetlbfs mmap()ed with the MAP_PRIVATE flag. This is to avoid potentially serious instability that may result if BLCR attempts to checkpoint such a process. - Fixes the following user-visible bugs and "issues" + 1974 - Make it possible to decide whether a restart succeeded + 2023 - ARM atomics need update + 2042 - libcr.so not linked to libc + 2124 - Make check fails at pid_in_use.st + 2214 - close cri_live_count race + 2216 - Move post-restart signal delivery to post-callback + 2247 - BLCR assumes 64-bit gcc on 64-bit arch + 2248 - Separate CC and KCC + 2265 - CR_CHECKPOINT_OMIT generates 0 byte context file + 2266 - process doing CR_CHECKPOINT_TEMP_FAILURE is killed! + 2271 - cr_checkpoint --clobber fails to overwrite file + 2272 - cr_get_restart_info returns wrong src path + 2274 - Invalid (zero or huge) pids seen at restart time + Remove bash-specific assumptions in the tests + Stronger validation of BLCR against proper kernel version + Validation of BLCR's kernel module versions against each other + Performance improvements from better memory management and from coalescing of background work. + Preserve error codes for I/O errors. Previously any error from a read/write at kernel level was reported as EIO. Now the original errors (such as ENOSPC) are preserved. + Several others found by internal testing or reported by email and fixed without assigning bug numbers. - The file contrib/blcr.magic contains the format description needed by the "file" utility to identify BLCR's context files. 0.6.5 -------- February 29, 2008 Bug-fix release. - This release fixes a bug that could corrupt the kernel's pid hash data structures if a restart failed due to a pid conflict on kernels 2.6.17 and newer. - This release fixes a use-after-free bug in the code for aborting a checkpoint that could have caused a kernel Oops. 0.6.4 -------- January 28, 2008 Bug-fix and expanded-support release. - This release adds support for 2.6.24 kernels. - This release fixes bug 2234 which could cause a kernel Oops when dealing with mmap()s of HUGETLBFS on some kernels. 0.6.3 -------- January 22, 2008 Bug-fix release. - This release fixes bug 2001 which was causing intermittent floating- point register corruption on x86-64, even after BLCR was unloaded. 0.6.2 -------- January 14, 2008 Bug-fix and expanded-support release. - This release adds support for 2.6.23 kernels. - This release adds support for SuSE's 2.6.22.x kernels. - This release fixes a file descriptor leak that occurred on restart from a checkpoint-of-self requested via cr_request_checkpoint(). - This release fixes a deadlock (and unkillable process(es)) when a multi-threaded process aborts (or omits itself from) a checkpoint under certain conditions. - This release fixes a restart-time failure when a checkpoint includes a pipe with one end outside the checkpoint scope, and data is buffered in the pipe. - This release fixes a bug with the cr_request{,_file}() calls in which a failed checkpoint would cause failure of the next one if it had the same destination file name. - This release fixes a race condition with the cr_enter_cs() and checkpoints in multi-threaded processes. - This release fixes post-checkpoint signal delivery (--stop and friends) to occur after the checkpoint is fully completed. See bug 2201 for a full description of the problems addressed by these changes. - This release documents (and fully implements) signal-delivery options to cr_restart (see bug 2200). - This release fixes two kernel Oopses (bugs 2222 and 2223) due to races against processes/threads that are exiting. - Adds test cases for most of the bugs fixed in this release. - Minor improvements/changes to documentation - Other minor bug fixes 0.6.1 -------- September 25, 2007 Bug-fix release - This release resolves build and run-time issues seen on Debian "sid". - This release eliminates the need to manually set __LINUX_ARM_ARCH__ at configure time (ARM platform only). - This release fixes a file descriptor leak that occurred on failure of a checkpoint requested using any of the cr_request{,_file,_fd}() calls. - This release fixes a race condition and a LinuxThreads incompatibility in the "hooks" test (which is not run by default). 0.6.0 -------- September 10, 2007 Functionality and expanded-support release. - This release adds support for 2.6.22 kernels. - This release includes experimental support for PPC64 platforms + PPC64 supports both 32- and 64-bit applications. + No support for 32-bit kernels. Contact us if you would like to help w/ a PPC32 port. + No support for 2.4.x kernels + Tested with NPTL and kernels 2.6.12 (Gentoo) and 2.6.18 (FC6) + There are known problems with BLCR with LinuxThreads on PPC64 - This release includes experimental support for ARM platforms. + Tested only for 2.6.12 and newer kernels + Thanks to Anton V. Uzunov of the Australian Government Department of Defence, Defence Science and Technology Organisation for contributing this port. + ARM-specific questions should be directed to blcr-arm@hpcrd.lbl.gov - This release includes experimental support for cross-compilation. + See config/cross_helper.c for information on cross-compilation. + This has been tested only in the context of the ARM port + Thanks to Anton V. Uzunov for motivating and testing this work - This release includes a new API for issuing a checkpoint request. + Allows a program to request a checkpoint without the need to invoke system("cr_checkpoint ..."). + See comments in include/libcr.h for information on the following: cr_initialize_checkpoint_args_t() cr_request_checkpoint() cr_poll_checkpoint() - This release adds a mechanism (CR_CHECKPOINT_OMIT) for processes to exclude themselves from a checkpoint (useful for batch-system helper or shepherd processes). - This release makes cr_checkpoint and cr_restart utilities checkpointable - This release adds full support for mmap()-based shared memory + Repairs the loss of sharing that existed in 0.5.x releases + Supports hugetlbfs - This release adds full support for save/restore of pending signals. - Default scope of cr_checkpoint is now --tree, rather than --pid. - Now checkpoint/restart unlinked open files. - Revised handling of certain file-descriptors at restart: + No longer override "normal" files with correspondingly-numbered fds from cr_restart as that consistently breaks shell "here documents". + Restore pipes endpoints that lie outside the checkpoint scope by attaching them to stdin or stdout of cr_restart, rather than to its correspondingly-numbered fds. + Opens of a process's controlling tty are attached to "/dev/tty" at restart, even if they were open by their "exact" name at checkpoint time (e.g. "/dev/pts/0"). - Experimental support for relocatable kernels on x86 and x86-64 - Expanded test-suite - Option to install the testsuite (--enable-testsuite) - Support "install-strip", "install-exec" and "install-data" make targets - Tested against many scripting and programming language environments: + shells: ash, bash, (t)csh, (pd)ksh and zsh + scripting-type languages: perl, python, tcl/expect, ruby and guile + java runtime environments: Sun, IBM and GNU + misc. language runtimes: php, rep, clisp, emacslisp, gst, ocaml and sml + Run "make bonus-tests" to run these tests on your own machine, but be warned that the tests themselves are fragile (contain races) and may experience random failures. However, please do report any tests that fail consistently. - Many minor bug fixes and code cleanups July, 2007 - DEPRECATED support for LinuxThreads and for Linux 2.4.X kernels - Starting with the 0.6.0 release, new bug reports that one cannot reproduce under NPTL + Linux 2.6.x will receive little or none of our attention. However, we will try to distribute user-contributed fixes for such bugs. Note that the 0.6.0 release *does* pass the BLCR test-suite under LinuxThreads and/or 2.4.x kernels on the developers' x86 systems. However, we have seen test failures on PPC64 when running LinuxThreads with a 2.6.12 kernel (Gentoo distro). - Beginning with the next "full" release (0.7.0) we will begin to remove code in BLCR that exists only to support LinuxThreads and/or Linux 2.4.x. - We have not yet decided the fate of support for those 2.4.x kernels which include Red Hat's backport of NPTL support (RHL9.0, RHEL, RHAS, etc.). - If anybody cares enough about 2.4.x and/or LinuxThreads to volunteer to take over testing and maintenance of BLCR on such platforms, let us know. 0.5.6 -------- July 11, 2007 Bug-fix release. - Fix a bug that could incorrectly restore data buffered in a pipe. 0.5.5 -------- April 27, 2007 Expanded-support release. - This release adds support for 2.6.21 kernels. 0.5.4 -------- April 20, 2007 Bug-fix release. - Multiple bug fixes, including: + Bug 1972: Restart pid-conflict could cause kernel Oops + Bug 1977: Unintended 2GB limit on application working set + Compilation problems on some x86_64 kernels (map_vsyscall undefined) 0.5.3 -------- March 29, 2007 Bug-fix release. - Multiple bug fixes, including: + Bug 1961: Checkpoint of zombie yields kernel Oops. + Bug 1967: Restart failed: Bad address + Unkillable cr_restart if multi-threaded restart failed due to pid in use. 0.5.2 -------- March 23, 2007 Bug-fix release. - Multiple bug fixes, including: + Bug 1949: cr_request*() functions need original context file to restart + Bug 1954: "cr_checkpoint -T" yields "invalid option" + Bug 1955: mmap(PROT_READ, MAP_SHARED) broken for read-only files - Add "with_autoreconf" option to rpm specfile. 0.5.1 -------- March 20, 2007 Expanded-support and minor improvement release. - Expanded kernel coverage + Add support for 2.6.17-5mdv and its updates (Mandriva 2007) + Add support for 2.6.20 - Fix -fstack-protector problems w/ the .src.rpm on FC6 - Eliminate harmless undefined symbol warnings from MODPOST 0.5.0 -------- March 2, 2007 Functionality and expanded-support release. - Expanded kernel coverage + 2.6.0 through 2.6.19 for x86 and x86_64 + 2.4.0 through 2.4.34 for x86 only - Multi-process support (related processes and associated pipes) + See BLCR_Users_Guide.html and the cr_checkpoint man page - Support for 32-bit apps on 64-bit kernels + See "--enable-multilib" in BLCR_Admin_Guide.html - Support for directories opened with opendir() - Support for open()s of /dev/{null,zero,full,random,urandom} - Support for checkpoints on Luster file systems + Contributed by Dean Luick - Support for building static libcr + Contributed by Dean Luick - Fixes to many distclean problems + Issues identified by Dean Luick - I/O aggregation for improved performance + Contributed by Qi Gao - Additional examples and test cases - API addition: cr_get_restart_info() - "Retool" of configure code for ease of addition/maintenance - Numerous bug fixes, including: + Bug 1240: pid leak on restart failure + Bug 1396: SIGPIPE when restarting w/ stdin/out from/to a pipe + Bug 1640: context files > 2GB require O_LARGEFILE + Bug 1662: context files open R/W leads to restart failure + Bug 1669: checkpoint to a socket fails + Bug 1807: unrecognized warning suppression flag passed to gcc + Bug 1854: libcr link failure w/ stack-protection-enabled gcc + Bug 1925: link failure w/ pthread_atfork() on some glibc versions + Bug 1933: crash restoring dup of ignored fd (socket or chrdev) + Incorrect treatment of certain anonymous mmap() cases + MAP_SHARED mmap()ed regions would become MAP_PRIVATE upon restart * NOTE: We still fail to restore any sharing among processes when using MAP_ANONYMOUS or when mapping an unlinked file. However, children fork()ed after a restart will now correctly share with their parent. FIXING THE LOST SHARING IS A HIGH-PRIORITY ITEM FOR 0.6.0 + Wrong parent for restored orphans (children of init) + dup()ed file descriptors always restored together 0.4.2 -------- November 22, 2005 Functionality and bug-fix release. - 2.6.x kernel support "stable" - x86_64 support "stable" (but there is no support for 32-bit apps) - Multiple bug fixes (some critical) 0.4.1_b5 -------- October 10, 2005 BETA bug-fix release. - Multiple bug fixes (some critical) 0.4.1_b4 -------- August 24, 2005 BETA bug-fix release. - Multiple bug fixes (some critical) 0.4.1_b3 -------- July 29, 2005 BETA bug-fix and functionality release. - Fix inter-module dependencies under 2.6 kernels. - Fix empty /etc/init.d/blcr in rpms 0.4.1_b2 -------- July 6, 2005 BETA bug-fix and functionality release. - Opteron support completed (but experimental). - Improved coverage of 2.6.x kernels (still considered experimental): + At least minimal testing under SuSE 9.{2,3} and Fedora Core {2,3,4} + Example init script updated for 2.6.x + Updates to Admin Guide for Fedora-isms - Fixed file truncation bug - Fixed signal trampoline bug with RHAS - Support for Scalable Systems Software advanced to Fedora Core 2 - Some "dirty tricks" have been reimplemented with cleaner solutions: + New method for syscalls that bypass glibc + Better-supported signal trampolines (work w/ gcc 2.96 through 4.0.0) + More robust mechanism for module symbols (linker rather than cpp) + More robust mechanism for restart time thread creation - Cleanups of .spec file to work w/ latest rpm version. 0.4.1_b1 -------- Not publicly released. 0.4.0 ----- February 18, 2005 Functionality release. - Add experimental support for Linux 2.6.x kernels. - Many changes as part of an in-progress Opteron port (incomplete). 0.3.1 ----- December 1, 2004 Bug-fix release. - Fix a bug which rendered cr_run useless for most applications. - Add athlon support to the RPM specfile and generally improve cpu support in the specfile by honoring --target. - Fix a race condition in pthreaded tests with LinuxThreads. - Minor improvements to Admin Guide, including fixing a confusing typo. 0.3.0 ----- November 8, 2004 Functionality release. - Files support is now enabled by default and no longer "experimental". - Support for Scalable Systems Software (http://sss-oscar.sf.net). - Fix libcr.so to allow use via dlopen(). - Many small bug fixes. - Security fix related to LDT/TLS restore. - Support for more kernel versions, including RHEL3 and CentOS 3.1 - Much more robust configuration-time checking of kernel headers. - Runtime version checking between user space and kernel module. - More informative error from cr_checkpoint when target process lacks checkpointing support. 0.2.4 and 0.2.5 --------------- Snapshots for SSS-OSCAR testing. Not publicly released. 0.2.3 ----- April 30, 2004 Bug-fix release. - Fixed compilation error that occurred with --enable-trace. - Updated timeout thread to handle new DEAD state in 2.6 kernel (also in some recent 2.4 RedHat kernels). 0.2.2 ----- April 23, 2004 Bug-fix release. - Fixed bug with --enable-files support: regular file handles now saved/restored across checkpoint correctly. 0.2.1 ----- December 05, 2003 Bug-fix release. - Fix compilation problems with certain kernels and compilers. Now known to compile with kernel.org kernels as old as 2.4.0 and as new as 2.4.23. - Tested against kernels as old as a RedHat 2.4.7-10 and as new as a RedHat 2.4.20-24.9. - Tested w/ gcc 2.96, 3.2, 3.2.2 and 3.3.1. - Fix vfork() problem which was causing "cr_run make" (or "make" with LD_PRELOAD set) to fail. - Fix problem where processes restored under 2.4.23 could not subsequently be ptraced or dump core. - Strip debugger bloat from kernel modules. - Fixed locking problems which prevented experimental files code from compiling against SMP kernels. - Make the rpm spec file more easily reusable for different kernels. - Modules now include proper version and contact info in syslog. - Proper use count is now kept by modules. 0.2.0 ----- November 20, 2003 Initial public release. blcr-0.8.5/COPYING0000664000000000000000000004313107755224357010414 00000000000000 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 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 Library 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 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 Library General Public License instead of this License. blcr-0.8.5/README.devel0000664000000000000000000000775111021611222011313 00000000000000$Id: README.devel,v 1.2 2008/06/04 22:09:22 phargrov Exp $ This file contains information targeted at people wishing to develop code either IN or USING BLCR. Right now this file is a work-in-progress and lacks many useful items and is unorganized. * Autotools If you get these files from CVS (as opposed to a tarball or other package) or if you wish to make modifications to the build system (such as to configure.ac or any Makefile.am) then you will need the following tools installed: GNU autoconf 2.54 or newer if using automake-1.7 GNU automake 1.7 or newer GNU libtool 1.4 or newer NOTE: this list is not always kept up-to-date. If you have a CVS checkout, then your source tree has not been "bootstrapped". You should run "./autogen.sh" to setup the build environment. You can then proceed with "configure" and "make". You must take care if you later do a "cvs update" which changes any of the following files in any directory: configure.ac Makefile.am *.m4 If a cvs update does change any of these then a "make distclean" and a fresh "configure" are recommended to ensure all changes have their intended effects. * Certificate of Origin All mail contributions intended for redistribution as part of BLCR should include a "Developer's Certificate of Origin" to remove any question as to the rights to redistribute your contribution. The term "contribution" here mostly is intended to cover patches to BLCR, but anything that could end up in a BLCR tarball is a contribution, including for instance text for use in the FAQ. The description of the Developer's Certificate of Origin below is a direct quote from linux-2.6.22/Documentation/SubmittingPatches. Please read and understand it before sending us any contributions. If you cannot be certain that your work meets these requirements, we rather not see your work at all until we can discuss it with you. So, please contact us if you have questions. --- begin quote --- To improve tracking of who did what, especially with patches that can percolate to their final resting place in the kernel through several layers of maintainers, we've introduced a "sign-off" procedure on patches that are being emailed around. The sign-off is a simple line at the end of the explanation for the patch, which certifies that you wrote it or otherwise have the right to pass it on as a open-source patch. The rules are pretty simple: if you can certify the below: Developer's Certificate of Origin 1.1 By making a contribution to this project, I certify that: (a) The contribution was created in whole or in part by me and I have the right to submit it under the open source license indicated in the file; or (b) The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate open source license and I have the right under that license to submit that work with modifications, whether created in whole or in part by me, under the same open source license (unless I am permitted to submit under a different license), as indicated in the file; or (c) The contribution was provided directly to me by some other person who certified (a), (b) or (c) and I have not modified it. (d) I understand and agree that this project and the contribution are public and that a record of the contribution (including all personal information I submit with it, including my sign-off) is maintained indefinitely and may be redistributed consistent with this project or the open source license(s) involved. then you just add a line saying Signed-off-by: Random J Developer using your real name (sorry, no pseudonyms or anonymous contributions.) Some people also put extra tags at the end. They'll just be ignored for now, but you can do this to mark internal company procedures or just point out some special detail about the sign-off. --- end quote --- blcr-0.8.5/autogen.sh0000775000000000000000000000376012065170641011350 00000000000000#! /bin/sh # # Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) # 2008, The Regents of the University of California, through Lawrence # Berkeley National Laboratory (subject to receipt of any required # approvals from the U.S. Dept. of Energy). All rights reserved. # # Portions may be copyrighted by others, as may be noted in specific # copyright notices within specific files. # # 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 # # $Id: autogen.sh,v 1.7.38.3 2012/12/21 23:32:49 phargrov Exp $ set -e mkdir -p config for dir in . ./config; do ( cd $dir && rm -f config.guess config.sub depcomp install-sh libtool ltmain.sh missing mkinstalldirs ) done rm -rf autom4te.cache aclocal autoheader touch blcr_config.h.in autoconf libtoolize --automake --copy if [ -f ./ltmain.sh ]; then # older libtool didn't find AC_CONFIG_AUX_DIR in configure.ac mv ltmain.sh config/ rm -f config.sub config.guess fi automake --include-deps --add-missing --copy if [ -x config.status ]; then echo "################################################################" echo "# You appear to have already configured the build environment. #" echo "# Trying to update your configuration. #" echo "################################################################" ./config.status make clean fi blcr-0.8.5/blcr_config.h.in0000664000000000000000000010422312102070001012345 00000000000000/* blcr_config.h.in. Generated from configure.ac by autoheader. */ /* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2012, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * 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 */ /* Timestamp of BLCR configuration */ #undef BLCR_CONFIG_TIMESTAMP /* Define to 1 to enable debugging of BLCR */ #undef CRI_DEBUG /* Computed value of 'CR_CHECKPOINT_OMIT' */ #undef CR_ASM_CHECKPOINT_OMIT /* Computed value of '_CR_CHECKPOINT_STUB' */ #undef CR_ASM_CHECKPOINT_STUB /* Computed value of '__NR_ioctl' */ #undef CR_ASM_NR_ioctl /* Computed value of '__NR_rt_sigreturn' */ #undef CR_ASM_NR_rt_sigreturn /* Computed value of 'CR_OP_HAND_ABORT' */ #undef CR_ASM_OP_HAND_ABORT /* Computed value of 'CR_OP_HAND_CHKPT' */ #undef CR_ASM_OP_HAND_CHKPT /* Computed value of 'offsetof(siginfo_t, si_pid)' */ #undef CR_ASM_SI_PID_OFFSET /* Define to address of exported kernel symbol __register_chrdev */ #undef CR_EXPORTED_KCODE___register_chrdev /* Define to address of exported kernel symbol register_blkdev */ #undef CR_EXPORTED_KCODE_register_blkdev /* Define to address of exported kernel symbol register_chrdev */ #undef CR_EXPORTED_KCODE_register_chrdev /* Computed value of 'F_GETPIPE_SZ' */ #undef CR_F_GETPIPE_SZ /* Computed value of 'F_SETPIPE_SZ' */ #undef CR_F_SETPIPE_SZ /* Define to 1 if work around for bug 2524 is requested. */ #undef CR_HAVE_BUG2524 /* Define to the proper incantation for inline functions */ #undef CR_INLINE /* Define to address of non-exported kernel symbol __audit_syscall_exit, or 0 if exported */ #undef CR_KCODE___audit_syscall_exit /* Define to address of non-exported kernel symbol __flush_icache_range, or 0 if exported */ #undef CR_KCODE___flush_icache_range /* Define to address of non-exported kernel symbol __kuser_cmpxchg, or 0 if exported */ #undef CR_KCODE___kuser_cmpxchg /* Define to address of non-exported kernel symbol __kuser_helper_start, or 0 if exported */ #undef CR_KCODE___kuser_helper_start /* Define to address of non-exported kernel symbol __put_task_struct, or 0 if exported */ #undef CR_KCODE___put_task_struct /* Define to address of non-exported kernel symbol __put_task_struct_cb, or 0 if exported */ #undef CR_KCODE___put_task_struct_cb /* Define to address of non-exported kernel symbol arch_get_unmaped_area, or 0 if exported */ #undef CR_KCODE_arch_get_unmaped_area /* Define to address of non-exported kernel symbol arch_pick_mmap_layout, or 0 if exported */ #undef CR_KCODE_arch_pick_mmap_layout /* Define to address of non-exported kernel symbol arch_setup_additional_pages, or 0 if exported */ #undef CR_KCODE_arch_setup_additional_pages /* Define to address of non-exported kernel symbol arch_unmap_area, or 0 if exported */ #undef CR_KCODE_arch_unmap_area /* Define to address of non-exported kernel symbol attach_pid, or 0 if exported */ #undef CR_KCODE_attach_pid /* Define to address of non-exported kernel symbol audit_syscall_exit, or 0 if exported */ #undef CR_KCODE_audit_syscall_exit /* Define to address of non-exported kernel symbol change_pid, or 0 if exported */ #undef CR_KCODE_change_pid /* Define to address of non-exported kernel symbol copy_fs_struct, or 0 if exported */ #undef CR_KCODE_copy_fs_struct /* Define to address of non-exported kernel symbol copy_siginfo_to_user, or 0 if exported */ #undef CR_KCODE_copy_siginfo_to_user /* Define to address of non-exported kernel symbol detach_pid, or 0 if exported */ #undef CR_KCODE_detach_pid /* Define to address of non-exported kernel symbol do_mmap, or 0 if exported */ #undef CR_KCODE_do_mmap /* Define to address of non-exported kernel symbol do_mmap_pgoff, or 0 if exported */ #undef CR_KCODE_do_mmap_pgoff /* Define to address of non-exported kernel symbol do_munmap, or 0 if exported */ #undef CR_KCODE_do_munmap /* Define to address of non-exported kernel symbol do_pipe, or 0 if exported */ #undef CR_KCODE_do_pipe /* Define to address of non-exported kernel symbol do_pipe_flags, or 0 if exported */ #undef CR_KCODE_do_pipe_flags /* Define to address of non-exported kernel symbol do_sigaction, or 0 if exported */ #undef CR_KCODE_do_sigaction /* Define to address of non-exported kernel symbol do_sigaltstack, or 0 if exported */ #undef CR_KCODE_do_sigaltstack /* Define to address of non-exported kernel symbol expand_files, or 0 if exported */ #undef CR_KCODE_expand_files /* Define to address of non-exported kernel symbol find_pid, or 0 if exported */ #undef CR_KCODE_find_pid /* Define to address of non-exported kernel symbol find_task_by_pid_ns, or 0 if exported */ #undef CR_KCODE_find_task_by_pid_ns /* Define to address of non-exported kernel symbol follow_huge_addr, or 0 if exported */ #undef CR_KCODE_follow_huge_addr /* Define to address of non-exported kernel symbol follow_huge_pmd, or 0 if exported */ #undef CR_KCODE_follow_huge_pmd /* Define to address of non-exported kernel symbol free_fs_struct, or 0 if exported */ #undef CR_KCODE_free_fs_struct /* Define to address of non-exported kernel symbol free_pid, or 0 if exported */ #undef CR_KCODE_free_pid /* Define to address of non-exported kernel symbol get_dumpable, or 0 if exported */ #undef CR_KCODE_get_dumpable /* Define to address of non-exported kernel symbol group_send_sig_info, or 0 if exported */ #undef CR_KCODE_group_send_sig_info /* Define to address of non-exported kernel symbol groups_search, or 0 if exported */ #undef CR_KCODE_groups_search /* Define to address of non-exported kernel symbol hugepage_vma, or 0 if exported */ #undef CR_KCODE_hugepage_vma /* Define to address of non-exported kernel symbol init_fpu, or 0 if exported */ #undef CR_KCODE_init_fpu /* Define to address of non-exported kernel symbol is_file_shm_hugepages, or 0 if exported */ #undef CR_KCODE_is_file_shm_hugepages /* Define to address of non-exported kernel symbol jiffies_to_timeval, or 0 if exported */ #undef CR_KCODE_jiffies_to_timeval /* Define to address of non-exported kernel symbol link_pid, or 0 if exported */ #undef CR_KCODE_link_pid /* Define to address of non-exported kernel symbol load_gs_index, or 0 if exported */ #undef CR_KCODE_load_gs_index /* Define to address of non-exported kernel symbol map_vsyscall, or 0 if exported */ #undef CR_KCODE_map_vsyscall /* Define to address of non-exported kernel symbol pipe_fcntl, or 0 if exported */ #undef CR_KCODE_pipe_fcntl /* Define to address of non-exported kernel symbol pmd_huge, or 0 if exported */ #undef CR_KCODE_pmd_huge /* Define to address of non-exported kernel symbol put_fs_struct, or 0 if exported */ #undef CR_KCODE_put_fs_struct /* Define to address of non-exported kernel symbol set_dumpable, or 0 if exported */ #undef CR_KCODE_set_dumpable /* Define to address of non-exported kernel symbol set_fs_pwd, or 0 if exported */ #undef CR_KCODE_set_fs_pwd /* Define to address of non-exported kernel symbol supplemental_group_member, or 0 if exported */ #undef CR_KCODE_supplemental_group_member /* Define to address of non-exported kernel symbol sys_dup2, or 0 if exported */ #undef CR_KCODE_sys_dup2 /* Define to address of non-exported kernel symbol sys_fchmod, or 0 if exported */ #undef CR_KCODE_sys_fchmod /* Define to address of non-exported kernel symbol sys_ftruncate, or 0 if exported */ #undef CR_KCODE_sys_ftruncate /* Define to address of non-exported kernel symbol sys_link, or 0 if exported */ #undef CR_KCODE_sys_link /* Define to address of non-exported kernel symbol sys_lseek, or 0 if exported */ #undef CR_KCODE_sys_lseek /* Define to address of non-exported kernel symbol sys_mknod, or 0 if exported */ #undef CR_KCODE_sys_mknod /* Define to address of non-exported kernel symbol sys_mprotect, or 0 if exported */ #undef CR_KCODE_sys_mprotect /* Define to address of non-exported kernel symbol sys_mremap, or 0 if exported */ #undef CR_KCODE_sys_mremap /* Define to address of non-exported kernel symbol sys_munmap, or 0 if exported */ #undef CR_KCODE_sys_munmap /* Define to address of non-exported kernel symbol sys_prctl, or 0 if exported */ #undef CR_KCODE_sys_prctl /* Define to address of non-exported kernel symbol sys_setgroups, or 0 if exported */ #undef CR_KCODE_sys_setgroups /* Define to address of non-exported kernel symbol sys_setitimer, or 0 if exported */ #undef CR_KCODE_sys_setitimer /* Define to address of non-exported kernel symbol sys_setresgid, or 0 if exported */ #undef CR_KCODE_sys_setresgid /* Define to address of non-exported kernel symbol sys_setresuid, or 0 if exported */ #undef CR_KCODE_sys_setresuid /* Define to address of non-exported kernel symbol sys_unlink, or 0 if exported */ #undef CR_KCODE_sys_unlink /* Define to address of non-exported kernel symbol syscall32_setup_pages, or 0 if exported */ #undef CR_KCODE_syscall32_setup_pages /* Define to address of non-exported kernel symbol timeval_to_jiffies, or 0 if exported */ #undef CR_KCODE_timeval_to_jiffies /* Define to address of non-exported kernel symbol vectors_user_mapping, or 0 if exported */ #undef CR_KCODE_vectors_user_mapping /* Define to address of non-exported kernel symbol HPAGE_SHIFT, or 0 if exported */ #undef CR_KDATA_HPAGE_SHIFT /* Define to address of non-exported kernel symbol anon_pipe_buf_ops, or 0 if exported */ #undef CR_KDATA_anon_pipe_buf_ops /* Define to address of non-exported kernel symbol child_reaper, or 0 if exported */ #undef CR_KDATA_child_reaper /* Define to address of non-exported kernel symbol cpu_gdt_descr, or 0 if exported */ #undef CR_KDATA_cpu_gdt_descr /* Define to address of non-exported kernel symbol cpu_gdt_table, or 0 if exported */ #undef CR_KDATA_cpu_gdt_table /* Define to address of non-exported kernel symbol empty_zero_page, or 0 if exported */ #undef CR_KDATA_empty_zero_page /* Define to address of non-exported kernel symbol hugetlbfs_file_operations, or 0 if exported */ #undef CR_KDATA_hugetlbfs_file_operations /* Define to address of non-exported kernel symbol init_pid_ns, or 0 if exported */ #undef CR_KDATA_init_pid_ns /* Define to address of non-exported kernel symbol init_pspace, or 0 if exported */ #undef CR_KDATA_init_pspace /* Define to address of non-exported kernel symbol mem_map_zero, or 0 if exported */ #undef CR_KDATA_mem_map_zero /* Define to address of non-exported kernel symbol old_rsp, or 0 if exported */ #undef CR_KDATA_old_rsp /* Define to address of non-exported kernel symbol per_cpu__cpu_gdt_descr, or 0 if exported */ #undef CR_KDATA_per_cpu__cpu_gdt_descr /* Define to address of non-exported kernel symbol per_cpu__old_rsp, or 0 if exported */ #undef CR_KDATA_per_cpu__old_rsp /* Define to address of non-exported kernel symbol phys_base, or 0 if exported */ #undef CR_KDATA_phys_base /* Define to address of non-exported kernel symbol pid_cachep, or 0 if exported */ #undef CR_KDATA_pid_cachep /* Define to address of non-exported kernel symbol pid_hash, or 0 if exported */ #undef CR_KDATA_pid_hash /* Define to address of non-exported kernel symbol pidhash_shift, or 0 if exported */ #undef CR_KDATA_pidhash_shift /* Define to address of non-exported kernel symbol pidmap_array, or 0 if exported */ #undef CR_KDATA_pidmap_array /* Define to address of non-exported kernel symbol pidmap_lock, or 0 if exported */ #undef CR_KDATA_pidmap_lock /* Define to address of non-exported kernel symbol ptrace_utrace_ops, or 0 if exported */ #undef CR_KDATA_ptrace_utrace_ops /* Define to address of non-exported kernel symbol ramfs_file_operations, or 0 if exported */ #undef CR_KDATA_ramfs_file_operations /* Define to address of non-exported kernel symbol shmem_file_operations, or 0 if exported */ #undef CR_KDATA_shmem_file_operations /* Define to address of non-exported kernel symbol suid_dumpable, or 0 if exported */ #undef CR_KDATA_suid_dumpable /* Define to address of non-exported kernel symbol tasklist_lock, or 0 if exported */ #undef CR_KDATA_tasklist_lock /* Define to address of non-exported kernel symbol xstate_size, or 0 if exported */ #undef CR_KDATA_xstate_size /* Define to 1 to enable debugging/tracing output from kernel modules, controlled by the 'cr_ktrace_mask' module option */ #undef CR_KERNEL_TRACING /* Maximum legal size to kmalloc() */ #undef CR_KMALLOC_MAX /* Define to 1 if linux/autoconf.h must be included explicitly */ #undef CR_NEED_AUTOCONF_H /* Define to 1 to enable restore of uid, gid and supplemental groups when invoked by root. (default is no) */ #undef CR_RESTORE_IDS /* Positive if stack grows up, negative if it grows down */ #undef CR_STACK_GROWTH /* Define to 1 if the kernel has 0-arg alloc_pid(). */ #undef HAVE_0_ARG_ALLOC_PID /* Define to 1 if the kernel has 1-arg alloc_pid(). */ #undef HAVE_1_ARG_ALLOC_PID /* Define to 1 if the kernel has 1-arg find_pid(). */ #undef HAVE_1_ARG_FIND_PID /* Define to 1 if the kernel has 2.6.0 attach_pid. */ #undef HAVE_2_6_0_ATTACH_PID /* Define to 1 if the kernel has 2.6.0 restore_fpu_checking. */ #undef HAVE_2_6_0_RESTORE_FPU_CHECKING /* Define to 1 if the kernel type 'struct task_struct' has member '__pgrp' of type 'int'. */ #undef HAVE_2_6_0_TASK_IDS /* Define to 1 if the kernel has " audit_syscall_exit(NULL,AUDITSC_RESULT(0),0)". */ #undef HAVE_2_6_12_AUDIT_SYSCALL_EXIT /* Define to 1 if the kernel has " audit_syscall_exit(AUDITSC_RESULT(0),0)". */ #undef HAVE_2_6_17_AUDIT_SYSCALL_EXIT /* Define to 1 if the kernel has "int process_session(NULL)". */ #undef HAVE_2_6_20_TASK_IDS /* Define to 1 if the kernel has 2.6.22 attach_pid. */ #undef HAVE_2_6_22_ATTACH_PID /* Define to 1 if the kernel has "int task_session_vnr(NULL)". */ #undef HAVE_2_6_24_TASK_IDS /* Define to 1 if the kernel has 2.6.26 attach_pid. */ #undef HAVE_2_6_26_ATTACH_PID /* Define to 1 if the kernel has 2.6.28 restore_fpu_checking. */ #undef HAVE_2_6_28_RESTORE_FPU_CHECKING /* Define to 1 if the kernel has " audit_syscall_exit(NULL,0)". */ #undef HAVE_2_6_6_AUDIT_SYSCALL_EXIT /* Define to 1 if the kernel type 'struct task_struct' has member 'signal->session' of type 'int'. */ #undef HAVE_2_6_6_TASK_IDS /* Define to 1 if the kernel has 2-arg arch_setup_additional_pages(). */ #undef HAVE_2_ARG_ARCH_SETUP_ADDITIONAL_PAGES /* Define to 1 if the kernel has 2-arg find_pid(). */ #undef HAVE_2_ARG_FIND_PID /* Define to 1 if the kernel has 2-arg pipe_ops.unmap. */ #undef HAVE_2_ARG_PIPE_OPS_UNMAP /* Define to 1 if the kernel has 3-arg dentry_open(). */ #undef HAVE_3_ARG_DENTRY_OPEN /* Define to 1 if the kernel has 3-arg follow_huge_addr(). */ #undef HAVE_3_ARG_FOLLOW_HUGE_ADDR /* Define to 1 if the kernel has 3-arg pipe_ops.unmap. */ #undef HAVE_3_ARG_PIPE_OPS_UNMAP /* Define to 1 if the kernel has 4-arg arch_setup_additional_pages(). */ #undef HAVE_4_ARG_ARCH_SETUP_ADDITIONAL_PAGES /* Define to 1 if the kernel has 4-arg dentry_open(). */ #undef HAVE_4_ARG_DENTRY_OPEN /* Define to 1 if the kernel has 4-arg do_generic_file_read(). */ #undef HAVE_4_ARG_DO_GENERIC_FILE_READ /* Define to 1 if the kernel has 4-arg follow_huge_addr(). */ #undef HAVE_4_ARG_FOLLOW_HUGE_ADDR /* Define to 1 if the kernel has 5-arg do_generic_file_read(). */ #undef HAVE_5_ARG_DO_GENERIC_FILE_READ /* Define to 1 if the kernel has the macro or function alloc_pid(). */ #undef HAVE_ALLOC_PID /* Define to 1 if the kernel has the header file. */ #undef HAVE_ASM_DESC_H /* Define to 1 if the kernel has the header file. */ #undef HAVE_ASM_ELF_H /* Define to 1 if the kernel has the header file. */ #undef HAVE_ASM_I387_H /* Define to 1 if the kernel has the header file. */ #undef HAVE_ASM_SWITCH_TO_H /* Define to 1 if the kernel has the header file. */ #undef HAVE_ASM_TLS_H /* Define to 1 if the kernel has the header file. */ #undef HAVE_ASM_VSYSCALL32_H /* Define to 1 if the kernel has the macro or function audit_dummy_context(). */ #undef HAVE_AUDIT_DUMMY_CONTEXT /* Define to 1 if the kernel has the macro or function change_pid(). */ #undef HAVE_CHANGE_PID /* Define to 1 if the kernel has the macro or function child_reaper(). */ #undef HAVE_CHILD_REAPER /* Define to 1 if the kernel has the macro or function close_on_exec(). */ #undef HAVE_CLOSE_ON_EXEC /* Define to 1 if the kernel defines the macro CONFIG_AUDITSYSCALL. */ #undef HAVE_CONFIG_AUDITSYSCALL /* Define to 1 if the kernel defines the macro CONFIG_HUGETLBFS. */ #undef HAVE_CONFIG_HUGETLBFS /* Define to 1 if the kernel defines the macro CONFIG_THUMB2_KERNEL. */ #undef HAVE_CONFIG_THUMB2_KERNEL /* Define to 1 if the kernel has cpu_gdt_descr. */ #undef HAVE_CPU_GDT_DESCR /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H /* Define to 1 if the kernel defines the macro do_each_pid_task. */ #undef HAVE_DO_EACH_PID_TASK /* Define to 1 if the kernel defines the macro do_each_task_pid. */ #undef HAVE_DO_EACH_TASK_PID /* Define to 1 if the kernel has the macro or function do_mmap(). */ #undef HAVE_DO_MMAP /* Define to 1 if the kernel has the macro or function do_mmap_pgoff(). */ #undef HAVE_DO_MMAP_PGOFF /* Define to 1 if the kernel type 'struct fdtable' has member 'next_fd' of type 'int'. */ #undef HAVE_FDTABLE_NEXT_FD /* Define to 1 if the kernel has the macro or function fd_is_open(). */ #undef HAVE_FD_IS_OPEN /* Define to 1 if the kernel type 'struct files_struct' has member 'max_fdset' of type 'int'. */ #undef HAVE_FILES_STRUCT_MAX_FDSET /* Define to 1 if the kernel type 'struct files_struct' has member 'next_fd' of type 'int'. */ #undef HAVE_FILES_STRUCT_NEXT_FD /* Define to 1 if the kernel type 'struct file' has member 'f_lock' of type 'spinlock_t'. */ #undef HAVE_FILE_F_LOCK /* Define to 1 if the kernel type 'struct file' has member 'f_mapping' of type 'struct address_space*'. */ #undef HAVE_FILE_F_MAPPING /* Define to 1 if the kernel type 'struct file_operations' has member 'check_flags'. */ #undef HAVE_FILE_OPERATIONS_CHECK_FLAGS /* Define to 1 if the kernel type 'struct file_operations' has member 'unlocked_ioctl'. */ #undef HAVE_FILE_OPERATIONS_UNLOCKED_IOCTL /* Define to 1 if the kernel has the macro or function find_pid_ns(). */ #undef HAVE_FIND_PID_NS /* Define to 1 if the kernel has the macro or function find_task_by_pid(). */ #undef HAVE_FIND_TASK_BY_PID /* Define to 1 if the kernel has the macro or function find_task_by_pid_ns(). */ #undef HAVE_FIND_TASK_BY_PID_NS /* Define to 1 if the kernel has the macro or function find_task_by_pid_type(). */ #undef HAVE_FIND_TASK_BY_PID_TYPE /* Define to 1 if the kernel has the macro or function find_task_by_pid_type_ns(). */ #undef HAVE_FIND_TASK_BY_PID_TYPE_NS /* Define to 1 if the kernel defines the macro for_each_task_pid. */ #undef HAVE_FOR_EACH_TASK_PID /* Define to 1 if the kernel type 'struct fs_struct' has member 'lock' of type 'rwlock_t'. */ #undef HAVE_FS_STRUCT_RWLOCK /* Define to 1 if the kernel type 'struct fs_struct' has member 'lock' of type 'spinlock_t'. */ #undef HAVE_FS_STRUCT_SPINLOCK /* Define to 1 if the Fault Tolerance Backplane is available. */ #undef HAVE_FTB /* Define to 1 if the kernel defines the macro F_GETPIPE_SZ. */ #undef HAVE_F_GETPIPE_SZ /* Define to 1 if the kernel defines the macro F_SETPIPE_SZ. */ #undef HAVE_F_SETPIPE_SZ /* Define to 1 if the kernel has the header file. */ #undef HAVE_GENERATED_UTSRELEASE_H /* Define to 1 if the kernel has the type 'gfp_t'. */ #undef HAVE_GFP_T /* Define to 1 if the kernel has the macro or function init_utsname(). */ #undef HAVE_INIT_UTSNAME /* Define to 1 if the kernel type 'struct inode' has member 'i_mapping' of type 'struct address_space*'. */ #undef HAVE_INODE_I_MAPPING /* Define to 1 if the kernel type 'struct inode' has member 'i_mutex' of type 'struct mutex'. */ #undef HAVE_INODE_MUTEX /* Define to 1 if the kernel has the macro or function inode_permission(). */ #undef HAVE_INODE_PERMISSION /* Define to 1 if the kernel type 'struct inode' has member 'i_sem' of type 'struct semaphore'. */ #undef HAVE_INODE_SEM /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if the kernel has the macro or function kern_path(). */ #undef HAVE_KERN_PATH /* Define to 1 if the kernel has the macro or function kill_pid(). */ #undef HAVE_KILL_PID /* Define to 1 if the kernel has the macro or function kill_proc(). */ #undef HAVE_KILL_PROC /* Define to 1 if the kernel has the macro or function kmemdup(). */ #undef HAVE_KMEMDUP /* Define to 1 if the kmem_cache_t typedef exists and is not deprecated */ #undef HAVE_KMEM_CACHE_T /* Define to 1 if the kernel has the macro or function kmem_cache_zalloc(). */ #undef HAVE_KMEM_CACHE_ZALLOC /* Define to 1 if the kernel has the macro or function kzalloc(). */ #undef HAVE_KZALLOC /* Define to 1 if the kernel has the header file. */ #undef HAVE_LINUX_AUDIT_H /* Define to 1 if the kernel has the header file. */ #undef HAVE_LINUX_COMPILE_H /* Define to 1 if the kernel has the header file. */ #undef HAVE_LINUX_FDTABLE_H /* Define to 1 if the kernel has the header file. */ #undef HAVE_LINUX_LOCKDEP_H /* Define to 1 if the kernel has the header file. */ #undef HAVE_LINUX_PERF_EVENT_H /* Define to 1 if the kernel has the header file. */ #undef HAVE_LINUX_PID_NAMESPACE_H /* Define to 1 if the kernel has the header file. */ #undef HAVE_LINUX_PSPACE_H /* Define to 1 if the kernel has the header file. */ #undef HAVE_LINUX_SYSCALLS_H /* Define to 1 if the kernel has the header file. */ #undef HAVE_LINUX_UTRACE_H /* Define to 1 if the kernel has the header file. */ #undef HAVE_LINUX_UTSRELEASE_H /* Define to 1 if the kernel has the macro or function map_vsyscall(). */ #undef HAVE_MAP_VSYSCALL /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if the kernel type 'struct mm_struct' has member 'cached_hole_size' of type 'unsigned long'. */ #undef HAVE_MM_CACHED_HOLE_SIZE /* Define to 1 if the kernel type 'mm_context_t' has member 'vdso' of type 'unsigned long'. */ #undef HAVE_MM_CONTEXT_VDSO /* Define to 1 if the kernel type 'mm_context_t' has member 'vdso_base' of type 'unsigned long'. */ #undef HAVE_MM_CONTEXT_VDSO_BASE /* Define to 1 if the kernel type 'struct mm_struct' has member 'dumpable' of type 'int'. */ #undef HAVE_MM_DUMPABLE /* Define to 1 if the kernel type 'struct mm_struct' has member 'exe_file' of type 'struct file *'. */ #undef HAVE_MM_EXE_FILE /* Define to 1 if the kernel type 'struct mm_struct' has member 'mmap_base' of type 'unsigned long'. */ #undef HAVE_MM_MMAP_BASE /* Define to 1 if the kernel type 'struct mm_struct' has member 'task_size' of type 'unsigned long'. */ #undef HAVE_MM_TASK_SIZE /* Define to 1 if the kernel has nameidata.dentry. */ #undef HAVE_NAMEIDATA_DENTRY /* Define to 1 if fs functions pass 'struct path' */ #undef HAVE_NAMEIDATA_PATH /* Define to 1 if the kernel type 'struct files_struct' has member 'open_fds->fds_bits' of type 'unsigned long *'. */ #undef HAVE_OPEN_FDS_FDS_BITS /* Define to 1 if the kernel has the macro or function PageAnon(). */ #undef HAVE_PAGEANON /* Define to 1 if the kernel has the macro or function path_lookup(). */ #undef HAVE_PATH_LOOKUP /* Define to 1 if the kernel has the macro or function percpu_read(). */ #undef HAVE_PERCPU_READ /* Define to 1 if the kernel has the macro or function percpu_write(). */ #undef HAVE_PERCPU_WRITE /* Define to 1 if the kernel has the macro or function permission(). */ #undef HAVE_PERMISSION /* Define to 1 if the kernel defines the constant PIDTYPE_TGID. */ #undef HAVE_PIDTYPE_TGID /* Define to 1 if the kernel type 'struct pid_namespace' has member 'pid_cachep' of type 'void *'. */ #undef HAVE_PID_NAMESPACE_PID_CACHEP /* Define to 1 if the kernel type 'struct pipe_buf_operations' has member 'pin'. */ #undef HAVE_PIPE_BUF_OPERATIONS_PIN /* Define to 1 if the kernel has the macro or function pipe_fcntl(). */ #undef HAVE_PIPE_FCNTL /* Define to 1 if the kernel type 'struct pipe_inode_info' has member 'base' of type 'char*'. */ #undef HAVE_PIPE_INODE_INFO_BASE /* Define to 1 if the kernel type 'struct pipe_inode_info' has member 'buffers' of type 'unsigned int'. */ #undef HAVE_PIPE_INODE_INFO_BUFFERS /* Define to 1 if prctl() function is available. */ #undef HAVE_PRCTL /* Define to 1 if the kernel has proc_root. */ #undef HAVE_PROC_ROOT /* Define to 1 if you have the `pthread_attr_setstacksize' function. */ #undef HAVE_PTHREAD_ATTR_SETSTACKSIZE /* Define to 1 if the kernel type 'struct pt_regs' has member 'cs' of type 'int'. */ #undef HAVE_PT_REGS_CS /* Define to 1 if the kernel type 'struct pt_regs' has member 'eflags' of type 'unsigned long'. */ #undef HAVE_PT_REGS_EFLAGS /* Define to 1 if the kernel type 'struct pt_regs' has member 'flags' of type 'unsigned long'. */ #undef HAVE_PT_REGS_FLAGS /* Define to 1 if the kernel type 'struct pt_regs' has member 'fs' of type 'int'. */ #undef HAVE_PT_REGS_FS /* Define to 1 if the kernel type 'struct pt_regs' has member 'gs' of type 'int'. */ #undef HAVE_PT_REGS_GS /* Define to 1 if the kernel type 'struct pt_regs' has member 'xcs' of type 'int'. */ #undef HAVE_PT_REGS_XCS /* Define to 1 if the kernel type 'struct pt_regs' has member 'xfs' of type 'int'. */ #undef HAVE_PT_REGS_XFS /* Define to 1 if the kernel type 'struct pt_regs' has member 'xgs' of type 'int'. */ #undef HAVE_PT_REGS_XGS /* Define to 1 if the kernel type 'read_descriptor_t' has member 'arg.data' of type 'void*'. */ #undef HAVE_READ_DESCRIPTOR_T_ARG_DATA /* Define to 1 if the kernel type 'read_descriptor_t' has member 'buf' of type 'char*'. */ #undef HAVE_READ_DESCRIPTOR_T_BUF /* Define to 1 if the kernel has the macro or function read_pda(). */ #undef HAVE_READ_PDA /* Define to 1 if the kernel defines the macro REMOVE_LINKS. */ #undef HAVE_REMOVE_LINKS /* Define to 1 if the kernel has the macro or function restore_fpu_checking(). */ #undef HAVE_RESTORE_FPU_CHECKING /* Define to 1 if the kernel has the macro or function set_dumpable(). */ #undef HAVE_SET_DUMPABLE /* Define to 1 if the kernel has the macro or function set_task_pgrp(). */ #undef HAVE_SET_TASK_PGRP /* Define to 1 if the kernel has the macro or function set_task_session(). */ #undef HAVE_SET_TASK_SESSION /* Define to 1 if the kernel type 'struct task_struct' has member 'signal->rlim0' of type 'struct rlimit'. */ #undef HAVE_SIGNAL_RLIM /* Define to 1 if the kernel has the macro or function splice_direct_to_actor(). */ #undef HAVE_SPLICE_DIRECT_TO_ACTOR /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if the kernel has the type 'struct delayed_work'. */ #undef HAVE_STRUCT_DELAYED_WORK /* Define to 1 if the kernel has the type 'struct fdtable'. */ #undef HAVE_STRUCT_FDTABLE /* Define to 1 if the kernel has the type 'struct n_desc_struct'. */ #undef HAVE_STRUCT_N_DESC_STRUCT /* Define to 1 if the kernel has the type 'struct path'. */ #undef HAVE_STRUCT_PATH /* Define to 1 if the kernel has the type 'struct pidmap'. */ #undef HAVE_STRUCT_PIDMAP /* Define to 1 if the kernel has suid_dumpable. */ #undef HAVE_SUID_DUMPABLE /* Define to 1 if the kernel has system_utsname. */ #undef HAVE_SYSTEM_UTSNAME /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if the kernel has the macro or function task_child_reaper(). */ #undef HAVE_TASK_CHILD_REAPER /* Define to 1 if the kernel type 'struct task_struct' has member 'cred' of type 'const struct cred *'. */ #undef HAVE_TASK_CRED /* Define to 1 if the kernel type 'struct task_struct' has member 'group_info' of type 'struct group_info *'. */ #undef HAVE_TASK_GROUP_INFO /* Define to 1 if the kernel type 'struct task_struct' has member 'parent' of type 'struct task_struct *'. */ #undef HAVE_TASK_PARENT /* Define to 1 if the kernel type 'struct task_struct' has member 'pids0' of type 'struct pid'. */ #undef HAVE_TASK_PIDS_PID /* Define to 1 if the kernel type 'struct task_struct' has member 'pids0' of type 'struct pid_link'. */ #undef HAVE_TASK_PIDS_PID_LINK /* Define to 1 if the kernel type 'struct task_struct' has member 'ptrace' of type 'unsigned long'. */ #undef HAVE_TASK_PTRACE /* Define to 1 if the kernel type 'struct task_struct' has member 'ptraced' of type 'struct list_head'. */ #undef HAVE_TASK_PTRACED /* Define to 1 if the kernel type 'struct task_struct' has member 'ptracees' of type 'struct list_head'. */ #undef HAVE_TASK_PTRACEES /* Define to 1 if the kernel type 'struct task_struct' has member 'real_parent' of type 'struct task_struct *'. */ #undef HAVE_TASK_REAL_PARENT /* Define to 1 if the kernel type 'struct task_struct' has member 'rlim0' of type 'struct rlimit'. */ #undef HAVE_TASK_RLIM /* Define to 1 if the kernel type 'struct task_struct' has member 'thread_group' of type 'struct list_head'. */ #undef HAVE_TASK_THREAD_GROUP /* Define to 1 if the kernel has the macro or function this_cpu_read(). */ #undef HAVE_THIS_CPU_READ /* Define to 1 if the kernel has the macro or function this_cpu_write(). */ #undef HAVE_THIS_CPU_WRITE /* Define to 1 if the kernel type 'struct thread_struct' has member 'debugreg0' of type 'unsigned long'. */ #undef HAVE_THREAD_DEBUGREG0 /* Define to 1 if the kernel type 'struct thread_struct' has member 'debugreg1' of type 'unsigned long'. */ #undef HAVE_THREAD_DEBUGREGS /* Define to 1 if the kernel type 'struct thread_struct' has member 'esp0' of type 'unsigned long'. */ #undef HAVE_THREAD_ESP0 /* Define to 1 if the kernel type 'struct thread_struct' has member 'fpu' of type 'struct fpu'. */ #undef HAVE_THREAD_FPU /* Define to 1 if the kernel type 'struct thread_struct' has member 'i387' of type 'union i387_union'. */ #undef HAVE_THREAD_I387 /* Define to 1 if the kernel type 'struct thread_info' has member 'sysenter_return' of type 'void *'. */ #undef HAVE_THREAD_INFO_SYSENTER_RETURN /* Define to 1 if the kernel type 'struct thread_info' has member 'tp_value' of type 'unsigned long'. */ #undef HAVE_THREAD_INFO_TP_VALUE /* Define to 1 if the kernel type 'struct thread_struct' has member 'ptrace_bps1' of type 'struct perf_event *'. */ #undef HAVE_THREAD_PTRACE_BPS /* Define to 1 if the kernel type 'struct thread_struct' has member 'rsp0' of type 'unsigned long'. */ #undef HAVE_THREAD_RSP0 /* Define to 1 if the kernel type 'struct thread_struct' has member 'sp0' of type 'unsigned long'. */ #undef HAVE_THREAD_SP0 /* Define to 1 if the kernel type 'struct thread_struct' has member 'userrsp' of type 'unsigned long'. */ #undef HAVE_THREAD_USERRSP /* Define to 1 if the kernel type 'struct thread_struct' has member 'usersp' of type 'unsigned long'. */ #undef HAVE_THREAD_USERSP /* Define to 1 if the kernel type 'struct thread_struct' has member 'vdso_base' of type 'unsigned long'. */ #undef HAVE_THREAD_VDSO_BASE /* Define to 1 if the kernel type 'struct thread_struct' has member 'xstate' of type 'union thread_xstate *'. */ #undef HAVE_THREAD_XSTATE /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to 1 if the kernel has the macro or function valid_signal(). */ #undef HAVE_VALID_SIGNAL /* Define to 1 if the kernel type 'struct vm_area_struct' has member 'vm_mm' of type 'struct mm_struct *'. */ #undef HAVE_VMA_VM_MM /* Define to 1 if the kernel defines the constant VSYSCALL_BASE. */ #undef HAVE_VSYSCALL_BASE /* Define to 1 if the kernel has the macro or function write_pda(). */ #undef HAVE_WRITE_PDA /* Define to 1 if the kernel has the macro or function __audit_syscall_exit(). */ #undef HAVE___AUDIT_SYSCALL_EXIT /* Define to 1 if you have the `__nss_disable_nscd' function. */ #undef HAVE___NSS_DISABLE_NSCD /* Define to 1 if the kernel has the macro or function __putname(). */ #undef HAVE___PUTNAME /* Define to 1 if you have the `__register_atfork' function. */ #undef HAVE___REGISTER_ATFORK /* Define to 1 if the kernel has the macro or function __set_close_on_exec(). */ #undef HAVE___SET_CLOSE_ON_EXEC /* Define to 1 if the kernel has the macro or function __set_open_fd(). */ #undef HAVE___SET_OPEN_FD /* Define to 1 to enable debugging/tracing output from libcr, controlled by the 'LIBCR_TRACE_MASK' environment variable */ #undef LIBCR_TRACING /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #undef LT_OBJDIR /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the version of this package. */ #undef PACKAGE_VERSION /* The size of `void *', as computed by sizeof. */ #undef SIZEOF_VOID_P /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Version number of package */ #undef VERSION blcr-0.8.5/contrib/0000755000000000000000000000000012102072124011044 500000000000000blcr-0.8.5/contrib/cr_insmod.in0000664000000000000000000000015310131627213013277 00000000000000#!/bin/sh # @configure_input@ # # Reloads checkpoint/restart kernel modules make -C @TOP_BUILDDIR@ insmod blcr-0.8.5/contrib/Makefile.am0000664000000000000000000000022411010404333013016 00000000000000# Maintainer scripts requiring substitutions: noinst_SCRIPTS = cr_insmod gen_cscope batch_build # Others: EXTRA_DIST = README cr_depmod blcr.magic blcr-0.8.5/contrib/batch_build.in0000664000000000000000000000323512065170736013601 00000000000000#!/bin/sh # Given a list of kernel build directories on the command line, # this script will try to compile blcr against each of them. # This depends on having a System.map file in the kernel dir # with a redhat-style suffix to identify its type (smp, etc.). # A System.map w/o the suffix is possible, but not if using the # /boot/kernel.h mechanism. skipped=0 failed=0 total=0 build () { _srcdir=$1 _ver=$2 _args=$3 _map=$4 _blddir=BUILD-${_ver} _logfile=log-${_ver} echo -n "`date`: building ${_ver}... " if [ -e ${_blddir} ]; then echo "SKIPPED (build directory exists)" skipped=`expr $skipped + 1` return 1 fi ( \ mkdir $_blddir && \ cd $_blddir && \ @TOP_SRCDIR@/configure --with-linux=$_srcdir ${_args} && \ make && \ echo SUCCESS \ ) > $_logfile 2>&1 if [ "$?" = 0 ]; then echo SUCCESS rm -Rf ${_blddir} else echo FAILURE failed=`expr $failed + 1` fi total=`expr $total + 1` } for dir in $*; do ver=`basename $dir | sed -e s/linux-//` for s in $dir/System.map-*; do case $s in *-\*) break;; *smp) build $dir ${ver}smp --with-kernel-type=smp $s;; *bigmem) build $dir ${ver}bigmem --with-kernel-type=bigmem $s;; *hugemem) build $dir ${ver}bigmem --with-kernel-type=hugemem $s;; *enterprise) build $dir ${ver}enterprise --with-kernel-type=enterprise $s;; *) build $dir ${ver} --with-kernel-type=up $s;; esac done if [ -e $dir/System.map ]; then build $dir $ver fi done if [ $failed != 0 ]; then echo "### FAILED $failed of $total builds ($skipped skipped)." exit 1; fi if [ $skipped != 0 ]; then echo "### WARNING skipped $skipped builds." fi exit 0 blcr-0.8.5/contrib/blcr.magic0000664000000000000000000000207011115077240012720 00000000000000# This is file type detection data for the file(1), as described in the # magic(5) manpage. In most cases adding this to /etc/magic will allow # the file(1) utility to identify BLCR's context files. However, you # should consult your file(1) and magic(5) manpages to determine the # proper location for your own installation. # # Berkeley Lab Checkpoint Restart (BLCR) checkpoint context files # http://ftg.lbl.gov/checkpoint 0 string C\0\0\0R\0\0\0 BLCR >16 lelong 1 x86 >16 lelong 3 alpha >16 lelong 5 x86-64 >16 lelong 7 ARM >8 lelong x context data (little endian, version %d) # Uncomment the following only of your "file" program supports "search" #>0 search/1024 VMA\06 for kernel #>>&1 byte x %d. #>>&2 byte x %d. #>>&3 byte x %d 0 string \0\0\0C\0\0\0R BLCR >16 belong 2 SPARC >16 belong 4 ppc >16 belong 6 ppc64 >16 belong 7 ARMEB >16 belong 8 SPARC64 >8 belong x context data (big endian, version %d) # Uncomment the following only of your "file" program supports "search" #>0 search/1024 VMA\06 for kernel #>>&1 byte x %d. #>>&2 byte x %d. #>>&3 byte x %d blcr-0.8.5/contrib/Makefile.in0000664000000000000000000002645412102070007013044 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ 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 = contrib DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/batch_build.in $(srcdir)/cr_insmod.in \ $(srcdir)/gen_cscope.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/blcr_config.h CONFIG_CLEAN_FILES = cr_insmod gen_cscope batch_build CONFIG_CLEAN_VPATH_FILES = SCRIPTS = $(noinst_SCRIPTS) SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CONFIGURE_ARGS = @CONFIGURE_ARGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CR_ARCH = @CR_ARCH@ CR_CLIENT_LDADD = @CR_CLIENT_LDADD@ CR_CPU = @CR_CPU@ CR_FTB_INCLUDES = @CR_FTB_INCLUDES@ CR_FTB_LDADD = @CR_FTB_LDADD@ CR_FTB_LDFLAGS = @CR_FTB_LDFLAGS@ CR_KARCH = @CR_KARCH@ CR_KERNEL = @CR_KERNEL@ CR_KERNEL_BASE = @CR_KERNEL_BASE@ CR_LIBARCH = @CR_LIBARCH@ CR_LIBCR_CFLAGS = @CR_LIBCR_CFLAGS@ CR_MODULE_DIR = @CR_MODULE_DIR@ CR_MODULE_MAJOR = @CR_MODULE_MAJOR@ CR_MODULE_MINOR = @CR_MODULE_MINOR@ CR_MODULE_PATCH = @CR_MODULE_PATCH@ CR_MODULE_VERSION = @CR_MODULE_VERSION@ CR_NDEBUG = @CR_NDEBUG@ CR_RELEASE_MAJOR = @CR_RELEASE_MAJOR@ CR_RELEASE_MINOR = @CR_RELEASE_MINOR@ CR_RELEASE_PATCH = @CR_RELEASE_PATCH@ CR_RELEASE_VERSION = @CR_RELEASE_VERSION@ CR_SIGNUM = @CR_SIGNUM@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GMAKE_ELSE = @GMAKE_ELSE@ GMAKE_ENDIF = @GMAKE_ENDIF@ GMAKE_IFEQ = @GMAKE_IFEQ@ GMAKE_IFNEQ = @GMAKE_IFNEQ@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KBUILD_MAK = @KBUILD_MAK@ KBUILD_MAKE_ARGS = @KBUILD_MAKE_ARGS@ KCC = @KCC@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBCR_MAJOR = @LIBCR_MAJOR@ LIBCR_MINOR = @LIBCR_MINOR@ LIBCR_PATCH = @LIBCR_PATCH@ LIBCR_VERSION = @LIBCR_VERSION@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_AGE = @LIBTOOL_AGE@ LIBTOOL_INTERFACE = @LIBTOOL_INTERFACE@ LIBTOOL_REVISION = @LIBTOOL_REVISION@ LINUX_OBJ = @LINUX_OBJ@ LINUX_SRC = @LINUX_SRC@ LINUX_SYMTAB_CMD = @LINUX_SYMTAB_CMD@ LINUX_SYMTAB_CONF = @LINUX_SYMTAB_CONF@ LINUX_SYMTAB_FILE = @LINUX_SYMTAB_FILE@ LINUX_VER = @LINUX_VER@ LINUX_VERSION_H = @LINUX_VERSION_H@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKE = @MAKE@ MAKEINFO = @MAKEINFO@ 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_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PWD_PROG = @PWD_PROG@ RANLIB = @RANLIB@ RPMBUILD = @RPMBUILD@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TOP_BUILDDIR = @TOP_BUILDDIR@ TOP_SRCDIR = @TOP_SRCDIR@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ 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@ lt_ECHO = @lt_ECHO@ 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@ # Maintainer scripts requiring substitutions: noinst_SCRIPTS = cr_insmod gen_cscope batch_build # Others: EXTRA_DIST = README cr_depmod blcr.magic all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign contrib/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign contrib/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): cr_insmod: $(top_builddir)/config.status $(srcdir)/cr_insmod.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ gen_cscope: $(top_builddir)/config.status $(srcdir)/gen_cscope.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ batch_build: $(top_builddir)/config.status $(srcdir)/batch_build.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags: TAGS TAGS: ctags: CTAGS CTAGS: 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 $(SCRIPTS) 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am 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: blcr-0.8.5/contrib/cr_depmod0000664000000000000000000000425411115077240012661 00000000000000#!/usr/bin/perl # Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) # 2007, The Regents of the University of California, through Lawrence # Berkeley National Laboratory (subject to receipt of any required # approvals from the U.S. Dept. of Energy). All rights reserved. # # Portions may be copyrighted by others, as may be noted in specific # copyright notices within specific files. # # 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 # # This script is a depmod replacement # It expects the System.map file on STDIN and the modules to check as args use strict vars; my $result = 0; my %exports = (); my %imports = (); my $file; my $nm = $ENV{'NM'} || 'nm -B'; # Get exported symbols from System.map (or nm vmlinux). $exports{__this_module} = 1; while () { if (/ksymtab_(.*)$/) { $exports{$1} = 1; } # The following is a HACK to deal with SPARC linker entries for global registers elsif (/sparc_cpu_type/) { $exports{'current_thread_info_reg'} = 1; } } # Scan module files for both exports and imports, striping modversions for $file (@ARGV) { (my $shortname = $file) =~ s,^.*/,,; open NM, "$nm $file |" || die "failed to 'nm $file'"; while () { if (/ksymtab_(.*)$/) { $exports{$1} = 1; } elsif (/\sU\s+\.?(.+?)(_R(smp_)?[[:xdigit:]]{8})?$/) { $imports{$1} = $shortname; } } } # Output any unresolved imports foreach (keys (%imports)) { next if (exists $exports{$_}); print "cr_depmod: $_\tunresolved in $imports{$_}\n"; $result = 1; } exit $result; blcr-0.8.5/contrib/README0000664000000000000000000000267711010404333011660 00000000000000Contents of the contrib directory * batch_build.in This is source for contrib/batch_build, which is built at configure time. The resulting script can be invoked with a list of kernel build directories and will attempt to build BLCR against each of the listed kernels. A significant part of the code deals with the /boot/kernel.h mechanism used by Red Had Linux 8 and 9 (among other distributions). * blcr.magic This is file type detection data for the file(1), as described in the magic(5) manpage. In most cases adding this to /etc/magic will allow the file(1) utility to identify BLCR's context files. However, you should consult your file(1) and magic(5) manpages to determine the proper location for your own installation. * cr_depmod This is a perl script we use as a replacement for the depmod(8) utility. It is not a full replacement: it only checks for unresolved symbol references. We wrote this because the depmod(8) interface changed on us a couple times. * cr_insmod.in This is source for contrib/cr_insmod, which is built at configure time. It used to contain a script to load the appropriate kernel modules. Now that function is in BLCR's top-level Makefile, and this script is now just a one-liner to invoke make. * gen_cscope.in This is source for contrib/gen_scope, which is built at configure time. We use the resulting script to contruct a cscope(1) database of the combined BLCR and kernel sources. blcr-0.8.5/contrib/gen_cscope.in0000664000000000000000000000256410625367257013460 00000000000000# vim:set ft=sh: # # (re)builds cscope database for Linux kernel and checkpoint/restart sources KROOT="@LINUX_SRC@" CR_ROOT="@TOP_SRCDIR@" BUILD_DIR="@TOP_BUILDDIR@" if [ ! -d "$KROOT" ]; then echo "Invalid \$LINUX_SRC directory: '$LINUX_SRC'" exit -1 fi if [ -z "$CR_ROOT" ]; then echo "Must set \$CR_ROOT" exit -1 fi ### Build list of files to index # 'find' doesn't recurse into symlinks: neither bld/src dirs are symlinks, but # linux src often is cd $KROOT; KROOT=`pwd -P`; cd - # go to / to store absolute paths in the cscope database cd / find $KROOT $CR_ROOT \ -path "$KROOT/arch/*" ! -path "$KROOT/arch/i386*" -prune -o \ -path "$KROOT/include/asm-*" ! -path "$KROOT/include/asm-i386*" -prune -o \ -path "$KROOT/tmp*" -prune -o \ -path "$KROOT/Documentation*" -prune -o \ -path "$KROOT/scripts*" -prune -o \ -path "$KROOT/drivers*" -prune -o \ -type l -prune -o \ -name "*.[chxsS]" -print >${BUILD_DIR}/cscope.files ### Build cscope database cd $BUILD_DIR # -q for inverted index (for fast symbol lookup) # -b to build ref only: no interaction cscope -q -b blcr-0.8.5/COPYING.LIB0000664000000000000000000006347607755224357011037 00000000000000 GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 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! blcr-0.8.5/man/0000755000000000000000000000000012102072123010156 500000000000000blcr-0.8.5/man/help2man0000775000000000000000000003056307707572234011572 00000000000000#!/usr/bin/perl -w # Generate a short man page from --help and --version output. # Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 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, write to the Free Software Foundation, # Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # Written by Brendan O'Dea # Available from ftp://ftp.gnu.org/gnu/help2man/ use 5.005; use strict; use Getopt::Long; use Text::Tabs qw(expand); use POSIX qw(strftime setlocale LC_TIME); my $this_program = 'help2man'; my $this_version = '1.29'; my $version_info = < EOT my $help_info = <. EOT my $section = 1; my $manual = ''; my $source = ''; my $help_option = '--help'; my $version_option = '--version'; my ($opt_name, @opt_include, $opt_output, $opt_info, $opt_no_info); my %opt_def = ( 'n|name=s' => \$opt_name, 's|section=s' => \$section, 'm|manual=s' => \$manual, 'S|source=s' => \$source, 'i|include=s' => sub { push @opt_include, [ pop, 1 ] }, 'I|opt-include=s' => sub { push @opt_include, [ pop, 0 ] }, 'o|output=s' => \$opt_output, 'p|info-page=s' => \$opt_info, 'N|no-info' => \$opt_no_info, 'h|help-option=s' => \$help_option, 'v|version-option=s' => \$version_option, ); # Parse options. Getopt::Long::config('bundling'); GetOptions (%opt_def, help => sub { print $help_info; exit }, version => sub { print $version_info; exit }, ) or die $help_info; die $help_info unless @ARGV == 1; my %include = (); my %append = (); my @include = (); # retain order given in include file # Process include file (if given). Format is: # # [section name] # verbatim text # # or # # /pattern/ # verbatim text # while (@opt_include) { my ($inc, $required) = @{shift @opt_include}; next unless -f $inc or $required; die "$this_program: can't open `$inc' ($!)\n" unless open INC, $inc; my $key; my $hash = \%include; while () { # [section] if (/^\[([^]]+)\]/) { $key = uc $1; $key =~ s/^\s+//; $key =~ s/\s+$//; $hash = \%include; push @include, $key unless $include{$key}; next; } # /pattern/ if (m!^/(.*)/([ims]*)!) { my $pat = $2 ? "(?$2)$1" : $1; # Check pattern. eval { $key = qr($pat) }; if ($@) { $@ =~ s/ at .*? line \d.*//; die "$inc:$.:$@"; } $hash = \%append; next; } # Check for options before the first section--anything else is # silently ignored, allowing the first for comments and # revision info. unless ($key) { # handle options if (/^-/) { local @ARGV = split; GetOptions %opt_def; } next; } $hash->{$key} ||= ''; $hash->{$key} .= $_; } close INC; die "$this_program: no valid information found in `$inc'\n" unless $key; } # Compress trailing blank lines. for my $hash (\(%include, %append)) { for (keys %$hash) { $hash->{$_} =~ s/\n+$/\n/ } } # Turn off localisation of executable's ouput. @ENV{qw(LANGUAGE LANG LC_ALL)} = ('C') x 3; # Turn off localisation of date (for strftime). setlocale LC_TIME, 'C'; # Grab help and version info from executable. my ($help_text, $version_text) = map { join '', map { s/ +$//; expand $_ } `$ARGV[0] $_ 2>/dev/null` or die "$this_program: can't get `$_' info from $ARGV[0]\n" } $help_option, $version_option; my $date = strftime "%B %Y", localtime; (my $program = $ARGV[0]) =~ s!.*/!!; my $package = $program; my $version; if ($opt_output) { unlink $opt_output or die "$this_program: can't unlink $opt_output ($!)\n" if -e $opt_output; open STDOUT, ">$opt_output" or die "$this_program: can't create $opt_output ($!)\n"; } # The first line of the --version information is assumed to be in one # of the following formats: # # # # {GNU,Free} # ({GNU,Free} ) # - {GNU,Free} # # and seperated from any copyright/author details by a blank line. ($_, $version_text) = split /\n+/, $version_text, 2; if (/^(\S+) +\(((?:GNU|Free) +[^)]+)\) +(.*)/ or /^(\S+) +- *((?:GNU|Free) +\S+) +(.*)/) { $program = $1; $package = $2; $version = $3; } elsif (/^((?:GNU|Free) +)?(\S+) +(.*)/) { $program = $2; $package = $1 ? "$1$2" : $2; $version = $3; } else { $version = $_; } $program =~ s!.*/!!; # No info for `info' itself. $opt_no_info = 1 if $program eq 'info'; # --name overrides --include contents. $include{NAME} = "$program \\- $opt_name\n" if $opt_name; # Default (useless) NAME paragraph. $include{NAME} ||= "$program \\- manual page for $program $version\n"; # Man pages traditionally have the page title in caps. my $PROGRAM = uc $program; # Set default page head/footers $source ||= "$program $version"; unless ($manual) { for ($section) { if (/^(1[Mm]|8)/) { $manual = 'System Administration Utilities' } elsif (/^6/) { $manual = 'Games' } else { $manual = 'User Commands' } } } # Extract usage clause(s) [if any] for SYNOPSIS. if ($help_text =~ s/^Usage:( +(\S+))(.*)((?:\n(?: {6}\1| *or: +\S).*)*)//m) { my @syn = $2 . $3; if ($_ = $4) { s/^\n//; for (split /\n/) { s/^ *(or: +)?//; push @syn, $_ } } my $synopsis = ''; for (@syn) { $synopsis .= ".br\n" if $synopsis; s!^\S*/!!; s/^(\S+) *//; $synopsis .= ".B $1\n"; s/\s+$//; s/(([][]|\.\.+)+)/\\fR$1\\fI/g; s/^/\\fI/ unless s/^\\fR//; $_ .= '\fR'; s/(\\fI)( *)/$2$1/g; s/\\fI\\fR//g; s/^\\fR//; s/\\fI$//; s/^\./\\&./; $synopsis .= "$_\n"; } $include{SYNOPSIS} ||= $synopsis; } # Process text, initial section is DESCRIPTION. my $sect = 'DESCRIPTION'; $_ = "$help_text\n\n$version_text"; # Normalise paragraph breaks. s/^\n+//; s/\n*$/\n/; s/\n\n+/\n\n/g; # Temporarily exchange leading dots, apostrophes and backslashes for # tokens. s/^\./\x80/mg; s/^'/\x81/mg; s/\\/\x82/g; # Start a new paragraph (if required) for these. s/([^\n])\n(Report +bugs|Email +bug +reports +to|Written +by)/$1\n\n$2/g; sub convert_option; while (length) { # Convert some standard paragraph names. if (s/^(Options|Examples): *\n//) { $sect = uc $1; next; } # Copyright section if (/^Copyright +[(\xa9]/) { $sect = 'COPYRIGHT'; $include{$sect} ||= ''; $include{$sect} .= ".PP\n" if $include{$sect}; my $copy; ($copy, $_) = split /\n\n/, $_, 2; for ($copy) { # Add back newline s/\n*$/\n/; # Convert iso9959-1 copyright symbol or (c) to nroff # character. s/^Copyright +(?:\xa9|\([Cc]\))/Copyright \\(co/mg; # Insert line breaks before additional copyright messages # and the disclaimer. s/(.)\n(Copyright |This +is +free +software)/$1\n.br\n$2/g; # Join hyphenated lines. s/([A-Za-z])-\n */$1/g; } $include{$sect} .= $copy; $_ ||= ''; next; } # Catch bug report text. if (/^(Report +bugs|Email +bug +reports +to) /) { $sect = 'REPORTING BUGS'; } # Author section. elsif (/^Written +by/) { $sect = 'AUTHOR'; } # Examples, indicated by an indented leading $, % or > are # rendered in a constant width font. if (/^( +)([\$\%>] )\S/) { my $indent = $1; my $prefix = $2; my $break = '.IP'; $include{$sect} ||= ''; while (s/^$indent\Q$prefix\E(\S.*)\n*//) { $include{$sect} .= "$break\n\\f(CW$prefix$1\\fR\n"; $break = '.br'; } next; } my $matched = ''; $include{$sect} ||= ''; # Sub-sections have a trailing colon and the second line indented. if (s/^(\S.*:) *\n / /) { $matched .= $& if %append; $include{$sect} .= qq(.SS "$1"\n); } my $indent = 0; my $content = ''; # Option with description. if (s/^( {1,10}([+-]\S.*?))(?:( +(?!-))|\n( {20,}))(\S.*)\n//) { $matched .= $& if %append; $indent = length ($4 || "$1$3"); $content = ".TP\n\x83$2\n\x83$5\n"; unless ($4) { # Indent may be different on second line. $indent = length $& if /^ {20,}/; } } # Option without description. elsif (s/^ {1,10}([+-]\S.*)\n//) { $matched .= $& if %append; $content = ".HP\n\x83$1\n"; $indent = 80; # not continued } # Indented paragraph with tag. elsif (s/^( +(\S.*?) +)(\S.*)\n//) { $matched .= $& if %append; $indent = length $1; $content = ".TP\n\x83$2\n\x83$3\n"; } # Indented paragraph. elsif (s/^( +)(\S.*)\n//) { $matched .= $& if %append; $indent = length $1; $content = ".IP\n\x83$2\n"; } # Left justified paragraph. else { s/(.*)\n//; $matched .= $& if %append; $content = ".PP\n" if $include{$sect}; $content .= "$1\n"; } # Append continuations. while (s/^ {$indent}(\S.*)\n//) { $matched .= $& if %append; $content .= "\x83$1\n" } # Move to next paragraph. s/^\n+//; for ($content) { # Leading dot and apostrophe protection. s/\x83\./\x80/g; s/\x83'/\x81/g; s/\x83//g; # Convert options. s/(^| )(-[][\w=-]+)/$1 . convert_option $2/mge; } # Check if matched paragraph contains /pat/. if (%append) { for my $pat (keys %append) { if ($matched =~ $pat) { $content .= ".PP\n" unless $append{$pat} =~ /^\./; $content .= $append{$pat}; } } } $include{$sect} .= $content; } # Refer to the real documentation. unless ($opt_no_info) { my $info_page = $opt_info || $program; $sect = 'SEE ALSO'; $include{$sect} ||= ''; $include{$sect} .= ".PP\n" if $include{$sect}; $include{$sect} .= < #include #include +#include #include "ftb_def.h" #include "ftb_client_lib_defs.h" @@ -201,6 +202,7 @@ hp = FTBNI_gethostbyname(addr->name); if (hp == NULL) { FTB_WARNING("cannot find host %s", addr->name); + close(entry->fd); return FTB_ERR_NETWORK_NO_ROUTE; } memset((void *) &sa, 0, sizeof(sa)); @@ -208,11 +210,22 @@ sa.sin_family = AF_INET; sa.sin_port = htons(addr->port); if (setsockopt(entry->fd, IPPROTO_TCP, TCP_NODELAY, (char *) &optval, sizeof(optval))) { + close(entry->fd); return FTB_ERR_NETWORK_GENERAL; } if (connect(entry->fd, (struct sockaddr *) &sa, sizeof(sa)) < 0) { + close(entry->fd); return FTB_ERR_NETWORK_NO_ROUTE; } +#ifdef FD_CLOEXEC + else { + int rc = fcntl(entry->fd, F_GETFD); + if ((rc < 0) || (fcntl(entry->fd, F_SETFD, rc | FD_CLOEXEC) < 0)) { + FTB_WARNING("Failed to set FD_CLOEXEC"); + /* non-fatal */ + } + } +#endif entry->dst = (FTB_location_id_t *) malloc(sizeof(FTB_location_id_t)); FTBNI_UTIL_WRITE(entry, &(FTBN_config_location.FTB_system_id), sizeof(uint32_t)); FTBNI_UTIL_WRITE(entry, &FTBN_my_location_id, sizeof(FTB_location_id_t)); @@ -345,6 +358,7 @@ FTBU_list_for_each(pos, FTBNI_connection_table, temp) { FTB_connection_entry_t *entry = (FTB_connection_entry_t *) pos; + close(entry->fd); free(entry->dst); free(entry); } blcr-0.8.5/aclocal.m40000664000000000000000000115160512102067776011220 00000000000000# generated automatically by aclocal 1.11.1 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2007, 2008, 2009 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_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.63],, [m4_warning([this file was generated for autoconf 2.63. 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'.])]) # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008 Free Software Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. m4_define([_LT_COPYING], [dnl # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008 Free Software Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. # # GNU Libtool is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of # the License, or (at your option) any later version. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, or # obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ]) # serial 56 LT_INIT # LT_PREREQ(VERSION) # ------------------ # Complain and exit if this libtool version is less that VERSION. m4_defun([LT_PREREQ], [m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, [m4_default([$3], [m4_fatal([Libtool version $1 or higher is required], 63)])], [$2])]) # _LT_CHECK_BUILDDIR # ------------------ # Complain if the absolute build directory name contains unusual characters m4_defun([_LT_CHECK_BUILDDIR], [case `pwd` in *\ * | *\ *) AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; esac ]) # LT_INIT([OPTIONS]) # ------------------ AC_DEFUN([LT_INIT], [AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT AC_BEFORE([$0], [LT_LANG])dnl AC_BEFORE([$0], [LT_OUTPUT])dnl AC_BEFORE([$0], [LTDL_INIT])dnl m4_require([_LT_CHECK_BUILDDIR])dnl dnl Autoconf doesn't catch unexpanded LT_ macros by default: m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 dnl unless we require an AC_DEFUNed macro: AC_REQUIRE([LTOPTIONS_VERSION])dnl AC_REQUIRE([LTSUGAR_VERSION])dnl AC_REQUIRE([LTVERSION_VERSION])dnl AC_REQUIRE([LTOBSOLETE_VERSION])dnl m4_require([_LT_PROG_LTMAIN])dnl dnl Parse OPTIONS _LT_SET_OPTIONS([$0], [$1]) # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ltmain" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' AC_SUBST(LIBTOOL)dnl _LT_SETUP # Only expand once: m4_define([LT_INIT]) ])# LT_INIT # Old names: AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PROG_LIBTOOL], []) dnl AC_DEFUN([AM_PROG_LIBTOOL], []) # _LT_CC_BASENAME(CC) # ------------------- # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. m4_defun([_LT_CC_BASENAME], [for cc_temp in $1""; do case $cc_temp in compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` ]) # _LT_FILEUTILS_DEFAULTS # ---------------------- # It is okay to use these file commands and assume they have been set # sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'. m4_defun([_LT_FILEUTILS_DEFAULTS], [: ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} ])# _LT_FILEUTILS_DEFAULTS # _LT_SETUP # --------- m4_defun([_LT_SETUP], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl _LT_DECL([], [host_alias], [0], [The host system])dnl _LT_DECL([], [host], [0])dnl _LT_DECL([], [host_os], [0])dnl dnl _LT_DECL([], [build_alias], [0], [The build system])dnl _LT_DECL([], [build], [0])dnl _LT_DECL([], [build_os], [0])dnl dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl dnl AC_REQUIRE([AC_PROG_LN_S])dnl test -z "$LN_S" && LN_S="ln -s" _LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl dnl AC_REQUIRE([LT_CMD_MAX_LEN])dnl _LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl _LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl m4_require([_LT_CMD_RELOAD])dnl m4_require([_LT_CHECK_MAGIC_METHOD])dnl m4_require([_LT_CMD_OLD_ARCHIVE])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl _LT_CONFIG_LIBTOOL_INIT([ # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi ]) if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi _LT_CHECK_OBJDIR m4_require([_LT_TAG_COMPILER])dnl _LT_PROG_ECHO_BACKSLASH case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\([["`\\]]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld="$lt_cv_prog_gnu_ld" old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o _LT_CC_BASENAME([$compiler]) # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then _LT_PATH_MAGIC fi ;; esac # Use C for the default configuration in the libtool script LT_SUPPORTED_TAG([CC]) _LT_LANG_C_CONFIG _LT_LANG_DEFAULT_CONFIG _LT_CONFIG_COMMANDS ])# _LT_SETUP # _LT_PROG_LTMAIN # --------------- # Note that this code is called both from `configure', and `config.status' # now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, # `config.status' has no value for ac_aux_dir unless we are using Automake, # so we pass a copy along to make sure it has a sensible value anyway. m4_defun([_LT_PROG_LTMAIN], [m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl _LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) ltmain="$ac_aux_dir/ltmain.sh" ])# _LT_PROG_LTMAIN # 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], [[!?.]$], [], [.]) )]) # _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) # ------------------------------------------------------------------- # CONFIGNAME is the name given to the value in the libtool script. # VARNAME is the (base) name used in the configure script. # VALUE may be 0, 1 or 2 for a computed quote escaped value based on # VARNAME. Any other value will be used directly. m4_define([_LT_DECL], [lt_if_append_uniq([lt_decl_varnames], [$2], [, ], [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], [m4_ifval([$1], [$1], [$2])]) lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) m4_ifval([$4], [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) lt_dict_add_subkey([lt_decl_dict], [$2], [tagged?], [m4_ifval([$5], [yes], [no])])]) ]) # _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) # -------------------------------------------------------- m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) # lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_tag_varnames], [_lt_decl_filter([tagged?], [yes], $@)]) # _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) # --------------------------------------------------------- m4_define([_lt_decl_filter], [m4_case([$#], [0], [m4_fatal([$0: too few arguments: $#])], [1], [m4_fatal([$0: too few arguments: $#: $1])], [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], [lt_dict_filter([lt_decl_dict], $@)])[]dnl ]) # lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) # -------------------------------------------------- m4_define([lt_decl_quote_varnames], [_lt_decl_filter([value], [1], $@)]) # lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_dquote_varnames], [_lt_decl_filter([value], [2], $@)]) # lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_varnames_tagged], [m4_assert([$# <= 2])dnl _$0(m4_quote(m4_default([$1], [[, ]])), m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) m4_define([_lt_decl_varnames_tagged], [m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) # lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_all_varnames], [_$0(m4_quote(m4_default([$1], [[, ]])), m4_if([$2], [], m4_quote(lt_decl_varnames), m4_quote(m4_shift($@))))[]dnl ]) m4_define([_lt_decl_all_varnames], [lt_join($@, lt_decl_varnames_tagged([$1], lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl ]) # _LT_CONFIG_STATUS_DECLARE([VARNAME]) # ------------------------------------ # Quote a variable value, and forward it to `config.status' so that its # declaration there will have the same value as in `configure'. VARNAME # must have a single quote delimited value for this to work. m4_define([_LT_CONFIG_STATUS_DECLARE], [$1='`$ECHO "X$][$1" | $Xsed -e "$delay_single_quote_subst"`']) # _LT_CONFIG_STATUS_DECLARATIONS # ------------------------------ # We delimit libtool config variables with single quotes, so when # we write them to config.status, we have to be sure to quote all # embedded single quotes properly. In configure, this macro expands # each variable declared with _LT_DECL (and _LT_TAGDECL) into: # # ='`$ECHO "X$" | $Xsed -e "$delay_single_quote_subst"`' m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], [m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAGS # ---------------- # Output comment and list of tags supported by the script m4_defun([_LT_LIBTOOL_TAGS], [_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl available_tags="_LT_TAGS"dnl ]) # _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) # ----------------------------------- # Extract the dictionary values for VARNAME (optionally with TAG) and # expand to a commented shell variable setting: # # # Some comment about what VAR is for. # visible_name=$lt_internal_name m4_define([_LT_LIBTOOL_DECLARE], [_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [description])))[]dnl m4_pushdef([_libtool_name], m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), [0], [_libtool_name=[$]$1], [1], [_libtool_name=$lt_[]$1], [2], [_libtool_name=$lt_[]$1], [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl ]) # _LT_LIBTOOL_CONFIG_VARS # ----------------------- # Produce commented declarations of non-tagged libtool config variables # suitable for insertion in the LIBTOOL CONFIG section of the `libtool' # script. Tagged libtool config variables (even for the LIBTOOL CONFIG # section) are produced by _LT_LIBTOOL_TAG_VARS. m4_defun([_LT_LIBTOOL_CONFIG_VARS], [m4_foreach([_lt_var], m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAG_VARS(TAG) # ------------------------- m4_define([_LT_LIBTOOL_TAG_VARS], [m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) # _LT_TAGVAR(VARNAME, [TAGNAME]) # ------------------------------ m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) # _LT_CONFIG_COMMANDS # ------------------- # Send accumulated output to $CONFIG_STATUS. Thanks to the lists of # variables for single and double quote escaping we saved from calls # to _LT_DECL, we can put quote escaped variables declarations # into `config.status', and then the shell code to quote escape them in # for loops in `config.status'. Finally, any additional code accumulated # from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. m4_defun([_LT_CONFIG_COMMANDS], [AC_PROVIDE_IFELSE([LT_OUTPUT], dnl If the libtool generation code has been placed in $CONFIG_LT, dnl instead of duplicating it all over again into config.status, dnl then we will have config.status run $CONFIG_LT later, so it dnl needs to know what name is stored there: [AC_CONFIG_COMMANDS([libtool], [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], dnl If the libtool generation code is destined for config.status, dnl expand the accumulated commands and init code now: [AC_CONFIG_COMMANDS([libtool], [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) ])#_LT_CONFIG_COMMANDS # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], [ # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' _LT_CONFIG_STATUS_DECLARATIONS LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # Quote evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_quote_varnames); do case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_dquote_varnames); do case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Fix-up fallback echo if it was mangled by the above quoting rules. case \$lt_ECHO in *'\\\[$]0 --fallback-echo"')dnl " lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\[$]0 --fallback-echo"\[$]/\[$]0 --fallback-echo"/'\` ;; esac _LT_OUTPUT_LIBTOOL_INIT ]) # LT_OUTPUT # --------- # This macro allows early generation of the libtool script (before # AC_OUTPUT is called), incase it is used in configure for compilation # tests. AC_DEFUN([LT_OUTPUT], [: ${CONFIG_LT=./config.lt} AC_MSG_NOTICE([creating $CONFIG_LT]) cat >"$CONFIG_LT" <<_LTEOF #! $SHELL # Generated by $as_me. # Run this file to recreate a libtool stub with the current configuration. lt_cl_silent=false SHELL=\${CONFIG_SHELL-$SHELL} _LTEOF cat >>"$CONFIG_LT" <<\_LTEOF AS_SHELL_SANITIZE _AS_PREPARE exec AS_MESSAGE_FD>&1 exec AS_MESSAGE_LOG_FD>>config.log { echo AS_BOX([Running $as_me.]) } >&AS_MESSAGE_LOG_FD lt_cl_help="\ \`$as_me' creates a local libtool stub from the current configuration, for use in further configure time tests before the real libtool is generated. Usage: $[0] [[OPTIONS]] -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files Report bugs to ." lt_cl_version="\ m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) configured by $[0], generated by m4_PACKAGE_STRING. Copyright (C) 2008 Free Software Foundation, Inc. This config.lt script is free software; the Free Software Foundation gives unlimited permision to copy, distribute and modify it." while test $[#] != 0 do case $[1] in --version | --v* | -V ) echo "$lt_cl_version"; exit 0 ;; --help | --h* | -h ) echo "$lt_cl_help"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --quiet | --q* | --silent | --s* | -q ) lt_cl_silent=: ;; -*) AC_MSG_ERROR([unrecognized option: $[1] Try \`$[0] --help' for more information.]) ;; *) AC_MSG_ERROR([unrecognized argument: $[1] Try \`$[0] --help' for more information.]) ;; esac shift done if $lt_cl_silent; then exec AS_MESSAGE_FD>/dev/null fi _LTEOF cat >>"$CONFIG_LT" <<_LTEOF _LT_OUTPUT_LIBTOOL_COMMANDS_INIT _LTEOF cat >>"$CONFIG_LT" <<\_LTEOF AC_MSG_NOTICE([creating $ofile]) _LT_OUTPUT_LIBTOOL_COMMANDS AS_EXIT(0) _LTEOF chmod +x "$CONFIG_LT" # configure is writing to config.log, but config.lt does its own redirection, # appending to config.log, which fails on DOS, as config.log is still kept # open by configure. Here we exec the FD to /dev/null, effectively closing # config.log, so it can be properly (re)opened and appended to by config.lt. if test "$no_create" != yes; then lt_cl_success=: test "$silent" = yes && lt_config_lt_args="$lt_config_lt_args --quiet" exec AS_MESSAGE_LOG_FD>/dev/null $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false exec AS_MESSAGE_LOG_FD>>config.log $lt_cl_success || AS_EXIT(1) fi ])# LT_OUTPUT # _LT_CONFIG(TAG) # --------------- # If TAG is the built-in tag, create an initial libtool script with a # default configuration from the untagged config vars. Otherwise add code # to config.status for appending the configuration named by TAG from the # matching tagged config vars. m4_defun([_LT_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_CONFIG_SAVE_COMMANDS([ m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl m4_if(_LT_TAG, [C], [ # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi cfgfile="${ofile}T" trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # _LT_COPYING _LT_LIBTOOL_TAGS # ### BEGIN LIBTOOL CONFIG _LT_LIBTOOL_CONFIG_VARS _LT_LIBTOOL_TAG_VARS # ### END LIBTOOL CONFIG _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac _LT_PROG_LTMAIN # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) _LT_PROG_XSI_SHELLFNS sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ], [cat <<_LT_EOF >> "$ofile" dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded dnl in a comment (ie after a #). # ### BEGIN LIBTOOL TAG CONFIG: $1 _LT_LIBTOOL_TAG_VARS(_LT_TAG) # ### END LIBTOOL TAG CONFIG: $1 _LT_EOF ])dnl /m4_if ], [m4_if([$1], [], [ PACKAGE='$PACKAGE' VERSION='$VERSION' TIMESTAMP='$TIMESTAMP' RM='$RM' ofile='$ofile'], []) ])dnl /_LT_CONFIG_SAVE_COMMANDS ])# _LT_CONFIG # LT_SUPPORTED_TAG(TAG) # --------------------- # Trace this macro to discover what tags are supported by the libtool # --tag option, using: # autoconf --trace 'LT_SUPPORTED_TAG:$1' AC_DEFUN([LT_SUPPORTED_TAG], []) # C support is built-in for now m4_define([_LT_LANG_C_enabled], []) m4_define([_LT_TAGS], []) # LT_LANG(LANG) # ------------- # Enable libtool support for the given language if not already enabled. AC_DEFUN([LT_LANG], [AC_BEFORE([$0], [LT_OUTPUT])dnl m4_case([$1], [C], [_LT_LANG(C)], [C++], [_LT_LANG(CXX)], [Java], [_LT_LANG(GCJ)], [Fortran 77], [_LT_LANG(F77)], [Fortran], [_LT_LANG(FC)], [Windows Resource], [_LT_LANG(RC)], [m4_ifdef([_LT_LANG_]$1[_CONFIG], [_LT_LANG($1)], [m4_fatal([$0: unsupported language: "$1"])])])dnl ])# LT_LANG # _LT_LANG(LANGNAME) # ------------------ m4_defun([_LT_LANG], [m4_ifdef([_LT_LANG_]$1[_enabled], [], [LT_SUPPORTED_TAG([$1])dnl m4_append([_LT_TAGS], [$1 ])dnl m4_define([_LT_LANG_]$1[_enabled], [])dnl _LT_LANG_$1_CONFIG($1)])dnl ])# _LT_LANG # _LT_LANG_DEFAULT_CONFIG # ----------------------- m4_defun([_LT_LANG_DEFAULT_CONFIG], [AC_PROVIDE_IFELSE([AC_PROG_CXX], [LT_LANG(CXX)], [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])]) AC_PROVIDE_IFELSE([AC_PROG_F77], [LT_LANG(F77)], [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])]) AC_PROVIDE_IFELSE([AC_PROG_FC], [LT_LANG(FC)], [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])]) dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal dnl pulling things in needlessly. AC_PROVIDE_IFELSE([AC_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([LT_PROG_GCJ], [LT_LANG(GCJ)], [m4_ifdef([AC_PROG_GCJ], [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([A][M_PROG_GCJ], [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([LT_PROG_GCJ], [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) AC_PROVIDE_IFELSE([LT_PROG_RC], [LT_LANG(RC)], [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) ])# _LT_LANG_DEFAULT_CONFIG # Obsolete macros: AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_CXX], []) dnl AC_DEFUN([AC_LIBTOOL_F77], []) dnl AC_DEFUN([AC_LIBTOOL_FC], []) dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) # _LT_TAG_COMPILER # ---------------- m4_defun([_LT_TAG_COMPILER], [AC_REQUIRE([AC_PROG_CC])dnl _LT_DECL([LTCC], [CC], [1], [A C compiler])dnl _LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl _LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl _LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC ])# _LT_TAG_COMPILER # _LT_COMPILER_BOILERPLATE # ------------------------ # Check for compiler boilerplate output or warnings with # the simple compiler test code. m4_defun([_LT_COMPILER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ])# _LT_COMPILER_BOILERPLATE # _LT_LINKER_BOILERPLATE # ---------------------- # Check for linker boilerplate output or warnings with # the simple link test code. m4_defun([_LT_LINKER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ])# _LT_LINKER_BOILERPLATE # _LT_REQUIRED_DARWIN_CHECKS # ------------------------- m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ case $host_os in rhapsody* | darwin*) AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) AC_CHECK_TOOL([LIPO], [lipo], [:]) AC_CHECK_TOOL([OTOOL], [otool], [:]) AC_CHECK_TOOL([OTOOL64], [otool64], [:]) _LT_DECL([], [DSYMUTIL], [1], [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) _LT_DECL([], [NMEDIT], [1], [Tool to change global to local symbols on Mac OS X]) _LT_DECL([], [LIPO], [1], [Tool to manipulate fat objects and archives on Mac OS X]) _LT_DECL([], [OTOOL], [1], [ldd/readelf like tool for Mach-O binaries on Mac OS X]) _LT_DECL([], [OTOOL64], [1], [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], [lt_cv_apple_cc_single_mod=no if test -z "${LT_MULTI_MODULE}"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -rf libconftest.dylib* rm -f conftest.* fi]) AC_CACHE_CHECK([for -exported_symbols_list linker flag], [lt_cv_ld_exported_symbols_list], [lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [lt_cv_ld_exported_symbols_list=yes], [lt_cv_ld_exported_symbols_list=no]) LDFLAGS="$save_LDFLAGS" ]) case $host_os in rhapsody* | darwin1.[[012]]) _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; 10.[[012]]*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test "$lt_cv_apple_cc_single_mod" = "yes"; then _lt_dar_single_mod='$single_module' fi if test "$lt_cv_ld_exported_symbols_list" = "yes"; then _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' fi if test "$DSYMUTIL" != ":"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac ]) # _LT_DARWIN_LINKER_FEATURES # -------------------------- # Checks for linker and compiler features on darwin m4_defun([_LT_DARWIN_LINKER_FEATURES], [ m4_require([_LT_REQUIRED_DARWIN_CHECKS]) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(whole_archive_flag_spec, $1)='' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined" case $cc_basename in ifort*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then output_verbose_link_cmd=echo _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" m4_if([$1], [CXX], [ if test "$lt_cv_apple_cc_single_mod" != "yes"; then _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" fi ],[]) else _LT_TAGVAR(ld_shlibs, $1)=no fi ]) # _LT_SYS_MODULE_PATH_AIX # ----------------------- # Links a minimal program and checks the executable # for the system default hardcoded library path. In most cases, # this is /usr/lib:/lib, but when the MPI compilers are used # the location of the communication and MPI libs are included too. # If we don't find anything, use the default library path according # to the aix ld manual. m4_defun([_LT_SYS_MODULE_PATH_AIX], [m4_require([_LT_DECL_SED])dnl AC_LINK_IFELSE(AC_LANG_PROGRAM,[ lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/ p } }' aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi],[]) if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi ])# _LT_SYS_MODULE_PATH_AIX # _LT_SHELL_INIT(ARG) # ------------------- m4_define([_LT_SHELL_INIT], [ifdef([AC_DIVERSION_NOTICE], [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], [AC_DIVERT_PUSH(NOTICE)]) $1 AC_DIVERT_POP ])# _LT_SHELL_INIT # _LT_PROG_ECHO_BACKSLASH # ----------------------- # Add some code to the start of the generated configure script which # will find an echo command which doesn't interpret backslashes. m4_defun([_LT_PROG_ECHO_BACKSLASH], [_LT_SHELL_INIT([ # Check that we are running under the correct shell. SHELL=${CONFIG_SHELL-/bin/sh} case X$lt_ECHO in X*--fallback-echo) # Remove one level of quotation (which was required for Make). ECHO=`echo "$lt_ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','` ;; esac ECHO=${lt_ECHO-echo} if test "X[$]1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X[$]1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then # Yippee, $ECHO works! : else # Restart under the correct shell. exec $SHELL "[$]0" --no-reexec ${1+"[$]@"} fi if test "X[$]1" = X--fallback-echo; then # used as fallback echo shift cat <<_LT_EOF [$]* _LT_EOF exit 0 fi # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH if test -z "$lt_ECHO"; then if test "X${echo_test_string+set}" != Xset; then # find a string as large as possible, as long as the shell can cope with it for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... if { echo_test_string=`eval $cmd`; } 2>/dev/null && { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null then break fi done fi if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then : else # The Solaris, AIX, and Digital Unix default echo programs unquote # backslashes. This makes it impossible to quote backslashes using # echo "$something" | sed 's/\\/\\\\/g' # # So, first we look for a working echo in the user's PATH. lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for dir in $PATH /usr/ucb; do IFS="$lt_save_ifs" if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then ECHO="$dir/echo" break fi done IFS="$lt_save_ifs" if test "X$ECHO" = Xecho; then # We didn't find a better echo, so look for alternatives. if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' && echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # This shell has a builtin print -r that does the trick. ECHO='print -r' elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } && test "X$CONFIG_SHELL" != X/bin/ksh; then # If we have ksh, try running configure again with it. ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} export ORIGINAL_CONFIG_SHELL CONFIG_SHELL=/bin/ksh export CONFIG_SHELL exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"} else # Try using printf. ECHO='printf %s\n' if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # Cool, printf works : elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL export CONFIG_SHELL SHELL="$CONFIG_SHELL" export SHELL ECHO="$CONFIG_SHELL [$]0 --fallback-echo" elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then ECHO="$CONFIG_SHELL [$]0 --fallback-echo" else # maybe with a smaller string... prev=: for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null then break fi prev="$cmd" done if test "$prev" != 'sed 50q "[$]0"'; then echo_test_string=`eval $prev` export echo_test_string exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"} else # Oops. We lost completely, so just stick with echo. ECHO=echo fi fi fi fi fi fi # Copy echo and quote the copy suitably for passing to libtool from # the Makefile, instead of quoting the original, which is used later. lt_ECHO=$ECHO if test "X$lt_ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then lt_ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo" fi AC_SUBST(lt_ECHO) ]) _LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) _LT_DECL([], [ECHO], [1], [An echo program that does not interpret backslashes]) ])# _LT_PROG_ECHO_BACKSLASH # _LT_ENABLE_LOCK # --------------- m4_defun([_LT_ENABLE_LOCK], [AC_ARG_ENABLE([libtool-lock], [AS_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '[#]line __oline__ "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; ppc*-*linux*|powerpc*-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, [AC_LANG_PUSH(C) AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) AC_LANG_POP]) if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; sparc*-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) LD="${LD-ld} -m elf64_sparc" ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks="$enable_libtool_lock" ])# _LT_ENABLE_LOCK # _LT_CMD_OLD_ARCHIVE # ------------------- m4_defun([_LT_CMD_OLD_ARCHIVE], [AC_CHECK_TOOL(AR, ar, false) test -z "$AR" && AR=ar test -z "$AR_FLAGS" && AR_FLAGS=cru _LT_DECL([], [AR], [1], [The archiver]) _LT_DECL([], [AR_FLAGS], [1]) AC_CHECK_TOOL(STRIP, strip, :) test -z "$STRIP" && STRIP=: _LT_DECL([], [STRIP], [1], [A symbol stripping program]) AC_CHECK_TOOL(RANLIB, ranlib, :) test -z "$RANLIB" && RANLIB=: _LT_DECL([], [RANLIB], [1], [Commands used to install an old-style archive]) # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" fi _LT_DECL([], [old_postinstall_cmds], [2]) _LT_DECL([], [old_postuninstall_cmds], [2]) _LT_TAGDECL([], [old_archive_cmds], [2], [Commands used to build an old-style archive]) ])# _LT_CMD_OLD_ARCHIVE # _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------------------- # Check whether the given compiler option works AC_DEFUN([_LT_COMPILER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$3" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi fi $RM conftest* ]) if test x"[$]$2" = xyes; then m4_if([$5], , :, [$5]) else m4_if([$6], , :, [$6]) fi ])# _LT_COMPILER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) # _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------- # Check whether the given linker option works AC_DEFUN([_LT_LINKER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $3" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&AS_MESSAGE_LOG_FD $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi else $2=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" ]) if test x"[$]$2" = xyes; then m4_if([$4], , :, [$4]) else m4_if([$5], , :, [$5]) fi ])# _LT_LINKER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) # LT_CMD_MAX_LEN #--------------- AC_DEFUN([LT_CMD_MAX_LEN], [AC_REQUIRE([AC_CANONICAL_HOST])dnl # find the maximum length of command line arguments AC_MSG_CHECKING([the maximum length of command line arguments]) AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl i=0 teststring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8 ; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test "X"`$SHELL [$]0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \ = "XX$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac ]) if test -n $lt_cv_sys_max_cmd_len ; then AC_MSG_RESULT($lt_cv_sys_max_cmd_len) else AC_MSG_RESULT(none) fi max_cmd_len=$lt_cv_sys_max_cmd_len _LT_DECL([], [max_cmd_len], [0], [What is the maximum length of a command?]) ])# LT_CMD_MAX_LEN # Old name: AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) # _LT_HEADER_DLFCN # ---------------- m4_defun([_LT_HEADER_DLFCN], [AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl ])# _LT_HEADER_DLFCN # _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) # ---------------------------------------------------------------- m4_defun([_LT_TRY_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test "$cross_compiling" = yes; then : [$4] else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF [#line __oline__ "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } else puts (dlerror ()); return status; }] _LT_EOF if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) $1 ;; x$lt_dlneed_uscore) $2 ;; x$lt_dlunknown|x*) $3 ;; esac else : # compilation failed $3 fi fi rm -fr conftest* ])# _LT_TRY_DLOPEN_SELF # LT_SYS_DLOPEN_SELF # ------------------ AC_DEFUN([LT_SYS_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ]) ;; *) AC_CHECK_FUNC([shl_load], [lt_cv_dlopen="shl_load"], [AC_CHECK_LIB([dld], [shl_load], [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"], [AC_CHECK_FUNC([dlopen], [lt_cv_dlopen="dlopen"], [AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], [AC_CHECK_LIB([svld], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], [AC_CHECK_LIB([dld], [dld_link], [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"]) ]) ]) ]) ]) ]) ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" AC_CACHE_CHECK([whether a program can dlopen itself], lt_cv_dlopen_self, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) ]) if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" AC_CACHE_CHECK([whether a statically linked program can dlopen itself], lt_cv_dlopen_self_static, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) ]) fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi _LT_DECL([dlopen_support], [enable_dlopen], [0], [Whether dlopen is supported]) _LT_DECL([dlopen_self], [enable_dlopen_self], [0], [Whether dlopen of programs is supported]) _LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], [Whether dlopen of statically linked programs is supported]) ])# LT_SYS_DLOPEN_SELF # Old name: AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) # _LT_COMPILER_C_O([TAGNAME]) # --------------------------- # Check to see if options -c and -o are simultaneously supported by compiler. # This macro does not hard code the compiler like AC_PROG_CC_C_O. m4_defun([_LT_COMPILER_C_O], [m4_require([_LT_DECL_SED])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes fi fi chmod u+w . 2>&AS_MESSAGE_LOG_FD $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* ]) _LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], [Does compiler simultaneously support -c and -o options?]) ])# _LT_COMPILER_C_O # _LT_COMPILER_FILE_LOCKS([TAGNAME]) # ---------------------------------- # Check to see if we can do hard links to lock some files if needed m4_defun([_LT_COMPILER_FILE_LOCKS], [m4_require([_LT_ENABLE_LOCK])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_COMPILER_C_O([$1]) hard_links="nottested" if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user AC_MSG_CHECKING([if we can lock with hard links]) hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no AC_MSG_RESULT([$hard_links]) if test "$hard_links" = no; then AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) need_locks=warn fi else need_locks=no fi _LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) ])# _LT_COMPILER_FILE_LOCKS # _LT_CHECK_OBJDIR # ---------------- m4_defun([_LT_CHECK_OBJDIR], [AC_CACHE_CHECK([for objdir], [lt_cv_objdir], [rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null]) objdir=$lt_cv_objdir _LT_DECL([], [objdir], [0], [The name of the directory that contains temporary libtool files])dnl m4_pattern_allow([LT_OBJDIR])dnl AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/", [Define to the sub-directory in which libtool stores uninstalled libraries.]) ])# _LT_CHECK_OBJDIR # _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) # -------------------------------------- # Check hardcoding attributes. m4_defun([_LT_LINKER_HARDCODE_LIBPATH], [AC_MSG_CHECKING([how to hardcode library paths into programs]) _LT_TAGVAR(hardcode_action, $1)= if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || test -n "$_LT_TAGVAR(runpath_var, $1)" || test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then # We can hardcode non-existent directories. if test "$_LT_TAGVAR(hardcode_direct, $1)" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no && test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then # Linking always hardcodes the temporary library directory. _LT_TAGVAR(hardcode_action, $1)=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. _LT_TAGVAR(hardcode_action, $1)=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. _LT_TAGVAR(hardcode_action, $1)=unsupported fi AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) if test "$_LT_TAGVAR(hardcode_action, $1)" = relink || test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi _LT_TAGDECL([], [hardcode_action], [0], [How to hardcode a shared library path into an executable]) ])# _LT_LINKER_HARDCODE_LIBPATH # _LT_CMD_STRIPLIB # ---------------- m4_defun([_LT_CMD_STRIPLIB], [m4_require([_LT_DECL_EGREP]) striplib= old_striplib= AC_MSG_CHECKING([whether stripping libraries is possible]) if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" AC_MSG_RESULT([yes]) else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" old_striplib="$STRIP -S" AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi ;; *) AC_MSG_RESULT([no]) ;; esac fi _LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) _LT_DECL([], [striplib], [1]) ])# _LT_CMD_STRIPLIB # _LT_SYS_DYNAMIC_LINKER([TAG]) # ----------------------------- # PORTME Fill in your ld.so characteristics m4_defun([_LT_SYS_DYNAMIC_LINKER], [AC_REQUIRE([AC_CANONICAL_HOST])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_OBJDUMP])dnl m4_require([_LT_DECL_SED])dnl AC_MSG_CHECKING([dynamic linker characteristics]) m4_if([$1], [], [ if test "$GCC" = yes; then case $host_os in darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"` if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'` else lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path/$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" else test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO $lt_tmp_lt_search_path_spec | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo="/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[[lt_foo]]++; } if (lt_freq[[lt_foo]] == 1) { print lt_foo; } }'` sys_lib_search_path_spec=`$ECHO $lt_search_path_spec` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi]) library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix[[4-9]]*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[[01]] | aix4.[[01]].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[[45]]*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[[123]]*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[[01]]* | freebsdelf3.[[01]]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; interix[[3-9]]*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux* | k*bsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], [shlibpath_overrides_runpath=yes])]) LDFLAGS=$save_LDFLAGS libdir=$save_libdir # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Add ABI-specific directories to the system library path. sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib" # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $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 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[[89]] | openbsd2.[[89]].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac AC_MSG_RESULT([$dynamic_linker]) test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" fi _LT_DECL([], [variables_saved_for_relink], [1], [Variables whose values should be saved in libtool wrapper scripts and restored at link time]) _LT_DECL([], [need_lib_prefix], [0], [Do we need the "lib" prefix for modules?]) _LT_DECL([], [need_version], [0], [Do we need a version for libraries?]) _LT_DECL([], [version_type], [0], [Library versioning type]) _LT_DECL([], [runpath_var], [0], [Shared library runtime path variable]) _LT_DECL([], [shlibpath_var], [0],[Shared library path variable]) _LT_DECL([], [shlibpath_overrides_runpath], [0], [Is shlibpath searched before the hard-coded library search path?]) _LT_DECL([], [libname_spec], [1], [Format of library name prefix]) _LT_DECL([], [library_names_spec], [1], [[List of archive names. First name is the real one, the rest are links. The last name is the one that the linker finds with -lNAME]]) _LT_DECL([], [soname_spec], [1], [[The coded name of the library, if different from the real name]]) _LT_DECL([], [postinstall_cmds], [2], [Command to use after installation of a shared archive]) _LT_DECL([], [postuninstall_cmds], [2], [Command to use after uninstallation of a shared archive]) _LT_DECL([], [finish_cmds], [2], [Commands used to finish a libtool library installation in a directory]) _LT_DECL([], [finish_eval], [1], [[As "finish_cmds", except a single script fragment to be evaled but not shown]]) _LT_DECL([], [hardcode_into_libs], [0], [Whether we should hardcode library paths into libraries]) _LT_DECL([], [sys_lib_search_path_spec], [2], [Compile-time system search path for libraries]) _LT_DECL([], [sys_lib_dlsearch_path_spec], [2], [Run-time system search path for libraries]) ])# _LT_SYS_DYNAMIC_LINKER # _LT_PATH_TOOL_PREFIX(TOOL) # -------------------------- # find a file program which can recognize shared library AC_DEFUN([_LT_PATH_TOOL_PREFIX], [m4_require([_LT_DECL_EGREP])dnl AC_MSG_CHECKING([for $1]) AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, [case $MAGIC_CMD in [[\\/*] | ?:[\\/]*]) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR dnl $ac_dummy forces splitting on constant user-supplied paths. dnl POSIX.2 word splitting is done only on the output of word expansions, dnl not every word. This closes a longstanding sh security hole. ac_dummy="m4_if([$2], , $PATH, [$2])" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$1; then lt_cv_path_MAGIC_CMD="$ac_dir/$1" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac]) MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then AC_MSG_RESULT($MAGIC_CMD) else AC_MSG_RESULT(no) fi _LT_DECL([], [MAGIC_CMD], [0], [Used to examine libraries when file_magic_cmd begins with "file"])dnl ])# _LT_PATH_TOOL_PREFIX # Old name: AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) # _LT_PATH_MAGIC # -------------- # find a file program which can recognize a shared library m4_defun([_LT_PATH_MAGIC], [_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) else MAGIC_CMD=: fi fi ])# _LT_PATH_MAGIC # LT_PATH_LD # ---------- # find the pathname to the GNU or non-GNU linker AC_DEFUN([LT_PATH_LD], [AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl AC_ARG_WITH([gnu-ld], [AS_HELP_STRING([--with-gnu-ld], [assume the C compiler uses GNU ld @<:@default=no@:>@])], [test "$withval" = no || with_gnu_ld=yes], [with_gnu_ld=no])dnl ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by $CC]) case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [[\\/]]* | ?:[[\\/]]*) re_direlt='/[[^/]][[^/]]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL(lt_cv_path_LD, [if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &1 /dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; gnu*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'] lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[[3-9]]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be Linux ELF. linux* | k*bsd*-gnu) 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_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown _LT_DECL([], [deplibs_check_method], [1], [Method to check whether dependent libraries are shared objects]) _LT_DECL([], [file_magic_cmd], [1], [Command to use when deplibs_check_method == "file_magic"]) ])# _LT_CHECK_MAGIC_METHOD # LT_PATH_NM # ---------- # find the pathname to a BSD- or MS-compatible name lister AC_DEFUN([LT_PATH_NM], [AC_REQUIRE([AC_PROG_CC])dnl AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, [if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else lt_nm_to_check="${ac_tool_prefix}nm" if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. tmp_nm="$ac_dir/$lt_tmp_nm" if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS="$lt_save_ifs" done : ${lt_cv_path_NM=no} fi]) if test "$lt_cv_path_NM" != "no"; then NM="$lt_cv_path_NM" else # Didn't find any BSD compatible name lister, look for dumpbin. AC_CHECK_TOOLS(DUMPBIN, ["dumpbin -symbols" "link -dump -symbols"], :) AC_SUBST([DUMPBIN]) if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" fi fi test -z "$NM" && NM=nm AC_SUBST([NM]) _LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], [lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:__oline__: $ac_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:__oline__: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:__oline__: output\"" >&AS_MESSAGE_LOG_FD) cat conftest.out >&AS_MESSAGE_LOG_FD if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest*]) ])# LT_PATH_NM # Old names: AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_PROG_NM], []) dnl AC_DEFUN([AC_PROG_NM], []) # LT_LIB_M # -------- # check for math library AC_DEFUN([LT_LIB_M], [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case $host in *-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*) # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") ;; *) AC_CHECK_LIB(m, cos, LIBM="-lm") ;; esac AC_SUBST([LIBM]) ])# LT_LIB_M # Old name: AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_CHECK_LIBM], []) # _LT_COMPILER_NO_RTTI([TAGNAME]) # ------------------------------- m4_defun([_LT_COMPILER_NO_RTTI], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= if test "$GCC" = yes; then _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], lt_cv_prog_compiler_rtti_exceptions, [-fno-rtti -fno-exceptions], [], [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) fi _LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], [Compiler flag to turn off builtin functions]) ])# _LT_COMPILER_NO_RTTI # _LT_CMD_GLOBAL_SYMBOLS # ---------------------- m4_defun([_LT_CMD_GLOBAL_SYMBOLS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([LT_PATH_NM])dnl AC_REQUIRE([LT_PATH_LD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_TAG_COMPILER])dnl # Check for command to grab the raw symbol name followed by C symbol from nm. AC_MSG_CHECKING([command to parse $NM output from $compiler object]) AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [ # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[[BCDEGRST]]' # Regexp to match symbols that can be accessed directly from C. sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[[BCDT]]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[[ABCDGISTW]]' ;; hpux*) if test "$host_cpu" = ia64; then symcode='[[ABCDEGRST]]' fi ;; irix* | nonstopux*) symcode='[[BCDEGRST]]' ;; osf*) symcode='[[BCDEGQRST]]' ;; solaris*) symcode='[[BDRT]]' ;; sco3.2v5*) symcode='[[DT]]' ;; sysv4.2uw2*) symcode='[[DT]]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[[ABDT]]' ;; sysv4) symcode='[[DFNSTU]]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[[ABCDGIRSTW]]' ;; esac # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'" lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function # and D for any global variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK ['"\ " {last_section=section; section=\$ 3};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ " {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ " s[1]~/^[@?]/{print s[1], s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx]" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if AC_TRY_EVAL(ac_compile); then # Now try to grab the symbols. nlist=conftest.nm if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ const struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[[]] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_save_LIBS="$LIBS" lt_save_CFLAGS="$CFLAGS" LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS="$lt_save_LIBS" CFLAGS="$lt_save_CFLAGS" else echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD fi else echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done ]) if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then AC_MSG_RESULT(failed) else AC_MSG_RESULT(ok) fi _LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], [Take the output of nm and produce a listing of raw symbols and C names]) _LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], [Transform the output of nm in a proper C declaration]) _LT_DECL([global_symbol_to_c_name_address], [lt_cv_sys_global_symbol_to_c_name_address], [1], [Transform the output of nm in a C name address pair]) _LT_DECL([global_symbol_to_c_name_address_lib_prefix], [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], [Transform the output of nm in a C name address pair when lib prefix is needed]) ]) # _LT_CMD_GLOBAL_SYMBOLS # _LT_COMPILER_PIC([TAGNAME]) # --------------------------- m4_defun([_LT_COMPILER_PIC], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_wl, $1)= _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)= AC_MSG_CHECKING([for $compiler option to produce PIC]) m4_if([$1], [CXX], [ # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else case $host_os in aix[[4-9]]*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; dgux*) case $cc_basename in ec++*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; ghcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; freebsd* | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' if test "$host_cpu" != ia64; then _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' fi ;; aCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu) case $cc_basename in KCC*) # KAI C++ Compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; ecpc* ) # old Intel C++ for x86_64 which still supported -KPIC. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; icpc* ) # Intel C++, used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgCC* | pgcpp*) # Portland Group C++ compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xlc* | xlC*) # IBM XL 8.0 on PPC _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' ;; *) ;; esac ;; netbsd*) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; cxx*) # Digital/Compaq C++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; lcc*) # Lucid _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; *) ;; esac ;; vxworks*) ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ], [ if test "$GCC" = yes; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; hpux9* | hpux10* | hpux11*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC (with -KPIC) is the default. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; linux* | k*bsd*-gnu) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # Lahey Fortran 8.1. lf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' ;; pgcc* | pgf77* | pgf90* | pgf95*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; ccc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All Alpha code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xl*) # IBM XL C 8.0/Fortran 10.1 on PPC _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; *Sun\ F*) # Sun Fortran 8.3 passes all unrecognized flags to the linker _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='' ;; esac ;; esac ;; newsos6) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All OSF/1 code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; rdos*) _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; solaris*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' case $cc_basename in f77* | f90* | f95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; *) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; esac ;; sunos4*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; unicos*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; uts4*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ]) case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" ;; esac AC_MSG_RESULT([$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) _LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], [How to pass a linker flag through the compiler]) # # Check to make sure the PIC flag actually works. # if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works], [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)], [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [], [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in "" | " "*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;; esac], [_LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) fi _LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], [Additional compiler flags for building library objects]) # # Check to make sure the static flag actually works. # wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\" _LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1), $lt_tmp_static_flag, [], [_LT_TAGVAR(lt_prog_compiler_static, $1)=]) _LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], [Compiler flag to prevent dynamic linking]) ])# _LT_COMPILER_PIC # _LT_LINKER_SHLIBS([TAGNAME]) # ---------------------------- # See if the linker supports building shared libraries. m4_defun([_LT_LINKER_SHLIBS], [AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) m4_if([$1], [CXX], [ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' case $host_os in aix[[4-9]]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" ;; cygwin* | mingw* | cegcc*) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] ], [ runpath_var= _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_cmds, $1)= _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(old_archive_from_new_cmds, $1)= _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)= _LT_TAGVAR(thread_safe_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list _LT_TAGVAR(include_expsyms, $1)= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. dnl Note also adjust exclude_expsyms for C++ above. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; esac _LT_TAGVAR(ld_shlibs, $1)=yes if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi supports_anon_versioning=no case `$LD -v 2>&1` in *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[[3-9]]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to modify your PATH *** so that a non-GNU linker is found, and then restart. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test "$tmp_diet" = no then tmp_addflag= tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 _LT_TAGVAR(whole_archive_flag_spec, $1)= tmp_sharedflag='--shared' ;; xl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi case $cc_basename in xlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; sunos4*) _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then runpath_var= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. _LT_TAGVAR(hardcode_minus_L, $1)=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. _LT_TAGVAR(hardcode_direct, $1)=unsupported fi ;; aix[[4-9]]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' if test "$GCC" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; bsdi[[45]]*) _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' # FIXME: Should let the user specify the lib program. _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' _LT_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; freebsd1*) _LT_TAGVAR(ld_shlibs, $1)=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; hpux9*) if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; hpux10*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes fi ;; hpux11*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac fi if test "$with_gnu_ld" = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" AC_LINK_IFELSE(int foo(void) {}, _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' ) LDFLAGS="$save_LDFLAGS" else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes _LT_TAGVAR(link_all_deplibs, $1)=yes ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; newsos6) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *nto* | *qnx*) ;; openbsd*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' else case $host_os in openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' ;; esac fi else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$ECHO DATA >> $output_objdir/$libname.def~$ECHO " SINGLE NONSHARED" >> $output_objdir/$libname.def~$ECHO EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; solaris*) _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' if test "$GCC" = yes; then wlarc='${wl}' _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='${wl}' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. GCC discards it without `$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test "$GCC" = yes; then _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' fi ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4) case $host_vendor in sni) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' _LT_TAGVAR(hardcode_direct, $1)=no ;; motorola) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4.3*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes _LT_TAGVAR(ld_shlibs, $1)=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(ld_shlibs, $1)=no ;; esac if test x$host_vendor = xsni; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym' ;; esac fi fi ]) AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld _LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl _LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl _LT_DECL([], [extract_expsyms_cmds], [2], [The commands to extract the exported symbol list from a shared archive]) # # Do we need to explicitly link libc? # case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in x|xyes) # Assume -lc should be added _LT_TAGVAR(archive_cmds_need_lc, $1)=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $_LT_TAGVAR(archive_cmds, $1) in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. AC_MSG_CHECKING([whether -lc should be explicitly linked in]) $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if AC_TRY_EVAL(ac_compile) 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) _LT_TAGVAR(allow_undefined_flag, $1)= if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) then _LT_TAGVAR(archive_cmds_need_lc, $1)=no else _LT_TAGVAR(archive_cmds_need_lc, $1)=yes fi _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* AC_MSG_RESULT([$_LT_TAGVAR(archive_cmds_need_lc, $1)]) ;; esac fi ;; esac _LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], [Whether or not to add -lc for building shared libraries]) _LT_TAGDECL([allow_libtool_libs_with_static_runtimes], [enable_shared_with_static_runtimes], [0], [Whether or not to disallow shared libs when runtime libs are static]) _LT_TAGDECL([], [export_dynamic_flag_spec], [1], [Compiler flag to allow reflexive dlopens]) _LT_TAGDECL([], [whole_archive_flag_spec], [1], [Compiler flag to generate shared objects directly from archives]) _LT_TAGDECL([], [compiler_needs_object], [1], [Whether the compiler copes with passing no objects directly]) _LT_TAGDECL([], [old_archive_from_new_cmds], [2], [Create an old-style archive from a shared archive]) _LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], [Create a temporary old-style archive to link instead of a shared archive]) _LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) _LT_TAGDECL([], [archive_expsym_cmds], [2]) _LT_TAGDECL([], [module_cmds], [2], [Commands used to build a loadable module if different from building a shared archive.]) _LT_TAGDECL([], [module_expsym_cmds], [2]) _LT_TAGDECL([], [with_gnu_ld], [1], [Whether we are building with GNU ld or not]) _LT_TAGDECL([], [allow_undefined_flag], [1], [Flag that allows shared libraries with undefined symbols to be built]) _LT_TAGDECL([], [no_undefined_flag], [1], [Flag that enforces no undefined symbols]) _LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], [Flag to hardcode $libdir into a binary during linking. This must work even if $libdir does not exist]) _LT_TAGDECL([], [hardcode_libdir_flag_spec_ld], [1], [[If ld is used when linking, flag to hardcode $libdir into a binary during linking. This must work even if $libdir does not exist]]) _LT_TAGDECL([], [hardcode_libdir_separator], [1], [Whether we need a single "-rpath" flag with a separated argument]) _LT_TAGDECL([], [hardcode_direct], [0], [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_direct_absolute], [0], [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the resulting binary and the resulting library dependency is "absolute", i.e impossible to change by setting ${shlibpath_var} if the library is relocated]) _LT_TAGDECL([], [hardcode_minus_L], [0], [Set to "yes" if using the -LDIR flag during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_shlibpath_var], [0], [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_automatic], [0], [Set to "yes" if building a shared library automatically hardcodes DIR into the library and all subsequent libraries and executables linked against it]) _LT_TAGDECL([], [inherit_rpath], [0], [Set to yes if linker adds runtime paths of dependent libraries to runtime path list]) _LT_TAGDECL([], [link_all_deplibs], [0], [Whether libtool must link a program against all its dependency libraries]) _LT_TAGDECL([], [fix_srcfile_path], [1], [Fix the shell variable $srcfile for the compiler]) _LT_TAGDECL([], [always_export_symbols], [0], [Set to "yes" if exported symbols are required]) _LT_TAGDECL([], [export_symbols_cmds], [2], [The commands to list exported symbols]) _LT_TAGDECL([], [exclude_expsyms], [1], [Symbols that should not be listed in the preloaded symbols]) _LT_TAGDECL([], [include_expsyms], [1], [Symbols that must always be exported]) _LT_TAGDECL([], [prelink_cmds], [2], [Commands necessary for linking programs (against libraries) with templates]) _LT_TAGDECL([], [file_list_spec], [1], [Specify filename containing input files]) dnl FIXME: Not yet implemented dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], dnl [Compiler flag to generate thread safe objects]) ])# _LT_LINKER_SHLIBS # _LT_LANG_C_CONFIG([TAG]) # ------------------------ # Ensure that the configuration variables for a C compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to `libtool'. m4_defun([_LT_LANG_C_CONFIG], [m4_require([_LT_DECL_EGREP])dnl lt_save_CC="$CC" AC_LANG_PUSH(C) # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' _LT_TAG_COMPILER # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) LT_SYS_DLOPEN_SELF _LT_CMD_STRIPLIB # Report which library types will actually be built AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_CONFIG($1) fi AC_LANG_POP CC="$lt_save_CC" ])# _LT_LANG_C_CONFIG # _LT_PROG_CXX # ------------ # Since AC_PROG_CXX is broken, in that it returns g++ if there is no c++ # compiler, we have our own version here. m4_defun([_LT_PROG_CXX], [ pushdef([AC_MSG_ERROR], [_lt_caught_CXX_error=yes]) AC_PROG_CXX if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then AC_PROG_CXXCPP else _lt_caught_CXX_error=yes fi popdef([AC_MSG_ERROR]) ])# _LT_PROG_CXX dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([_LT_PROG_CXX], []) # _LT_LANG_CXX_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a C++ compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to `libtool'. m4_defun([_LT_LANG_CXX_CONFIG], [AC_REQUIRE([_LT_PROG_CXX])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl AC_LANG_PUSH(C++) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the CXX compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_caught_CXX_error" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then # We don't want -fno-exception when compiling C++ code, so set the # no_builtin_flag separately if test "$GXX" = yes; then _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' else _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= fi if test "$GXX" = yes; then # Set up default GNU C++ configuration LT_PATH_LD # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test "$with_gnu_ld" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='${wl}' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) _LT_TAGVAR(ld_shlibs, $1)=yes case $host_os in aix3*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aix[[4-9]]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' if test "$GXX" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to # export. _LT_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an empty # executable. _LT_SYS_MODULE_PATH_AIX _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared # libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; freebsd[[12]]*) # C++ shared libraries reported to be fairly broken before # switch to ELF _LT_TAGVAR(ld_shlibs, $1)=no ;; freebsd-elf*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; freebsd* | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions _LT_TAGVAR(ld_shlibs, $1)=yes ;; gnu*) ;; hpux9*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' ;; *) if test "$GXX" = yes; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; hpux10*|hpux11*) if test $with_gnu_ld = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) ;; *) _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' ;; *) if test "$GXX" = yes; then if test $with_gnu_ld = no; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` -o $lib' fi fi _LT_TAGVAR(link_all_deplibs, $1)=yes ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes ;; linux* | k*bsd*-gnu) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc* | ecpc* ) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; esac _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ;; pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in *pgCC\ [[1-5]]* | *pgcpp\ [[1-5]]*) _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ compile_command="$compile_command `find $tpldir -name \*.o | $NL2SP`"' _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | $NL2SP`~ $RANLIB $oldlib' _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; *) # Version 6 will use weak symbols _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' ;; cxx*) # Compaq C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' ;; xl*) # IBM XL 8.0 on PPC, with GNU ld _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. output_verbose_link_cmd='echo' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; esac ;; esac ;; lynxos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; m88k*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; *nto* | *qnx*) _LT_TAGVAR(ld_shlibs, $1)=yes ;; openbsd2*) # C++ shared libraries are fairly broken _LT_TAGVAR(ld_shlibs, $1)=no ;; openbsd*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi output_verbose_link_cmd=echo else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # the KAI C++ compiler. case $host in osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; esac ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; cxx*) case $host in osf3*) _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && $ECHO "X${wl}-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' ;; *) _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~ $RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' ;; esac _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' case $host in osf3*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; solaris*) case $cc_basename in CC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(archive_cmds_need_lc,$1)=yes _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. # Supported since Solaris 2.6 (maybe 2.5.1?) _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes output_verbose_link_cmd='echo' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' ;; esac fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_TAGVAR(GCC, $1)="$GXX" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" CC=$lt_save_CC LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld fi # test "$_lt_caught_CXX_error" != yes AC_LANG_POP ])# _LT_LANG_CXX_CONFIG # _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) # --------------------------------- # Figure out "hidden" library dependencies from verbose # compiler output when linking a shared library. # Parse the compiler output and extract the necessary # objects, libraries and library flags. m4_defun([_LT_SYS_HIDDEN_LIBDEPS], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl # Dependencies to place before and after the object being linked: _LT_TAGVAR(predep_objects, $1)= _LT_TAGVAR(postdep_objects, $1)= _LT_TAGVAR(predeps, $1)= _LT_TAGVAR(postdeps, $1)= _LT_TAGVAR(compiler_lib_search_path, $1)= dnl we can't use the lt_simple_compile_test_code here, dnl because it contains code intended for an executable, dnl not a library. It's possible we should let each dnl tag define a new lt_????_link_test_code variable, dnl but it's only used here... m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF int a; void foo (void) { a = 0; } _LT_EOF ], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF class Foo { public: Foo (void) { a = 0; } private: int a; }; _LT_EOF ], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer*4 a a=0 return end _LT_EOF ], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer a a=0 return end _LT_EOF ], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF public class foo { private int a; public void bar (void) { a = 0; } }; _LT_EOF ]) dnl Parse the compiler output and extract the necessary dnl objects, libraries and library flags. if AC_TRY_EVAL(ac_compile); then # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do case $p in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test $p = "-L" || test $p = "-R"; then prev=$p continue else prev= fi if test "$pre_test_object_deps_done" = no; then case $p in -L* | -R*) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}" else _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}" fi ;; # The "-l" case would never come before the object being # linked, so don't bother handling this case. esac else if test -z "$_LT_TAGVAR(postdeps, $1)"; then _LT_TAGVAR(postdeps, $1)="${prev}${p}" else _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}" fi fi ;; *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test "$pre_test_object_deps_done" = no; then if test -z "$_LT_TAGVAR(predep_objects, $1)"; then _LT_TAGVAR(predep_objects, $1)="$p" else _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" fi else if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then _LT_TAGVAR(postdep_objects, $1)="$p" else _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling $1 test program" fi $RM -f confest.$objext # PORTME: override above test on systems where it is broken m4_if([$1], [CXX], [case $host_os in interix[[3-9]]*) # Interix 3.5 installs completely hosed .la files for C++, so rather than # hack all around it, let's just trust "g++" to DTRT. _LT_TAGVAR(predep_objects,$1)= _LT_TAGVAR(postdep_objects,$1)= _LT_TAGVAR(postdeps,$1)= ;; linux*) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac if test "$solaris_use_stlport4" != yes; then _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' fi ;; esac ;; solaris*) case $cc_basename in CC*) # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac # Adding this requires a known-good setup of shared libraries for # Sun compiler versions before 5.6, else PIC objects from an old # archive will be linked into the output, leading to subtle bugs. if test "$solaris_use_stlport4" != yes; then _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' fi ;; esac ;; esac ]) case " $_LT_TAGVAR(postdeps, $1) " in *" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; esac _LT_TAGVAR(compiler_lib_search_dirs, $1)= if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` fi _LT_TAGDECL([], [compiler_lib_search_dirs], [1], [The directories searched by this compiler when creating a shared library]) _LT_TAGDECL([], [predep_objects], [1], [Dependencies to place before and after the objects being linked to create a shared library]) _LT_TAGDECL([], [postdep_objects], [1]) _LT_TAGDECL([], [predeps], [1]) _LT_TAGDECL([], [postdeps], [1]) _LT_TAGDECL([], [compiler_lib_search_path], [1], [The library search path used internally by the compiler when linking a shared library]) ])# _LT_SYS_HIDDEN_LIBDEPS # _LT_PROG_F77 # ------------ # Since AC_PROG_F77 is broken, in that it returns the empty string # if there is no fortran compiler, we have our own version here. m4_defun([_LT_PROG_F77], [ pushdef([AC_MSG_ERROR], [_lt_disable_F77=yes]) AC_PROG_F77 if test -z "$F77" || test "X$F77" = "Xno"; then _lt_disable_F77=yes fi popdef([AC_MSG_ERROR]) ])# _LT_PROG_F77 dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([_LT_PROG_F77], []) # _LT_LANG_F77_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a Fortran 77 compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_F77_CONFIG], [AC_REQUIRE([_LT_PROG_F77])dnl AC_LANG_PUSH(Fortran 77) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for f77 test sources. ac_ext=f # Object file extension for compiled f77 test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the F77 compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_disable_F77" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC CC=${F77-"f77"} compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) GCC=$G77 if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)="$G77" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC="$lt_save_CC" fi # test "$_lt_disable_F77" != yes AC_LANG_POP ])# _LT_LANG_F77_CONFIG # _LT_PROG_FC # ----------- # Since AC_PROG_FC is broken, in that it returns the empty string # if there is no fortran compiler, we have our own version here. m4_defun([_LT_PROG_FC], [ pushdef([AC_MSG_ERROR], [_lt_disable_FC=yes]) AC_PROG_FC if test -z "$FC" || test "X$FC" = "Xno"; then _lt_disable_FC=yes fi popdef([AC_MSG_ERROR]) ])# _LT_PROG_FC dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([_LT_PROG_FC], []) # _LT_LANG_FC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for a Fortran compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_FC_CONFIG], [AC_REQUIRE([_LT_PROG_FC])dnl AC_LANG_PUSH(Fortran) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for fc test sources. ac_ext=${ac_fc_srcext-f} # Object file extension for compiled fc test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the FC compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_disable_FC" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC CC=${FC-"f95"} compiler=$CC GCC=$ac_cv_fc_compiler_gnu _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC="$lt_save_CC" fi # test "$_lt_disable_FC" != yes AC_LANG_POP ])# _LT_LANG_FC_CONFIG # _LT_LANG_GCJ_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Java Compiler compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_GCJ_CONFIG], [AC_REQUIRE([LT_PROG_GCJ])dnl AC_LANG_SAVE # Source file extension for Java test sources. ac_ext=java # Object file extension for compiled Java test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="class foo {}" # Code to be used in simple link tests lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC GCC=yes CC=${GCJ-"gcj"} compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)="$LD" _LT_CC_BASENAME([$compiler]) # GCJ did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC="$lt_save_CC" ])# _LT_LANG_GCJ_CONFIG # _LT_LANG_RC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for the Windows resource compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_RC_CONFIG], [AC_REQUIRE([LT_PROG_RC])dnl AC_LANG_SAVE # Source file extension for RC test sources. ac_ext=rc # Object file extension for compiled RC test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' # Code to be used in simple link tests lt_simple_link_test_code="$lt_simple_compile_test_code" # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC GCC= CC=${RC-"windres"} compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes if test -n "$compiler"; then : _LT_CONFIG($1) fi GCC=$lt_save_GCC AC_LANG_RESTORE CC="$lt_save_CC" ])# _LT_LANG_RC_CONFIG # LT_PROG_GCJ # ----------- AC_DEFUN([LT_PROG_GCJ], [m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], [AC_CHECK_TOOL(GCJ, gcj,) test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" AC_SUBST(GCJFLAGS)])])[]dnl ]) # Old name: AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_GCJ], []) # LT_PROG_RC # ---------- AC_DEFUN([LT_PROG_RC], [AC_CHECK_TOOL(RC, windres,) ]) # Old name: AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_RC], []) # _LT_DECL_EGREP # -------------- # If we don't have a new enough Autoconf to choose the best grep # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_EGREP], [AC_REQUIRE([AC_PROG_EGREP])dnl AC_REQUIRE([AC_PROG_FGREP])dnl test -z "$GREP" && GREP=grep _LT_DECL([], [GREP], [1], [A grep program that handles long lines]) _LT_DECL([], [EGREP], [1], [An ERE matcher]) _LT_DECL([], [FGREP], [1], [A literal string matcher]) dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too AC_SUBST([GREP]) ]) # _LT_DECL_OBJDUMP # -------------- # If we don't have a new enough Autoconf to choose the best objdump # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_OBJDUMP], [AC_CHECK_TOOL(OBJDUMP, objdump, false) test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) AC_SUBST([OBJDUMP]) ]) # _LT_DECL_SED # ------------ # Check for a fully-functional sed program, that truncates # as few characters as possible. Prefer GNU sed if found. m4_defun([_LT_DECL_SED], [AC_PROG_SED test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" _LT_DECL([], [SED], [1], [A sed program that does not truncate output]) _LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"], [Sed that helps us avoid accidentally triggering echo(1) options like -n]) ])# _LT_DECL_SED m4_ifndef([AC_PROG_SED], [ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_SED. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # m4_defun([AC_PROG_SED], [AC_MSG_CHECKING([for a sed that does not truncate output]) AC_CACHE_VAL(lt_cv_path_SED, [# Loop through the user's path and test for sed and gsed. # Then use that list of sed's as ones to test for truncation. as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for lt_ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" fi done done done IFS=$as_save_IFS lt_ac_max=0 lt_ac_count=0 # Add /usr/xpg4/bin/sed as it is typically found on Solaris # along with /bin/sed that truncates output. for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do test ! -f $lt_ac_sed && continue cat /dev/null > conftest.in lt_ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >conftest.in # Check for GNU sed and select it if it is found. if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then lt_cv_path_SED=$lt_ac_sed break fi while true; do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo >>conftest.nl $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break cmp -s conftest.out conftest.nl || break # 10000 chars as input seems more than enough test $lt_ac_count -gt 10 && break lt_ac_count=`expr $lt_ac_count + 1` if test $lt_ac_count -gt $lt_ac_max; then lt_ac_max=$lt_ac_count lt_cv_path_SED=$lt_ac_sed fi done done ]) SED=$lt_cv_path_SED AC_SUBST([SED]) AC_MSG_RESULT([$SED]) ])#AC_PROG_SED ])#m4_ifndef # Old name: AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_SED], []) # _LT_CHECK_SHELL_FEATURES # ------------------------ # Find out whether the shell is Bourne or XSI compatible, # or has some other useful features. m4_defun([_LT_CHECK_SHELL_FEATURES], [AC_MSG_CHECKING([whether the shell understands some XSI constructs]) # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c" test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \ = c,a/b,, \ && eval 'test $(( 1 + 1 )) -eq 2 \ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ && xsi_shell=yes AC_MSG_RESULT([$xsi_shell]) _LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell']) AC_MSG_CHECKING([whether the shell understands "+="]) lt_shell_append=no ( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \ >/dev/null 2>&1 \ && lt_shell_append=yes AC_MSG_RESULT([$lt_shell_append]) _LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append']) if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi _LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac _LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl _LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl ])# _LT_CHECK_SHELL_FEATURES # _LT_PROG_XSI_SHELLFNS # --------------------- # Bourne and XSI compatible variants of some useful shell functions. m4_defun([_LT_PROG_XSI_SHELLFNS], [case $xsi_shell in yes) cat << \_LT_EOF >> "$cfgfile" # func_dirname file append nondir_replacement # Compute the dirname of FILE. If nonempty, add APPEND to the result, # otherwise set result to NONDIR_REPLACEMENT. func_dirname () { case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac } # func_basename file func_basename () { func_basename_result="${1##*/}" } # func_dirname_and_basename file append nondir_replacement # perform func_basename and func_dirname in a single function # call: # dirname: Compute the dirname of FILE. If nonempty, # add APPEND to the result, otherwise set result # to NONDIR_REPLACEMENT. # value returned in "$func_dirname_result" # basename: Compute filename of FILE. # value retuned in "$func_basename_result" # Implementation must be kept synchronized with func_dirname # and func_basename. For efficiency, we do not delegate to # those functions but instead duplicate the functionality here. func_dirname_and_basename () { case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac func_basename_result="${1##*/}" } # func_stripname prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). func_stripname () { # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are # positional parameters, so assign one to ordinary parameter first. func_stripname_result=${3} func_stripname_result=${func_stripname_result#"${1}"} func_stripname_result=${func_stripname_result%"${2}"} } # func_opt_split func_opt_split () { func_opt_split_opt=${1%%=*} func_opt_split_arg=${1#*=} } # func_lo2o object func_lo2o () { case ${1} in *.lo) func_lo2o_result=${1%.lo}.${objext} ;; *) func_lo2o_result=${1} ;; esac } # func_xform libobj-or-source func_xform () { func_xform_result=${1%.*}.lo } # func_arith arithmetic-term... func_arith () { func_arith_result=$(( $[*] )) } # func_len string # STRING may not start with a hyphen. func_len () { func_len_result=${#1} } _LT_EOF ;; *) # Bourne compatible functions. cat << \_LT_EOF >> "$cfgfile" # func_dirname file append nondir_replacement # Compute the dirname of FILE. If nonempty, add APPEND to the result, # otherwise set result to NONDIR_REPLACEMENT. func_dirname () { # Extract subdirectory from the argument. func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"` if test "X$func_dirname_result" = "X${1}"; then func_dirname_result="${3}" else func_dirname_result="$func_dirname_result${2}" fi } # func_basename file func_basename () { func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"` } dnl func_dirname_and_basename dnl A portable version of this function is already defined in general.m4sh dnl so there is no need for it here. # func_stripname prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). # func_strip_suffix prefix name func_stripname () { case ${2} in .*) func_stripname_result=`$ECHO "X${3}" \ | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;; *) func_stripname_result=`$ECHO "X${3}" \ | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;; esac } # sed scripts: my_sed_long_opt='1s/^\(-[[^=]]*\)=.*/\1/;q' my_sed_long_arg='1s/^-[[^=]]*=//' # func_opt_split func_opt_split () { func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"` func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"` } # func_lo2o object func_lo2o () { func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"` } # func_xform libobj-or-source func_xform () { func_xform_result=`$ECHO "X${1}" | $Xsed -e 's/\.[[^.]]*$/.lo/'` } # func_arith arithmetic-term... func_arith () { func_arith_result=`expr "$[@]"` } # func_len string # STRING may not start with a hyphen. func_len () { func_len_result=`expr "$[1]" : ".*" 2>/dev/null || echo $max_cmd_len` } _LT_EOF esac case $lt_shell_append in yes) cat << \_LT_EOF >> "$cfgfile" # func_append var value # Append VALUE to the end of shell variable VAR. func_append () { eval "$[1]+=\$[2]" } _LT_EOF ;; *) cat << \_LT_EOF >> "$cfgfile" # func_append var value # Append VALUE to the end of shell variable VAR. func_append () { eval "$[1]=\$$[1]\$[2]" } _LT_EOF ;; esac ]) # Helper functions for option handling. -*- Autoconf -*- # # Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 6 ltoptions.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) # _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) # ------------------------------------------ m4_define([_LT_MANGLE_OPTION], [[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) # _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) # --------------------------------------- # Set option OPTION-NAME for macro MACRO-NAME, and if there is a # matching handler defined, dispatch to it. Other OPTION-NAMEs are # saved as a flag. m4_define([_LT_SET_OPTION], [m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), _LT_MANGLE_DEFUN([$1], [$2]), [m4_warning([Unknown $1 option `$2'])])[]dnl ]) # _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) # ------------------------------------------------------------ # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. m4_define([_LT_IF_OPTION], [m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) # _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) # ------------------------------------------------------- # Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME # are set. m4_define([_LT_UNLESS_OPTIONS], [m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), [m4_define([$0_found])])])[]dnl m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 ])[]dnl ]) # _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) # ---------------------------------------- # OPTION-LIST is a space-separated list of Libtool options associated # with MACRO-NAME. If any OPTION has a matching handler declared with # LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about # the unknown option and exit. m4_defun([_LT_SET_OPTIONS], [# Set options m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [_LT_SET_OPTION([$1], _LT_Option)]) m4_if([$1],[LT_INIT],[ dnl dnl Simply set some default values (i.e off) if boolean options were not dnl specified: _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no ]) _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no ]) dnl dnl If no reference was made to various pairs of opposing options, then dnl we run the default mode handler for the pair. For example, if neither dnl `shared' nor `disable-shared' was passed, we enable building of shared dnl archives by default: _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], [_LT_ENABLE_FAST_INSTALL]) ]) ])# _LT_SET_OPTIONS # _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) # ----------------------------------------- m4_define([_LT_MANGLE_DEFUN], [[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) # LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) # ----------------------------------------------- m4_define([LT_OPTION_DEFINE], [m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl ])# LT_OPTION_DEFINE # dlopen # ------ LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes ]) AU_DEFUN([AC_LIBTOOL_DLOPEN], [_LT_SET_OPTION([LT_INIT], [dlopen]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `dlopen' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) # win32-dll # --------- # Declare package support for building win32 dll's. LT_OPTION_DEFINE([LT_INIT], [win32-dll], [enable_win32_dll=yes case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-cegcc*) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) ;; esac test -z "$AS" && AS=as _LT_DECL([], [AS], [0], [Assembler program])dnl test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [0], [DLL creation program])dnl test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [0], [Object dumper program])dnl ])# win32-dll AU_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_REQUIRE([AC_CANONICAL_HOST])dnl _LT_SET_OPTION([LT_INIT], [win32-dll]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `win32-dll' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) # _LT_ENABLE_SHARED([DEFAULT]) # ---------------------------- # implement the --enable-shared flag, and supports the `shared' and # `disable-shared' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_SHARED], [m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([shared], [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) _LT_DECL([build_libtool_libs], [enable_shared], [0], [Whether or not to build shared libraries]) ])# _LT_ENABLE_SHARED LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) # Old names: AC_DEFUN([AC_ENABLE_SHARED], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) ]) AC_DEFUN([AC_DISABLE_SHARED], [_LT_SET_OPTION([LT_INIT], [disable-shared]) ]) AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_SHARED], []) dnl AC_DEFUN([AM_DISABLE_SHARED], []) # _LT_ENABLE_STATIC([DEFAULT]) # ---------------------------- # implement the --enable-static flag, and support the `static' and # `disable-static' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_STATIC], [m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([static], [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_static=]_LT_ENABLE_STATIC_DEFAULT) _LT_DECL([build_old_libs], [enable_static], [0], [Whether or not to build static libraries]) ])# _LT_ENABLE_STATIC LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) # Old names: AC_DEFUN([AC_ENABLE_STATIC], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) ]) AC_DEFUN([AC_DISABLE_STATIC], [_LT_SET_OPTION([LT_INIT], [disable-static]) ]) AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_STATIC], []) dnl AC_DEFUN([AM_DISABLE_STATIC], []) # _LT_ENABLE_FAST_INSTALL([DEFAULT]) # ---------------------------------- # implement the --enable-fast-install flag, and support the `fast-install' # and `disable-fast-install' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_FAST_INSTALL], [m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([fast-install], [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) _LT_DECL([fast_install], [enable_fast_install], [0], [Whether or not to optimize for fast installation])dnl ])# _LT_ENABLE_FAST_INSTALL LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) # Old names: AU_DEFUN([AC_ENABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `fast-install' option into LT_INIT's first parameter.]) ]) AU_DEFUN([AC_DISABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], [disable-fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `disable-fast-install' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) # _LT_WITH_PIC([MODE]) # -------------------- # implement the --with-pic flag, and support the `pic-only' and `no-pic' # LT_INIT options. # MODE is either `yes' or `no'. If omitted, it defaults to `both'. m4_define([_LT_WITH_PIC], [AC_ARG_WITH([pic], [AS_HELP_STRING([--with-pic], [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], [pic_mode="$withval"], [pic_mode=default]) test -z "$pic_mode" && pic_mode=m4_default([$1], [default]) _LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl ])# _LT_WITH_PIC LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) # Old name: AU_DEFUN([AC_LIBTOOL_PICMODE], [_LT_SET_OPTION([LT_INIT], [pic-only]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `pic-only' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) 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])]) # 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 ]) # ltversion.m4 -- version numbers -*- Autoconf -*- # # Copyright (C) 2004 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # Generated from ltversion.in. # serial 3017 ltversion.m4 # This file is part of GNU Libtool m4_define([LT_PACKAGE_VERSION], [2.2.6b]) m4_define([LT_PACKAGE_REVISION], [1.3017]) AC_DEFUN([LTVERSION_VERSION], [macro_version='2.2.6b' macro_revision='1.3017' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) # lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # # Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004. # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 4 lt~obsolete.m4 # These exist entirely to fool aclocal when bootstrapping libtool. # # In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN) # which have later been changed to m4_define as they aren't part of the # exported API, or moved to Autoconf or Automake where they belong. # # The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN # in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us # using a macro with the same name in our local m4/libtool.m4 it'll # pull the old libtool.m4 in (it doesn't see our shiny new m4_define # and doesn't know about Autoconf macros at all.) # # So we provide this file, which has a silly filename so it's always # included after everything else. This provides aclocal with the # AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything # because those macros already exist, or will be overwritten later. # We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. # # Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. # Yes, that means every name once taken will need to remain here until # we give up compatibility with versions before 1.7, at which point # we need to keep only those names which we still refer to. # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) m4_ifndef([AC_LIBTOOL_RC], [AC_DEFUN([AC_LIBTOOL_RC])]) m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) # Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 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.11' 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.11.1], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.11.1])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001, 2003, 2005 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, 2000, 2001, 2003, 2004, 2005, 2006, 2008 # 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. # serial 9 # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ(2.52)dnl ifelse([$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, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009 # 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. # serial 10 # 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", "GCJ", or "OBJC". # 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 ifelse([$1], CC, [depcc="$CC" am_compiler_list=], [$1], CXX, [depcc="$CXX" am_compiler_list=], [$1], OBJC, [depcc="$OBJC" 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'. 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 8's {/usr,}/bin/sh. touch 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 ;; 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, [ --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008 # 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. #serial 5 # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ # Autoconf 2.62 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"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //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' -e 's/\$U/'"$U"'/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, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2008, 2009 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. # serial 16 # 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.62])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], [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], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, [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([AM_PROG_MKDIR_P])dnl # 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)], [define([AC_PROG_CC], defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES(CXX)], [define([AC_PROG_CXX], defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES(OBJC)], [define([AC_PROG_OBJC], defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl ]) _AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl dnl The `parallel-tests' driver may need to know about EXEEXT, so add the dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro dnl 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, 2003, 2005, 2008 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, 2005 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. # serial 2 # 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, 2002, 2003, 2005, 2009 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. # serial 4 # 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, 1999, 2000, 2001, 2003, 2004, 2005, 2008 # 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. # serial 6 # 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 supports --run. # If it does, 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 --run true"; then am_missing_run="$MISSING --run " else am_missing_run= AC_MSG_WARN([`missing' script is too old or missing]) fi ]) # Copyright (C) 2003, 2004, 2005, 2006 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_MKDIR_P # --------------- # Check for `mkdir -p'. AC_DEFUN([AM_PROG_MKDIR_P], [AC_PREREQ([2.60])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, dnl while keeping a definition of mkdir_p for backward compatibility. dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of dnl Makefile.ins that do not define MKDIR_P, so we do our own dnl adjustment using top_builddir (which is defined more often than dnl MKDIR_P). AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl case $mkdir_p in [[\\/$]]* | ?:[[\\/]]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005, 2008 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. # serial 4 # _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, 1997, 2000, 2001, 2003, 2005, 2008 # 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. # serial 5 # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Just in case sleep 1 echo timestamp > conftest.file # 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 ( 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 rm -f conftest.file 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 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)]) # Copyright (C) 2001, 2003, 2005 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, 2008 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. # serial 2 # _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, 2005 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. # serial 2 # _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. AM_MISSING_PROG([AMTAR], [tar]) m4_if([$1], [v7], [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], [m4_case([$1], [ustar],, [pax],, [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' _am_tools=${am_cv_prog_tar_$1-$_am_tools} # Do not fold the above two line into one, because Tru64 sh and # Solaris sh will not grok spaces in the rhs of `-'. 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([acinclude.m4]) blcr-0.8.5/acinclude.m40000664000000000000000000014323512071675416011551 00000000000000# This file is read by Autoconf. -*- Autoconf -*- # # Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) # 2008, The Regents of the University of California, through Lawrence # Berkeley National Laboratory (subject to receipt of any required # approvals from the U.S. Dept. of Energy). All rights reserved. # # Portions may be copyrighted by others, as may be noted in specific # copyright notices within specific files. # # 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 # # $Id: acinclude.m4,v 1.177.14.17 2013/01/05 00:59:58 phargrov Exp $ AC_REVISION($Revision: 1.177.14.17 $) # Match all kernels major/minor we might accept m4_define([cr_kern_maj_min_patt],[[\(2\.6\|3\.[0-9][0-9]*\)\.]])[]dnl No SUBLEVEL or following m4_define([cr_kern_maj_min_perl],[[(2\.6|3\.[0-9]+)\.]])[]dnl No SUBLEVEL or following # cr_substr(STRING,OFFSET,[LEN]) # ------------------------------------------------------ # Wrapper around substr to implement perl-style negative # values of offset and len AC_DEFUN([cr_substr],[dnl pushdef([length],len([$1]))dnl pushdef([offset],m4_eval($2+length*($2<0)))dnl m4_ifval([$3],[m4_substr($1,offset,m4_eval($3+(length-offset)*($3<0)))],[m4_substr($1,offset)])[]dnl popdef([offset])dnl popdef([length])]) # cr_trim_ws(STRING) # ------------------------------------------------------ # Trims leading and trailing whitespace AC_DEFUN([cr_trim_ws],[regexp([$1],[^[ ]*\(.*[^ ]\)[ ]*$],[\1])])dnl # cr_type_check(EXPR,TYPE) # ------------------------------------------------------ # Expands to one or more C declarations and statements that # try to compile-time check that the given EXPR has the given TYPE. # Uses tc_ prefix for identifiers. # Current checks: # For TYPE="" # Just evaluate the expression (which might actually be a statement macro). # No type checking, but ensures EXPR is syntax checked. # For TYPE="void" # Evaluate "(void)(EXPR);" # Ensures that EXPR is a valid "rvalue". NOT WHAT CALLER MIGHT EXCPECT. # For TYPE="void *" # Evaluate "void * tc_1 = EXPR" # Ensures that EXPR has *some* pointer type. # For TYPE="foo *" # Evaluate "foo tc_1 = *(EXPR)" # Ensures the type really is exactly what we said. # Default: # Evaluate "TYPE tc_1 = EXPR" # Ensures the type is assignment compatible (pretty weak). # XXX: probably broken for array types. AC_DEFUN([cr_type_check],[dnl pushdef([cr_type],cr_trim_ws([$2]))dnl m4_if(cr_type,[],[$1;], cr_type,[void],[(void)($1);], regexp(cr_type,[void[ ]*\*$]),0,[void * tc_1 = [$1];], regexp(cr_type,[.*\*$]),0, cr_substr(cr_type,0,-1)[ tc_1 = *([$1]);], [cr_type tc_1 = [$1];])[]dnl popdef([cr_type])dnl ]) # CR_CACHE_REVALIDATE(FILE,KEY,DESCR) # ------------------------------------------------------ # Check that FILE is still the same as our cached version. # Invalidates corresponding autoconf cache values if not. AC_DEFUN([CR_CACHE_REVALIDATE],[ pushdef([cr_cached_file],[.cached_]$2)[]dnl pushdef([cr_cvprefix],[cr_cv_]$2[_])[]dnl if test -z "$cache_file" || \ test "$cache_file" = /dev/null || \ cmp "$1" cr_cached_file >/dev/null 2>/dev/null; then : # OK - either not caching or cached version still matches else if test -f cr_cached_file; then AC_MSG_WARN([$3 has changed... discarding cached results.]) rm -f cr_cached_file fi for cr_var in cr_cvprefix[]_NON_EMPTY_HACK `(set) | grep "^cr_cvprefix" | cut -d= -f1`; do unset $cr_var done cp "$1" cr_cached_file fi popdef([cr_cvprefix])[]dnl popdef([cr_cached_file])[]dnl ]) # CR_GET_CACHE_VAR(VARNAME) # CR_SET_CACHE_VAR(VARNAME) # ------------------------------------------------------ # Manage cached values of LINUX_{SRC,OBJ,etc.} # Includes checking against current (command line) settings AC_DEFUN([CR_GET_CACHE_VAR],[ pushdef([cr_cvname],cr_cv_var_[$1])[]dnl if test "${[$1]+set}${cr_cvname+set}" = setset; then if test "$[$1]" != "$cr_cvname"; then AC_MSG_ERROR([Cached [$1] ($cr_cvname) does not match current value ($[$1]). Remove '$cache_file' before re-running configure.]) fi elif test "${cr_cvname+set}" = set; then [$1]="$cr_cvname" fi popdef([cr_cvname])[]dnl ]) AC_DEFUN([CR_SET_CACHE_VAR],[test -n "$[$1]" && cr_cv_var_[$1]="$[$1]"]) # CR_IF(test,[ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND]) # ------------------------------------------------------ # Basic functionality of AS_IF, but not as "optimized" # Implemented here because m4sh is not yet documented. AC_DEFUN([CR_IF],[ if $1; then m4_default([$2], :) else m4_default([$3], :) fi ]) # CR_PROG_GCC([LIST],[ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND]) # ------------------------------------------------------ # Find the first compiler in the list and verify that it is gcc. AC_DEFUN([CR_PROG_GCC],[ AC_PROG_CC($1) CR_IF([test "$GCC" = yes],[$2],[$3]) ]) # CR_PROG_CXX # ------------------------------------------------------ # Find a C++ compiler and verify that it is word-size compatible with $CC # Returns with CXX set to the compiler, or "no" # Note bug 2619 reports that CR_PROG_CXX must not be called conditionally # because of some internal use of AM_CONDITIONAL() AC_DEFUN([CR_PROG_CXX],[ AC_REQUIRE([AC_PROG_CC]) # Totally gross way to perform a non-fatal probe for CXX pushdef([AC_MSG_ERROR], [CXX=no]) AC_REQUIRE([AC_PROG_CXX]) AC_REQUIRE([AC_PROG_CXXCPP]) popdef([AC_MSG_ERROR]) # Now validate the choice if test "x$CXX" != xno; then AC_LANG_SAVE AC_LANG_C AC_CHECK_SIZEOF(void *, $cross_void_P) AC_LANG_CPLUSPLUS AC_CACHE_CHECK([[whether CXX='$CXX' acts like a C++ compiler]], cr_cv_cxx_is_cxx, [ cr_cv_cxx_is_cxx=no AC_TRY_COMPILE([ #ifndef __cplusplus #error __cplusplus must be defined in a C++ compilation! #endif ], [ int x = 1; ], [cr_cv_cxx_is_cxx=yes]) ]) if test x"$cr_cv_cxx_is_cxx" = xyes; then AC_CACHE_CHECK([[whether CXX='$CXX' matches wordsize of CC]], cr_cv_cxx_voidp, [ cr_cv_cxx_voidp=no AC_TRY_COMPILE([ #ifndef __cplusplus #error __cplusplus must be defined in a C++ compilation! #endif ], [ int a[(($ac_cv_sizeof_void_p == sizeof(void *))? 1 : -1)];], [cr_cv_cxx_voidp=yes]) ]) fi AC_LANG_RESTORE if test x"$cr_cv_cxx_is_cxx$cr_cv_cxx_voidp" != xyesyes; then CXX=no fi fi ]) # CR_CHECK_GLIBC(MAJOR,MINOR,[ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND]) # ------------------------------------------------------ # Check for glibc >= MAJOR.MINOR and sets the variable # cr_cv_check_glibc_MAJOR_MINOR_or_higher to 'yes' or 'no' AC_DEFUN([CR_CHECK_GLIBC],[ pushdef([cr_cvname],cr_cv_check_glibc_[$1]_[$2]_or_higher)[]dnl AC_CACHE_CHECK([[for GNU libc version >= $1.$2]],cr_cvname,[ AC_TRY_LINK([ #include #ifndef __GLIBC_PREREQ #define __GLIBC_PREREQ(maj, min) \ ((__GLIBC__ << 16) + __GLIBC_MINOR__ >= ((maj) << 16) + (min)) #endif #if !__GLIBC_PREREQ($1, $2) #error "Bad glibc version" #endif extern int gnu_get_libc_version(void); /* Ensures this *is* glibc */ ],[ return !gnu_get_libc_version(); ], [cr_cvname=yes], [cr_cvname=no]) ]) CR_IF([eval test $cr_cvname = yes],[$3],[$4]) popdef([cr_cvname])[]dnl ]) # CR_KERNEL_TYPE(TYPE) # ------------------------------------------------------ # Check for /boot/kernel.h and establish user-requested overrides # if possible. AC_DEFUN([CR_KERNEL_TYPE],[ cr_kernel_type=`echo $1 | tr 'a-z' 'A-Z'` cr_header="/boot/kernel.h" AC_MSG_CHECKING([for $cr_header]); cr_result=ok if test \! -e "$cr_header"; then cr_result='missing' elif test \! -r "$cr_header"; then cr_result='not readable' fi AC_MSG_RESULT([$cr_result]) if test "$cr_result" != "ok"; then AC_MSG_ERROR([You have requested '--with-kernel-type=$cr_kernel_type', but $cr_header is $cr_result.]) fi cr_kernel_var="__BOOT_KERNEL_$cr_kernel_type" if test -z "`grep \"$cr_kernel_var\" $cr_header 2>/dev/null`"; then AC_MSG_ERROR([You have requested '--with-kernel-type=$cr_kernel_type', but $cr_header does not appear to support that type.]) fi # The following sed command transforms all the #ifndef lines from kernel.h into # corresponding preprocessor flags (on one line) which select the desired kernel type. # Note use of [] for m4 quoting of a sed command containing [ and ] CR_KTYPE_CPPFLAGS=[`sed -n -e '/^#ifndef \('$cr_kernel_var'\)$/ {s//-D\1=1 /;H;}' \ -e '/^#ifndef \(__BOOT_KERNEL_[A-Z]*\)$/ {s//-D\1=0 /;H;}' \ -e '$ {x;s/[ \t\n]\+/ /g;s/^ //;s/ $//;p;}' \ $cr_header`] ]) # _CR_EXTRACT_UTS_VERSION(DIR,CPP_CMD) # ------------------------------------------------------ # Helper to extract UTS_VERSION from Linux kernel sources. AC_DEFUN([_CR_EXTRACT_UTS_VERSION],[dnl $PERL -- - "$1" "$2" <<'_EOF_' [ my ($srcdir, $cpp_cmd) = @ARGV; my $stamp = time; $cpp_cmd =~ s/([#()])/\\$1/g; # quote problematic shell metachars FILE: foreach my $file (qw(linux/version.h linux/utsrelease.h generated/utsrelease.h)) { my $path = "$srcdir/include/$file"; next FILE unless (-f $path); open(F, "echo '=${stamp}->UTS_RELEASE<-' | ${cpp_cmd} -include ${path} - |") || exit 1; LINE: while () { next LINE if(/^#/); if ((my $uts) = /=${stamp}->"(]cr_kern_maj_min_perl[[0-9].*)"<-/o) { print "$uts\n"; exit 0; } } close(F) || exit 1; } exit 1; ] _EOF_ ]) # _CR_CHECK_VERSION_H(DIR,VAR) # ------------------------------------------------------ # Check if the indicated DIR contains version.h. # Sets $VAR to the full UTS_RELEASE string, or an error string AC_DEFUN([_CR_CHECK_VERSION_H],[ for cr_version_h in $1/include/linux/version.h $1/include/generated/uapi/linux/version.h none; do test -r $cr_version_h && break done if test $cr_version_h = none; then [$2]='version.h missing' else [$2]=`_CR_EXTRACT_UTS_VERSION($1, [$KCC -E -I$1/include -D__KERNEL__ -DMODULE $CR_KTYPE_CPPFLAGS $CPPFLAGS])` test $? = 0 || [$2]='no UTS_RELEASE could be extracted' AC_SUBST([LINUX_VERSION_H],[$cr_version_h]) fi ]) # _CR_CHECK_LINUX_SRC(VERSION,DIR) # ------------------------------------------------------ # Check if the indicated DIR contains source for the given # kernel version. Verification consists of a Makefile with # the proper version info. # # Sets cr_linux_src_ver to the version found (w/ EXTRAVERSION), or to the empty string # Note that a build dir with a Makefile created by scripts/mkmakefile # is acceptible as a "source" directory for our purposes. AC_DEFUN([_CR_CHECK_LINUX_SRC],[ AC_MSG_CHECKING([[for Linux kernel source in $2]]) cr_cvname=cr_cv_kernel_src_[]AS_TR_SH($2) AC_CACHE_VAL([${cr_cvname}],[ cr_tmp='' if test -e "[$2]/Makefile"; then # First try using version.h, as some distros play odd games w/ the Makefile _CR_CHECK_VERSION_H([$2],cr_tmp) # Now trim EXTRAVERSION, or yield empty if no pattern match cr_tmp=`echo $cr_tmp | sed -n -e '/^\(cr_kern_maj_min_patt[[0-9]]\+\).*$/ {s//\1/p;q;}'` # Next try "asking" the Makefile if test -z "$cr_tmp"; then # If a dependency does not exist, then make may complain. # The -k and 2>/dev/null take care of that. cr_tmp=`(make -k echo_kver --no-print-directory -C $2 -f - 2>/dev/null | grep '^cr_kern_maj_min_patt') <<'_EOF_' echo_kver: @echo '$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)' include Makefile _EOF_` expr "$cr_tmp" : 'cr_kern_maj_min_patt' >/dev/null || cr_tmp='' # Reject if not matched to pattern fi # Finally try grepping the Makefile if test -z "$cr_tmp"; then # Note the use of [] for m4 quoting, since the pattern contains [ and ] cr_linux_ver1=[`sed -n -e '/^VERSION[ \t]*=[ \t]*\([0-9]\+\).*$/ {s//\1/p;q;}' "$2/Makefile"`] cr_linux_ver2=[`sed -n -e '/^PATCHLEVEL[ \t]*=[ \t]*\([0-9]\+\).*$/ {s//\1/p;q;}' "$2/Makefile"`] cr_linux_ver3=[`sed -n -e '/^SUBLEVEL[ \t]*=[ \t]*\([0-9]\+\).*$/ {s//\1/p;q;}' "$2/Makefile"`] cr_tmp="${cr_linux_ver1}.${cr_linux_ver2}.${cr_linux_ver3}" expr "$cr_tmp" : 'cr_kern_maj_min_patt' >/dev/null || cr_tmp='' # Reject if not matched to pattern fi test -n "$cr_tmp" || cr_tmp='not found' elif test -d "$2"; then cr_tmp='Makefile missing' else cr_tmp='not found' fi eval "$cr_cvname='$cr_tmp'" unset cr_tmp ]) eval "cr_result=\$$cr_cvname" unset cr_cvname if expr "$cr_result" : 'cr_kern_maj_min_patt' >/dev/null; then AC_MSG_RESULT([found version $cr_result]) else AC_MSG_RESULT([$cr_result]) fi # Check that version is acceptible (exact match, or a prefix with the next char non-numeric) case "$cr_linux_obj_ver" in [${cr_result}|${cr_result}[!0-9]*]) # the outer [] is m4 quoting cr_linux_src_ver="$cr_result";; *) cr_linux_src_ver='';; esac ]) # CR_FIND_LINUX_SRC(VERSION) # ------------------------------------------------------ # Search for Linux src dir matching the given version # Sets cr_linux_src_ver to the version found, or to the empty string # Sets LINUX_SRC if found. AC_DEFUN([CR_FIND_LINUX_SRC],[ cr_linux_src_ver='' CR_GET_CACHE_VAR([LINUX_SRC_ARG]) if expr X"$LINUX_SRC_ARG" : X/ >/dev/null; then cr_list="$LINUX_SRC_ARG" elif test -n "$LINUX_SRC_ARG"; then AC_MSG_ERROR([[--with-linux-src argument '$LINUX_SRC_ARG' is not a full path]]) else # Search standard locations cr_list="${LINUX_OBJ} \ /lib/modules/[$1]/source \ /usr/src/linux-[$1] \ /usr/src/linux-headers-[$1] \ /usr/src/kernels/[$1]" fi for cr_linux_dir in $cr_list; do _CR_CHECK_LINUX_SRC([$1],[$cr_linux_dir]) if test -n "$cr_linux_src_ver"; then LINUX_SRC="$cr_linux_dir" break fi done CR_IF([test -z "$cr_linux_src_ver"], [AC_MSG_ERROR([Could not locate source directory corresponding to build directory '${LINUX_OBJ}'. Please use --with-linux-src=FULL_PATH_TO_KERNEL_SRC])]) ]) # _CR_CHECK_LINUX_OBJ(VER_PATT,DIR,VAR) # ------------------------------------------------------ # Check if the indicated DIR contains a kernel build with version # matching the given patterm (expr). Verification consists of: # + include/linux/version.h w/ proper version # + .config # Sets cr_linux_obj_ver to the version found, or to the empty string AC_DEFUN([_CR_CHECK_LINUX_OBJ],[ AC_MSG_CHECKING([[for Linux kernel build in $2]]) cr_cvname=cr_cv_kernel_obj_[]AS_TR_SH($2) AC_CACHE_VAL([${cr_cvname}],[ if test -d "$2"; then # Check for version.h _CR_CHECK_VERSION_H([$2],[cr_tmp]) # Check for .config if required if expr "$cr_tmp" : 'cr_kern_maj_min_patt' >/dev/null; then test -r "$2/.config" || cr_tmp='.config missing' fi else cr_tmp='not found' fi eval "$cr_cvname='$cr_tmp'" unset cr_tmp ]) eval "cr_result=\$$cr_cvname" unset cr_cvname if expr "$cr_result" : 'cr_kern_maj_min_patt' >/dev/null; then AC_MSG_RESULT([found version $cr_result]) else AC_MSG_RESULT([$cr_result]) fi # Check that version appears acceptible CR_IF([expr "$cr_result" : $1 >/dev/null], [cr_linux_obj_ver="$cr_result"], [cr_linux_obj_ver='']) ]) # CR_FIND_LINUX_OBJ(VER_PATT) # ------------------------------------------------------ # Search for Linux obj (aka build) dir. # Sets cr_linux_obj_ver to the version found, or to the empty string # Sets LINUX_OBJ if found. AC_DEFUN([CR_FIND_LINUX_OBJ],[ CR_GET_CACHE_VAR([LINUX_OBJ_ARG]) if expr X"$LINUX_OBJ_ARG" : X/ >/dev/null; then # User provided a path _CR_CHECK_LINUX_OBJ(['cr_kern_maj_min_patt'], [${LINUX_OBJ_ARG}]) CR_IF([test -z "$cr_linux_obj_ver"], [AC_MSG_ERROR([Directory ${LINUX_OBJ_ARG} does not appear to contain a Linux kernel build])]) LINUX_OBJ="${LINUX_OBJ_ARG}" else if test -z "$LINUX_OBJ_ARG"; then cr_tmp_ver=`uname -r` elif expr "$LINUX_OBJ_ARG" : 'cr_kern_maj_min_patt' >/dev/null; then cr_tmp_ver="$LINUX_OBJ_ARG" else AC_MSG_ERROR([[--with-linux argument '$LINUX_OBJ_ARG' is neither a kernel version string nor a full path]]) fi cr_ver_patt="`echo $cr_tmp_ver | sed -e 's/\./\\\\./g;'`\$" # Search standard locations for cr_linux_dir in \ /lib/modules/${cr_tmp_ver}/build \ /usr/src/linux-${cr_tmp_ver}-obj \ /usr/src/linux-${cr_tmp_ver} \ /usr/src/linux-headers-${cr_tmp_ver} \ /usr/src/kernels/${cr_tmp_ver} \ ; do _CR_CHECK_LINUX_OBJ([${cr_ver_patt}],[${cr_linux_dir}]) if test -n "$cr_linux_obj_ver"; then LINUX_OBJ="${cr_linux_dir}" break fi done CR_IF([test -z "$cr_linux_obj_ver"], [AC_MSG_ERROR([Could not find a directory containing a Linux kernel ${cr_tmp_ver} build. Perhaps try --with-linux=FULL_PATH_TO_KERNEL_BUILD])]) unset cr_tmp_ver fi ]) # CR_CHECK_LINUX() # ------------------------------------------------------ # Check for Linux source and build dirs. # Sets LINUX_SRC, LINUX_OBJ and LINUX_VER accordingly. # Also sets HAVE_LINUX_2_6 or HAVE_LINUX_3 on success AC_DEFUN([CR_CHECK_LINUX],[ AC_SUBST([LINUX_SRC]) AC_SUBST([LINUX_OBJ]) AC_SUBST([LINUX_VER]) AC_SUBST([CR_KERNEL]) AC_SUBST([CR_KERNEL_BASE]) CR_FIND_LINUX_OBJ() CR_IF([test -n "$cr_linux_obj_ver"],[CR_FIND_LINUX_SRC($cr_linux_obj_ver)]) CR_IF([test -n "$cr_linux_src_ver" -a -n "$cr_linux_obj_ver"],[ case "$cr_linux_obj_ver" in 2.6.*) HAVE_LINUX_2_6=yes;; 3.*.*) HAVE_LINUX_3=yes;; esac LINUX_VER="$cr_linux_obj_ver" CR_KERNEL=`echo $cr_linux_obj_ver | tr - _` CR_KERNEL_BASE=`echo $CR_KERNEL | sed -e 's:smp\|enterprise\|bigmem\|hugemem::g'` CR_SET_CACHE_VAR([LINUX_SRC_ARG]) CR_SET_CACHE_VAR([LINUX_OBJ_ARG]) CR_CACHE_REVALIDATE([${LINUX_OBJ}/.config],[kconfig],[kernel configuration]) ]) ]) # CR_CHECK_KBUILD() # ------------------------------------------------------ # Sets up the automake to kbuild interface AC_DEFUN([CR_CHECK_KBUILD],[ pushdef([cr_cvname],cr_cv_KBUILD_MAKE_ARGS)[]dnl AC_SUBST([KBUILD_MAKE_ARGS]) AC_CACHE_CHECK([[for parameters to interface GNU automake with Linux kbuild]],cr_cvname,[ if grep KBUILD_EXTMOD ${LINUX_SRC}/Makefile >/dev/null 2>/dev/null; then cr_cvname='KBUILD_EXTMOD=$(builddir)' else cr_cvname='SUBDIRS=$(builddir) modules' fi if test "${LINUX_OBJ}" != "${LINUX_SRC}"; then cr_cvname="${cr_cvname} O=${LINUX_OBJ}" fi if test x$enable_kbuild_verbose = xyes; then cr_cvname="${cr_cvname} V=1" fi if test x$cross_compiling = xyes; then cr_cvname="$cr_cvname ARCH=$CR_KARCH CROSS_COMPILE=$host_alias-" fi ]) KBUILD_MAKE_ARGS="$cr_cvname" popdef([cr_cvname])[]dnl # Note: we'll actually try the result in CR_SET_KCFLAGS ]) # CR_SET_KCFLAGS() # ------------------------------------------------------ # Finds CFLAGS needed for compiler-based probes of kernel sources AC_DEFUN([CR_SET_KCFLAGS],[ AC_REQUIRE([AC_PROG_EGREP]) pushdef([cr_cvname],[cr_cv_kconfig_kcflags])[]dnl AC_CACHE_CHECK([[for flags to compile Linux kernel probes]],cr_cvname,[ rm -rf conftestdir mkdir conftestdir echo '#include ' > conftestdir/conftest.c echo 'int foo = 0;' >> conftestdir/conftest.c echo 'obj-m := conftest.o' >conftestdir/Makefile unset cr_tmp echo "make -C ${LINUX_SRC} builddir=\"`pwd`/conftestdir\" ${KBUILD_MAKE_ARGS} CC=\"${KCC}\" V=1" >&5 make -C ${LINUX_SRC} builddir="`pwd`/conftestdir" ${KBUILD_MAKE_ARGS} CC="${KCC}" V=1 >conftestdir/output 2>&1 &5 if test "${cr_tmp:+OK}" != OK; then AC_MSG_RESULT([FAILED]) cat conftestdir/output if $EGREP ['include/(asm|linux)/[a-zA-Z0-9_-]+\.h:'] conftestdir/output >/dev/null 2>&1; then AC_MSG_WARN([Apparent compilation problem in ${LINUX_SRC}]) ver=`$KCC --version | head -1` AC_MSG_WARN([Perhaps KCC='$KCC' ($ver) is not compatible with this kernel source]) if test $cr_wordsize -gt $ac_cv_sizeof_void_p; then echo "$KCC" | grep -e '-m64' >/dev/null 2>/dev/null if test $? != 0; then AC_MSG_WARN([You might try setting KCC='$KCC -m64']) fi fi fi if grep -i 'permission denied' conftestdir/output >/dev/null 2>&1; then AC_MSG_WARN([Apparent permissions problem in ${LINUX_SRC}]) fi rm -rf conftestdir AC_MSG_ERROR([Failed test run of kernel make/kbuild failed (see above)]) fi rm -rf conftestdir cr_cvname='' prev_del='' prev_inc='' for arg in ${cr_tmp}; do if test -n "$prev_del"; then # skip this arg at request of prev arg prev_del='' continue fi arg=`echo $arg | tr -d "\"'"` # remove quote marks if test -n "$prev_inc"; then # prev arg says this arg is an -include prev_inc='' case "$arg" in *include/linux/modversions.h) continue;; /*) arg="-include $arg";; *) arg="-include ${LINUX_OBJ}/$arg";; esac else case "$arg" in -o) prev_del=1; continue;; -include) prev_inc=1; continue;; -c) continue;; conftest.c) continue;; /*/conftest.c) continue;; -Wp,-MD,*) continue;; -Wp,-MMD,*) continue;; -I/*) ;; -I*) arg=`echo $arg | [sed -e "s:-I:-I${LINUX_OBJ}/:"]`;; esac fi cr_cvname="$cr_cvname $arg" done]) KCFLAGS="$cr_cvname" popdef([cr_cvname])[]dnl AC_MSG_CHECKING([if autoconf.h or kconfig.h is included implicitly]) if echo "$KCFLAGS" | grep -e 'include [[^ ]]*/autoconf\.h' -e 'include [[^ ]]*/kconfig\.h' >/dev/null 2>&1; then AC_MSG_RESULT([yes]); else AC_MSG_RESULT([no]); AC_DEFINE([CR_NEED_AUTOCONF_H], [1]) AH_TEMPLATE([CR_NEED_AUTOCONF_H], [Define to 1 if linux/autoconf.h must be included explicitly]) fi # Do these init steps early, in case first CR_FIND_KSYM is a conditional call AC_REQUIRE([_CR_KSYM_INIT_PATTS]) AC_REQUIRE([_CR_KSYM_INIT_FILES]) ]) # CR_DEFINE(VARIABLE,TEST,[TEMPLATE_TEXT]) # ------------------------------------------------------ # Wrapper to invoke AC_DEFINE for a boolean, and optionally AH_TEMPLATE AC_DEFUN([CR_DEFINE],[ if [$2]; then AC_DEFINE([$1], [1]) else AC_DEFINE([$1], [0]) fi m4_ifval([$3], AH_TEMPLATE([$1], [$3])) ]) # CR_DEFINE_AND_SET(VARIABLE,TEST,[TEMPLATE_TEXT]) # ------------------------------------------------------ # Wrapper like CR_DEFINE which also sets the corresponding shell variable # to either 1 or the empty string AC_DEFUN([CR_DEFINE_AND_SET],[ if [$2]; then AC_DEFINE([$1], [1]) eval "$1=1" else AC_DEFINE([$1], [0]) eval "$1=''" fi m4_ifval([$3], AH_TEMPLATE([$1], [$3])) ]) # CR_ARG_ENABLE(NAME,HELP,[DEFAULT]) # ------------------------------------------------------ # Our own wrapper for AC_ARG_ENABLE # Default for DEFAULT is "no" AC_DEFUN([CR_ARG_ENABLE],[ AC_ARG_ENABLE([$1], [AC_HELP_STRING([--enable-$1], [$2])], :, [[enable_]translit([$1],[-],[_])=m4_default([$3], [no])]) ]) # CR_WITH_COMPONENTS(LIST) # ------------------------------------------------------ # If no flag is passed, then ALL components are built. # If a flag IS passed, then ONLY the given components are built. # This is for internal/maintainer use only, thus no --help. # ex: --with-components=bin,lib AC_DEFUN([CR_WITH_COMPONENTS],[ AC_ARG_WITH([components]) case x"$with_components" in xyes) AC_MSG_ERROR([--with-components requires an argument. Known components are: $1]); ;; x) for cr_lcv in $1; do eval cr_build_${cr_lcv}=yes done ;; *) for cr_lcv in $1; do if expr "$with_components" : '.*'"$cr_lcv" >/dev/null; then eval cr_build_${cr_lcv}=yes else eval cr_build_${cr_lcv}=no fi done ;; esac ]) # CR_CHECK_SIGNUM # ------------------------------------------------------ # Probes for value to assign to CR_SIGNUM # Care is taken to use the value from the lib if preloaded AC_DEFUN([CR_CHECK_SIGNUM],[ pushdef([cr_cvname],[cr_cv_check_cr_signum])[]dnl AC_CACHE_CHECK([[for value of CR_SIGNUM]],cr_cvname,[ cr_cvname="failed" SAVE_LIBS="$LIBS" LIBS="-ldl -lpthread $LIBS" AC_TRY_RUN( [#include #include extern int __libc_allocate_rtsig(int); int main() { int s = -1; FILE *f=fopen("conftestval", "w"); void *dlhandle = dlopen(NULL, RTLD_LAZY); if (dlhandle) { int *tmp = (int *)dlsym(dlhandle, "cri_signum"); dlclose(dlhandle); if (tmp) s = *tmp; } if (s <= 0) { s=__libc_allocate_rtsig(0); } if (!f || s<=0) return(1); fprintf(f, "%d\n", s); return(0); }], [cr_cvname=`cat conftestval`], [AC_MSG_ERROR([Failed to probe CR_SIGNUM])], [CR_CROSS_VAR(cross_signum) cr_cvname=$cross_signum]) LIBS="$SAVE_LIBS" ]) AC_SUBST([CR_SIGNUM],[$cr_cvname]) popdef([cr_cvname])[]dnl ]) # CR_CONFIG_REPORT # ------------------------------------------------------ # Reports certain probed/configured values AC_DEFUN([CR_CONFIG_REPORT],[ echo "======================================================================" echo "Please review the following configuration information:" echo " Kernel source directory = $LINUX_SRC" echo " Kernel build directory = $LINUX_OBJ" echo " Kernel symbol table = ${LINUX_SYSTEM_MAP}${LINUX_VMLINUX}" echo " Kernel version probed from kernel build = $LINUX_VER" echo " Kernel running currently = `uname -r`" echo "======================================================================" ]) # CR_TRY_GCC_FLAG(FLAG,[ACTION-IF-TRUE],[ACTION-IF_FALSE]) # ------------------------------------------------------ # Wrapper to invoke AC_TRY_COMPILE for checking a gcc flag AC_DEFUN([CR_TRY_GCC_FLAG],[ pushdef([cr_cvname],[cr_cv_gcc_flag]AS_TR_CPP($1))[]dnl AC_CACHE_CHECK([[whether gcc accepts $1]],cr_cvname,[ SAVE_CFLAGS=$CFLAGS CFLAGS="$CFLAGS $1" AC_TRY_COMPILE([], [], [cr_cvname=yes], [cr_cvname=no]) CFLAGS=$SAVE_CFLAGS ]) CR_IF([eval test $cr_cvname = yes],[$2],[$3]) popdef([cr_cvname])[]dnl ]) # CR_EGREP_KERNEL_CPP(PATTERN,PROGRAM,[ACTION-IF-TRUE],[ACTION-IF_FALSE]) # ------------------------------------------------------ # Wrapper to invoke AC_EGREP_CPP against the kernel headers AC_DEFUN([CR_EGREP_KERNEL_CPP],[ AC_REQUIRE([CR_SET_KCFLAGS]) SAVE_CPP=$CPP SAVE_CPPFLAGS=$CPPFLAGS CPP="$KCC -E" CPPFLAGS="$KCFLAGS" AC_EGREP_CPP([$1],[ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include $2], [CPP=$SAVE_CPP CPPFLAGS=$SAVE_CPPFLAGS $3], [CPP=$SAVE_CPP CPPFLAGS=$SAVE_CPPFLAGS $4]) ]) # CR_EGREP_KERNEL_HEADER(PATTERN,HEADER,[ACTION-IF-TRUE],[ACTION-IF_FALSE]) # ------------------------------------------------------ # Wrapper to invoke (approximately) AC_EGREP_HEADER against the kernel headers AC_DEFUN([CR_EGREP_KERNEL_HEADER],[ CR_EGREP_KERNEL_CPP([$1],[#include <$2>],[$3],[$4]) ]) # CR_TRY_KERNEL_COMPILE(INCLUDES,PROGRAM,[ACTION-IF-TRUE],[ACTION-IF_FALSE]) # ------------------------------------------------------ # Wrapper to invoke AC_TRY_COMPILE against the kernel headers AC_DEFUN([CR_TRY_KERNEL_COMPILE],[ AC_REQUIRE([CR_SET_KCFLAGS]) SAVE_CC=$CC SAVE_CFLAGS=$CFLAGS SAVE_CPPFLAGS=$CPPFLAGS CC=$KCC CFLAGS="" CPPFLAGS="$KCFLAGS" AC_TRY_COMPILE([ #include #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif #include $1], [$2], [CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS $3], [CC=$SAVE_CC CFLAGS=$SAVE_CFLAGS CPPFLAGS=$SAVE_CPPFLAGS $4]) ]) # CR_CACHED_KERNEL_COMPILE(KEY,INCLUDES,PROGRAM,[ACTION-IF-TRUE],[ACTION-IF_FALSE]) # ------------------------------------------------------ # Wrapper to invoke CR_TRY_KERNEL_COMPILE w/ caching # Note KEY should be un-prefixed cache key # Should be called only between AC_MSG_CHECKING and AC_MSG_RESULT # Result appears as "yes" or "no" in cr_result (valid in the ACTIONs) AC_DEFUN([CR_CACHED_KERNEL_COMPILE],[ pushdef([cr_cvname],cr_cv_kconfig_[]$1)[]dnl AC_CACHE_VAL([cr_cvname],[ CR_TRY_KERNEL_COMPILE([$2],[$3],[cr_cvname=yes],[cr_cvname=no]) ]) cr_result=$cr_cvname CR_IF([test $cr_result = yes],[$4],[$5]) popdef([cr_cvname])[]dnl ]) # CR_CHECK_KERNEL_COMPILE(SYMBOL,INCLUDES,PROGRAM,[TEMPLATE_TEXT]) # ------------------------------------------------------ # Wrapper to invoke CR_CACHED_KERNEL_COMPILE then AC_DEFINE. # Calls AH_TEMPLATE with either default or supplied text. # Also sets HAVE_... to 1 or empty string AC_DEFUN([CR_CHECK_KERNEL_COMPILE],[ pushdef([cr_name],AS_TR_CPP(HAVE_[]$1))[]dnl AH_TEMPLATE(cr_name,m4_default([$4], [[Define to 1 if the kernel has $1.]])) AC_MSG_CHECKING([kernel for $1]) CR_CACHED_KERNEL_COMPILE(cr_name,[$2],[$3], [AC_DEFINE(cr_name, [1]) cr_name=1], [AC_DEFINE(cr_name, [0]) cr_name='']) AC_MSG_RESULT([$cr_result]) popdef([cr_name])[]dnl ]) # CR_CHECK_KERNEL_HEADER(FILE,[INCLUDES],[TEMPLATE_TEXT]) # ------------------------------------------------------ # Wrapper to invoke CR_CHECK_KERNEL_COMPILE for a given header AC_DEFUN([CR_CHECK_KERNEL_HEADER],[ CR_CHECK_KERNEL_COMPILE([$1],[ $2 #include <$1> ],[ ], m4_default([$3], [[Define to 1 if the kernel has the <$1> header file.]])) ]) # CR_CHECK_KERNEL_SYMBOL(SYMBOL,[INCLUDES],[TEMPLATE_TEXT]) # ------------------------------------------------------ # Wrapper to invoke CR_CHECK_KERNEL_COMPILE for a given symbol AC_DEFUN([CR_CHECK_KERNEL_SYMBOL],[ CR_CHECK_KERNEL_COMPILE([$1],[$2],[ int x = sizeof(&$1); ],[$3]) ]) # CR_CHECK_KERNEL_CALL(SYMBOL,[INCLUDES],[TEMPLATE_TEXT]) # ------------------------------------------------------ # Wrapper to invoke CR_CHECK_KERNEL_COMPILE for a given function or macro AC_DEFUN([CR_CHECK_KERNEL_CALL],[ CR_CHECK_KERNEL_COMPILE([$1],[$2],[ #ifdef $1 /* OK, it exists and is a macro */ #else /* Check for function case */ int x = sizeof(&$1); #endif ],m4_default([$3], [[Define to 1 if the kernel has the macro or function $1().]])) ]) # CR_CHECK_KERNEL_CALL_FULL(SHORTNAME,SYMBOL,INCLUDES,TYPE,ARGS,[TEMPLATE_TEXT]) # ------------------------------------------------------ # Wrapper to invoke CR_CHECK_KERNEL_COMPILE for a given function or macro # Includes checking for compatible return type and arguments AC_DEFUN([CR_CHECK_KERNEL_CALL_FULL],[ CR_CHECK_KERNEL_COMPILE([$1],[$3],[ #ifndef $2 /* Must be macro or have a decl */ int x = sizeof(&$2); #endif ]cr_type_check([$2($5)],[$4]), m4_default([$6], m4_ifval([$4], [Define to 1 if the kernel has "$4 $2($5)".], [Define to 1 if the kernel has "$2($5)".]))) ]) # CR_CHECK_KERNEL_CALL_NARGS(SYMBOL,INCLUDES,ARGS1[,ARGS2...]) # ------------------------------------------------------ # See if each given SYMBOL(ARGSn) will compile # Defines HAVE_[N]_ARG_[uppercase($1)] for N equal to argument # count for any successful compilations. AC_DEFUN([CR_CHECK_KERNEL_CALL_NARGS],[ m4_if(m4_eval([$# >= 3]),1,[ pushdef([cr_nargs],[len(patsubst([$3],[[^,]+,?],[@]))]) CR_CHECK_KERNEL_CALL_FULL(cr_nargs[-arg $1],[$1],[$2],[],[$3], [[Define to 1 if the kernel has ]cr_nargs[-arg $1().]]) popdef([cr_nargs])]) m4_if(m4_eval([$# > 3]),1,[$0([$1],[$2],m4_shift(m4_shift(m4_shift($@))))])dnl tail recursion ]) # CR_CHECK_KERNEL_TYPE(NAME,[INCLUDES],[TEMPLATE_TEXT]) # ------------------------------------------------------ # Wrapper to invoke CR_CHECK_KERNEL_COMPILE for a given type AC_DEFUN([CR_CHECK_KERNEL_TYPE],[ CR_CHECK_KERNEL_COMPILE([$1],[$2],[ $1 y; int x = sizeof(y); ],m4_default([$3], [[Define to 1 if the kernel has the type '$1'.]])) ]) # CR_CHECK_KERNEL_MEMBER(SHORTNAME,INCLUDES,AGGREGATE,TYPE,MEMBER,[TEMPLATE_TEXT]) # ------------------------------------------------------ # Wrapper to invoke CR_CHECK_KERNEL_COMPILE for a given aggregate member w/ type check AC_DEFUN([CR_CHECK_KERNEL_MEMBER],[ CR_CHECK_KERNEL_COMPILE([$1],[$2], [$3 x; ] cr_type_check([x.$5],[$4]), m4_default([$6], m4_ifval([$4], [Define to 1 if the kernel type '$3' has member '$5' of type '$4'.], [Define to 1 if the kernel type '$3' has member '$5'.]))) ]) # CR_CHECK_KERNEL_CONSTANT(SYMBOL,[INCLUDES],[TEMPLATE_TEXT]) # ------------------------------------------------------ # Wrapper to invoke CR_CHECK_KERNEL_COMPILE for a given constant AC_DEFUN([CR_CHECK_KERNEL_CONSTANT],[ CR_CHECK_KERNEL_COMPILE([$1],[$2],[ typeof($1) y; int x = sizeof(y); ],m4_default([$3], [[Define to 1 if the kernel defines the constant $1.]])) ]) # CR_CHECK_KERNEL_MACRO(SYMBOL,[INCLUDES],[TEMPLATE_TEXT]) # ------------------------------------------------------ # Wrapper to invoke CR_CHECK_KERNEL_COMPILE for a given macro AC_DEFUN([CR_CHECK_KERNEL_MACRO],[ CR_CHECK_KERNEL_COMPILE([$1],[$2],[ #ifndef $1 choke me #endif ],m4_default([$3], [[Define to 1 if the kernel defines the macro $1.]])) ]) # CR_CHECK_KERNEL_DECL(SHORTNAME,SYMBOL,INCLUDES,DECL,[TEMPLATE_TEXT]) # ------------------------------------------------------ # Wrapper to invoke CR_CHECK_KERNEL_COMPILE to check a protoype/declaration. # The prototype/declaration is tried at file scope to check for conflicting # declarations, and the symbol is referenced in main to catch lack of any # declaration. AC_DEFUN([CR_CHECK_KERNEL_DECL],[ CR_CHECK_KERNEL_COMPILE([$1], [$3 $4],[int x = sizeof(&$2)], m4_default([$5], [[Define to 1 if the kernel has $1.]])) ]) # CR_BAD_KERNEL([REASON]) # ------------------------------------------------------ # Die, informing the user that the kernel cannot be used. # Optionally provide a reason. AC_DEFUN([CR_BAD_KERNEL],[ AC_CACHE_SAVE CR_CONFIG_REPORT m4_ifval([$1], [ AC_MSG_ERROR([Unable to use kernel $LINUX_VER - $1]) ], [ AC_MSG_ERROR([Unable to use kernel $LINUX_VER]) ]) ]) # CR_LINUX_SYMTAB() # ------------------------------------------------------ # Check for System.map in some standard places # If LINUX_SYSTEM_MAP is set, just verifies existance, # else if LINUX_VMLINUX is set, just verifies existance, # else search for either file in standard locations. # When complete sets LINUX_SYMTAB_CMD such that # "eval $LINUX_SYMTAB_CMD" will produce a System.map on stdout. cr_stripped_maps='' m4_define([cr_ksymtab_patt],[[-e '[TD] sys_open' -e '[AB] _end']]) AC_DEFUN([_CR_CHECK_SYSTEM_MAP],[ if test -n "$1" -a -r "$1" && grep cr_ksymtab_patt <"$1" >/dev/null 2>/dev/null; then if grep -B1 '[[AB]] _end' <"$1" | grep _stext >/dev/null 2>/dev/null; then # Reject "stripped" files (such as in FC2) # Recognized (poorly) by _stext and _end as last two entries. cr_stripped_maps="$cr_stripped_maps $1" else LINUX_SYSTEM_MAP="$1" LINUX_SYMTAB_FILE="$1" LINUX_SYMTAB_CMD="cat $1 2>/dev/null" fi fi ]) AC_DEFUN([_CR_CHECK_VMLINUX],[ AC_REQUIRE([AC_PROG_NM]) if test -n "$1" -a -r "$1" && ($NM "$1" | grep cr_ksymtab_patt) >/dev/null 2>/dev/null; then LINUX_VMLINUX="$1" LINUX_SYMTAB_FILE="$1" LINUX_SYMTAB_CMD="$NM $1 2>/dev/null" fi ]) AC_DEFUN([CR_LINUX_SYMTAB],[ AC_REQUIRE([CR_CHECK_LINUX]) AC_MSG_CHECKING([[for Linux kernel symbol table]]) AC_SUBST([LINUX_SYMTAB_FILE]) AC_SUBST([LINUX_SYMTAB_CMD]) AC_SUBST([LINUX_SYMTAB_CONF]) CR_GET_CACHE_VAR([LINUX_SYSTEM_MAP]) CR_GET_CACHE_VAR([LINUX_VMLINUX]) LINUX_SYMTAB_CMD="" # First try validating the user's (or cached) selection if test -n "$LINUX_SYSTEM_MAP" ; then _CR_CHECK_SYSTEM_MAP(["$LINUX_SYSTEM_MAP"]) if test -z "$LINUX_SYMTAB_CMD"; then # The user specified a file, but we can't use it. Abort. AC_MSG_RESULT([failed]) AC_MSG_ERROR([Failed to validate "$LINUX_SYSTEM_MAP"]) fi fi if test -z "$LINUX_SYMTAB_CMD" -a -n "$LINUX_VMLINUX" ; then _CR_CHECK_VMLINUX(["$LINUX_VMLINUX"]) if test -z "$LINUX_SYMTAB_CMD"; then # The user specified a file, but we can't use it. Abort. AC_MSG_RESULT([failed]) AC_MSG_ERROR([Failed to validate "$LINUX_VMLINUX"]) fi fi # Next try searching for System.map or vmlinux in standard locations # Note we use the kernel version found in the headers, not `uname -r` if test -z "$LINUX_SYMTAB_CMD" ; then for cr_file_pattern in "$LINUX_OBJ/@-$LINUX_VER" \ "/boot/@-$LINUX_VER" \ "/@-$LINUX_VER" \ "$LINUX_OBJ/@" \ "/usr/lib/debug/boot/@-$LINUX_VER" \ "/usr/lib/debug/lib/modules/$LINUX_VER/@" \ ; do # Try System.map in the given location cr_file=`echo $cr_file_pattern | sed -e 's|@|System.map|'` _CR_CHECK_SYSTEM_MAP([$cr_file]) if test -n "$LINUX_SYMTAB_CMD"; then break fi # Try vmlinux in the given location cr_file=`echo $cr_file_pattern | sed -e 's|@|vmlinux|'` _CR_CHECK_VMLINUX([$cr_file]) if test -n "$LINUX_SYMTAB_CMD"; then break fi done fi # Announce our result if test -z "$LINUX_SYMTAB_CMD"; then LINUX_SYMTAB_CMD="true" AC_MSG_RESULT([failed]) AC_CACHE_SAVE if test -n "$cr_stripped_maps"; then AC_MSG_WARN([Skipped stripped System.map file(s): $cr_stripped_maps]) AC_MSG_ERROR([Failed to locate kernel symbol table. Try installing the kernel-debuginfo package matching your kernel, or using --with-system-map or --with-vmlinux.]) else AC_MSG_ERROR([Failed to locate kernel symbol table. Try using --with-system-map or --with-vmlinux.]) fi else AC_MSG_RESULT([$LINUX_SYMTAB_FILE]) CR_SET_CACHE_VAR([LINUX_SYSTEM_MAP]) CR_SET_CACHE_VAR([LINUX_VMLINUX]) CR_CACHE_REVALIDATE([${LINUX_SYMTAB_FILE}],[ksymtab],[kernel symbol table]) fi ]) # Now check for SYMTAB consistency w/ the kernel source # XXX: Currently just check SMPness. Can this be more aggressive? AC_DEFUN([CR_LINUX_SYMTAB_VALIDATE],[ AC_MSG_CHECKING([for SMP kernel source]) CR_CACHED_KERNEL_COMPILE([smp_source],[ #ifdef CR_NEED_AUTOCONF_H #include #endif #ifndef CONFIG_SMP choke me #endif ],[]) AC_MSG_RESULT([$cr_result]); cr_kernel_smp=$cr_result AC_MSG_CHECKING([for SMP kernel symbol table]) cr_symtab_smp=no if test -n "`eval $LINUX_SYMTAB_CMD | grep del_timer_sync 2>/dev/null | grep -v try_to_del_`"; then cr_symtab_smp=yes fi AC_MSG_RESULT([$cr_symtab_smp]); if test "$cr_kernel_smp" != "$cr_symtab_smp"; then CR_CONFIG_REPORT if test "$cr_kernel_smp" = yes; then AC_MSG_ERROR([Kernel source is configured SMP but the kernel symbol table is not. Consider specifying a symbol table with --with-system-map or --with-vmlinux. Or, if using kernel sources that are configured by /boot/kernel.h, you may try --with-kernel-type=UP to force a uni-processor interpretation of the sources.]) else AC_MSG_ERROR([Kernel source is configured uni-processor but the kernel symbol table is SMP. Consider specifying a symbol table with --with-system-map or --with-vmlinux. Or, if using kernel sources that are configured by /boot/kernel.h, you may try --with-kernel-type=SMP to force an SMP interpretation of the sources.]) fi fi ]) # ------------------------------------------------------ # Helpers for CR_FIND_KSYM() and CR_FIND_EXPORTED_KSYM() AC_DEFUN([_CR_KSYM_INIT_PATTS],[ case "$CR_KARCH" in ppc64) CR_KSYM_PATTERN_DATA=['[bBdDgGrRsStTvV] '] CR_KSYM_PATTERN_CODE=['[dD] '] dnl Function descriptor is data ;; *) CR_KSYM_PATTERN_DATA=['[bBdDgGrRsStTvV] '] CR_KSYM_PATTERN_CODE=['[tT] '] ;; esac ]) AC_DEFUN([_CR_KSYM_INIT_FILE],[dnl pushdef([cr_name],CR_KSYM_[]AS_TR_CPP([$1])) cr_name="${TOP_BUILDDIR}/.$1" AC_SUBST_FILE(cr_name) echo '/* This file is autogenerated - do not edit or remove */' > $cr_name popdef([cr_name]) ]) AC_DEFUN([_CR_KSYM_INIT_FILES],[dnl _CR_KSYM_INIT_FILE([import_decls]) _CR_KSYM_INIT_FILE([import_calls]) ]) AC_DEFUN([_CR_FIND_KSYM],[dnl pushdef([cr_pattern],[${CR_KSYM_PATTERN_$2}$1$])dnl `eval $LINUX_SYMTAB_CMD | sed -n -e "/cr_pattern/ {s/ .*//p;q;}"`[]dnl popdef([cr_pattern])dnl ]) # CR_KSYM_FIXUP(NAME,TYPE) # The System.map for ARM THUMB2 kernels does not currently # include the lowest-bit-must-be-set on function pointers. # This helps us fix that up at configure time, using a bitwise-OR as # insurance against the possibility the bit IS set in later kernels. # # It also is a hook for any similar problems in the future. AC_DEFUN([CR_KSYM_FIXUP],[ if test "[$2]${HAVE_CONFIG_THUMB2_KERNEL}" = 'CODE1'; then [$1]=`$PERL -e "printf '%x', 1 | hex '$[$1]';"` fi ]) # Helper to collect data used by CR_KSYM_FIXUP AC_DEFUN([_CR_KSYM_FIXUP],[ if test "$CR_ARCH" = 'arm'; then CR_CHECK_KERNEL_MACRO([CONFIG_THUMB2_KERNEL]) fi ]) # CR_FIND_KSYM(SYMBOL,TYPE,[DECL]) # ------------------------------------------------------ # Search System.map for address of the given symbol and deposit the # neccessary bits in $CR_KSYM_IMPORT_DECLS and $CR_KSYM_IMPORT_CALLS # to generate blcr_imports.h and imports.c, respectively: # If the symbol is not found, nothing is deposited. # If the symbol is not found to be not exported, then, as appropriate, # deposit a call to either _CR_IMPORT_KDATA or _CR_IMPORT_KCODE into # the file $CR_KSYM_IMPORT_CALLS # If the symbol is found (exported or nor) but does not have a declaration # aftern including blcr_imports.h.in, then we deposit the supplied # declaration into the file $CR_KSYM_IMPORT_DECLS, or issue an error if # no declaration was supplied. # We also conditionally define a symbol in $(CONFIG_HEADER) as follows: # If not found, leave CR_K${TYPE}_${symbol} undefined # If found to be exported, "#define CR_K${TYPE}_${symbol} 0" # If found not to be exported, "#define CR_K${TYPE}_${symbol} 0x" # On return, cr_addr is set (or empty) the same way. AC_DEFUN([CR_FIND_KSYM],[ AC_REQUIRE([CR_LINUX_SYMTAB]) AC_REQUIRE([_CR_KSYM_FIXUP]) AC_REQUIRE([_CR_KSYM_INIT_PATTS]) AC_MSG_CHECKING([[kernel symbol table for $1]]) # Our cacheval is encoded with 'Y' or 'N' as the first char to indicate # if a declaration was found or not, and the address or 0 as the rest. pushdef([cr_cvname],cr_cv_ksymtab_[$1])[]dnl AC_CACHE_VAL([cr_cvname],[ cr_cvname=_CR_FIND_KSYM([$1],[$2]) if test -n "$cr_cvname"; then if eval $LINUX_SYMTAB_CMD | grep " __ksymtab_$1\$" >/dev/null ; then cr_cvname=0 else CR_KSYM_FIXUP(cr_cvname,[$2]) fi CR_TRY_KERNEL_COMPILE([ #define IN_CONFIGURE 1 #include "${TOP_SRCDIR}/include/blcr_imports.h.in" ],[int x = sizeof(&$1);],[cr_cvname="Y$cr_cvname"],[cr_cvname="N$cr_cvname"]) fi ]) cr_addr='' if test -z "$cr_cvname"; then cr_result='not found' else if expr "$cr_cvname" : N >/dev/null; then m4_ifval([$3],[cat >>$CR_KSYM_IMPORT_DECLS <<_EOF [$3] _EOF ], AC_MSG_ERROR([Found symbol $1 but no declaration -- please file a bug report.])) fi cr_result=`echo $cr_cvname | tr -d 'YN'` if test $cr_result = 0; then cr_result=exported cr_addr=0 else cr_addr="0x$cr_result" echo "_CR_IMPORT_K$2($1, $cr_addr)" >>$CR_KSYM_IMPORT_CALLS fi AC_DEFINE_UNQUOTED(CR_K[$2]_[$1],$cr_addr, [Define to address of non-exported kernel symbol $1, or 0 if exported]) fi popdef([cr_cvname])[]dnl AC_MSG_RESULT([$cr_result]) ]) # CR_FIND_EXPORTED_KSYM(SYMBOL,TYPE) # ------------------------------------------------------ # Search System.map for address of the given symbol and # add the following to $(CONFIG_HEADER): # "#define CR_EXPORTED_K${TYPE}_foo 0x" # If not found, cr_addr will be 0 on return. AC_DEFUN([CR_FIND_EXPORTED_KSYM],[ AC_REQUIRE([CR_LINUX_SYMTAB]) AC_REQUIRE([_CR_KSYM_FIXUP]) AC_REQUIRE([_CR_KSYM_INIT_PATTS]) AC_MSG_CHECKING([[kernel symbol table for exported $1]]) pushdef([cr_cvname],cr_cv_ksymtab_exp_[$1])[]dnl AC_CACHE_VAL([cr_cvname],[ cr_cvname=_CR_FIND_KSYM([$1],[$2]) if test -n "$cr_cvname" && eval $LINUX_SYMTAB_CMD | grep " __ksymtab_$1\$" >/dev/null; then : # keep it else cr_cvname='' fi]) if test -n "$cr_cvname"; then CR_KSYM_FIXUP(cr_cvname,[$2]) cr_result="$cr_cvname" cr_addr="0x$cr_cvname" AC_DEFINE_UNQUOTED(CR_EXPORTED_K[$2]_[$1],$cr_addr, [Define to address of exported kernel symbol $1]) else cr_result='not found' cr_addr=0 fi popdef([cr_cvname])[]dnl AC_MSG_RESULT([$cr_result]) ]) # Find how to rpmbuild (if possible at all) AC_DEFUN([CR_PROG_RPMBUILD],[ AC_PATH_PROGS([RPMBUILD],[rpmbuild rpmb rpm],[none],[$PATH:/usr/lib/rpm]) if $RPMBUILD -bs 2>&1 | grep 'no spec' >/dev/null 2>/dev/null; then : else RPMBUILD=none fi ]) # CR_STACK_DIRECTION() # ------------------------------------------------------ # Determine direction of stack grown # Copied (and slightly modified) from autoconf's alloca code AC_DEFUN([CR_STACK_DIRECTION],[ pushdef([cr_cvname],cr_cv_check_stack_direction)[]dnl AC_CACHE_CHECK([[for direction of stack growth]],cr_cvname,[ AC_TRY_RUN([ int find_stack_direction (void) { static char *addr = 0; auto char dummy; if (addr == 0) { addr = &dummy; return find_stack_direction(); } else { return (&dummy > addr) ? 0 : 1; } } int main(void) { return find_stack_direction(); }], [cr_cvname=up], [cr_cvname=down], [CR_CROSS_VAR(cross_stack_direction) if test $cross_stack_direction = 1; then cr_cvname=up else cr_cvname=down fi]) ]) if test $cr_cvname = up; then cr_stack_direction=1 else cr_stack_direction=-1 fi AC_DEFINE_UNQUOTED([CR_STACK_GROWTH], $cr_stack_direction) AH_TEMPLATE([CR_STACK_GROWTH],[Positive if stack grows up, negative if it grows down]) popdef([cr_cvname])[]dnl ]) # CR_CHECK_KMALLOC_MAX() # ------------------------------------------------------ # Determine maximum kmalloc allocation AC_DEFUN([CR_CHECK_KMALLOC_MAX],[ pushdef([cr_cvname],cr_cv_kconfig_kmalloc_max)[]dnl AC_CACHE_CHECK([[kernel for maximum kmalloc() allocation]],cr_cvname,[ cr_kmalloc_default="131072 (default)" cr_header="${LINUX_OBJ}/include/generated/autoconf.h" test -e "$cr_header" || cr_header="${LINUX_OBJ}/include/linux/autoconf.h" cr_cvname=`eval "$CPP $CPPFLAGS -I${LINUX_OBJ}/include \ -include ${cr_header} \ ${LINUX_OBJ}/include/linux/kmalloc_sizes.h" 2>/dev/null | \ $PERL -n -e 'BEGIN {$max=0;}' \ -e ['if (/CACHE\s*\(\s*([0-9]+)\s*\)/ && ($][1 > $max)) { $max = $][1; }'] \ -e 'END {print "$max\n";}'` if test $? = 0 -a "$cr_cvname" != 0; then : # OK - keep it else cr_cvname="$cr_kmalloc_default" fi ]) cr_kmalloc_max=`echo $cr_cvname | cut -d' ' -f1` AC_DEFINE_UNQUOTED([CR_KMALLOC_MAX], $cr_kmalloc_max, [Maximum legal size to kmalloc()]) popdef([cr_cvname])[]dnl ]) # CR_CROSS_VAR(varname) # ------------------------------------------------------ # Check for a value of given variable, or AC_MSG_ERROR if unset AC_DEFUN([CR_CROSS_VAR],[ if test "${$1-unset}" = unset; then AC_MSG_ERROR([When cross-compiling, variable $1 must be set.]) fi ]) # CR_COMPUTE_INT(VAR,EXPRESSION,[INCLUDES]) # ------------------------------------------------------ # Compute a constant (ulong) C expression, even when cross compiling AC_DEFUN([CR_COMPUTE_INT],[ pushdef([cr_cvname],cr_cv_compute_int_[$1])[]dnl AC_CACHE_CHECK([[for value for $1]],cr_cvname,[ cr_cvname="not found" m4_ifdef([AC_COMPUTE_INT], [AC_COMPUTE_INT([cr_cvname], [$2], [$3])], [_AC_COMPUTE_INT([$2], [cr_cvname], [$3])]) ]) if test "$cr_cvname" != "not found"; then [$1]="$cr_cvname" fi popdef([cr_cvname])[]dnl ]) # CR_DEFINE_INT(VAR,EXPRESSION,[INCLUDES],[TEMPLATE_TEXT]) # ------------------------------------------------------ # Like CR_COMPUTE_INT, but also doing AC_DEFINE AC_DEFUN([CR_DEFINE_INT],[ pushdef([cr_varname],[$1])[]dnl cr_varname="" CR_COMPUTE_INT(cr_varname,[$2],[$3]) if test -n "$cr_varname"; then AC_DEFINE_UNQUOTED(cr_varname, $cr_varname) AH_TEMPLATE(cr_varname,m4_default([$4], [[Computed value of '$2']])) fi popdef([cr_varname])[]dnl ]) # CR_COMPUTE_KERNEL_INT(VAR,EXPRESSION,[INCLUDES]) # ------------------------------------------------------ # Compute a constant (ulong) C expression, even when cross compiling, using # the kernel compilation environment. I had to kludge this to get it to work # by setting the cross_compiling flag to yes. Otherwise, the program that # autoconf builds tries to use stdio calls, and the test fails. # # By setting this flag, autoconf uses _AC_COMPUTE_INT_RUN to evaluate the # expression, rather than _AC_COMPUTE_INT_COMPILE, which uses stdio by default. AC_DEFUN([CR_COMPUTE_KERNEL_INT],[ AC_REQUIRE([CR_SET_KCFLAGS]) pushdef([cr_cvname],cr_cv_compute_kernel_int_[$1])[]dnl SAVE_CPP=$CPP SAVE_CPPFLAGS=$CPPFLAGS SAVE_cross_compiling="$cross_compiling" CPP="$KCC -E" CPPFLAGS="$KCFLAGS" cross_compiling="yes" AC_CACHE_CHECK([[kernel for value for $1]],cr_cvname,[ cr_cvname="not found" m4_ifdef([AC_COMPUTE_INT], [AC_COMPUTE_INT([cr_cvname], [$2], [$3])], [_AC_COMPUTE_INT([$2], [cr_cvname], [$3])]) ]) CPP=$SAVE_CPP CPPFLAGS=$SAVE_CPPFLAGS cross_compiling="$SAVE_cross_compiling" if test "$cr_cvname" != "not found"; then [$1]="$cr_cvname" fi popdef([cr_cvname])[]dnl ]) # CR_DEFINE_KERNEL_INT(VAR,EXPRESSION,[INCLUDES],[TEMPLATE_TEXT]) # ------------------------------------------------------ # Like CR_COMPUTE_KERNEL_INT, but also doing AC_DEFINE AC_DEFUN([CR_DEFINE_KERNEL_INT],[ pushdef([cr_varname],[$1])[]dnl cr_varname="" CR_COMPUTE_KERNEL_INT(cr_varname,[$2],[$3]) if test -n "$cr_varname"; then AC_DEFINE_UNQUOTED(cr_varname, $cr_varname) AH_TEMPLATE(cr_varname,m4_default([$4], [[Computed value of '$2']])) fi popdef([cr_varname])[]dnl ]) blcr-0.8.5/include/0000755000000000000000000000000012102072123011026 500000000000000blcr-0.8.5/include/blcr_ioctl.h0000664000000000000000000001471611051416207013255 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2003, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 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 * Library 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * $Id: blcr_ioctl.h,v 1.38 2008/08/16 00:17:11 phargrov Exp $ */ #ifndef _CR_IOCTL_H #define _CR_IOCTL_H 1 #define CR_IOCTL_BASE 0xA1 // // ioctl()s for libcr/callback code: // // CR_OP_HAND_CHKPT(unsigned long flags) // Called from libcr when the callbacks have run their CHECKPOINT // code and the thread is prepared for the kernel to save it. #define CR_OP_HAND_CHKPT _IOW (CR_IOCTL_BASE, 0x01, unsigned long) // CR_OP_HAND_ABORT(unsigned long flags) // Called from libcr when a callback wishes to abort the checkpoint/restart. // If flags is set to CR_CHECKPOINT_PERM_FAILURE, all processes in the // checkpoint are killed. #define CR_OP_HAND_ABORT _IOW (CR_IOCTL_BASE, 0x02, unsigned long) // 0x03 was CR_OP_HAND_CONT // 0x04 was CR_OP_HAND_RSTRT // CR_OP_HAND_PHASE1(long fd) // This is how a Phase1 thread/task announces itself to the kernel. #define CR_OP_HAND_PHASE1 _IOW (CR_IOCTL_BASE, 0x05, long) // CR_OP_HAND_SUSP(struct timeval * timeout) // Block in the kernel until one of the following three things happens: // 1) A checkpoint request arrives for this thread. // 2) A signal arrives for this thread. // 3) The timeout expires. // The timeout argument works exactly as in select(2). #define CR_OP_HAND_SUSP _IOWR(CR_IOCTL_BASE, 0x06, struct timeval *) // CR_OP_HAND_PHASE2(long fd) // This is how a Phase2 thread/task announces itself to the kernel. #define CR_OP_HAND_PHASE2 _IOW (CR_IOCTL_BASE, 0x07, long) // CR_OP_HAND_DONE(unsigned long flags) // Called from libcr when the callbacks have run to completion // and the thread is just about to resume execution // (returning from the signal handler or from cr_leave_cs). // This is the chance for the kernel to SIGSTOP us if we are to // be placed in a STOPPED state. #define CR_OP_HAND_DONE _IOW (CR_IOCTL_BASE, 0x08, unsigned long) // CR_OP_HAND_SRC(char *buffer) // This is how libcr queries the restart source. // The argument is a buffer of len >= PATH_MAX // The result is a string: // Empty if the source is not in the file system // Full path if source is a file, device, fifo, etc. // Path ending in "/." if source is a directory. #define CR_OP_HAND_SRC _IOR (CR_IOCTL_BASE, 0x09, char *) // CR_OP_HAND_CHKPT_INFO(struct cr_chkpt_info *) // This is how cr_get_checkpoint_info() is implemented. #define CR_OP_HAND_CHKPT_INFO _IOR (CR_IOCTL_BASE, 0x0a, struct cr_chkpt_info *) // // ioctl()s for cr_checkpoint: // // CR_OP_CHKPT_REQ(struct cr_chkpt_args *args) // Called to request a checkpoint of a task/proc/pgrp/session. #define CR_OP_CHKPT_REQ _IOW (CR_IOCTL_BASE, 0x10, struct cr_chkpt_args *) // 0x11 was CR_OP_CHKPT_DONE // CR_OP_CHKPT_REAP(void) // Called to reap a completed checkpoint. // This is necessary if you wish to issue a new request on the same // file descriptor, and is recommended as a polite way to cleanup. // However, closing the fd (or exiting) will do this implicitly. #define CR_OP_CHKPT_REAP _IO (CR_IOCTL_BASE, 0x12) // CR_OP_CHKPT_FWD(struct cr_fwd_args *args) // Called to propagate a checkpoint request to another process. #define CR_OP_CHKPT_FWD _IOW (CR_IOCTL_BASE, 0x13, struct cr_fwd_args *) // CR_OP_CHKPT_LOG(struct cr_log_args *args) // Called to collect error/warning log from a completed checkpoint. // arg.buf is the space allocated for the result // arg.len is the length of buf // Return value is value of arg.len required to receive full log. // arg.buf is always nul-terminated if return >= 0. #define CR_OP_CHKPT_LOG _IOR (CR_IOCTL_BASE, 0x14, struct cr_log_args *) // // ioctl()s for cr_restart: // // CR_OP_RSTRT_REQ(struct cr_rstrt_args *args) // Called to request a restart from a given file descriptor. #define CR_OP_RSTRT_REQ _IOW (CR_IOCTL_BASE, 0x20,\ struct cr_rstrt_args *) // 0x21 was CR_OP_RSTRT_DONE // CR_OP_RSTRT_REAP(void) // Called to reap a completed restart. // This is necessary if you wish to issue a new request on the same // file descriptor, and is recommended as a polite way to cleanup. // However, closing the fd (or exiting) will do this implicitly. #define CR_OP_RSTRT_REAP _IO (CR_IOCTL_BASE, 0x22) // CR_OP_RSTRT_CHILD(void) // Called to overlay a process with a restart image. // Acts like exec(). Will not return unless there has been an error. #define CR_OP_RSTRT_CHILD _IO (CR_IOCTL_BASE, 0x23) // 0x24 : was OP_RSTRT_CLONES // 0x25 : was OP_RSTRT_FORKS // CR_OP_RSTRT_PROCS(struct cr_procs_tbl **) // Called to determine if more processes are needed. // Returns 0 if done, positive if not, or negative on error. // Stores info on needed procs to supplied address. #define CR_OP_RSTRT_PROCS _IOR (CR_IOCTL_BASE, 0x26,\ struct cr_procs_tbl *) // CR_OP_RSTRT_LOG(struct cr_log_args *args) // Called to collect error/warning log from a completed restart. // arg.buf is the space allocated for the result // arg.len is the length of buf // Return value is value of arg.len required to receive full log. // arg.buf is always nul-terminated if return >= 0. #define CR_OP_RSTRT_LOG _IOR (CR_IOCTL_BASE, 0x27, struct cr_log_args *) // // ioctl()s for general use: // // CR_OP_VERSION(unsigned long version) // Called to verify the kernel supports the specified version // where version = (CR_MODULE_MAJOR << 16) | CR_MODULE_MINOR // Return of 0 is success, meaning we support that version. #define CR_OP_VERSION _IOW (CR_IOCTL_BASE, 0x30, unsigned long) #endif blcr-0.8.5/include/Makefile.am0000664000000000000000000000103310672337651013025 00000000000000if CR_BUILD_INCLUDE include_HEADERS = blcr_ioctl.h blcr_proc.h blcr_errcodes.h libcr.h nodist_include_HEADERS = blcr_common.h noinst_HEADERS = blcr_ksyms.h blcr_vmadump.h nodist_noinst_HEADERS = blcr_imports.h else nodist_noinst_HEADERS = blcr_common.h blcr_imports.h endif if CR_BUILD_MODULES # Additional dependence for file generated via AC_SUBST_FILE() blcr_imports.h: $(top_builddir)/.import_decls endif all-local: if test -d $(top_builddir)/libcr32/include; then $(MAKE) $(AM_MAKEFLAGS) -C $(top_builddir)/libcr32/include all; fi blcr-0.8.5/include/blcr_errcodes.h0000664000000000000000000000460111011453605013740 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2007, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 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 * Library 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * $Id: blcr_errcodes.h,v 1.13 2008/05/11 02:18:45 phargrov Exp $ */ /* * This file is included twice, once to #define the error codes, and once to * map the error codes to their descriptions for cr_strerror(). * * Do not put anything besides CR_ERROR_DEF() macros in this file. * Always APPEND to the file, to avoid renumbering existing error codes. */ CR_ERROR_DEF(CR_ETEMPFAIL, "Temporary error: checkpoint cancelled") CR_ERROR_DEF(CR_EPERMFAIL, "Permanent failure: checkpoint cancelled and job killed") CR_ERROR_DEF(CR_ENOSUPPORT, "Checkpoint support not linked into one or more processes") CR_ERROR_DEF(CR_EVERSION, "Requested kernel interface version is not supported") CR_ERROR_DEF(CR_EOMITTED, "Process omitted from checkpoint at a callback's request") CR_ERROR_DEF(CR_EBADARCH, "Context file does not match the kernel architecture") CR_ERROR_DEF(CR_EPTRACED, "One or more target processes is being ptraced") CR_ERROR_DEF(CR_EPTRACER, "One or more target processes has ptrace children") CR_ERROR_DEF(CR_ERSTRTABRT, "Restart aborted: restart cancelled and job killed") CR_ERROR_DEF(CR_ERESTARTED, "Request is invalid across a restart") CR_ERROR_DEF(CR_ENOTCB, "Call is only valid from a checkpoint callback") CR_ERROR_DEF(CR_ENOINIT, "Calling thread has not called cr_init()") blcr-0.8.5/include/blcr_imports.h.in0000664000000000000000000000604411431067212014240 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2008, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * * 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 * * $Id: blcr_imports.h.in,v 1.14.14.2 2010/08/12 21:58:34 phargrov Exp $ * * This file provides otherwise missing declarations for functions * and data which BLCR imports via the blcr_imports kernel module. * These declartations serve two purposes: * 1) The import mechanism requires a visible prototype. * 2) The code that uses the imported symbols will need prototypes too. */ #ifndef _BLCR_IMPORTS_H #define _BLCR_IMPORTS_H 1 #ifdef CR_NEED_AUTOCONF_H #include #endif #if defined(CONFIG_SMP) && ! defined(__SMP__) #define __SMP__ #endif #if defined(CONFIG_MODVERSIONS) && ! defined(MODVERSIONS) #define MODVERSIONS #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #if HAVE_LINUX_SYSCALLS_H #include #endif #if HAVE_LINUX_PSPACE_H #include #endif #if HAVE_LINUX_PID_NAMESPACE_H #include #endif #if HAVE_ASM_ELF_H #include #endif #if HAVE_ASM_DESC_H #include #endif #if HAVE_ASM_I387_H #include #endif #include #include #if HAVE_LINUX_UTRACE_H #include #endif #if HAVE_LINUX_FDTABLE_H #include #endif #ifndef FASTCALL #define FASTCALL(_decl) _decl #endif extern const char *blcr_config_timestamp; #ifndef IN_CONFIGURE /* BEGIN AUTO-GENERATED FRAGMENT */ @CR_KSYM_IMPORT_DECLS@ /* END AUTO-GENERATED FRAGMENT */ #endif #endif /* !_BLCR_IMPORTS_H */ blcr-0.8.5/include/blcr_vmadump.h0000664000000000000000000001107312064133247013612 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2007, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * * 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 * * $Id: blcr_vmadump.h,v 1.17.14.1 2012/12/18 18:32:07 phargrov Exp $ * * This file provides declarations for BLCR-specific VMADump extensions. */ #ifndef _BLCR_VMADUMP_H #define _BLCR_VMADUMP_H #ifndef EXPORT_SYMBOL_GPL #define EXPORT_SYMBOL_GPL EXPORT_SYMBOL #endif /* Not maintaining the binfmt code */ #undef HAVE_BINFMT_VMADUMP /* Flags for dump/undump */ #define VMAD_DUMP_NOSHANON 0x0100 /* let BLCR dump shared anonymous mappings */ #define VMAD_DUMP_NOEXEC 0x0200 /* let BLCR dump the executable */ #define VMAD_DUMP_NOPRIVATE 0x0400 /* let BLCR dump private filenamed memory */ #define VMAD_DUMP_NOSHARED 0x0800 /* let BLCR dump shared filenamed memory */ /* Additional flags */ #define VMAD_DUMP_REGSONLY 0x1000 /* Only thread-specific info */ /* Check for mis-match */ #if defined(CR_CHKPT_DUMP_EXEC) && (CR_CHKPT_DUMP_EXEC != VMAD_DUMP_NOEXEC) #error "Mismatch CR_CHKPT_DUMP_EXEC vs. VMAD_DUMP_EXEC" #endif #if defined(CR_CHKPT_DUMP_PRIVATE) && (CR_CHKPT_DUMP_PRIVATE != VMAD_DUMP_NOPRIVATE) #error "Mismatch CR_CHKPT_DUMP_PRIVATE vs. VMAD_DUMP_PRIVATE" #endif #if defined(CR_CHKPT_DUMP_SHARED) && (CR_CHKPT_DUMP_SHARED != VMAD_DUMP_NOSHARED) #error "Mismatch CR_CHKPT_DUMP_SHARED vs. VMAD_DUMP_SHARED" #endif #ifdef __KERNEL__ #include "blcr_config.h" #include "blcr_imports.h" /* Overload the namelen flag to store ARCH-specific mappings */ #define VMAD_NAMELEN_ARCH (PAGE_SIZE+1) #if defined(ARCH_HAS_SETUP_ADDITIONAL_PAGES) #define VMAD_HAVE_ARCH_MAPS 1 #elif (defined(CR_KCODE_map_vsyscall) && HAVE_MAP_VSYSCALL) /* Note care taken w/ map_vsyscall(): * + FC5/x86 declares the symbol but never defines it. * + x86_64 kernels have a symbol by the same name, but w/ a different purpose * So, we look for both CR_KCODE_map_vsyscall and HAVE_MAP_VSYSCALL */ #define VMAD_HAVE_ARCH_MAPS 1 #elif ((VMAD_ARCH == VMAD_ARCH_x86_64) && defined(CR_KCODE_syscall32_setup_pages)) /* x86_64 kernels prior to 2.6.23 supported the 32-bit vDSO w/o having one of their own */ #define VMAD_HAVE_ARCH_MAPS 1 #else #define VMAD_HAVE_ARCH_MAPS 0 #endif #if VMAD_HAVE_ARCH_MAPS extern int vmad_is_arch_map(const struct vm_area_struct *map); #else #define vmad_is_arch_map(map) (0) #endif /* Here because vmadump and BLCR must agree */ static inline int vmad_dentry_unlinked(struct dentry *dentry) { return ((!IS_ROOT(dentry) && d_unhashed(dentry)) || (dentry->d_inode->i_nlink == 0) || (dentry->d_flags & DCACHE_NFSFS_RENAMED)); } static inline int vmad_is_exe(struct vm_area_struct *map) { #if HAVE_VMA_VM_MM && HAVE_MM_EXE_FILE return (map->vm_mm && (map->vm_mm->exe_file == map->vm_file)); #elif defined(VM_EXECUTABLE) return (map->vm_flags & VM_EXECUTABLE); #else #error "No way to detect /proc/pid/exe" #endif } /* Here because vmadump and BLCR must agree */ static inline int vmad_is_special_mmap(struct vm_area_struct *map, int flags) { const struct file * const filp = map->vm_file; const unsigned long vm_flags = map->vm_flags; BUG_ON(!filp); if (vmad_is_arch_map(map)) return 0; #ifdef CONFIG_HUGETLBFS /* Ignore unlinked status, since hugetlbfs is not persistent */ if (is_vm_hugetlb_page(map)) return 1; #endif if (vmad_dentry_unlinked(filp->f_dentry)) { return (vm_flags & VM_SHARED); } return (((flags & VMAD_DUMP_NOEXEC) && vmad_is_exe(map)) || ((flags & VMAD_DUMP_NOPRIVATE) && !(vm_flags & VM_SHARED)) || ((flags & VMAD_DUMP_NOSHARED) && (vm_flags & VM_SHARED))); } #endif /* defined(__KERNEL__) */ #endif blcr-0.8.5/include/Makefile.in0000664000000000000000000004114312102070010013011 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = include DIST_COMMON = $(am__include_HEADERS_DIST) $(am__noinst_HEADERS_DIST) \ $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/blcr_common.h.in $(srcdir)/blcr_imports.h.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/blcr_config.h CONFIG_CLEAN_FILES = blcr_imports.h blcr_common.h CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = am__include_HEADERS_DIST = blcr_ioctl.h blcr_proc.h blcr_errcodes.h \ libcr.h 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__installdirs = "$(DESTDIR)$(includedir)" "$(DESTDIR)$(includedir)" am__noinst_HEADERS_DIST = blcr_ksyms.h blcr_vmadump.h HEADERS = $(include_HEADERS) $(nodist_include_HEADERS) \ $(nodist_noinst_HEADERS) $(noinst_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CONFIGURE_ARGS = @CONFIGURE_ARGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CR_ARCH = @CR_ARCH@ CR_CLIENT_LDADD = @CR_CLIENT_LDADD@ CR_CPU = @CR_CPU@ CR_FTB_INCLUDES = @CR_FTB_INCLUDES@ CR_FTB_LDADD = @CR_FTB_LDADD@ CR_FTB_LDFLAGS = @CR_FTB_LDFLAGS@ CR_KARCH = @CR_KARCH@ CR_KERNEL = @CR_KERNEL@ CR_KERNEL_BASE = @CR_KERNEL_BASE@ CR_LIBARCH = @CR_LIBARCH@ CR_LIBCR_CFLAGS = @CR_LIBCR_CFLAGS@ CR_MODULE_DIR = @CR_MODULE_DIR@ CR_MODULE_MAJOR = @CR_MODULE_MAJOR@ CR_MODULE_MINOR = @CR_MODULE_MINOR@ CR_MODULE_PATCH = @CR_MODULE_PATCH@ CR_MODULE_VERSION = @CR_MODULE_VERSION@ CR_NDEBUG = @CR_NDEBUG@ CR_RELEASE_MAJOR = @CR_RELEASE_MAJOR@ CR_RELEASE_MINOR = @CR_RELEASE_MINOR@ CR_RELEASE_PATCH = @CR_RELEASE_PATCH@ CR_RELEASE_VERSION = @CR_RELEASE_VERSION@ CR_SIGNUM = @CR_SIGNUM@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GMAKE_ELSE = @GMAKE_ELSE@ GMAKE_ENDIF = @GMAKE_ENDIF@ GMAKE_IFEQ = @GMAKE_IFEQ@ GMAKE_IFNEQ = @GMAKE_IFNEQ@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KBUILD_MAK = @KBUILD_MAK@ KBUILD_MAKE_ARGS = @KBUILD_MAKE_ARGS@ KCC = @KCC@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBCR_MAJOR = @LIBCR_MAJOR@ LIBCR_MINOR = @LIBCR_MINOR@ LIBCR_PATCH = @LIBCR_PATCH@ LIBCR_VERSION = @LIBCR_VERSION@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_AGE = @LIBTOOL_AGE@ LIBTOOL_INTERFACE = @LIBTOOL_INTERFACE@ LIBTOOL_REVISION = @LIBTOOL_REVISION@ LINUX_OBJ = @LINUX_OBJ@ LINUX_SRC = @LINUX_SRC@ LINUX_SYMTAB_CMD = @LINUX_SYMTAB_CMD@ LINUX_SYMTAB_CONF = @LINUX_SYMTAB_CONF@ LINUX_SYMTAB_FILE = @LINUX_SYMTAB_FILE@ LINUX_VER = @LINUX_VER@ LINUX_VERSION_H = @LINUX_VERSION_H@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKE = @MAKE@ MAKEINFO = @MAKEINFO@ 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_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PWD_PROG = @PWD_PROG@ RANLIB = @RANLIB@ RPMBUILD = @RPMBUILD@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TOP_BUILDDIR = @TOP_BUILDDIR@ TOP_SRCDIR = @TOP_SRCDIR@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ 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@ lt_ECHO = @lt_ECHO@ 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@ @CR_BUILD_INCLUDE_TRUE@include_HEADERS = blcr_ioctl.h blcr_proc.h blcr_errcodes.h libcr.h @CR_BUILD_INCLUDE_TRUE@nodist_include_HEADERS = blcr_common.h @CR_BUILD_INCLUDE_TRUE@noinst_HEADERS = blcr_ksyms.h blcr_vmadump.h @CR_BUILD_INCLUDE_FALSE@nodist_noinst_HEADERS = blcr_common.h blcr_imports.h @CR_BUILD_INCLUDE_TRUE@nodist_noinst_HEADERS = blcr_imports.h all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign include/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign include/Makefile .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): blcr_imports.h: $(top_builddir)/config.status $(srcdir)/blcr_imports.h.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ blcr_common.h: $(top_builddir)/config.status $(srcdir)/blcr_common.h.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-includeHEADERS: $(include_HEADERS) @$(NORMAL_INSTALL) test -z "$(includedir)" || $(MKDIR_P) "$(DESTDIR)$(includedir)" @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includedir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(includedir)" || exit $$?; \ done uninstall-includeHEADERS: @$(NORMAL_UNINSTALL) @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ test -n "$$files" || exit 0; \ echo " ( cd '$(DESTDIR)$(includedir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(includedir)" && rm -f $$files install-nodist_includeHEADERS: $(nodist_include_HEADERS) @$(NORMAL_INSTALL) test -z "$(includedir)" || $(MKDIR_P) "$(DESTDIR)$(includedir)" @list='$(nodist_include_HEADERS)'; test -n "$(includedir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includedir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(includedir)" || exit $$?; \ done uninstall-nodist_includeHEADERS: @$(NORMAL_UNINSTALL) @list='$(nodist_include_HEADERS)'; test -n "$(includedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ test -n "$$files" || exit 0; \ echo " ( cd '$(DESTDIR)$(includedir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(includedir)" && rm -f $$files ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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 CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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" 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 $(HEADERS) all-local installdirs: for dir in "$(DESTDIR)$(includedir)" "$(DESTDIR)$(includedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-includeHEADERS install-nodist_includeHEADERS install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-includeHEADERS uninstall-nodist_includeHEADERS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am all-local check check-am clean \ clean-generic clean-libtool ctags distclean distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am \ install-includeHEADERS install-info install-info-am \ install-man install-nodist_includeHEADERS install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \ uninstall-am uninstall-includeHEADERS \ uninstall-nodist_includeHEADERS # Additional dependence for file generated via AC_SUBST_FILE() @CR_BUILD_MODULES_TRUE@blcr_imports.h: $(top_builddir)/.import_decls all-local: if test -d $(top_builddir)/libcr32/include; then $(MAKE) $(AM_MAKEFLAGS) -C $(top_builddir)/libcr32/include all; 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: blcr-0.8.5/include/blcr_common.h.in0000664000000000000000000002717611641423632014051 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2008, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 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 * Library 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * $Id: blcr_common.h.in,v 1.50.4.2 2011/09/30 20:33:30 phargrov Exp $ * * This file contains definitions of BLCR types and constants that are * common to both user-space and kernel-space. */ #ifndef _BLCR_COMMON_H #define _BLCR_COMMON_H 1 #ifndef __KERNEL__ # include # include # include __BEGIN_DECLS #else # include # include # include #endif #if defined(__GNUC__) && ((100 * __GNUC__ + __GNUC_MINOR__) >= 302) #define _CR_DEPRECATED __attribute__((__deprecated__)) #else #define _CR_DEPRECATED /* empty */ #endif // Get things specific to the current /proc implementation. // This includes the actual entry points. #include // The signal number allocated for checkpoint: #define CR_SIGNUM @CR_SIGNUM@ /* version numbers */ #define CR_RELEASE_MAJOR @CR_RELEASE_MAJOR@ #define CR_RELEASE_MINOR @CR_RELEASE_MINOR@ #define CR_RELEASE_PATCH @CR_RELEASE_PATCH@ #define CR_RELEASE_VERSION "@CR_RELEASE_VERSION@" #define LIBCR_MAJOR @LIBCR_MAJOR@ #define LIBCR_MINOR @LIBCR_MINOR@ #define LIBCR_PATCH @LIBCR_PATCH@ #define LIBCR_VERSION "@LIBCR_VERSION@" #define CR_MODULE_MAJOR @CR_MODULE_MAJOR@ #define CR_MODULE_MINOR @CR_MODULE_MINOR@ #define CR_MODULE_PATCH @CR_MODULE_PATCH@ #define CR_MODULE_VERSION "@CR_MODULE_VERSION@" /* CR-specific error codes: * ------------------------ * i386 currently uses 1-125 for standard errno codes, and kernel-only ones * from 512-528. Alpha/IA64 are similar. * * NOTE: You add new error codes by APPENDNG to blcr_errcodes.h. * Changing/reordering any of the existing error codes requires * incrementing the major version numbers of BOTH the kernel/libcr and * libcr/user interfaces. Adding a new error requires incrementing the minor * version number of both. */ #define CR_ERROR_DEF(name, desc) name, enum { CR_MIN_ERRCODE = 2353, #include CR_MAX_ERRCODE }; #undef CR_ERROR_DEF // basic boolean type for atomic bit operations typedef long cr_bool_t; // Types of context files to dump typedef enum { cr_format_vmadump = 0, // cr_format_coredump, NO LONGER SUPPORTED } cr_format_t; // // Definitions for a checkpoint request: // // Scope of a checkpoint request: typedef enum { // CR_SCOPE_TASK, single task NO LONGER SUPPORTED CR_SCOPE_PROC, // All threads in this process CR_SCOPE_PGRP, // All processes in the process group CR_SCOPE_SESS, // All processes in the session CR_SCOPE_TREE, // This process and all descendants } cr_scope_t; /* cr_checkpoint() callback flags */ enum { CR_CHECKPOINT_READY = 0, /* checkpoint me */ CR_CHECKPOINT_TEMP_FAILURE = 1, /* cancel checkpoint and continue */ CR_CHECKPOINT_PERM_FAILURE = 2, /* cancel checkpoint, and kill me */ CR_CHECKPOINT_OMIT = 4, /* continue checkpoint, but w/o my process */ /* Following are for internal use only: */ _CR_CHECKPOINT_STUB = 0x4000, /* caller is a "stub" handler - must fit in 15 bits */ }; #define CR_CHECKPOINT_TEMP_FAILURE_CODE(_v) (CR_CHECKPOINT_TEMP_FAILURE | ((_v)<<16)) #define CR_CHECKPOINT_PERM_FAILURE_CODE(_v) (CR_CHECKPOINT_PERM_FAILURE | ((_v)<<16)) #define CR_CHECKPOINT_ABORT_MASK (CR_CHECKPOINT_TEMP_FAILURE|CR_CHECKPOINT_PERM_FAILURE|CR_CHECKPOINT_OMIT) // Setting cr_fd = CR_DEST_CWD sends context files to the cwd of the requester. // Using (-1) could cause confusion with unchecked error returns from open(). #define CR_DEST_CWD (-4096) // The actual checkpoint request structure: // XXX: If you make changes to this structure: // 1) Modify cr_module.h to keep the "compat" version up-to-date // 2) Be sure to advance CR_MODULE_* in configure.ac to avoid caller/callee mismatch struct cr_chkpt_args { pid_t cr_target; // Who to checkpoint cr_scope_t cr_scope; // Scope of the checkpoint int cr_fd; // Destination of the context unsigned int cr_secs; // Seconds for target to // respond. 0 == unbounded // XXX: Should one or more of the following fields move to opts? cr_format_t dump_format; // Format to use for this dump int signal; // Sent after checkpoint unsigned int flags; // See below... }; // Structure to propagate a checkpoint to another process used by // cr_forward_checkpoint // XXX: If you make changes to this structure: // 1) Modify cr_module.h to keep the "compat" version up-to-date // 2) Be sure to advance CR_MODULE_* in configure.ac to avoid caller/callee mismatch struct cr_fwd_args { pid_t cr_target; // Who to checkpoint cr_scope_t cr_scope; // Scope of the checkpoint }; // // Flag values to OR together for 'flags' field of cr_chkpt_args // // CR_CHKPT_PROHIBIT_SELF // When given this flag, a checkpoint request will return failure (with // errno=EDEADLK) if the requestor's task would be included in the // checkpoint. Note that in general checkpointing one's own task is // legal and only results in deadlock when critical sections and // blocking calls to CR_OP_CHKPT_DONE interact. #define CR_CHKPT_PROHIBIT_SELF 0x00000001 // CR_CHKPT_PTRACED_* // Without either of these flags, requesting a checkpoint of a ptraced // process will fail with errno=CR_EPTRACED. // CR_CHKPT_PTRACED_ALLOW // When given this flag, ptraced processes will be treated as any // other process would. Since BLCR interacts with the processes // to be checkpointed using signals and sysem calls, the debugger // (or other ptracer) must "continue" the process until the // checkpoint has been taken. // CR_CHKPT_PTRACED_SKIP // When given this flag, ptraced processes are silently excluded // from the checkpoint request (and their children if the scope // is CR_SCOPE_TREE). An error will result ONLY if this leads to // zero processes checkpointed. // NOTE: These flags are mutually exclusive. #define CR_CHKPT_PTRACED_ALLOW 0x00000002 #define CR_CHKPT_PTRACED_SKIP 0x00000004 // CR_CHKPT_PTRACER_SKIP // Without these this flag, requesting a checkpoint of a process which // is ptracing others will fail with errno=CR_EPTRACER. // When given this flag, such processes are silently excluded from the // checkpoint request (and their children if the scope is CR_SCOPE_TREE). // An error will result ONLY if this leads to zero processes // checkpointed. #define CR_CHKPT_PTRACER_SKIP 0x00000008 // CR_CHKPT_ASYNC_ERR // When this flag is passed most errors that would otherwise be reported // at request time are instead reported at CR_OP_CHKPT_REAP. #define CR_CHKPT_ASYNC_ERR 0x00000010 // CR_CHKPT_DUMP_* // Request dump of optional portions of memory: // CR_CHKPT_DUMP_EXEC dump the executable // CR_CHKPT_DUMP_PRIVATE dump private mapped files // CR_CHKPT_DUMP_SHARED dump shared mapped files // CR_CHKPT_DUMP_ALL dump all optional portions of memory #define CR_CHKPT_DUMP_EXEC 0x0200 /* BLCR will dump the executable */ #define CR_CHKPT_DUMP_PRIVATE 0x0400 /* BLCR will dump private file maps */ #define CR_CHKPT_DUMP_SHARED 0x0800 /* BLCR will dump shared file maps */ #define CR_CHKPT_DUMP_ALL (CR_CHKPT_DUMP_EXEC|CR_CHKPT_DUMP_PRIVATE|CR_CHKPT_DUMP_SHARED) // // Definitions for a restart request: // // path pairs for restart-time relocations // XXX: If you make changes to this structure: // 1) Modify cr_module.h to keep the "compat" version up-to-date // 2) Be sure to advance CR_MODULE_* in configure.ac to avoid caller/callee mismatch struct cr_rstrt_relocate_pair { const char *oldpath; const char *newpath; }; struct cr_rstrt_relocate { unsigned int count; struct cr_rstrt_relocate_pair #if defined(__GNUC__) && (__GNUC__ < 3) path[0]; // GNU (not ISO C99) variable length array #else path[]; // ISO C99 variable length array #endif }; // Bytes to allocate for struct cr_rstrt_relocate with _cnt path entries: #define CR_RSTRT_RELOCATE_SIZE(_cnt) (sizeof(struct cr_rstrt_relocate) + \ (_cnt) * sizeof(struct cr_rstrt_relocate_pair)) // Maximum number of path entries supported in struct cr_rstrt_relocate #define CR_MAX_RSTRT_RELOC 16 // The actual restart request structure: // XXX: If you make changes to this structure: // 1) Modify cr_module.h to keep the "compat" version up-to-date // 2) Be sure to advance CR_MODULE_* in configure.ac to avoid caller/callee mismatch struct cr_rstrt_args { int cr_fd; // Source of the context // XXX: Should one or more of the following fields move to opts? int signal; // delivered just before callbacks run struct cr_rstrt_relocate *relocate; // mapping of paths to new locations unsigned int flags; // See below... }; // // Flag values to OR together for 'flags' field of cr_rstrt_args // // // CR_RSTRT_ASYNC_ERR // When this flag is passed most errors that would otherwise be reported // at request time are instead reported at CR_OP_RSTRT_REAP. #define CR_RSTRT_ASYNC_ERR 0x00000001 // CR_RSTRT_RESTORE_PID // When this flag is passes, the pid and tgid of tasks are restored. #define CR_RSTRT_RESTORE_PID 0x00000002 // CR_RSTRT_RESTORE_PGID // When this flag is passes, the process group ids of task are restored. #define CR_RSTRT_RESTORE_PGID 0x00000004 // CR_RSTRT_RESTORE_SID // When this flag is passes, the session ids of task are restored. #define CR_RSTRT_RESTORE_SID 0x00000008 // Structure for returning processes to spawn // XXX: If you make changes to this structure: // 1) Modify cr_module.h to keep the "compat" version up-to-date // 2) Be sure to advance CR_MODULE_* in configure.ac to avoid caller/callee mismatch struct cr_procs_tbl { int threads; int clone_flags; }; // Structure for returning checkpoint info */ // XXX: If you make changes to this structure: // 1) Modify cr_module.h to keep the "compat" version up-to-date // 2) Be sure to advance CR_MODULE_* in configure.ac to avoid caller/callee mismatch // The 'dest' field is a buffer of len >= PATH_MAX, and the result is a string: // Empty if the destination is not in the file system // Full path if destination is a file, device, fifo, etc. // Path ending in "/." if destination is a directory. struct cr_chkpt_info { pid_t requester; pid_t target; int scope; int signal; char *dest; }; // Structure for requesting error/warning log // XXX: If you make changes to this structure: // 1) Modify cr_module.h to keep the "compat" version up-to-date // 2) Be sure to advance CR_MODULE_* in configure.ac to avoid caller/callee mismatch struct cr_log_args { unsigned int len; char *buf; }; // Flags to OP_HAND_DONE and to cr_hold_ctrl() #define CR_HOLD_READ -1 #define CR_HOLD_NONE 0 #define CR_HOLD_CONT 1 #define CR_HOLD_RSTRT 2 #define CR_HOLD_BOTH (CR_HOLD_CONT|CR_HOLD_RSTRT) #define CR_HOLD_DFLT 4 #ifndef __KERNEL__ __END_DECLS #endif #endif blcr-0.8.5/include/blcr_proc.h0000664000000000000000000000254010114724633013102 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2003, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 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 * Library 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * $Id: blcr_proc.h,v 1.10 2004/08/30 22:26:35 phargrov Exp $ */ #ifndef _CR_PROC_H #define _CR_PROC_H 1 #include // include ioctl entry points (not /proc specific). #define CR_CTRL_FILE "/proc/checkpoint/ctrl" #endif blcr-0.8.5/include/libcr.h0000664000000000000000000014011011146701546012230 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2008, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 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 * Library 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * $Id: libcr.h,v 1.83.4.2 2009/02/18 03:41:26 phargrov Exp $ */ #ifndef _CRLIB_H #define _CRLIB_H 1 #include #include // for (struct timeval) #include #include __BEGIN_DECLS // Version codes to identify caller's versions of the interface(s). // The library will adapt to versions older than itself. // Client code can also use this to know what members to expect in // the corresponding struct type. typedef int cr_version_t; #define CR_CHECKPOINT_ARGS_VERSION 1 #define CR_RESTART_ARGS_VERSION 1 // Maximum number of callbacks which can be registered #define CR_MAX_CALLBACKS 0x1FFFFFF // Type of callback functions typedef int (*cr_callback_t)(void *); // Integer type returned as an identifier from cr_init() typedef int cr_client_id_t; // Integer type returned as an identifier from cr_register_callback() typedef int cr_callback_id_t; // Type for signal-safe spinlocks typedef unsigned int cr_spinlock_t; // Type for cr_get_checkpoint_info() struct cr_checkpoint_info { int signal; /* Signal that will be sent to the process(es) when the checkpoint has been taken, or zero if none will be sent. */ const char *dest; /* Path to the context file. */ pid_t requester; /* pid of requester */ pid_t target; /* Pid, pgid or sid of which chkpt is requested */ cr_scope_t scope; /* scope of the request */ }; // Type for cr_get_restart_info() struct cr_restart_info { pid_t requester; /* pid of cr_restart */ const char *src; /* Path to the context file. */ }; // Values for return code from cr_status enum { CR_STATE_IDLE, CR_STATE_PENDING, CR_STATE_ACTIVE }; // For usage examples see // tests/crut.c:crut_checkpoint_to_file() // tests/crut_util_libcr.c:crut_checkpoint_request() // util/cr_checkpoint/cr_checkpoint.c:real_main() typedef struct cr_checkpoint_args { cr_version_t cr_version; cr_scope_t cr_scope; pid_t cr_target; int cr_fd; int cr_signal; unsigned int cr_timeout; /* cr_secs in cr_chkpt_args */ unsigned int cr_flags; } cr_checkpoint_args_t; // For usage examples see // util/cr_restart/cr_restart.c:main() // tests/crut_wrapper.c:try_restart() typedef struct cr_restart_args { cr_version_t cr_version; int cr_fd; int cr_signal; unsigned int cr_flags; struct cr_rstrt_relocate *cr_relocate; } cr_restart_args_t; // Opaque handles typedef unsigned long cr_checkpoint_handle_t; typedef unsigned long cr_restart_handle_t; // Context flags for cr_{register,replace}_callback() and cr_replace_self(). #define CR_THREAD_CONTEXT 0x4000000 #define CR_SIGNAL_CONTEXT 0x2000000 // cr_client_id for use by callbacks #define CR_ID_CALLBACK ((cr_client_id_t)(-1)) // Initializer for use with statically allocated spinlocks. #define CR_SPINLOCK_INITIALIZER 0U // Eval values for cr_register_hook() typedef enum { // CR_HOOK_CONT_*: continuing after a checkpoint... // ... in a thread with signal-context callbacks and/or critical sections CR_HOOK_CONT_SIGNAL_CONTEXT = 0, // ... in a thread servicing thread-context callbacks CR_HOOK_CONT_THREAD_CONTEXT, // ... in a thread with no registered callbacks CR_HOOK_CONT_NO_CALLBACKS, // CR_HOOK_CONT_*: restarting from a checkpoint... // ... in a thread with signal-context callbacks and/or critical sections CR_HOOK_RSTRT_SIGNAL_CONTEXT, // ... in a thread servicing thread-context callbacks CR_HOOK_RSTRT_THREAD_CONTEXT, // ... in a thread with no registered callbacks CR_HOOK_RSTRT_NO_CALLBACKS, // Not a valid value to pass to cr_register_hook: CR_NUM_HOOKS } cr_hook_event_t; // Function type for cr_register_hook() typedef void (*cr_hook_fn_t)(cr_hook_event_t); #define CR_HOOK_FN_ERROR ((cr_hook_fn_t)(~0UL)) // Values for scope argument to cr_hold_ctrl() enum { CR_HOLD_SCOPE_THREAD, CR_HOLD_SCOPE_INIT, CR_HOLD_SCOPE_UNINIT }; // cr_init() // // Initialize (per-thread) state for use with libcr. // // This function must be called once from each thread before it makes // any other calls to libcr functions. This is not needed from // threads which will never call libcr functions, nor is it needed // inside of thread-context callback code (which runs in a thread // created by libcr). // // On success, returns a non-negative identifier, of type // cr_client_id_t, to be used in any subsequent calls to // cr_{enter,leave}_cs(). This identifier has only thread-local scope // and must not be used from another thread. // Returns negative values to indicate failure. // // This function is not reentrant - do not call it from signal context. // extern cr_client_id_t cr_init(void); // cr_initialize_checkpoint_args_t // // This initializer ensures that a client will get sane default values // for fields they know nothing about even if linked to a library version // newer than the one they were written and/or compiled for. // // Returns 0 on success, -1 on failure. // Only likely failure is an incompatible library version, // though that should be resolved at library link/load time. // // Never call cri_init_checkpoint_args_t() directly #define cr_initialize_checkpoint_args_t(_cr_args) \ cri_init_checkpoint_args_t(CR_CHECKPOINT_ARGS_VERSION, (_cr_args)) // cr_request_checkpoint // // Initiate a checkpoint of another process, process group, or session. // Must call cr_initialize_checkpoint_args_t first. // Use cr_wait_checkpoint(), cr_poll_checkpoint() or cr_poll_checkpoint_msg() // to check or block for completion. // // IN: args See cr_checkpoint_args_t type for options. // OUT: handle Opaque output argument filled in by function call. // // Returns: // 0 - checkpoint has been requested. // < 0 - an error occurred (check errno for details) // // Most likely errno values when return < 0: // ESRCH Request did not identify any existing pid, pgid or sid. // EPERM One or more of the target processes are not checkpointable // by the current user. // EBADF The destination (args->cr_fd) is not a valid file descriptor. // EINVAL Some field of the args argument is invalid. // Other values may be possible. // // Setting CR_CHKPT_ASYNC_ERR in args->cr_flags will defer reporting of // nearly all errors in cr_request_checkpoint() until the cr_reap_checkpoint() // call. This allows for use of cr_log_checkpoint() to collect kernel // messages that are associated with these error conditions. // extern int cr_request_checkpoint(cr_checkpoint_args_t *args, cr_checkpoint_handle_t *handle); // cr_forward_checkpoint // // Adds the given scope to a current checkpoint request. Use this if there // is some other process(es) that you want checkpointed consistently with // your process // // Returns: // 0 - the requested process(es) have been added to the checkpoint request. // < 0 - an error occurred (check errno for details) // // Most likely errno values when return < 0: // ESRCH Request did not identify any existing pid, pgid or sid. // EPERM One or more of the target processes are not checkpointable // by the current user. // EINVAL One of the arguments is invalid. // CR_ENOTCB Called from other than a callback context. // Other values may be possible. // // Note that it is not an error for cr_forward_checkpoint() to have a scope // that overlaps the existing scope of the checkpoint (or to be identical). // Processes in the overlap will be checkpointed exactly once. // // This routine may only be called from a registered callback, and not // after calling cr_checkpoint(). // extern int cr_forward_checkpoint(cr_scope_t cr_scope, pid_t cr_target); // cr_wait_checkpoint // // INOUT: handle Pointer to opaque value filled in by cr_request_checkpoint() // INOUT: timeval Time limit, or NULL for unbounded wait. // // Returns: // > 0 - checkpoint complete // 0 - it's not done yet and the timeout (if any) has expired // < 0 - an error occurred (see below for details) // // Waits until checkpoint completes, bounded by timeval (if non-NULL). // // The remaining timeout is written back to timeval if, and only if, // select() would do so for the current Linux personality. The contents // of timeval are undefined on error. // // A negative return value indicates that an error occurred in trying to // wait for completion, and is not an indication of the status of the // checkpoint request. // Most likely errno values when returning < 0: // EINVAL No checkpoint request associated with the given handle. // EINTR Call was interrupted by a signal. // EFAULT 'timeval' argument points outside caller's address space. // Other values may be possible. // extern int cr_wait_checkpoint(cr_checkpoint_handle_t *handle, struct timeval *timeout); // cr_log_checkpoint // // INOUT: handle Pointer to opaque value filled in by cr_request_checkpoint() // IN: len Size of allocated space. // OUT: msg Space to return kernel messages. // // Returns: // > 0 - space consumed by kernel messages. // 0 - no kernel messages were logged. // < 0 - an error occurred (see below for details) // // Collects messages logged by the kernel and associated with the checkpoint // request. // // Up to 'len' bytes (including the terminating '\0' character) of kernel // messages are copied to 'msg'. Collecting the log messages does not destroy // them. So, the same messages may be retreived multiple times. // // Except in error cases, the return value is the number of bytes of storage // required to retreive all the kernel messages logged for the given request, // including the '\0' string terminator. If the return value is larger than // 'len', then the messages have been truncated. In the case of 'len' equal // to zero, 'msg' is ignored (and thus may safely be NULL) and the return // value can be used to allocate a large enough buffer for a second call. // // Most likely errno values when returning < 0: // EINVAL No checkpoint request associated with the given handle. // EFAULT 'msg' argument points outside caller's address space. // Other values may be possible. // extern int cr_log_checkpoint(cr_checkpoint_handle_t *handle, unsigned int len, char *msg); // cr_reap_checkpoint // // INOUT: handle Pointer to opaque value filled in by cr_request_checkpoint() // // Returns: // > 0 - checkpoint complete // < 0 - an error occurred (see below for details) // // Retreives the status of a completed checkpoint request and releases the // associated resources. // // If this call returns positive (success) or returns negative with an errno // value other than EAGAIN, then the checkpoint is complete and the handle is // invalid. Further use of the handle w/o calling cr_request_checkpoint() to // obtain a new one will result in undefined behavior. // // When checkpointing a set of processes which includes one's self, note: // - When restarting from a checkpoint which includes one's self, releases // priot to 0.7.0 yielded, from cr_poll_checkpoint(): // ((return==CR_POLL_CHKPT_ERR_PRE) && (errno==EINVAL)). // - For this case, the current release yields // errno==CR_ERESTARTED // and this behavior is expected to continue in future releases. // - Do not attempt to skip the cr_reap_checkpoint() to avoid this // particular error return. Omitting the poll causes a resource leak. // // A negative return value with errno == EAGAIN indicates that the // checkpoint request is NOT completed. Use of cr_wait_checkpoint() is // recommended (but not required) to check that a request is completed // before calling cr_reap_checkpoint(). // // A negative return value with errno == CR_ERESTARTED indicates that the // checkpoint request was completed successfully. // // A negative return value with any other value for errno indicates that the // checkpoint request was unsuccessful (was completed with errors): // EINVAL No checkpoint request associated with the given handle. // CR_ENOSUPPORT One or more of the target processes are not linked (or // LD_PRELOADed) with libcr. // CR_ETEMPFAIL One or more of the target processes indicated a // temporary inability to perform the requested checkpoint. // CR_EPERMFAIL One or more of the target processes indicated a // permanent inability to perform the requested checkpoint. // ESRCH All target processes indicated that they should be // omitted from the checkpoint. // EIO Problem writing the checkpoint output. // ENOSPC Out of space on filesystem while writing the checkpoint. // Other values may be possible. // // If cr_flags of the request included CR_CHKPT_ASYNC_ERR, then all the // errno values listed in the description of cr_request_checkpoint() are // also possible results from cr_reap_checkpoint(). // // Note that even in the event of an error, it is possible that data has // been written to the requested file descriptor. // extern int cr_reap_checkpoint(cr_checkpoint_handle_t *handle); // cr_poll_checkpoint_msg // // INOUT: handle Pointer to opaque value filled in by cr_request_checkpoint() // INOUT: timeval Time limit, or NULL for unbounded wait. // OUT: msg_p Space to return pointer to kernel messages. // // Returns: // > 0 - checkpoint complete // 0 - it's not done yet and the timeout (if any) has expired // < 0 - an error occurred (see below for details) // // Waits until checkpoint completes, bounded by timeval (if non-NULL), and // collects kernel log messages and checkpoint request status. // // This call is roughly equivalent to: // rc = cr_wait_checkpoint(handle, timeval); // if (rc == 0) return 0; // Not done // if (rc < 0) return CR_POLL_CHKPT_ERR_PRE; // if (msg_p) { // int len = cr_log_checkpoint(handle, 0, NULL); // char *buf = *msg_p = malloc(len); // rc = cr_log_checkpoint(handle, len, buf); // if (rc < 0) return CR_POLL_CHKPT_ERR_LOG; // } // rc = cr_reap_checkpoint(handle); // if (rc < 0) return CR_POLL_CHKPT_ERR_POST; // return SOME_POSITIVE_VALUE; // Done // with some additional error checking. // // For non-NULL 'msg_p', the caller is responsible for calling free(*msg_p) // when the need for the collected messages is ended. // // If an error is detected from the cr_wait_checkpoint() call, then the // negative value CR_POLL_CHKPT_ERR_PRE is returned. See the documentation // for cr_wait_checkpoint() for possible errno values and their meaning. // // If cr_wait_checkpoint() returns 0 to indicate the request is not done, // then cr_poll_checkpoint_msg() also returns 0. // // If an error is detected from the cr_log_checkpoint() call, then the // negative value CR_POLL_CHKPT_ERR_LOG is returned. See the documentation // for cr_log_checkpoint() for possible errno values and their meaning. // // If an error is detected from the cr_reap_checkpoint() call, then the // negative value CR_POLL_CHKPT_ERR_POST is returned. See the documentation // for cr_reap_checkpoint() for possible errno values and their meaning. // #define CR_POLL_CHKPT_ERR_PRE -1 #define CR_POLL_CHKPT_ERR_POST -2 #define CR_POLL_CHKPT_ERR_LOG -3 extern int cr_poll_checkpoint_msg(cr_checkpoint_handle_t *handle, struct timeval *timeout, char **msg_p); // cr_poll_checkpoint // // INOUT: handle Pointer to opaque value filled in by cr_request_checkpoint() // INOUT: timeval Time limit, or NULL for unbounded wait. // // Calling // rc = cr_poll_checkpoint(handle, timeout); // is equivalent to // rc = cr_poll_checkpoint_msg(handle, timeout, NULL); // extern int cr_poll_checkpoint(cr_checkpoint_handle_t *handle, struct timeval *timeout); // cr_initialize_restart_args_t // THIS FUNCTION IS EXPERIMENTAL: USE AT YOUR OWN RISK // // This initializer ensures that a client will get sane default values // for fields they know nothing about even if linked to a library version // newer than the one they were written and/or compiled for. // // Returns 0 on success, -1 on failure. // Only likely failure is an incompatible library version, // though that should be resolved at library link/load time. #define cr_initialize_restart_args_t(_cr_args) \ cri_init_restart_args_t(CR_RESTART_ARGS_VERSION, (_cr_args)) /* Never call the following directly. * The public interface is via cr_initialize_restart_args_t() */ extern int cri_init_restart_args_t(cr_version_t, cr_restart_args_t *); // cr_request_restart // THIS FUNCTION IS EXPERIMENTAL: USE AT YOUR OWN RISK // // Initiate a restart from a given file descriptor. // Use cr_wait_restart(), cr_poll_restart() or cr_poll_restart_msg() to // check or block for completion. // // IN: args See cr_restart_args_t type for options. // OUT: handle Opaque output argument filled in by function call. // // Returns: // 0 - restart has been requested. // < 0 - an error occurred (check errno for details) // // Most likely errno values when return < 0: // EBADF The source (args->cr_fd) is not a valid file descriptor. // EINVAL Some field of the args argument is invalid. // XXX: THIS LIST IS KNOWN TO BE INCOMPLETE // Other values may be possible. // // Setting CR_RSTRT_ASYNC_ERR in args->cr_flags will defer reporting of // nearly all errors in cr_request_restart() until the cr_reap_restart() // call. This allows for use of cr_log_restart() to collect kernel messages // that are associated with these error conditions. // extern int cr_request_restart(cr_restart_args_t *args, cr_restart_handle_t *handle); // cr_wait_restart // THIS FUNCTION IS EXPERIMENTAL: USE AT YOUR OWN RISK // // INOUT: handle Pointer to opaque value filled in by cr_request_restart() // INOUT: timeval Time limit, or NULL for unbounded wait. // // Returns: // > 0 - restart complete // 0 - it's not done yet and the timeout (if any) has expired // < 0 - an error occurred (see below for details) // // Waits until restart completes, bounded by timeval (if non-NULL). // // The remaining timeout is written back to timeval if, and only if, // select() would do so for the current Linux personality. The contents // of timeval are undefined on error. // // A negative return value indicates that an error occurred in trying to // wait for completion, and is not an indication of the status of the // restart request. // Most likely errno values when returning < 0: // EINVAL No restart request associated with the given handle. // EINTR Call was interrupted by a signal. // EFAULT 'timeval' argument points outside caller's address space. // Other values may be possible. // extern int cr_wait_restart(cr_restart_handle_t *handle, struct timeval *timeout); // cr_log_restart // THIS FUNCTION IS EXPERIMENTAL: USE AT YOUR OWN RISK // // INOUT: handle Pointer to opaque value filled in by cr_request_restart() // IN: len Size of allocated space. // OUT: msg Space to return kernel messages. // // Returns: // > 0 - space consumed by kernel messages. // 0 - no kernel messages were logged. // < 0 - an error occurred (see below for details) // // Collects messages logged by the kernel and associated with the restart // request. // // Up to 'len' bytes (including the terminating '\0' character) of kernel // messages are copied to 'msg'. Collecting the log messages does not destroy // them. So, the same messages may be retreived multiple times. // // Except in error cases, the return value is the number of bytes of storage // required to retreive all the kernel messages logged for the given request, // including the '\0' string terminator. If the return value is larger than // 'len', then the messages have been truncated. In the case of 'len' equal // to zero, 'msg' is ignored (and thus may safely be NULL) and the return // value can be used to allocate a large enough buffer for a second call. // // Most likely errno values when returning < 0: // EINVAL No restart request associated with the given handle. // EFAULT 'msg' argument points outside caller's address space. // Other values may be possible. // extern int cr_log_restart(cr_restart_handle_t *handle, unsigned int len, char *msg); // cr_reap_restart // THIS FUNCTION IS EXPERIMENTAL: USE AT YOUR OWN RISK // // INOUT: handle Pointer to opaque value filled in by cr_request_restart() // // Returns: // > 0 - restart complete // < 0 - an error occurred (see below for details) // // Retreives the status of a completed restart request and releases the // associated resources. // // If this call returns positive (success) or returns negative with an errno // value other than EAGAIN, then the restart is complete and the handle is // invalid. Further use of the handle w/o calling cr_request_restart() to // obtain a new one will result in undefined behavior. // // A negative return value with errno == EAGAIN indicates that the // restart request is NOT completed. Use of cr_wait_restart() is // recommended (but not required) to check that a request is completed // before calling cr_reap_restart(). // // A negative return value with any other value for errno indicates that the // restart request was unsuccessful (was completed with errors): // EINVAL No restart request associated with the given handle. // EIO Problem reading the restart input. // Other values may be possible. // // If cr_flags of the request included CR_RTSRT_ASYNC_ERR, then all the // errno values listed in the description of cr_request_restart() are // also possible results from cr_reap_restart(). // // Note that even in the event of an error, it is possible that data has // been left unread from the requested file descriptor. // extern int cr_reap_restart(cr_restart_handle_t *handle); // cr_poll_restart_msg // THIS FUNCTION IS EXPERIMENTAL: USE AT YOUR OWN RISK // // INOUT: handle Pointer to opaque value filled in by cr_request_restart() // INOUT: timeval Time limit, or NULL for unbounded wait. // OUT: msg_p Space to return pointer to kernel messages. // // Returns: // > 0 - restart complete // 0 - it's not done yet and the timeout (if any) has expired // < 0 - an error occurred (see below for details) // // Waits until restart completes, bounded by timeval (if non-NULL), and // collects kernel log messages and restart request status. // // This call is roughly equivalent to: // rc = cr_wait_restart(handle, timeval); // if (rc == 0) return 0; // Not done // if (rc < 0) return CR_POLL_RSTRT_ERR_PRE; // if (msg_p) { // int len = cr_log_restart(handle, 0, NULL); // char *buf = *msg_p = malloc(len); // rc = cr_log_restart(handle, len, buf); // if (rc < 0) return CR_POLL_RSTRT_ERR_LOG; // } // rc = cr_reap_restart(handle); // if (rc < 0) return CR_POLL_RSTRT_ERR_POST; // return SOME_POSITIVE_VALUE; // Done // with some additional error checking. // // For non-NULL 'msg_p', the caller is responsible for calling free(*msg_p) // when the need for the collected messages is ended. // // If an error is detected from the cr_wait_restart() call, then the // negative value CR_POLL_RSTRT_ERR_PRE is returned. See the documentation // for cr_wait_restart() for possible errno values and their meaning. // // If cr_wait_restart() returns 0 to indicate the request is not done, // then cr_poll_restart_msg() also returns 0. // // If an error is detected from the cr_log_restart() call, then the // negative value CR_POLL_RSTRT_ERR_LOG is returned. See the documentation // for cr_log_restart() for possible errno values and their meaning. // // If an error is detected from the cr_reap_restart() call, then the // negative value CR_POLL_RSTRT_ERR_POST is returned. See the documentation // for cr_reap_restart() for possible errno values and their meaning. // #define CR_POLL_RSTRT_ERR_PRE -1 #define CR_POLL_RSTRT_ERR_POST -2 #define CR_POLL_RSTRT_ERR_LOG -3 extern int cr_poll_restart_msg(cr_restart_handle_t *handle, struct timeval *timeout, char **msg_p); // cr_poll_restart // THIS FUNCTION IS EXPERIMENTAL: USE AT YOUR OWN RISK // // INOUT: handle Pointer to opaque value filled in by cr_request_restart() // INOUT: timeval Time limit, or NULL for unbounded wait. // // Calling // rc = cr_poll_restart(handle, timeout); // is equivalent to // rc = cr_poll_restart_msg(handle, timeout, NULL); // extern int cr_poll_restart(cr_restart_handle_t *handle, struct timeval *timeout); // cr_register_callback() // // Register a checkpoint callback. // // Returns an identifier, of type cr_callback_id_t, to be used in any // subsequent calls to cr_replace_callback(). // // On error, the return value is -1. The most likely errno values are: // CR_ENOINIT Calling thread has not called cr_init() // ENOMEM Insufficient free memory to complete the registration. // ENOSPC Given context has reached CR_MAX_CALLBACKS registrations. // EINVAL Invalid 'flags' argument. // EBUSY Called from inside a callback. // // The 'func' argument is the callback to invoke at checkpoint time. // // The supplied 'arg' argument will be passed to your callback when // invoked. // // The 'flags' argument is a bit-wise OR of flags. The flags must // include exactly one of following to specify in which context the // callback may be run. // CR_THREAD_CONTEXT: // This type of registration is shared among all threads in the // program. Thus, the ids returned from this call have global // scope. The callback will be invoked in a dedicated checkpoint // thread. The callback will NEVER be invoked within signal // context. When multiple thread-context callbacks are // registered, the order in which they run with respect to each // other is not specified, and it is possible that they may run // concurrently. It is guaranteed, however, that all // thread-context callbacks will reach their cr_checkpoint() // calls before ANY of signal-context callbacks run. // CR_SIGNAL_CONTEXT: // This type of registration is per-thread. Thus, the ids // returned from this call have only per-thread scope. The // callback will be invoked in the same thread which registered // it. The callback MIGHT be invoked within signal-handler // context. So, the callback must be capable of running to // completion in signal context. When multiple signal-context // callbacks are registered in a given thread, they are called in // the reverse of the order they were registered, as with // atexit(). Signal-context callbacks are not run until all // thread-context callbacks (if any) have called cr_checkpoint(). // // This function is not reentrant - do not call it from signal context // or from inside a callback. // extern cr_callback_id_t cr_register_callback(cr_callback_t func, void* arg, int flags); // cr_replace_callback() // // Atomically replace one callback with another. // // Atomically (with respect to checkpoints and other cr_replace_*() // calls) replaces the 'func', 'arg' and 'flags' associated with the // given 'id'. The new callback will be invoked in place of the // function previously registered with this id, and in the same place // in the ordering. // // There is currently no way to delete a callback id, but one can // specify NULL for the 'func' argument to disable one. // // Returns 0 on success, -1 on failure. // // Most likely errno values when return is -1: // CR_ENOINIT Calling thread has not called cr_init() // EINVAL Invalid 'id' or 'flags' argument. // EBUSY Called from inside a callback. // // This call can not change the context associated with the 'id'. // Therefore, the 'flags' argument must include the same one of // CR_SIGNAL_CONTEXT or CR_THREAD_CONTEXT which was originally used to // register this 'id'. // // For ids registered with CR_SIGNAL_CONTEXT, it only makes sense to // call this function from the thread which originally registered this // id because signal-context ids have only thread-local scope. // // For ids registered with CR_THREAD_CONTEXT the ids have global // scope. Therefore this function maybe called from any thread which // has previously called cr_init(). // // This function is not reentrant - do not call it from signal context // or from inside a callback. // extern int cr_replace_callback(cr_callback_id_t id, cr_callback_t func, void* arg, int flags); // cr_enter_cs() // // Enter a critical section. // // Critical sections allow blocks of code to run atomically with // respect to checkpoints and the associated callbacks. // // If invoked within any context other than a callback this routine // ensures that checkpoint requests arriving while execution is in the // critical section will be deferred. This call may block if a // checkpoint has been requested or is in progress. In this context // the 'id' argument must be the identifier returned from cr_init() in // the calling thread. // // If invoked from within a callback this routine returns immediately. // This allows the same code to be run from both inside and outside of // callbacks without causing deadlock, presumably taking the 'id' as // an argument. In this context the 'id' must be the value // CR_ID_CALLBACK. // // Returns 0 on success, -1 on failure. // // Most likely errno values when return is -1: // CR_ENOINIT Calling thread has not called cr_init() // EINVAL Invalid 'id' argument. // // This routine is both thread-safe and reentrant (signal-safe). // extern int cr_enter_cs(cr_client_id_t id); // cr_tryenter_cs() // // Enter a critical section (non-blocking). // // This function is identical to cr_enter_cs() except that it never // blocks (returning non-zero if cr_enter_cs() would have blocked). // // Returns: // Zero if the critical section has been entered (or when called // from within a callback). // Positive if the critical section could not be entered without // blocking. // -1 if an error occurred // // Most likely errno values when return is -1: // CR_ENOINIT Calling thread has not called cr_init() // EINVAL Invalid 'id' argument. // // A zero return must be balanced by an eventual cr_leave_cs(), while // a non-zero return must NOT be balanced by a matching cr_leave_cs(). // // This routine is both thread-safe and reentrant (signal-safe). // extern int cr_tryenter_cs(cr_client_id_t id); // cr_leave_cs() // // Leave a critical section. // // Leave a critical section previously entered by calling // cs_enter_cs(). If this call leaves the only critical section // currently active, then any pending checkpoint will be taken before // this call returns. // // The 'id' argument must be the same one used in a preceding call to // cr_enter_cs(). Calls to cr_enter_cs() and cr_leave_cs() must be // balanced in the sense that the number of calls to cr_leave_cs() // with a given id must never exceed the number of successful calls to // cr_enter_cs() with the same id. However, calls with distinct ids // may be nested and/or overlapped arbitrarily. // // Returns 0 on success, -1 on failure. // // Most likely errno values when return is -1: // CR_ENOINIT Calling thread has not called cr_init() // EINVAL Invalid 'id' argument. // // This routine is both thread-safe and reentrant (signal-safe). // extern int cr_leave_cs(cr_client_id_t id); // cr_status() // // Query the status of the checkpoint system. // // If this routine is called outside of a critical section one must // be aware that the state could change between the time cr_status() // returns and the time the return value is used. // // Returns an integer: // CR_STATE_IDLE No checkpoint is pending or active. // CR_STATE_PENDING A checkpoint request is pending // CR_STATE_ACTIVE A checkpoint is active. // -1 An error occurred // // Most likely errno values when return is -1: // CR_ENOINIT Calling thread has not called cr_init() // // This routine is both thread-safe and reentrant (signal-safe). // extern int cr_status(void); // cr_checkpoint() // // Proceed to next step in the checkpoint. // // Called inside a callback to indicate that checkpoint may proceed. // // Defined values for "flags" (mutually exclusive): // CR_CHECKPOINT_READY (==0) // The normal case. // CR_CHECKPOINT_OMIT // To continue the checkpoint, but exclude the current process. // Will also not run subsequent callbacks in the current group // (thread context, or signal context in this same thread). // CR_CHECKPOINT_TEMP_FAILURE // CR_CHECKPOINT_TEMP_FAILURE_CODE(error_code) // To abort the checkpoint and continue execution. // Will also not run subsequent callbacks in the current group // (thread context, or signal context in this same thread). // CR_CHECKPOINT_PERM_FAILURE // CR_CHECKPOINT_PERM_FAILURE_CODE(error_code) // To abort the checkpoint and kill all the processes involved in it. // Will also not run subsequent callbacks in the current group // (thread context, or signal context in this same thread). // // User-specified errors: // When the "flags" argument is CR_CHECKPOINT_TEMP_FAILURE_CODE(val) // or CR_CHECKPOINT_PERM_FAILURE_CODE(val), the "val" provided by // the caller replaces the default error codes of CR_ETEMPFAIL and // CR_EPERMFAIL. If a non-zero value is specified in this manner // it will replace the CR_ETEMPFAIL or CR_EPERMFAIL values as: // + the errno value returned by cr_poll_checkpoint() // + the exit code from the cr_checkpoint utility (low 8 bits only) // + the negative of the return value from cr_checkpoint() // Values are limited to 16-bits (1 through 65535), and a value of zero // will be be ignored (the default of CR_ETEMPFAIL or CR_EPERMFAIL will // be used instead). // If multiple callers of cr_checkpoint() indicate temporary or // permanent failure with different user-specified error values, then // exactly one of the provided values will be honored (but it is // undefined how the one is selected from the multiple callers). // BLCR does not provide any mechanism to distinguish how an error code // was generated. Therefore, users of this facility are cautioned to // avoid use of values that have predefined meanings in errno.h or as // CR_E* error codes. Additionally, care should be taken to consider // that the exit code from the cr_checkpoint utility preserves only the // 8 least-significant bits of the error code. // // Returns: // Zero when continuing after taking a checkpoint. // Positive when recovering from a checkpoint. // Negative of error code if a checkpoint failed for some reason. // (man setjmp(3) for an analogue in POSIX.1). // Specific errors include: // -CR_ETEMPFAIL // One or more callbacks (in any process in the checkpoint) passed // CR_CHECKPOINT_TEMP_FAILURE to cr_checkpoint(). // -CR_EPERMFAIL // One or more callbacks (in any process in the checkpoint) passed // CR_CHECKPOINT_PERM_FAILURE to cr_checkpoint(). Note that this // should not be seen unless the kill has failed. // -CR_EOMITTED // One or more callbacks in the current process passed // CR_CHECKPOINT_OMIT to cr_checkpoint(). // -CR_ENOTCB // Called from other than a callback context. // // Example callback: // int callback(void* arg) // { // int rc; // // /* do CHECKPOINT work here */ // // rc = cr_checkpoint(0); // if (rc < 0) { // /* deal with FAILURE here */ // } else if (rc) { // /* do RESTART work here */ // } else { // /* do CONTINUE work here */ // } // // return 0; // } // // Note that if a callback returns without invoking cr_checkpoint(), // then it will be invoked immediately after the return. // // Callbacks are expected to return zero on success. // A callback may return nonzero to indicate a failure to CONTINUE or // RESTART. This is preferred over calling _exit(), but the exact // behavior in this case is not yet defined. // // This routine may only be called from registered callbacks. // extern int cr_checkpoint(int flags); // cr_replace_self() // // Atomically replace the invoking callback with another. // // Atomically (with respect to checkpoints and other cr_replace_*() // calls) replaces the 'func', 'arg' and 'flags' associated with the // caller. // // There is currently no way to delete a callback id, but one can // specify NULL for the 'func' argument to disable one. // // This call can not change the context associated with the callback. // Therefore, the 'flags' argument must include the same one of // CR_SIGNAL_CONTEXT or CR_THREAD_CONTEXT which was originally used to // register the invoking callback. // // Returns 0 on success, -1 on failure. // // Most likely errno values when return is -1: // CR_ENOTCB Called from other than a callback context. // EINVAL Invalid 'flags' argument. // // This routine may only be called from registered callbacks. // extern int cr_replace_self(cr_callback_t func, void* arg, int flags); // cr_get_checkpoint_info() // // Returns information about the active checkpoint request. // // The return value is a pointer to a structure in thread-local // storage. Therefore, reads of the structure are thread-safe // within a running callback. However, the values may change across // calls to cr_checkpoint() if other callbacks run in the same thread. // The contents of the structure are undefined when no checkpoint // request is active. // // This routine may only be called from a registered callback, and not // after calling cr_checkpoint(). // // Returns NULL if called from other than a callback context. extern const struct cr_checkpoint_info * cr_get_checkpoint_info(void); // cr_get_restart_info() // // Returns information about the active restart request. // // The return value is a pointer to a structure in thread-local // storage. Therefore, reads of the structure are thread-safe // within a running callback. However, the values may change across // calls to cr_checkpoint() if other callbacks run in the same thread. // The contents of the structure are undefined when no restart // request is active. // // This routine may only be called from a registered callback, and not // before calling cr_checkpoint(). // // Returns NULL if called from other than a callback context. extern const struct cr_restart_info * cr_get_restart_info(void); // cr_spinlock_init() // // Initialize a spinlock (to the unlocked state). // // This must be done before the first use. // // This routine is both thread-safe and reentrant (signal-safe). // extern void cr_spinlock_init(cr_spinlock_t *); // cr_spinlock_lock() // // Spin (busy wait) until the lock can be obtained. // // This routine is both thread-safe and reentrant (signal-safe). // extern void cr_spinlock_lock(cr_spinlock_t *); // cr_spinlock_unlock() // // Unlock a lock held by this process/thread. // // This routine is both thread-safe and reentrant (signal-safe). // extern void cr_spinlock_unlock(cr_spinlock_t *); // cr_spinlock_trylock() // // Try only once to obtain a lock. // // Returns non-zero if and only if the lock is obtained. // // This routine is both thread-safe and reentrant (signal-safe). // extern int cr_spinlock_trylock(cr_spinlock_t *); // cr_strerror() // // Returns a string describing the error code passed in the 'errnum' argument. // It behaves similarly to the standard C strerror() function, except that it // can handle BLCR-specific error codes in addition to the standard ones. extern const char * cr_strerror(int errnum); // cr_register_hook() // // Registers a hook to be run any time a pre-defined event happens. // // Calling convention is modeled after signal(): // + First argument indicates for which event one is registering. // + Second argument is the function to register. // The value NULL means don't run any hook, and is the default value // of all hooks (like SIG_DFL). // + On success, the return value is the previous value registered. // // On failure, the return value is CR_HOOK_FN_ERROR. In this case // most likely errno values are: // CR_ENOINIT Calling thread has not called cr_init() // EINVAL Invalid 'event' or 'hook_fn' argument. // // The registrations persist until changed by another cr_register_hook() call. // // The registration is process-scoped (as opposed to thread-specific), but // the hooks are run in all threads effected by a given event. // // The hook function is called with the event that has occurred, like the // one argument passed to the handler registered by signal(). // // Depending on the event, hooks might be invoked from signal context. // // See the cr_hook_event_t enum for a list of defined events. // // This function is thread-safe. // This function is not reentrant - do not call it from signal context. // extern cr_hook_fn_t cr_register_hook(cr_hook_event_t event, cr_hook_fn_t hook_fn); // cr_hold_ctrl() // THIS FUNCTION IS EXPERIMENTAL: USE AT YOUR OWN RISK // // Controls post-callback hold behavior. // // By default, all threads of a process are "held" at a thread barrier // following the running of all registered callbacks. A thread which is // held at this barrier will not resume normal execution after a checkpoint // is written (CONTinue) or is resumed from (ReSTaRT) until all callbacks // registered in all threads have run to completion. However, this hold // is optional, and a thread may be allowed to resume normal execution // immediately after its own callbacks (if any) have completed. // // There are two global hold flags variables, plus each thread which has // called cr_init() has a thread-local hold flags variable. // Calls to cr_hold_ctrl() access one of these variables as determined by the // 'scope' argument: // CR_HOLD_SCOPE_THREAD This 'scope' value accesses the thread-local hold // flags for the calling thread. // CR_HOLD_SCOPE_INIT This 'scope' value accesses the hold flags for // threads that *have* called cr_init(), but have // a thread-local hold flags value of CR_HOLD_DFLT. // CR_HOLD_SCOPE_UNINIT This 'scope' value accesses the hold flags for // threads that have *not* called cr_init(). // // The value of 'flags' may be any of the following: // CR_HOLD_NONE Equal to zero. // If 'flags' has this value then the effected thread(s) // will not be held: they will resume normal execution // as soon as their own callbacks (if any) have completed. // CR_HOLD_CONT If set to this value, then the effected thread(s) will // be held after a checkpoint is taken (corresponding to // the CONTINUE branch of a callback) until all callbacks // have run to completion. // CR_HOLD_RSTRT If set to this value, then the effected thread(s) will // be held after resuming from a checkpoint (corresponding // to the RESTART branch of a callback) until all // callbacks have run to completion. // CR_HOLD_BOTH Equal to (CR_HOLD_CONT | CR_HOLD_RSTRT) // The effected thread(s) are held on both the CONTINUE // and RESTART paths. // CR_HOLD_READ The current value of the hold flags variable selected // by 'scope' is read and returned, but is not modified. // CR_HOLD_DFLT This is valid only when 'scope'==CR_HOLD_SCOPE_THREAD. // This value for 'flags' disables the thread-specific // value, ensuring that the CR_HOLD_SCOPE_INIT hold flags // variable will be used for the calling thread. // // Default values before any calls to cr_hold_ctrl() are: // For CR_HOLD_SCOPE_THREAD: CR_HOLD_DFLT (defers to CR_HOLD_SCOPE_INIT). // For CR_HOLD_SCOPE_INIT: CR_HOLD_BOTH // For CR_HOLD_SCOPE_UNINIT: CR_HOLD_BOTH // // Returns previous value of selected hold flags on success, -1 on failure. // Most likely errno values when returning -1: // CR_ENOINIT Calling thread has not called cr_init() // EINVAL Invalid 'scope' or 'flags' argument. // // This function maybe called from any thread which has previously called // cr_init() (this includes any thread created by libcr to run callback in // thread context). // // If invoking cr_hold_ctrl() from a callback, please NOTE: // + Calls made before the call to cr_checkpoint() and/or with a 'scope' of // CR_HOLD_SCOPE_THREAD are safe, and any value set will be used beginning // with the barrier following the active checkpoint or restart. // + The remaining case (non-THREAD 'scope' after calling cr_checkpoint()), // is legal, but discouraged. Unless some coordination among threads is // implemented outside of libcr, there is no guarantee in such a case // as to which threads will observe the old or new value. // // This routine is both thread-safe and reentrant (signal-safe). // // NOTE: // The default hold behavior in the BLCR 0.7.X series differs from that in // the 0.6.X series. In 0.6.X threads that had not called cr_init() were // not held at the thread barrier. In 0.7.X a call to // cr_hold_ctrl(CR_HOLD_SCOPE_UNINIT, CR_HOLD_NONE); // will restore the 0.6.X behavior for those applications that require it. // extern int cr_hold_ctrl(int scope, int flags); // cr_{inc,dec}_persist() // THESE FUNCTIONS ARE EXPERIMENTAL: USE AT YOUR OWN RISK // // Increment/decrement TLD use count // // Calls to cr_init() create thread-local data (TLD). Normally this TLD // is freed automatically when a pthread exits or is canceled. However, // the POSIX threads specification leaves undefined the order in which // TLD destructors are run. This creates the possibility that a libcr // function which requires a cr_init() call as a prerequisite could fail // with errno=CR_ENOINIT if invoked from a client-provided TLD destructor. // // This pair of functions allow a client to increment and decrement a // use count associated with the calling thread's libcr TLD. This count // begins at zero and the TLD can only be destroyed when the value is zero. // // Typical use of these function include a call to cr_inc_persist() before // a client thread's first call to pthread_setspecific() for any key that // has a destructor that invokes libcr functions (perhaps indirectly). // This call should be made once per-key, per-thread - it should not be // called for each pthread_setspecific(). Once the call has been made to // increment the use count, the TLD will not be destroyed until after an // equal number of calls to cr_dec_persist() in the same thread return the // count to zero. Therefore, the recommended use is to call cr_dec_persist() // in the TLD destructor which invokes libcr functions. A call to // cr_dec_persist() which returns the use count to zero only makes the TLD // eligible for destruction at thread exit, but will not immediately destroy // it. Therefore, one may call cr_dec_persist() at any time the need for // TLD persistence ends. // // Note that failure to balance cr_inc_persist() calls from one thread with // an equal number of cr_dec_persist() calls from the same thread will result // in a memory leak of approximately 5KB per exited thread. // // Returns previous value of the use count on success, -1 on failure. // On failure the use count is unchanged. // // Most likely errno values when returning -1: // CR_ENOINIT Calling thread has not called cr_init() // ERANGE The requested inc/dec would cause over/underflow // // These functions are not reentrant - do not call them from signal context. // extern int cr_inc_persist(void); extern int cr_dec_persist(void); // PRIVATE interfaces: // // The following are for internal use only and should never be called // directly. Use a documented public interface instead. extern int // The public interface is cr_initialize_checkpoint_args_t() cri_init_checkpoint_args_t(cr_version_t, cr_checkpoint_args_t *); // LEGACY interfaces: // // The following are DEPRECATED and therefore the corresponding documentation // is not present. You may consult the implementation of these functions for // clues on how to replace them in your own code. extern void cr_request(void) _CR_DEPRECATED; extern void cr_request_file(const char *filename) _CR_DEPRECATED; extern void cr_request_fd(int fd) _CR_DEPRECATED; __END_DECLS #endif blcr-0.8.5/include/blcr_ksyms.h0000664000000000000000000001203112065505123013277 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2003, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * * 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 * * $Id: blcr_ksyms.h,v 1.18.8.4 2012/12/23 04:36:35 phargrov Exp $ */ #ifndef _CR_KSYMS_H #define _CR_KSYMS_H 1 /* Give the linker a literal address for a symbol. * Note that the case is preserved in the preprocessor symbols. * * Note that the CR_IMPORT_K*() must come AFTER the last use in a given * source file, or in a separate source file. Otherwise, the assembler * may generate PC-relative calls that the ELF-validation code in some * 2.6.x kernels (e.g. FC3) will reject. To meet this requirement, * BLCR is currently putting all IMPORTS in a separate kernel module. * * * Example: * #if defined(CR_KDATA_foo) && CR_KDATA_foo * CR_IMPORT_KDATA(foo) * #endif * * Or, if you have the address * _CR_IMPORT_KDATA(foo, 0xabcd0123) */ #include "blcr_config.h" #ifndef EXPORT_SYMBOL_GPL #define EXPORT_SYMBOL_GPL EXPORT_SYMBOL #endif #if defined(__i386__) || defined(__x86_64__) #ifdef CONFIG_RELOCATABLE #ifndef CR_EXPORTED_KCODE___register_chrdev #define _CR_RELOC_KSYM(_addr) (_addr - CR_EXPORTED_KCODE_register_chrdev + register_chrdev) #else #define _CR_RELOC_KSYM(_addr) (_addr - CR_EXPORTED_KCODE___register_chrdev + __register_chrdev) #endif #else #define _CR_RELOC_KSYM(_addr) _addr #endif #define _CR_IMPORT_KSYM1(_name, _addr, _type) \ __asm__ (".weak " #_name "\n\t" \ ".type " #_name "," #_type "\n\t" \ ".equ " #_name "," #_addr "\n\t"); #define _CR_IMPORT_KSYM(_name, _addr, _type) _CR_IMPORT_KSYM1(_name, _addr, _type) EXPORT_SYMBOL_GPL(_name); #define _CR_IMPORT_KDATA(_name,_addr) _CR_IMPORT_KSYM(_name, _CR_RELOC_KSYM(_addr), @object) #define _CR_IMPORT_KCODE(_name,_addr) _CR_IMPORT_KSYM(_name, _CR_RELOC_KSYM(_addr), @function) #elif defined(__powerpc__) && (BITS_PER_LONG == 64) #define _CR_IMPORT_KSYM1(_name, _addr, _type) \ __asm__ (".weak " #_name "\n\t" \ ".type " #_name "," #_type "\n\t" \ ".equ " #_name "," #_addr "\n\t"); #define _CR_IMPORT_KSYM(_name, _addr, _type) _CR_IMPORT_KSYM1(_name, _addr, _type) EXPORT_SYMBOL_GPL(_name); #define _CR_IMPORT_KDATA(_name,_addr) _CR_IMPORT_KSYM(_name, _addr, @object) #define _CR_IMPORT_KCODE(_name,_addr) _CR_IMPORT_KSYM(_name, _addr, @object) #elif defined(__powerpc__) && (BITS_PER_LONG == 32) #define _CR_IMPORT_KSYM1(_name, _addr, _type) \ __asm__ (".weak " #_name "\n\t" \ ".type " #_name "," #_type "\n\t" \ ".equ " #_name "," #_addr "\n\t"); #define _CR_IMPORT_KSYM(_name, _addr, _type) _CR_IMPORT_KSYM1(_name, _addr, _type) EXPORT_SYMBOL_GPL(_name); #define _CR_IMPORT_KDATA(_name,_addr) _CR_IMPORT_KSYM(_name, _addr, @object) #define _CR_IMPORT_KCODE(_name,_addr) _CR_IMPORT_KSYM(_name, _addr, @function) #elif defined(__arm__) #define _CR_IMPORT_KSYM1(_name, _addr, _type) \ __asm__ (".weak " #_name "\n\t" \ ".type " #_name "," #_type "\n\t" \ ".equ " #_name "," #_addr "\n\t"); #define _CR_IMPORT_KSYM(_name, _addr, _type) _CR_IMPORT_KSYM1(_name, _addr, _type) EXPORT_SYMBOL_GPL(_name); #define _CR_IMPORT_KDATA(_name,_addr) _CR_IMPORT_KSYM(_name, _addr, %object) #define _CR_IMPORT_KCODE(_name,_addr) _CR_IMPORT_KSYM(_name, _addr, %function) #elif defined(__sparc__) #define _CR_IMPORT_KSYM1(_name, _addr, _type) \ __asm__ (".weak " #_name "\n\t" \ ".type " #_name "," #_type "\n\t" \ ".equ " #_name "," #_addr "\n\t"); #define _CR_IMPORT_KSYM(_name, _addr, _type) _CR_IMPORT_KSYM1(_name, _addr, _type) EXPORT_SYMBOL_GPL(_name); #define _CR_IMPORT_KDATA(_name,_addr) _CR_IMPORT_KSYM(_name, _addr, @object) #define _CR_IMPORT_KCODE(_name,_addr) _CR_IMPORT_KSYM(_name, _addr, @function) #else #error "Add your architecture to blcr_ksyms.h" #endif #define CR_IMPORT_KDATA(_name) _CR_IMPORT_KDATA(_name, CR_KDATA_##_name) #define CR_IMPORT_KCODE(_name) _CR_IMPORT_KCODE(_name, CR_KCODE_##_name) #endif blcr-0.8.5/etc/0000755000000000000000000000000012102072124010157 500000000000000blcr-0.8.5/etc/Makefile.am0000664000000000000000000000061710272464234012156 00000000000000EXTRA_DIST = license.txt blcr.rc module_dir=$(shell echo '@CR_MODULE_DIR@' | sed -e 's/@LINUX_VER@/`uname -r`/') install-exec-local: $(mkinstalldirs) $(DESTDIR)$(sysconfdir)/init.d @PERL@ -pe 's|\@MODULE_DIR\@|$(module_dir)|' \ < $(srcdir)/blcr.rc > $(DESTDIR)$(sysconfdir)/init.d/blcr chmod 755 $(DESTDIR)$(sysconfdir)/init.d/blcr uninstall-local: rm -f $(DESTDIR)$(sysconfdir)/init.d/blcr blcr-0.8.5/etc/blcr.rc0000664000000000000000000000402712075150751011370 00000000000000#!/bin/sh # # chkconfig: 345 90 01 # description: Load and unload BLCR kernel modules # # $Id: blcr.rc,v 1.17.14.1 2013/01/15 03:50:01 phargrov Exp $ # The only likely configuration is these three variables: PATH=/bin:/sbin:/usr/bin:/usr/sbin module_dir=@MODULE_DIR@ if [ -d /var/lock/subsys ]; then blcr_lock=/var/lock/subsys/blcr else blcr_lock=/var/lock/blcr fi # Default versions if disto-specific ones are lacking. success() { echo "Success!" } failure() { echo "Failure!" } if [ -f /etc/init.d/functions ]; then . /etc/init.d/functions elif [ -f /etc/rc.d/init.d/functions ] ; then . /etc/rc.d/init.d/functions fi do_checkmod() { lsmod | grep "^$1 " >/dev/null 2>&1 return $? } # Try modprobe by default, but fallback on insmod+fullpath do_insmod() { modprobe $1 || (do_checkmod $1 || insmod ${module_dir}/${1}.ko) } # Try modprobe -r by default, but fallback on rmmod do_rmmod() { modprobe -r $1 || (do_checkmod $1 && rmmod $1) } do_start() { echo -n "Loading BLCR: " if test ! -d ${module_dir}; then echo -n "no ${module_dir} " failure else (do_insmod blcr_imports && \ do_insmod blcr && \ touch $blcr_lock && success) || failure fi echo } do_stop() { echo -n "Unloading BLCR: " (do_rmmod blcr && \ do_rmmod blcr_imports && \ rm -f $blcr_lock && success) || failure echo } case "$1" in start) do_start ;; stop) do_stop ;; restart | force-reload) do_stop do_start ;; reload) if [ -f $blcr_lock ]; then do_stop do_start fi ;; status) if [ -f $blcr_lock ]; then do_checkmod blcr && rc1=1 || rc1=0 do_checkmod blcr_imports && rc2=1 || rc2=0 if [ "x$rc1$rc2" != "x11" ] ; then msg="BLCR subsytem lock exists, but the following is/are not loaded:" [ $rc1 -ne 1 ] && msg="$msg blcr" [ $rc2 -ne 1 ] && msg="$msg blcr_imports" echo "$msg" exit 2 fi echo "BLCR subsytem is active" exit 0 else echo "BLCR subsytem is stopped" exit 3 fi ;; *) echo "*** Usage: blcr {start|stop|restart|reload|status}" exit 1 esac exit 0 blcr-0.8.5/etc/Makefile.in0000664000000000000000000002612012102070007012145 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ 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 = etc DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/blcr_config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CONFIGURE_ARGS = @CONFIGURE_ARGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CR_ARCH = @CR_ARCH@ CR_CLIENT_LDADD = @CR_CLIENT_LDADD@ CR_CPU = @CR_CPU@ CR_FTB_INCLUDES = @CR_FTB_INCLUDES@ CR_FTB_LDADD = @CR_FTB_LDADD@ CR_FTB_LDFLAGS = @CR_FTB_LDFLAGS@ CR_KARCH = @CR_KARCH@ CR_KERNEL = @CR_KERNEL@ CR_KERNEL_BASE = @CR_KERNEL_BASE@ CR_LIBARCH = @CR_LIBARCH@ CR_LIBCR_CFLAGS = @CR_LIBCR_CFLAGS@ CR_MODULE_DIR = @CR_MODULE_DIR@ CR_MODULE_MAJOR = @CR_MODULE_MAJOR@ CR_MODULE_MINOR = @CR_MODULE_MINOR@ CR_MODULE_PATCH = @CR_MODULE_PATCH@ CR_MODULE_VERSION = @CR_MODULE_VERSION@ CR_NDEBUG = @CR_NDEBUG@ CR_RELEASE_MAJOR = @CR_RELEASE_MAJOR@ CR_RELEASE_MINOR = @CR_RELEASE_MINOR@ CR_RELEASE_PATCH = @CR_RELEASE_PATCH@ CR_RELEASE_VERSION = @CR_RELEASE_VERSION@ CR_SIGNUM = @CR_SIGNUM@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GMAKE_ELSE = @GMAKE_ELSE@ GMAKE_ENDIF = @GMAKE_ENDIF@ GMAKE_IFEQ = @GMAKE_IFEQ@ GMAKE_IFNEQ = @GMAKE_IFNEQ@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KBUILD_MAK = @KBUILD_MAK@ KBUILD_MAKE_ARGS = @KBUILD_MAKE_ARGS@ KCC = @KCC@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBCR_MAJOR = @LIBCR_MAJOR@ LIBCR_MINOR = @LIBCR_MINOR@ LIBCR_PATCH = @LIBCR_PATCH@ LIBCR_VERSION = @LIBCR_VERSION@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_AGE = @LIBTOOL_AGE@ LIBTOOL_INTERFACE = @LIBTOOL_INTERFACE@ LIBTOOL_REVISION = @LIBTOOL_REVISION@ LINUX_OBJ = @LINUX_OBJ@ LINUX_SRC = @LINUX_SRC@ LINUX_SYMTAB_CMD = @LINUX_SYMTAB_CMD@ LINUX_SYMTAB_CONF = @LINUX_SYMTAB_CONF@ LINUX_SYMTAB_FILE = @LINUX_SYMTAB_FILE@ LINUX_VER = @LINUX_VER@ LINUX_VERSION_H = @LINUX_VERSION_H@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKE = @MAKE@ MAKEINFO = @MAKEINFO@ 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_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PWD_PROG = @PWD_PROG@ RANLIB = @RANLIB@ RPMBUILD = @RPMBUILD@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TOP_BUILDDIR = @TOP_BUILDDIR@ TOP_SRCDIR = @TOP_SRCDIR@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ 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@ lt_ECHO = @lt_ECHO@ 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@ EXTRA_DIST = license.txt blcr.rc module_dir = $(shell echo '@CR_MODULE_DIR@' | sed -e 's/@LINUX_VER@/`uname -r`/') all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign etc/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign etc/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 tags: TAGS TAGS: ctags: CTAGS CTAGS: 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 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-exec-local install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-local .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-exec-local install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ uninstall uninstall-am uninstall-local install-exec-local: $(mkinstalldirs) $(DESTDIR)$(sysconfdir)/init.d @PERL@ -pe 's|\@MODULE_DIR\@|$(module_dir)|' \ < $(srcdir)/blcr.rc > $(DESTDIR)$(sysconfdir)/init.d/blcr chmod 755 $(DESTDIR)$(sysconfdir)/init.d/blcr uninstall-local: rm -f $(DESTDIR)$(sysconfdir)/init.d/blcr # 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: blcr-0.8.5/etc/license.txt0000664000000000000000000000143707755231443012314 00000000000000This 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 If you are recieving this as part of BLCR, you will find the GNU GPL in the file COPYING in the top-level BLCR directory. blcr-0.8.5/etc/README0000664000000000000000000000047710127324370011001 00000000000000This directory contains an example init script for loading the BLCR kernel modules at boot time. It is known to work with RedHat and similar systems. This file is NOT installed by default, but you can run 'make install' in this directory or add '--enable-init-script' to the configure flags to install it if desired. blcr-0.8.5/README0000664000000000000000000000077111122012512010207 00000000000000This is the top-level README for BLCR See the doc/html subdirectory for installation and usage instructions. See doc/README for pointers to various other sources of information. See LICENSE.txt for copyright and license information. See config/cross_helper.c for information on cross-compilation. See README.devel for information targeted at BLCR developers. See README.FTB for information about "Fault Tolerance Backplane" support. Visit http://ftg.lbl.gov/checkpoint for the most current information. blcr-0.8.5/libcr/0000755000000000000000000000000012102072123010476 500000000000000blcr-0.8.5/libcr/cr_syscall.h0000664000000000000000000000640311011513641012735 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2007, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 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 * Library 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * $Id: cr_syscall.h,v 1.14 2008/05/11 06:52:17 phargrov Exp $ */ #ifndef _CR_SYSCALL_H #define _CR_SYSCALL_H 1 #include "blcr_config.h" #include #include // for (struct timespec) #include // for siginfo_t and sigset_t #include // for uintptr_t #ifndef CRI_SYSCALL_NOARG #define CRI_SYSCALL_NOARG ((uintptr_t)(-1L)) #endif // arguments to rt_sigaction system call struct k_sigaction { void (*ksa_sigaction) (int, siginfo_t *, void *); unsigned long ksa_flags; void (*ksa_restorer)(void); sigset_t ksa_mask; /* mask moved last for extensibility */ }; // Establish "connection" to blcr kernel module extern int cri_connect(void); extern void cri_disconnect(void); // Call the blcr kernel module w/ the default "connection" extern int cri_syscall(int op, uintptr_t arg); extern int __cri_syscall(int op, uintptr_t arg, int * errno_p); // Manually manage connection(s) to the blcr kernel module // The value returned by cri_connect_token(), if non-negative, // should be passed as the 'token' argument to the other calls. // It is currently just the fd, but that could change some day. extern int cri_connect_token(void); extern void cri_disconnect_token(int token); extern int cri_syscall_token(int token, int op, uintptr_t arg); extern int __cri_syscall_token(int token, int op, uintptr_t arg, int * errno_p); // Special case for CR_OP_HAND_CHKPT to allow arch-specific register saves extern int __cri_chkpt(int fd, int cmd, void * arg, int * errno_p); // Direct system calls, bypassing any pthread wrappers extern int __cri_ioctl(int fd, int cmd, void * arg, int * errno_p); extern int __cri_open(const char * pathname, int flags, int mode, int * errno_p); extern int __cri_close(int fd, int * errno_p); extern int __cri_sched_yield(int * errno_p); extern int __cri_nanosleep(const struct timespec * req, struct timespec * rem, int * errno_p); extern int __cri_exit(int code, int * errno_p); extern int __cri_exit_group(int code, int * errno_p); extern int __cri_ksigaction(int signum, const struct k_sigaction *act, struct k_sigaction *oldact, size_t setsize, int * errno_p); #endif /* _CR_SYSCALL_H */ blcr-0.8.5/libcr/cr_syscall.c0000664000000000000000000001263411014616334012741 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2007, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 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 * Library 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * $Id: cr_syscall.c,v 1.33 2008/05/20 18:47:56 phargrov Exp $ * * * This file abstracts away the ioctl() interface so that we * can painlessly switch to a "real" syscall someday. */ #include // for ioctl() #include // for O_WRONLY #include // for errno #include // for dup2 #include "cr_private.h" // // Private data // static cri_atomic_t local_fd = {(unsigned int)(-1L)}; // // Private functions // // // Public Functions // // Open an instance of the control node. // // returns < 0 on failure, the fd on success int cri_connect_token(void) { int fd; // Try to open the control node fd = __cri_open(CR_CTRL_FILE, O_WRONLY, 0, NULL); if (fd < 0) { // Fail: not present errno = ENOSYS; goto out; } // Set close-on-exec flag, failing silently if at all (void)fcntl(fd, F_SETFD, FD_CLOEXEC); // Check kernel interface version if (ioctl(fd, CR_OP_VERSION, (CR_MODULE_MAJOR << 16) | CR_MODULE_MINOR) < 0) { // Kernel module doesn't support our version of the interface // ioctl() has set errno to CR_EVERSION (void)__cri_close(fd, NULL); // may fail silently, doesn't touch errno fd = -1; } out: return fd; } // Close an instance of the control descriptor. // Note that this is signal and thread safe. void cri_disconnect_token(int fd) { (void)__cri_close(fd, NULL); // may fail silently } // Call kernel w/ a specific location for errno int __cri_syscall_token(int fd, int op, uintptr_t arg, int *errno_p) { return __cri_ioctl(fd, op, (void *)arg, errno_p); } // Call kernel w/ the default location for errno int cri_syscall_token(int fd, int op, uintptr_t arg) { return __cri_syscall_token(fd, op, arg, &errno); } // Open a single, shared, instance of the control node. // Note that this is signal and thread safe. // // returns < 0 on failure, the fd on success int cri_connect(void) { int fd; while ((fd = (int)cri_atomic_read(&local_fd)) < 0) { int old = fd; // Try to open the control node fd = cri_connect_token(); // Try to install our fd if (!cri_cmp_swap(&local_fd, old, fd)) { // We lost the race: another thread has opened the file (void)__cri_close(fd, NULL); // may fail silently continue; } break; } return fd; } // Close the single shared instance of the control descriptor. // Note that this is signal and thread safe. // HOWEVER: not safe to race against cri_syscall(). void cri_disconnect(void) { int fd; if ((fd = (int)cri_atomic_read(&local_fd)) >= 0) { // Remove it if (cri_cmp_swap(&local_fd, fd, -1)) { cri_disconnect_token(fd); } else { // We lost the race: another thread has closed the file } } } /* Special version of cri_syscall that works even w/o a fully initialized thread environment. * However, does not check cri_connect(). */ int __cri_syscall(int op, uintptr_t arg, int *errno_p) { return __cri_ioctl((int)cri_atomic_read(&local_fd), op, (void *)arg, errno_p); } int cri_syscall(int op, uintptr_t arg) { int token = cri_connect(); return (token < 0) ? token : __cri_syscall_token(token, op, arg, &errno); } /* Functions for direct syscalls */ /* These don't require any thread environment and use a caller-provided errno */ #include #include #include #include #include #include cri_syscall3(int, __cri_ioctl, __NR_ioctl, int, int, void*) cri_syscall3(int, __cri_open, __NR_open, const char*, int, int) cri_syscall1(int, __cri_close, __NR_close, int); cri_syscall0(int, __cri_sched_yield, __NR_sched_yield) cri_syscall2(int, __cri_nanosleep, __NR_nanosleep, const struct timespec*, struct timespec*) cri_syscall1(int, __cri_exit, __NR_exit, int) #ifdef __NR_exit_group cri_syscall1(int, __cri_exit_group, __NR_exit_group, int) #else int __cri_exit_group(int code, int *errno_p) { if (errno_p) { *errno_p = ENOSYS; } return -1; } #endif cri_syscall4(int, __cri_ksigaction, __NR_rt_sigaction, int, const struct k_sigaction*, struct k_sigaction*, size_t) /* Special-case the checkpoint call (which is still an ioctl) to allow for * arch-specific code that deals with caller-saved registers (which don't * get restored by the kernel to the right values at restart). */ cri_syscall3X(int, __cri_chkpt, __NR_ioctl, int, int, void*) blcr-0.8.5/libcr/cr_pthread.c0000664000000000000000000000723310674603776012736 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2003, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 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 * Library 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * $Id: cr_pthread.c,v 1.31 2007/09/20 23:53:34 phargrov Exp $ */ #include #include #include #include #include "cr_private.h" #if PIC && HAVE___REGISTER_ATFORK // pthread_atfork() handling for shared objects // glibc has started putting pthread_atfork() in libpthread_nonshared.a, which is causing // problems when we call from a shared library. The problem is that the code in the // static lib gets pulled into libcr.so, but its was not PIC-compiled. // Therefore, we use our own private re-implementation. // This implementation is closely based on glibc-2.3.2-20030313/nptl/pthread_atfork.c extern void *__dso_handle __attribute__((__weak__)); extern int __register_atfork(void (*prepare)(void), void (*parent)(void), void (*child)(void), void *dso_handle); extern int cri_atfork(void (*prepare)(void), void (*parent)(void), void (*child)(void)) { void *my_handle = &__dso_handle ? __dso_handle : NULL; return __register_atfork(prepare, parent, child, my_handle); } #endif // Holds thread-specific data key for cri_info pthread_key_t cri_info_key; // atfork callback to reset the state static void child_reset(void) { cri_rb_init(&cri_cs_lock); cri_atomic_write(&cri_live_count, 0); cri_info_free(cri_info_location()); } #if !HAVE___REGISTER_ATFORK // Interpose on fork() to ensure the pthreads version is called // if the caller linked us, but not the pthreads library. pid_t cri_fork(void) { return __fork(); } weak_alias(cri_fork,fork); #endif // // Initialize pthread-dependent parts // void cri_pthread_init(void) { int rc; #if !HAVE___REGISTER_ATFORK // See bug #460 { // dlopen will fail if this is a static exectuable. // If so, then the pthread library references must // have been resolved. void *handle = dlopen(NULL /* the executable */, RTLD_LAZY); if (handle) { if (dlsym(handle, "__fork") == dlsym(handle, "__libc_fork")) { CRI_ABORT("Unable to ensure pthread_atfork() will run.\n" "If you dlopen(libcr.so) or use some versions of the libraries/loaders, " "then you may need to link libpthread explicitly (or use LD_PRELOAD)."); } dlclose(handle); } } #endif /* !HAVE___REGISTER_ATFORK */ // Install a atfork callback to cleanup state in children rc = cri_atfork(NULL, NULL, &child_reset); if (rc != 0) { CRI_ABORT("cri_atfork() returned %d", rc); } // Setup the thread-specific data for cri_info rc = pthread_key_create(&cri_info_key, &cri_info_free); if (rc != 0) { CRI_ABORT("pthread_key_create() returned %d", rc); } } blcr-0.8.5/libcr/cr_core.c0000664000000000000000000002663711146661403012232 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2008, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 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 * Library 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * $Id: cr_core.c,v 1.206.6.2 2009/02/18 01:23:15 phargrov Exp $ */ #include #include #include #include #include #include #include #include #include #include #include #include "cr_private.h" // // Private variables // // // Public variables // // // Internal variables // // How many threads are actively trying to checkpoint (PENDING + ACTIVE) cri_atomic_t cri_live_count = {0,}; // Red-black lock for critical sections cri_rb_lock_t cri_cs_lock = CRI_RB_LOCK_INITIALIZER; // Default values for hold flags cri_atomic_t cri_hold_init = {CR_HOLD_BOTH,}; cri_atomic_t cri_hold_uninit = {CR_HOLD_BOTH,}; // Table of hooks volatile cr_hook_fn_t cri_hook_tbl[CR_NUM_HOOKS]; // // Private functions // // Tell the kernel we are ready to be saved // This version just invokes __cri_chkpt(flags) static int do_checkpoint(int token, unsigned long flags) { int rc, local_errno; // "GLOBAL" CHECKPOINT STUFF HERE: // This does the actual kernel call to take the checkpoint: rc = __cri_chkpt(token, CR_OP_HAND_CHKPT, (void *)flags, &local_errno); if (rc < 0) { return -local_errno; } if (rc) { // "GLOBAL" RESTART STUFF HERE } else { // "GLOBAL" CONTINUE STUFF HERE } return rc; } // enter_idle_state(info) // // Transition to CR_STATE_IDLE, regardless of starting state static inline void enter_idle_state(cri_info_t *info) { cri_atomic_write(&info->cr_state, CR_STATE_IDLE); cri_atomic_write(&info->cr_cs_count, 1); } // Signal handler to dispatch the request // // Must NOT be static because we need to be able to dlsym() it // when trying to mix static and shared libs. // // WARNING: Must only be called as a signal handler. // Any other calls may not return correctly (see final lines). /* static */ void cri_sig_handler(int signr, siginfo_t *siginfo, void *context) { int saved_errno = errno; #if LIBCR_TRACING int pid = (int)getpid(); #endif cri_info_t *info = cri_info_location(); // thread-specific const int token = siginfo->si_pid; LIBCR_TRACE(LIBCR_TRACE_INFO, "[%d] signal %d received", pid, signr); #ifdef SI_KERNEL if (siginfo->si_code != SI_KERNEL) { LIBCR_TRACE(LIBCR_TRACE_INFO, "[%d] Ignoring false signal", pid); goto out; } #endif if (!info || !info->handler) { int rc; // No state and/or handler, so do this the "easy way" LIBCR_TRACE(LIBCR_TRACE_INFO, "[%d] START", pid); cri_atomic_inc(&cri_live_count); rc = do_checkpoint(token, 0); (void)cri_atomic_dec_and_test(&cri_live_count); if (rc < 0) { LIBCR_TRACE(LIBCR_TRACE_INFO, "[%d] do_checkpoint failed w/ rc=%d", pid, rc); } else { CRI_RUN_HOOK(rc ? CR_HOOK_RSTRT_NO_CALLBACKS : CR_HOOK_CONT_NO_CALLBACKS); rc = cri_syscall_token(token, CR_OP_HAND_DONE, cri_atomic_read(&cri_hold_uninit)); if (rc < 0) { CRI_ABORT("CR_OP_HAND_DONE failed w/ rc=%d errno=%d", rc, errno); } } LIBCR_TRACE(LIBCR_TRACE_INFO, "[%d] DONE", pid); } else { // Run the handler appropriate to this thread LIBCR_TRACE(LIBCR_TRACE_INFO, "[%d] running handler %p", pid, info->handler); info->run.token = token; info->handler(signr, siginfo, context); } out: errno = saved_errno; // Ugh!! Bug 2003: sa_restorer might be corrupted. // So, we return "directly" when supported #if defined(cri_sigreturn) cri_sigreturn(signr, siginfo, context); #endif } // // Public functions // cr_hook_fn_t cr_register_hook(cr_hook_event_t event, cr_hook_fn_t fn) { cr_hook_fn_t old_fn = CR_HOOK_FN_ERROR; // assume failure cri_info_t *info = CRI_INFO_OR_RETURN(old_fn); // thread-specific /* Static data: */ static pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER; /* Argument checking includes: * + Range check 'event' * + Check that 'fn' is not our reserved error value. */ errno = EINVAL; if ((event >= 0) && (event < CR_NUM_HOOKS) && (fn != CR_HOOK_FN_ERROR)) { (void)cri_do_enter(info, CRI_ID_INTERNAL); pthread_mutex_lock(&lock); old_fn = cri_hook_tbl[event]; cri_hook_tbl[event] = fn; pthread_mutex_unlock(&lock); cri_do_leave(info, CRI_ID_INTERNAL); } else { // return value and errno already set } return old_fn; } int cr_checkpoint(int flags) { cri_info_t *info; // thread-specific int my_id; int outer_most; int index; int token; int retval; int rc; #if LIBCR_TRACING int pid = (int)getpid(); #endif // Checks for improper calls info = CRI_CB_INFO_OR_RETURN(-CR_ENOTCB); // thread-specific // Save callers id and other bits from info-> my_id = info->run.index; token = info->run.token; outer_most = (my_id == info->cr_cb_count); // Loop calling callbacks until they have all been called and then // invoke do_checkpoint() to do the real work. // // This strange loop ensures that after the callback with (index == 0) // we next call do_checkpoint() even if callback0 is NULL or returns // without calling back into cr_checkpoint(). do { if (flags & CR_CHECKPOINT_ABORT_MASK) { // We've detected failure of the invoking callback // We we must now call the kernel and stop stacking of callbacks. LIBCR_TRACE(LIBCR_TRACE_INFO, "[%d] CANCELLING CHECKPOINT (flags=%d)", pid, flags); if (cri_syscall_token(token, CR_OP_HAND_ABORT, flags) == -1) info->run.rc = -errno; index = info->run.index = -1; break; } index = --info->run.index; if (index >= 0) { // Call the next callback, skipping NULLs if (info->cr_cb[index].func != NULL) { info->run.id = index; rc = (*info->cr_cb[index].func)(info->cr_cb[index].arg); if (rc) { LIBCR_TRACE(LIBCR_TRACE_INFO, "Callback %d returned %d - ABORTING\n", index, rc); (void)cri_syscall_token(token, CR_OP_HAND_ABORT, CR_CHECKPOINT_PERM_FAILURE); CRI_ABORT("Unexpected return from CR_OP_HAND_ABORT"); } } } else { LIBCR_TRACE(LIBCR_TRACE_INFO, "[%d] CHECKPOINTING (flags=%d)", pid, flags); info->run.rc = do_checkpoint(info->run.token, flags); if (info->run.rc < 0) { LIBCR_TRACE(LIBCR_TRACE_INFO, "[%d] do_checkpoint() FAILED", pid); } else if (info->run.rc) { LIBCR_TRACE(LIBCR_TRACE_INFO, "[%d] RESTORING", pid); } else { LIBCR_TRACE(LIBCR_TRACE_INFO, "[%d] CONTINUING", pid); } } } while (info->run.index >= 0); // Once the outer-most invocation calls CR_OP_HAND_{CONT,RSTRT} // the kernel might checkpoint us again. Save the return value now // because a second checkpoint could modify info->run.rc. retval = info->run.rc; /* Restore saved id for possible use by the caller (in replace_self). */ info->run.id = my_id; // Perform cleanup only on the final/outer-most return if (outer_most) { enter_idle_state(info); cri_atomic_dec_and_test(&cri_live_count); if (retval >= 0) { int hold; CRI_RUN_HOOK(retval ? (info->is_thread ? CR_HOOK_RSTRT_THREAD_CONTEXT : CR_HOOK_RSTRT_SIGNAL_CONTEXT) : (info->is_thread ? CR_HOOK_CONT_THREAD_CONTEXT : CR_HOOK_CONT_SIGNAL_CONTEXT)); hold = cri_atomic_read(&info->hold); if (hold == CR_HOLD_DFLT) { hold = cri_atomic_read(&cri_hold_init); } rc = cri_syscall_token(info->run.token, CR_OP_HAND_DONE, hold); if (rc < 0) { CRI_ABORT("CR_OP_HAND_DONE failed w/ rc=%d errno=%d", rc, errno); } } } return retval; } // cr_inc_persist() // // Routine to request delayed free of a cri_info_t int cr_inc_persist(void) { cri_info_t *info = CRI_INFO_OR_RETURN(-1); // thread-specific int retval; retval = info->persist; if (retval == INT_MAX) { /* Overflow */ errno = ERANGE; return -1; } info->persist += 1; return retval; } // cr_dec_persist() // // Routine to cancel a request for delayed free of a cri_info_t int cr_dec_persist(void) { cri_info_t *info = CRI_INFO_OR_RETURN(-1); // thread-specific int retval; retval = info->persist; if (retval == 0) { /* Underflow */ errno = ERANGE; return -1; } info->persist -= 1; return retval; } // // Internal functions // // cri_checkpoint_info_init() // // Initialize a thread-local struct cr_checkpoint_info void cri_checkpoint_info_init(cri_info_t *info) { info->cr_checkpoint_info.dest = NULL; // filled-in on demand info->cr_restart_info.src = NULL; // filled-in on demand } // cri_info_free() // // dtor for thread-specific data // // Docs claim we are called only for non-NULL val. // Docs claim we are called w/ stored value set to NULL. // I've seen both violated, so we code w/ paranoia here. void cri_info_free(void *val) { cri_info_t *info = (cri_info_t *)val; if (info && !info->persist) { free(info); info = NULL; } // Clear if destroyed, reinstall otherwise: pthread_setspecific(cri_info_key, info); } // cri_info_init() // // Routine to initialize the list of registered callbacks and other data // On first call per thread, allocates the thread-specific cri_info structure. cri_info_t* cri_info_init(void) { cri_info_t *info = cri_info_location(); // thread-specific int rc; if (!info) { info = malloc(sizeof(cri_info_t)); if (!info) { CRI_ABORT("Failed to allocate cri_info structure"); } memset(info, 0, sizeof(cri_info_t)); enter_idle_state(info); info->handler = NULL; info->next_id = 0; info->is_thread = 0; info->persist = 0; cri_atomic_write(&info->hold, CR_HOLD_DFLT); rc = pthread_setspecific(cri_info_key, info); if (rc != 0) { CRI_ABORT("pthread_setspecific() returned %d", rc); } } return info; } // cri_start_checkpoint() // // Routine to process the list of registered callbacks void cri_start_checkpoint(cri_info_t *info) { if (cri_cmp_swap(&info->cr_state, CR_STATE_PENDING, CR_STATE_ACTIVE)) { // State is valid, so start running callbacks #if LIBCR_TRACING int pid = (int)getpid(); #endif int rc; info->run.index = info->cr_cb_count; LIBCR_TRACE(LIBCR_TRACE_INFO, "[%d] START", pid); rc = cr_checkpoint(0); LIBCR_TRACE(LIBCR_TRACE_INFO, "[%d] DONE", pid); } else if (!info->is_thread) { CRI_ABORT("STATE ERROR. Probably an excess call to cr_leave_cs()."); } else { // False wake up of a checkpoint thread - not an error. } } // // Library Initialization // #define CR_LINK_ME_VAR cr_link_me #define CR_SIG_HANDLER cri_sig_handler #define CR_SIG_IS_FULL 1 #include "cr_libinit.c" blcr-0.8.5/libcr/cr_trace.h0000664000000000000000000000467210754671067012413 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2003, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 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 * Library 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * $Id: cr_trace.h,v 1.15 2008/02/13 22:41:59 phargrov Exp $ */ #ifndef _CR_TRACE_H #define _CR_TRACE_H 1 #include // for abort() #include // for signal() #include // for _exit() extern void libcr_trace_init(void); extern void libcr_trace(const char *filename, int line, const char *function, const char * format, ...) __attribute__ ((format (printf, 4, 5))); #if LIBCR_TRACING || !defined(LIBCR_SIGNAL_ONLY) #define __cri_abort libcr_trace #else #include #define __cri_abort(__FILE__, __LINE__, __FUNCTION__, args...) \ fprintf(stderr, args) #endif #define CRI_ABORT(args...) \ do { \ __cri_abort(__FILE__, __LINE__, __FUNCTION__, args); \ signal(SIGABRT, SIG_DFL); \ abort(); \ _exit(42); \ } while(0); #if LIBCR_TRACING extern unsigned int libcr_trace_mask; #define LIBCR_TRACE_NONE 0 #define LIBCR_TRACE_ALL (~0) #define LIBCR_TRACE_INFO 0x00000001 #define LIBCR_TRACE(trace, args...) \ do { \ if (libcr_trace_mask & (trace)) { \ libcr_trace(__FILE__, __LINE__, __FUNCTION__, args); \ } \ } while (0) #define LIBCR_TRACE_INIT() libcr_trace_init() #else /* If not tracing then just eat the args */ #define LIBCR_TRACE(args...) do {} while (0) #define LIBCR_TRACE_INIT() do {} while (0) #endif #endif blcr-0.8.5/libcr/arch/0000775000000000000000000000000012102072123011415 500000000000000blcr-0.8.5/libcr/arch/sparc64/0000775000000000000000000000000012102072123012677 500000000000000blcr-0.8.5/libcr/arch/sparc64/cr_atomic.h0000664000000000000000000000260111115077252014742 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2008, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 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 * Library 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * $Id: cr_atomic.h,v 1.2 2008/12/02 00:17:46 phargrov Exp $ * * Experimental SPARC support contributed to BLCR by Vincentius Robby * and Andrea Pellegrini . */ #ifndef _CR_ATOMIC_H #include "../sparc/cr_atomic.h" #endif blcr-0.8.5/libcr/arch/sparc64/cr_arch.h0000664000000000000000000000257311115077252014413 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2008, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 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 * Library 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * $Id: cr_arch.h,v 1.2 2008/12/02 00:17:46 phargrov Exp $ * * Experimental SPARC support contributed to BLCR by Vincentius Robby * and Andrea Pellegrini . */ #ifndef _CR_ARCH_H #include "../sparc/cr_arch.h" #endif blcr-0.8.5/libcr/arch/x86_64/0000775000000000000000000000000012102072123012353 500000000000000blcr-0.8.5/libcr/arch/x86_64/cr_atomic.h0000664000000000000000000000236110643445220014420 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2007, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 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 * Library 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * $Id: cr_atomic.h,v 1.5 2007/07/06 13:58:40 phargrov Exp $ */ #ifndef _CR_ATOMIC_H #include "../i386/cr_atomic.h" #endif blcr-0.8.5/libcr/arch/x86_64/cr_arch.h0000664000000000000000000001753411060347716014076 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2003, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 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 * Library 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * $Id: cr_arch.h,v 1.23 2008/09/06 00:33:18 phargrov Exp $ */ #ifndef _CR_ARCH_H #define _CR_ARCH_H 1 // Catch-all file for misc. arch-specific bits #define CRI_CLOBBERS "cc", "r11", "rcx", "memory" #define CRI_CLOBBERS_6 CRI_CLOBBERS, "r8", "r9", "r10" #define CRI_CLOBBERS_5 CRI_CLOBBERS, "r8", "r10" #define CRI_CLOBBERS_4 CRI_CLOBBERS, "r10" #define CRI_CLOBBERS_3 CRI_CLOBBERS #define CRI_CLOBBERS_2 CRI_CLOBBERS #define CRI_CLOBBERS_1 CRI_CLOBBERS #define CRI_CLOBBERS_0 CRI_CLOBBERS #define cri_syscall_cleanup(res,errno_p) \ if ((unsigned long)res >= (unsigned long)(-4096)) { \ if (errno_p != NULL) { *errno_p = -res; } \ res = -1; \ } #define cri_syscall6(type,name,nr,type1,type2,type3,type4,type5,type6)\ type name(type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5,type6 arg6,int *errno_p) {\ long _res; \ __asm__ volatile ( \ "\tmovq %5,%%r10\n" \ "\tmovq %6,%%r8\n" \ "\tmovq %7,%%r9\n" \ "\tsyscall\n" \ : "=a" (_res) \ : "0" (nr), \ "D" ((long)(arg1)), \ "S" ((long)(arg2)), \ "d" ((long)(arg3)), \ "g" ((long)(arg4)), \ "g" ((long)(arg5)), \ "g" ((long)(arg6)) \ : CRI_CLOBBERS_6); \ cri_syscall_cleanup(_res, errno_p); \ return (type)_res; \ } #define cri_syscall5(type,name,nr,type1,type2,type3,type4,type5)\ type name(type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5,int *errno_p) {\ long _res; \ __asm__ volatile ( \ "\tmovq %5,%%r10\n" \ "\tmovq %6,%%r8\n" \ "\tsyscall\n" \ : "=a" (_res) \ : "0" (nr), \ "D" ((long)(arg1)), \ "S" ((long)(arg2)), \ "d" ((long)(arg3)), \ "g" ((long)(arg4)), \ "g" ((long)(arg5)) \ : CRI_CLOBBERS_5); \ cri_syscall_cleanup(_res, errno_p); \ return (type)_res; \ } #define cri_syscall4(type,name,nr,type1,type2,type3,type4)\ type name(type1 arg1,type2 arg2,type3 arg3,type4 arg4,int *errno_p) {\ long _res; \ __asm__ volatile ( \ "\tmovq %5,%%r10\n" \ "\tsyscall\n" \ : "=a" (_res) \ : "0" (nr), \ "D" ((long)(arg1)), \ "S" ((long)(arg2)), \ "d" ((long)(arg3)), \ "g" ((long)(arg4)) \ : CRI_CLOBBERS_4); \ cri_syscall_cleanup(_res, errno_p); \ return (type)_res; \ } #define cri_syscall3(type,name,nr,type1,type2,type3) \ type name(type1 arg1,type2 arg2,type3 arg3,int *errno_p) {\ long _res; \ __asm__ volatile ( \ "\tsyscall\n" \ : "=a" (_res) \ : "0" (nr), \ "D" ((long)(arg1)), \ "S" ((long)(arg2)), \ "d" ((long)(arg3)) \ : CRI_CLOBBERS_3); \ cri_syscall_cleanup(_res, errno_p); \ return (type)_res; \ } #define cri_syscall2(type,name,nr,type1,type2) \ type name(type1 arg1,type2 arg2,int *errno_p) { \ long _res; \ __asm__ volatile ( \ "\tsyscall\n" \ : "=a" (_res) \ : "0" (nr), \ "D" ((long)(arg1)), \ "S" ((long)(arg2)) \ : CRI_CLOBBERS_2); \ cri_syscall_cleanup(_res, errno_p); \ return (type)_res; \ } #define cri_syscall1(type,name,nr,type1) \ type name(type1 arg1,int *errno_p) { \ long _res; \ __asm__ volatile ( \ "\tsyscall\n" \ : "=a" (_res) \ : "0" (nr), \ "D" ((long)(arg1)) \ : CRI_CLOBBERS_1); \ cri_syscall_cleanup(_res, errno_p); \ return (type)_res; \ } #define cri_syscall0(type,name,nr) \ type name(int *errno_p) { \ long _res; \ __asm__ volatile ( \ "\tsyscall\n" \ : "=a" (_res) \ : "0" (nr) \ : CRI_CLOBBERS_0); \ cri_syscall_cleanup(_res, errno_p); \ return (type)_res; \ } /* * Because we enter the kernel via a "normal" syscall, the kernel * will not save the caller-saved rbp, rbx or r12-15 in the ptregs * struct (they are individually spilled as needed). * Thus vmadump can't restore them correctly at restart. * We work around that here telling gcc they are clobbered. */ #define CRI_CLOBBERS_3X CRI_CLOBBERS, "rbx", "rbp", "r12", "r13", "r14", "r15" #define cri_syscall3X(type,name,nr,type1,type2,type3) \ type name(type1 arg1,type2 arg2,type3 arg3,int *errno_p) {\ long _res; \ __asm__ volatile ( \ "\tsyscall\n" \ : "=a" (_res) \ : "0" (nr), \ "D" ((long)(arg1)), \ "S" ((long)(arg2)), \ "d" ((long)(arg3)) \ : CRI_CLOBBERS_3X); \ cri_syscall_cleanup(_res, errno_p); \ return (type)_res; \ } #if !CR_USE_SIGACTION /* signal return trampoline, from glibc-2.3.2 */ /* We only need this when not calling sigaction() directly; * and then only because x86_64 kernels *require* that the * SA_RESTORER bit be set in sa_flags. */ #include #ifndef __NR_rt_sigreturn #error "no value for __NR_rt_sigreturn" #endif #define CRI_SA_RESTORER2(name, syscall) \ __asm__ ( \ ".text\n" \ ".align 16\n" \ #name ":\n" \ " movq $" _STRINGIFY(syscall) ", %rax\n" \ " syscall\n" \ ); \ static void cri_sa_restorer(void) __asm__(#name); #define CRI_SA_RESTORER CRI_SA_RESTORER2(__restore_rt, __NR_rt_sigreturn) #ifndef SA_RESTORER #define SA_RESTORER 0x04000000 #endif #endif /* !CR_USE_SIGACTION */ #define cri_sigreturn(__signr, __siginfo, __context) \ __asm__ __volatile__ ( \ "mov %0,%%rsp\n\t" \ "mov %1,%%rax\n\t" \ "syscall" \ : : "r" (__context), "i" (CR_ASM_NR_rt_sigreturn)) /* Template to build the "micro" handlers */ #define _CR_ASM_HANDLER(_name, _op, _arg) \ __asm__(" .text\n"\ " .align 16\n"\ ".globl " _STRINGIFY(_name) "\n"\ " .type " _STRINGIFY(_name) ",@function\n"\ "" _STRINGIFY(_name) ":\n"\ " mov " _STRINGIFY(CR_ASM_SI_PID_OFFSET) "(%rsi),%rdi # di = siginfo->si_pid\n"\ " mov $" _STRINGIFY(CR_ASM_NR_ioctl) ", %rax # ax = __NR_ioctl\n"\ " mov $" _STRINGIFY(_op) ", %rsi # si = _op\n"\ " mov $" _STRINGIFY(_arg) ", %rdx # dx = _arg\n"\ " syscall # syscall\n"\ " pop %rdi # pop return addr\n"\ " mov $" _STRINGIFY(CR_ASM_NR_rt_sigreturn) ", %rax # ax = __NR_rt_sigreturn\n"\ " syscall # syscall\n"\ " .size " _STRINGIFY(_name) ",.-" _STRINGIFY(_name) "\n"\ ); /* "micro" handler for libcr_run.so */ #define CR_RUN_ASM_HANDLER(_name) \ _CR_ASM_HANDLER(_name, CR_ASM_OP_HAND_CHKPT, CR_ASM_CHECKPOINT_STUB) /* "micro" handler for libcr_omit.so */ #define CR_OMIT_ASM_HANDLER(_name) \ _CR_ASM_HANDLER(_name, CR_ASM_OP_HAND_ABORT, CR_ASM_CHECKPOINT_OMIT) #endif blcr-0.8.5/libcr/arch/i386/0000775000000000000000000000000012102072123012106 500000000000000blcr-0.8.5/libcr/arch/i386/cr_atomic.h0000664000000000000000000000553510565411274014166 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2003, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 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 * Library 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * $Id: cr_atomic.h,v 1.10 2007/02/16 20:23:24 phargrov Exp $ */ #ifndef _CR_ATOMIC_H #define _CR_ATOMIC_H 1 // Define cri_atomic_t and five required operations: // read, write, inc, dec-and-test, compare-and-swap typedef volatile unsigned int cri_atomic_t; // Single-word reads are naturally atomic on Pentium-family CR_INLINE unsigned int cri_atomic_read(cri_atomic_t *p) { __asm__ __volatile__("": : :"memory"); return *p; } // Single-word writes are naturally atomic on Pentium-family CR_INLINE void cri_atomic_write(cri_atomic_t *p, unsigned int val) { *p = val; __asm__ __volatile__("": : :"memory"); } // Increment requires lock prefix for SMPs CR_INLINE void cri_atomic_inc(cri_atomic_t *p) { __asm__ __volatile__ ("lock; incl %0" : "=m" (*p) : "m" (*p) : "cc", "memory"); } // Dec-and-test requires lock prefix for SMPs // Returns non-zero if value reaches zero CR_INLINE int cri_atomic_dec_and_test(cri_atomic_t *p) { register unsigned char ret; __asm__ __volatile__ ("lock; decl %0; sete %1" : "=m" (*p), "=qm" (ret) : "m" (*p) : "cc", "memory"); return ret; } // cri_cmp_swap() // // Atomic compare and exchange (swap). // Atomic equivalent of: // if (*p == oldval) { // *p = newval; // return NONZERO; // } else { // return 0; // } // // Based on glibc source (LGPL) // XXX: this will fail on an old i386 CR_INLINE unsigned int cri_cmp_swap(cri_atomic_t *p, unsigned int oldval, unsigned int newval) { register unsigned char ret; register unsigned int readval; __asm__ __volatile__ ("lock; cmpxchgl %3, %1; sete %0" : "=q" (ret), "=m" (*p), "=a" (readval) : "r" (newval), "m" (*p), "a" (oldval) : "cc", "memory"); return ret; } #endif blcr-0.8.5/libcr/arch/i386/cr_arch.h0000664000000000000000000001462111014612464013615 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2003, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 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 * Library 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * $Id: cr_arch.h,v 1.23 2008/05/20 18:15:16 phargrov Exp $ */ #ifndef _CR_ARCH_H #define _CR_ARCH_H 1 // Catch-all file for misc. arch-specific bits #ifdef PIC #define CRI_SYSCALL_LD_ARG1 \ "\tmovl %2,%%ebx\n" #define CRI_SYSCALL_PRE \ "\tpushl %%ebx\n" \ CRI_SYSCALL_LD_ARG1 #define CRI_SYSCALL_POST \ "\tpopl %%ebx\n" #define CRI_SYSCALL_ARG1 "r" #else #define CRI_SYSCALL_LD_ARG1 #define CRI_SYSCALL_PRE #define CRI_SYSCALL_POST #define CRI_SYSCALL_ARG1 "b" #endif #define cri_syscall_cleanup(res,errno_p) \ __asm__ volatile ("" ::: "memory", "cc", "cx", "dx");\ if ((unsigned long)res >= (unsigned long)(-4096)) { \ if (errno_p != NULL) { *errno_p = -res; } \ res = -1; \ } // XXX: does syscall5 work w/ PIC? #define cri_syscall5(type,name,nr,type1,type2,type3,type4,type5)\ type name(type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5,int *errno_p) {\ long _res; \ __asm__ volatile ( \ CRI_SYSCALL_PRE \ "\tint $0x80\n" \ CRI_SYSCALL_POST \ : "=a" (_res) \ : "0" (nr), \ CRI_SYSCALL_ARG1 ((long)(arg1)), \ "c" ((long)(arg2)), \ "d" ((long)(arg3)), \ "S" ((long)(arg4)), \ "D" ((long)(arg5))); \ cri_syscall_cleanup(_res, errno_p); \ return (type)_res; \ } #define cri_syscall4(type,name,nr,type1,type2,type3,type4)\ type name(type1 arg1,type2 arg2,type3 arg3,type4 arg4,int *errno_p) {\ long _res; \ __asm__ volatile ( \ CRI_SYSCALL_PRE \ "\tint $0x80\n" \ CRI_SYSCALL_POST \ : "=a" (_res) \ : "0" (nr), \ CRI_SYSCALL_ARG1 ((long)(arg1)), \ "c" ((long)(arg2)), \ "d" ((long)(arg3)), \ "S" ((long)(arg4))); \ cri_syscall_cleanup(_res, errno_p); \ return (type)_res; \ } #define cri_syscall3(type,name,nr,type1,type2,type3)\ type name(type1 arg1,type2 arg2,type3 arg3,int *errno_p) {\ long _res; \ __asm__ volatile ( \ CRI_SYSCALL_PRE \ "\tint $0x80\n" \ CRI_SYSCALL_POST \ : "=a" (_res) \ : "0" (nr), \ CRI_SYSCALL_ARG1 ((long)(arg1)), \ "c" ((long)(arg2)), \ "d" ((long)(arg3))); \ cri_syscall_cleanup(_res, errno_p); \ return (type)_res; \ } #define cri_syscall2(type,name,nr,type1,type2)\ type name(type1 arg1,type2 arg2,int *errno_p) {\ long _res; \ __asm__ volatile ( \ CRI_SYSCALL_PRE \ "\tint $0x80\n" \ CRI_SYSCALL_POST \ : "=a" (_res) \ : "0" (nr), \ CRI_SYSCALL_ARG1 ((long)(arg1)), \ "c" ((long)(arg2))); \ cri_syscall_cleanup(_res, errno_p); \ return (type)_res; \ } #define cri_syscall1(type,name,nr,type1)\ type name(type1 arg1,int *errno_p) {\ long _res; \ __asm__ volatile ( \ CRI_SYSCALL_PRE \ "\tint $0x80\n" \ CRI_SYSCALL_POST \ : "=a" (_res) \ : "0" (nr), \ CRI_SYSCALL_ARG1 ((long)(arg1))); \ cri_syscall_cleanup(_res, errno_p); \ return (type)_res; \ } #define cri_syscall0(type,name,nr)\ type name(int *errno_p) {\ long _res; \ __asm__ volatile ( \ "\tint $0x80\n" \ : "=a" (_res) \ : "0" (nr)); \ cri_syscall_cleanup(_res, errno_p); \ return (type)_res; \ } /* On an x86_64 the registers ebx and ebp are callee-saved. * Currently we lack a way to know this is a 64-bit CPU. * So, we do this unconditionally. */ #define cri_syscall3X(type,name,nr,type1,type2,type3)\ type name(type1 arg1,type2 arg2,type3 arg3,int *errno_p) {\ long _res; \ __asm__ volatile ( \ "\tpushl %%ebp\n" \ "\tpushl %%ebx\n" \ CRI_SYSCALL_LD_ARG1 \ "\tint $0x80\n" \ "\tpopl %%ebx\n" \ "\tpopl %%ebp\n" \ : "=a" (_res) \ : "0" (nr), \ CRI_SYSCALL_ARG1 ((long)(arg1)), \ "c" ((long)(arg2)), \ "d" ((long)(arg3))); \ cri_syscall_cleanup(_res, errno_p); \ return (type)_res; \ } #define cri_sigreturn(__signr, __siginfo, __context) \ __asm__ __volatile__ ( \ "mov %0,%%esp\n\t" \ "mov %1,%%eax\n\t" \ "int $0x80" \ : : "r" (&(__signr)), "i" (CR_ASM_NR_rt_sigreturn)) /* Template to build the "micro" handlers */ #define _CR_ASM_HANDLER(_name,_op,_arg) \ __asm__(" .text\n"\ " .align 16\n"\ ".globl " _STRINGIFY(_name) "\n"\ " .type " _STRINGIFY(_name) ",@function\n"\ _STRINGIFY(_name) ":\n"\ " mov 8(%esp),%ebx # B = siginfo (2nd arg)\n"\ " mov " _STRINGIFY(CR_ASM_SI_PID_OFFSET) "(%ebx),%ebx # B = siginfo->si_pid\n"\ " mov $" _STRINGIFY(CR_ASM_NR_ioctl) ", %eax # A = __NR_ioctl\n"\ " mov $" _STRINGIFY(_op) ", %ecx # C = _op\n"\ " mov $" _STRINGIFY(_arg) ", %edx # D = _arg\n"\ " int $0x80 # syscall\n"\ " pop %ebx # pop return addr\n"\ " mov $" _STRINGIFY(CR_ASM_NR_rt_sigreturn) ", %eax # A = __NR_rt_sigreturn\n"\ " int $0x80 # syscall\n"\ " .size " _STRINGIFY(_name) ",.-" _STRINGIFY(_name) "\n"\ ); /* "micro" handler for libcr_run.so */ #define CR_RUN_ASM_HANDLER(_name) \ _CR_ASM_HANDLER(_name, CR_ASM_OP_HAND_CHKPT, CR_ASM_CHECKPOINT_STUB) /* "micro" handler for libcr_omit.so */ #define CR_OMIT_ASM_HANDLER(_name) \ _CR_ASM_HANDLER(_name, CR_ASM_OP_HAND_ABORT, CR_ASM_CHECKPOINT_OMIT) #endif blcr-0.8.5/libcr/arch/ppc64/0000775000000000000000000000000012102072123012351 500000000000000blcr-0.8.5/libcr/arch/ppc64/cr_atomic.h0000664000000000000000000000236010643445216014422 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2007, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 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 * Library 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * $Id: cr_atomic.h,v 1.8 2007/07/06 13:58:38 phargrov Exp $ */ #ifndef _CR_ATOMIC_H #include "../ppc/cr_atomic.h" #endif blcr-0.8.5/libcr/arch/ppc64/cr_arch.h0000664000000000000000000000235210643525747014074 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2007, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 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 * Library 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * $Id: cr_arch.h,v 1.6 2007/07/06 20:53:59 phargrov Exp $ */ #ifndef _CR_ARCH_H #include "../ppc/cr_arch.h" #endif blcr-0.8.5/libcr/arch/sparc/0000775000000000000000000000000012102072123012525 500000000000000blcr-0.8.5/libcr/arch/sparc/cr_atomic.h0000664000000000000000000001320611115077250014571 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2008, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 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 * Library 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * $Id: cr_atomic.h,v 1.2 2008/12/02 00:17:44 phargrov Exp $ * * Experimental SPARC support contributed to BLCR by Vincentius Robby * and Andrea Pellegrini . */ #ifndef _CR_ATOMIC_H #define _CR_ATOMIC_H 1 // Define cri_atomic_t and five required operations: // read, write, inc, dec-and-test, compare-and-swap typedef volatile unsigned int cri_atomic_t; // Single-word reads are naturally atomic on Pentium-family CR_INLINE unsigned int cri_atomic_read(cri_atomic_t *p) { __asm__ __volatile__("": : :"memory"); return *p; } // Single-word writes are naturally atomic on Pentium-family CR_INLINE void cri_atomic_write(cri_atomic_t *p, unsigned int val) { *p = val; __asm__ __volatile__("": : :"memory"); } #if 1 // // CAS-based add_fetch and cmp_swap - requires V8+ or newer CPU // By Paul H. Hargrove, from the GASNet atomics (BSD-type license). // CR_INLINE unsigned int __cri_atomic_add_fetch(cri_atomic_t *p, unsigned int op) { register unsigned int oldval, newval; __asm__ __volatile__ ( "membar #StoreLoad | #LoadLoad\n\t" "ld [%4],%0 \n\t" /* oldval = *addr; */ "0: \t" "add %0,%3,%1 \n\t" /* newval = oldval + op; */ "cas [%4],%0,%1 \n\t" /* if (*addr == oldval) SWAP(*addr,newval); else newval = *addr; */ "cmp %0, %1 \n\t" /* check if newval == oldval (swap succeeded) */ "bne,a,pn %%icc, 0b \n\t" /* otherwise, retry (,pn == predict not taken; ,a == annul) */ " mov %1, %0 \n\t" /* oldval = newval; (branch delay slot, annulled if not taken) */ "membar #StoreLoad | #StoreStore" : "=&r"(oldval), "=&r"(newval), "=m"(*p) : "rn"(op), "r"(p), "m"(*p) ); return newval; } CR_INLINE unsigned int cri_cmp_swap(cri_atomic_t *p, unsigned int oldval, unsigned int newval) { __asm__ __volatile__ ( /* if (*p == oldval) SWAP(*p,newval); else newval = *p; */ "membar #StoreLoad | #LoadLoad \n\t" "cas [%3], %2, %0 \n\t" "membar #StoreLoad | #StoreStore" : "+r"(newval), "=m"(*p) : "r"(oldval), "r"(p), "m"(*p) ); return (int)(newval == oldval); } #else // // LDSTUB-based add_fetch and cmp_swap - not signal safe // // XXX: Should automatically enable membar by target CPU type #if 0 #define __CRI_MEMBAR(_arg) "membar " _arg #else #define __CRI_MEMBAR(_arg) "" #endif /* "Tentative declaration" (aka "common") to ensure one instance * of the lock variable will be shared across all linked objects. * DO NOT add "extern". * DO NOT add an initializer. */ unsigned char __cri_atomic_lock_var; /* Macros to do the lock/unlock. * Passing the atomic var as an argument will ease * any future transition to a lock array. */ #define __cri_atomic_lock(_p) do { \ register unsigned int _lock_tmp; \ do { /* Try lock */ \ __asm__ __volatile__("ldstub [%1], %0\n\t" \ __CRI_MEMBAR("#StoreLoad | #StoreStore")\ : "=&r" (_lock_tmp) \ : "r" (&__cri_atomic_lock_var) \ : "memory"); \ } while (_lock_tmp); \ } while (0) #define __cri_atomic_unlock(_p) \ __asm__ __volatile__(__CRI_MEMBAR("#StoreStore | #LoadStore\n\t")\ "stb %%g0, [%0]" \ : /* no outputs */ \ : "r" (&__cri_atomic_lock_var) \ : "memory") CR_INLINE unsigned int __cri_atomic_add_fetch(cri_atomic_t *p, int op) { unsigned int retval; __cri_atomic_lock(p); retval = *p + op; *p = retval; __cri_atomic_unlock(p); return retval; } // cri_cmp_swap() // // Atomic compare and exchange (swap). // Atomic equivalent of: // if (*p == oldval) { // *p = newval; // return NONZERO; // } else { // return 0; // } CR_INLINE unsigned int cri_cmp_swap(cri_atomic_t *p, unsigned int oldval, unsigned int newval) { unsigned int retval; __cri_atomic_lock(p); if (*p == oldval) { *p = newval; retval = 1; } else { retval = 0; } __cri_atomic_unlock(p); return retval; } #endif CR_INLINE void cri_atomic_inc(cri_atomic_t *p) { (void)__cri_atomic_add_fetch(p, 1); } CR_INLINE int cri_atomic_dec_and_test(cri_atomic_t *p) { return (__cri_atomic_add_fetch(p, -1) == 0); } #endif blcr-0.8.5/libcr/arch/sparc/cr_arch.h0000664000000000000000000001543411115077250014237 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2008, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 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 * Library 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * $Id: cr_arch.h,v 1.2 2008/12/02 00:17:44 phargrov Exp $ * * Experimental SPARC support contributed to BLCR by Vincentius Robby * and Andrea Pellegrini . */ #ifndef _CR_ARCH_H #define _CR_ARCH_H 1 // Catch-all file for misc. arch-specific bits // syscall macros from glibc (LGPL) #if (SIZEOF_VOID_P == 4) #define CRI_SYSCALL_CLOBBERS "g2", "g3", "g4", "g5", "g6", \ "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", \ "f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15", \ "f16", "f17", "f18", "f19", "f20", "f21", "f22", "f23", \ "f24", "f25", "f26", "f27", "f28", "f29", "f30", "f31", \ "cc", "memory" #define CRI_SYSCALL_STRING "ta 0x10;" #elif (SIZEOF_VOID_P == 8) #define CRI_SYSCALL_CLOBBERS "g2", "g3", "g4", "g5", "g6", \ "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", \ "f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15", \ "f16", "f17", "f18", "f19", "f20", "f21", "f22", "f23", \ "f24", "f25", "f26", "f27", "f28", "f29", "f30", "f31", \ "f32", "f34", "f36", "f38", "f40", "f42", "f44", "f46", \ "f48", "f50", "f52", "f54", "f56", "f58", "f60", "f62", \ "cc", "memory" #define CRI_SYSCALL_STRING "ta 0x6d;" #else #error "Unknown SIZEOF_VOID_P" #endif /* * Note we are fudging on the errno return, assuming (like x86) that anything * lower than -4096 (rather than -515) is an error. This is to allow for our * extended errno values. */ #define cri_syscall_cleanup(res,errno_p) \ if ((unsigned long)res >= (unsigned long)(-4096)) { \ if (errno_p != NULL) { *errno_p = -res; } \ res = -1; \ } #define cri_syscall6(type,name,nr,type1,type2,type3,type4,type5,type6)\ type name(type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5,type6 arg6,int *errno_p) {\ register long __o0 __asm__ ("o0") = (long)(arg1); \ register long __o1 __asm__ ("o1") = (long)(arg2); \ register long __o2 __asm__ ("o2") = (long)(arg3); \ register long __o3 __asm__ ("o3") = (long)(arg4); \ register long __o4 __asm__ ("o4") = (long)(arg5); \ register long __o5 __asm__ ("o5") = (long)(arg6); \ register long __g1 __asm__ ("g1") = nr; \ __asm __volatile (CRI_SYSCALL_STRING \ : "=r" (__g1), "=r" (__o0) \ : "0" (__g1), "1" (__o0), "r" (__o1), \ "r" (__o2), "r" (__o3), "r" (__o4), \ "r" (__o5) \ : CRI_SYSCALL_CLOBBERS); \ cri_syscall_cleanup(__o0, errno_p); \ return (type)__o0; \ } #define cri_syscall5(type,name,nr,type1,type2,type3,type4,type5)\ type name(type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5,int *errno_p) {\ register long __o0 __asm__ ("o0") = (long)(arg1); \ register long __o1 __asm__ ("o1") = (long)(arg2); \ register long __o2 __asm__ ("o2") = (long)(arg3); \ register long __o3 __asm__ ("o3") = (long)(arg4); \ register long __o4 __asm__ ("o4") = (long)(arg5); \ register long __g1 __asm__ ("g1") = nr; \ __asm __volatile (CRI_SYSCALL_STRING \ : "=r" (__g1), "=r" (__o0) \ : "0" (__g1), "1" (__o0), "r" (__o1), \ "r" (__o2), "r" (__o3), "r" (__o4) \ : CRI_SYSCALL_CLOBBERS); \ cri_syscall_cleanup(__o0, errno_p); \ return (type)__o0; \ } #define cri_syscall4(type,name,nr,type1,type2,type3,type4)\ type name(type1 arg1,type2 arg2,type3 arg3,type4 arg4,int *errno_p) {\ register long __o0 __asm__ ("o0") = (long)(arg1); \ register long __o1 __asm__ ("o1") = (long)(arg2); \ register long __o2 __asm__ ("o2") = (long)(arg3); \ register long __o3 __asm__ ("o3") = (long)(arg4); \ register long __g1 __asm__ ("g1") = nr; \ __asm __volatile (CRI_SYSCALL_STRING \ : "=r" (__g1), "=r" (__o0) \ : "0" (__g1), "1" (__o0), "r" (__o1), \ "r" (__o2), "r" (__o3) \ : CRI_SYSCALL_CLOBBERS); \ cri_syscall_cleanup(__o0, errno_p); \ return (type)__o0; \ } #define cri_syscall3(type,name,nr,type1,type2,type3) \ type name(type1 arg1,type2 arg2,type3 arg3,int *errno_p) {\ register long __o0 __asm__ ("o0") = (long)(arg1); \ register long __o1 __asm__ ("o1") = (long)(arg2); \ register long __o2 __asm__ ("o2") = (long)(arg3); \ register long __g1 __asm__ ("g1") = nr; \ __asm __volatile (CRI_SYSCALL_STRING \ : "=r" (__g1), "=r" (__o0) \ : "0" (__g1), "1" (__o0), "r" (__o1), \ "r" (__o2) \ : CRI_SYSCALL_CLOBBERS); \ cri_syscall_cleanup(__o0, errno_p); \ return (type)__o0; \ } #define cri_syscall2(type,name,nr,type1,type2) \ type name(type1 arg1,type2 arg2,int *errno_p) { \ register long __o0 __asm__ ("o0") = (long)(arg1); \ register long __o1 __asm__ ("o1") = (long)(arg2); \ register long __g1 __asm__ ("g1") = nr; \ __asm __volatile (CRI_SYSCALL_STRING \ : "=r" (__g1), "=r" (__o0) \ : "0" (__g1), "1" (__o0), "r" (__o1) \ : CRI_SYSCALL_CLOBBERS); \ cri_syscall_cleanup(__o0, errno_p); \ return (type)__o0; \ } #define cri_syscall1(type,name,nr,type1) \ type name(type1 arg1,int *errno_p) { \ register long __o0 __asm__ ("o0") = (long)(arg1); \ register long __g1 __asm__ ("g1") = nr; \ __asm __volatile (CRI_SYSCALL_STRING \ : "=r" (__g1), "=r" (__o0) \ : "0" (__g1), "1" (__o0) \ : CRI_SYSCALL_CLOBBERS); \ cri_syscall_cleanup(__o0, errno_p); \ return (type)__o0; \ } #define cri_syscall0(type,name,nr) \ type name(int *errno_p) { \ register long __o0 __asm__ ("o0"); \ register long __g1 __asm__ ("g1") = nr; \ __asm __volatile (CRI_SYSCALL_STRING \ : "=r" (__g1), "=r" (__o0) \ : "0" (__g1) \ : CRI_SYSCALL_CLOBBERS); \ cri_syscall_cleanup(__o0, errno_p); \ return (type)__o0; \ } #endif blcr-0.8.5/libcr/arch/ppc/0000775000000000000000000000000012102072123012177 500000000000000blcr-0.8.5/libcr/arch/ppc/cr_atomic.h0000664000000000000000000000605310616503150014243 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2003, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 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 * Library 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * $Id: cr_atomic.h,v 1.2 2007/05/04 01:03:36 eroman Exp $ */ #ifndef _CR_ATOMIC_H #define _CR_ATOMIC_H 1 // Define cri_atomic_t and five required operations: // read, write, inc, dec-and-test, compare-and-swap typedef volatile unsigned int cri_atomic_t; // Single-word reads are naturally atomic CR_INLINE unsigned int cri_atomic_read(cri_atomic_t *p) { __asm__ __volatile__("": : :"memory"); return *p; } // Single-word writes are naturally atomic CR_INLINE void cri_atomic_write(cri_atomic_t *p, unsigned int val) { *p = val; __asm__ __volatile__("": : :"memory"); } CR_INLINE unsigned int cri_atomic_add_fetch(cri_atomic_t *p, int op) { register unsigned int result; __asm__ __volatile__ ( "0:\t" "lwarx %0,0,%2 \n\t" "add%I3 %0,%0,%3 \n\t" "stwcx. %0,0,%2 \n\t" "bne- 0b\n\t" "isync" : "=&b"(result), "=m" (p) /* constraint b = "b"ase register (not r0) */ : "r" (p), "Ir"(op) , "m"(p) : "cr0", "memory"); return result; } CR_INLINE void cri_atomic_inc(cri_atomic_t *p) { (void)cri_atomic_add_fetch(p, 1); } // Returns non-zero if value reaches zero CR_INLINE int cri_atomic_dec_and_test(cri_atomic_t *p) { return (cri_atomic_add_fetch(p, -1) == 0); } // cri_cmp_swap() // // Atomic compare and exchange (swap). // Atomic equivalent of: // if (*p == oldval) { // *p = newval; // return NONZERO; // } else { // return 0; // } CR_INLINE unsigned int cri_cmp_swap(cri_atomic_t *p, unsigned int oldval, unsigned int newval) { register unsigned int result; __asm__ __volatile__ ( "0:\t" "lwarx %0,0,%2 \n\t" /* load to result */ "xor. %0,%0,%3 \n\t" /* xor result w/ oldval */ "bne 1f\n\t" /* branch on mismatch */ "stwcx. %4,0,%2 \n\t" /* store newval */ "bne- 0b\n\t" /* retry on conflict */ "1: isync" : "=&r"(result), "=m"(p) : "r" (p), "r"(oldval), "r"(newval), "m"(p) : "cr0", "memory"); return (result == 0); } #endif blcr-0.8.5/libcr/arch/ppc/cr_arch.h0000664000000000000000000002305311151723006013702 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2007, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 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 * Library 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * $Id: cr_arch.h,v 1.15.26.1 2009/02/27 08:36:22 phargrov Exp $ */ #ifndef _CR_ARCH_H #define _CR_ARCH_H 1 // Catch-all file for misc. arch-specific bits // syscall macros from glibc (LGPL) /* On powerpc a system call basically clobbers the same registers like a * function call, with the exception of LR (which is needed for the * "sc; bnslr" sequence) and CR (where only CR0.SO is clobbered to signal * an error return status). * * Note we are fudging on the errno return, assuming (like x86) that anything * lower than -4096 is an error. This is to allow for our extended errno * values while the kernel checks against LAST_ERRNO when setting r3. */ #define cri_syscall_nr(nr, type, num, errno_p, args...) \ unsigned long cri_sc_ret, cri_sc_err; \ { \ register unsigned long cri_sc_0 __asm__ ("r0"); \ register unsigned long cri_sc_3 __asm__ ("r3"); \ register unsigned long cri_sc_4 __asm__ ("r4"); \ register unsigned long cri_sc_5 __asm__ ("r5"); \ register unsigned long cri_sc_6 __asm__ ("r6"); \ register unsigned long cri_sc_7 __asm__ ("r7"); \ register unsigned long cri_sc_8 __asm__ ("r8"); \ \ cri_sc_loadargs_##nr(num, args); \ __asm__ __volatile__ \ ( \ "sc \n\t" \ "mfcr %0 \n\t" \ : "=&r" (cri_sc_0), \ "=&r" (cri_sc_3), "=&r" (cri_sc_4), \ "=&r" (cri_sc_5), "=&r" (cri_sc_6), \ "=&r" (cri_sc_7), "=&r" (cri_sc_8) \ : cri_sc_asm_input_##nr \ : "cr0", "ctr", "memory", \ "r9", "r10","r11", "r12"); \ cri_sc_ret = cri_sc_3; \ cri_sc_err = cri_sc_0; \ } \ if (cri_sc_err & 0x10000000) \ { \ if (errno_p) *errno_p = cri_sc_ret; \ cri_sc_ret = -1; \ } \ else if (cri_sc_ret >= (unsigned long)(-4096)) \ { \ if (errno_p) *errno_p = -cri_sc_ret; \ cri_sc_ret = -1; \ } \ return (type) cri_sc_ret #define cri_sc_loadargs_0(num, dummy...) \ cri_sc_0 = num #define cri_sc_loadargs_1(num, arg1) \ cri_sc_loadargs_0(num); \ cri_sc_3 = (unsigned long) (arg1) #define cri_sc_loadargs_2(num, arg1, arg2) \ cri_sc_loadargs_1(num, arg1); \ cri_sc_4 = (unsigned long) (arg2) #define cri_sc_loadargs_3(num, arg1, arg2, arg3) \ cri_sc_loadargs_2(num, arg1, arg2); \ cri_sc_5 = (unsigned long) (arg3) #define cri_sc_loadargs_4(num, arg1, arg2, arg3, arg4) \ cri_sc_loadargs_3(num, arg1, arg2, arg3); \ cri_sc_6 = (unsigned long) (arg4) #define cri_sc_loadargs_5(num, arg1, arg2, arg3, arg4, arg5) \ cri_sc_loadargs_4(num, arg1, arg2, arg3, arg4); \ cri_sc_7 = (unsigned long) (arg5) #define cri_sc_loadargs_6(num, arg1, arg2, arg3, arg4, arg5, arg6) \ cri_sc_loadargs_5(num, arg1, arg2, arg3, arg4, arg5); \ cri_sc_8 = (unsigned long) (arg6) #define cri_sc_asm_input_0 "0" (cri_sc_0) #define cri_sc_asm_input_1 cri_sc_asm_input_0, "1" (cri_sc_3) #define cri_sc_asm_input_2 cri_sc_asm_input_1, "2" (cri_sc_4) #define cri_sc_asm_input_3 cri_sc_asm_input_2, "3" (cri_sc_5) #define cri_sc_asm_input_4 cri_sc_asm_input_3, "4" (cri_sc_6) #define cri_sc_asm_input_5 cri_sc_asm_input_4, "5" (cri_sc_7) #define cri_sc_asm_input_6 cri_sc_asm_input_5, "6" (cri_sc_8) #define cri_syscall0(type,name,nr) \ type name(int *errno_p) \ { \ cri_syscall_nr(0, type, nr, errno_p); \ } #define cri_syscall1(type,name,nr,type1) \ type name(type1 arg1,int *errno_p) \ { \ cri_syscall_nr(1, type, nr, errno_p, arg1); \ } #define cri_syscall2(type,name,nr,type1,type2) \ type name(type1 arg1,type2 arg2,int *errno_p) \ { \ cri_syscall_nr(2, type, nr, errno_p, arg1, arg2); \ } #define cri_syscall3(type,name,nr,type1,type2,type3) \ type name(type1 arg1,type2 arg2,type3 arg3,int *errno_p) \ { \ cri_syscall_nr(3, type, nr, errno_p, arg1, arg2, arg3); \ } #define cri_syscall4(type,name,nr,type1,type2,type3,type4) \ type name(type1 arg1,type2 arg2,type3 arg3,type4 arg4,int *errno_p) \ { \ cri_syscall_nr(4, type, nr, errno_p, arg1, arg2, arg3, arg4); \ } #define cri_syscall5(type,name,nr,type1,type2,type3,type4,type5) \ type name(type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5,int *errno_p) \ { \ cri_syscall_nr(5, type, nr, errno_p, arg1, arg2, arg3, arg4, arg5); \ } #define cri_syscall6(type,name,nr,type1,type2,type3,type4,type5,type6) \ type name(type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5,type6 arg6,int *errno_p)\ { \ cri_syscall_nr(6, type, nr, errno_p, arg1, arg2, arg3, arg4, arg5, arg6);\ } /* * Because we enter the kernel via a "normal" syscall, the kernel * will not save the caller-saved r13-29 in the ptregs struct. * Thus vmadump can't restore them correctly at restart. * We work around that here telling gcc they are clobbered. * Since gcc ignores clobbers of r30 and r31, we deal with them * on our own. */ #define cri_sc_asm_clobber_3X "r13", "r14", "r15", "r16", "r17", "r18", "r19", \ "r20", "r21", "r22", "r23", "r24", "r25", "r26", "r27", "r28", "r29", #if SIZEOF_VOID_P == 8 #define cri_sc_st "std 30,%8 \n\t" \ "std 31,%7 \n\t" #define cri_sc_ld "ld 31,%7 \n\t" \ "ld 30,%8 \n\t" #elif SIZEOF_VOID_P == 4 #define cri_sc_st "stw 30,%8 \n\t" \ "stw 31,%7 \n\t" #define cri_sc_ld "lwz 31,%7 \n\t" \ "lwz 30,%8 \n\t" #else #error "No SIZEOF_VOID_P" #endif #define cri_syscall3X(type,name,nr,type1,type2,type3) \ type name(type1 arg1,type2 arg2,type3 arg3,int *errno_p) \ { \ unsigned long cri_sc_ret, cri_sc_err; \ unsigned long cri_sc_tmp[2]; \ { \ register unsigned long cri_sc_0 __asm__ ("r0"); \ register unsigned long cri_sc_3 __asm__ ("r3"); \ register unsigned long cri_sc_4 __asm__ ("r4"); \ register unsigned long cri_sc_5 __asm__ ("r5"); \ register unsigned long cri_sc_6 __asm__ ("r6"); \ register unsigned long cri_sc_7 __asm__ ("r7"); \ register unsigned long cri_sc_8 __asm__ ("r8"); \ \ cri_sc_loadargs_3(nr, arg1, arg2, arg3); \ __asm__ __volatile__ \ ( \ cri_sc_st \ "sc \n\t" \ cri_sc_ld \ "mfcr %0 \n\t" \ : "=&r" (cri_sc_0), \ "=&r" (cri_sc_3), "=&r" (cri_sc_4), \ "=&r" (cri_sc_5), "=&r" (cri_sc_6), \ "=&r" (cri_sc_7), "=&r" (cri_sc_8) \ : "m" (cri_sc_tmp[0]), \ "m" (cri_sc_tmp[1]), \ cri_sc_asm_input_3 \ : cri_sc_asm_clobber_3X \ "cr0", "ctr", "memory", \ "r9", "r10","r11", "r12"); \ cri_sc_ret = cri_sc_3; \ cri_sc_err = cri_sc_0; \ } \ if (cri_sc_err & 0x10000000) \ { \ if (errno_p) *errno_p = cri_sc_ret; \ cri_sc_ret = -1; \ } \ else if (cri_sc_ret >= (unsigned long)(-4096)) \ { \ if (errno_p) *errno_p = -cri_sc_ret; \ cri_sc_ret = -1; \ } \ return (type) cri_sc_ret; \ } /* No sr_restorer on ppc/ppc64 */ #undef CRI_SA_RESTORER /* Template to build "micro" handlers */ #if SIZEOF_VOID_P == 8 #define _CR_ASM_FUNC_PRE(_name) \ " .section \".text\"\n"\ " .align 2\n"\ " .globl " _STRINGIFY(_name) "\n"\ " .type " _STRINGIFY(_name) ", @function\n"\ " .section \".opd\",\"aw\"\n"\ " .align 3\n"\ _STRINGIFY(_name) ":\n"\ " .quad .L." _STRINGIFY(_name) ",.TOC.@tocbase\n"\ " .previous\n"\ ".L." _STRINGIFY(_name) ":\n" #define _CR_ASM_FUNC_POST(_name) \ " .size " _STRINGIFY(_name) ",.-.L." _STRINGIFY(_name) "\n" #else #define _CR_ASM_FUNC_PRE(_name) \ " .section \".text\"\n"\ " .align 2\n"\ " .globl " _STRINGIFY(_name) "\n"\ " .type " _STRINGIFY(_name) ", @function\n"\ _STRINGIFY(_name) ":\n" #define _CR_ASM_FUNC_POST(_name) \ " .size " _STRINGIFY(_name) ",.-" _STRINGIFY(_name) "\n" #endif /* The following counts on _op fitting in 32 bits and _arg in 15 bits */ #define _CR_ASM_HANDLER(_name, _op, _arg) \ __asm__( \ _CR_ASM_FUNC_PRE(_name) \ " lwz %r3," _STRINGIFY(CR_ASM_SI_PID_OFFSET) "(%r4) # r3 = siginfo->si_pid\n"\ " lis %r4," _STRINGIFY(_op) "@h # r4 =\n"\ " ori %r4,%r4," _STRINGIFY(_op) "@l # ... _op\n"\ " li %r5," _STRINGIFY(_arg) " # r5 = _arg\n"\ " li %r0," _STRINGIFY(CR_ASM_NR_ioctl) " # r0 = __NR_ioctl\n"\ " sc # system call\n"\ " blr # return from signal\n"\ " nop\n" \ _CR_ASM_FUNC_POST(_name)); #if !CR_HAVE_BUG2524 #define CR_RUN_ASM_HANDLER(_name) \ _CR_ASM_HANDLER(_name, CR_ASM_OP_HAND_CHKPT, CR_ASM_CHECKPOINT_STUB) #endif #define CR_OMIT_ASM_HANDLER(_name) \ _CR_ASM_HANDLER(_name, CR_ASM_OP_HAND_ABORT, CR_ASM_CHECKPOINT_OMIT) #endif blcr-0.8.5/libcr/arch/arm/0000775000000000000000000000000012102072123012174 500000000000000blcr-0.8.5/libcr/arch/arm/cr_atomic.h0000664000000000000000000002140012065175545014246 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2007, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 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 * Library 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * $Id: cr_atomic.h,v 1.5.8.1 2012/12/22 00:14:29 phargrov Exp $ * * Experimental ARM support contributed by Anton V. Uzunov * of the Australian Government * Department of Defence, Defence Science and Technology Organisation. * * ARM-specific questions should be directed to blcr-arm@hpcrd.lbl.gov. */ #ifndef _CR_ATOMIC_H #define _CR_ATOMIC_H 1 #if defined(__ARM_ARCH_2__) || defined(__ARM_ARCH_3__) // Sanity-check that we're not building on a really old architecture, // so that the using #ifdef __ARM_ARCH_4__ works to test for // lack of blx support. #error "ARM Architecture versions prior to ARMv4 not supported." #elif defined(__ARM_ARCH_4T__) && defined(__thumb__) // The inline asm is not compatible with Thumb-1 anyway, but in particular // we assume later that if __ARM_ARCH_4__ is not defined, we have ARMv5 // or above. Ensure here that this assumption will be valid. #error "Building for Thumb on ARMv4 is not supported." #endif // Determine whether to use BLX for function calls to // computed addresses: #undef ARM_HAVE_BLX_REG #if !(defined(__ARM_ARCH_4__) || defined(__ARM_ARCH_4T__)) #define ARM_HAVE_BLX_REG 1 #endif #include "blcr_config.h" #ifndef _STRINGIFY #define _STRINGIFY_HELPER(x) #x #define _STRINGIFY(x) _STRINGIFY_HELPER(x) #endif // Define cri_atomic_t and five required operations: // read, write, inc, dec-and-test, compare-and-swap typedef volatile unsigned int cri_atomic_t; // Single-word reads are naturally atomic CR_INLINE unsigned int cri_atomic_read(cri_atomic_t *p) { __asm__ __volatile__("": : :"memory"); return( *p ); } // Single-word writes are naturally atomic CR_INLINE void cri_atomic_write(cri_atomic_t *p, unsigned int val) { *p = val; __asm__ __volatile__("": : :"memory"); } // Was '#if defined(CR_KCODE___kuser_cmpxchg), but that prevented separate user/kerel builds. #if 1 // For kernel >= 2.6.12, we use __kernel_cmpxchg() // See linux-2.6.12/arch/arm/kernel/entry-armv.S // For >= ARM6 we could/should be using load-exclusive directly. // To construct constants from (8-bit immediates + shifts) // we use a "base" that fits that constraint, and also lies a // distance from __kuser_cmpxchg fitting that constraint. // Specifically 0xffff0fff = ~(0xf0 << 8) = __kuser_cmpxchg + 0x3f #define cri_kuser_cmpxchg 0xffff0fc0 #define cri_kuser_base 0xffff0fff #define cri_kuser_offset (cri_kuser_base - cri_kuser_cmpxchg) CR_INLINE unsigned int __cri_atomic_add_fetch(cri_atomic_t *p, unsigned int op) { register unsigned long __sum asm("r1"); register unsigned long __ptr asm("r2") = (unsigned long)(p); __asm__ __volatile__ ( "0: ldr r0, [r2] @ r0 = *p \n" " add r1, r0, %2 @ r1 = r0 + op \n" " mov r3, #" _STRINGIFY(cri_kuser_base) " \n" #ifdef ARM_HAVE_BLX_REG " sub r3, r3, #" _STRINGIFY(cri_kuser_offset) "\n" " blx r3\n" #else // ARMv4T and below " adr lr, 1f @ lr = return address \n" " sub pc, r3, #" _STRINGIFY(cri_kuser_offset) "\n" #endif "1: bcc 0b @ retry on Carry Clear" : "=&r" (__sum) : "r" (__ptr), "rIL" (op) : "r0", "r3", "ip", "lr", "cc", "memory" ); return __sum; } CR_INLINE void cri_atomic_inc(cri_atomic_t *p) { (void)__cri_atomic_add_fetch(p, 1); } // Returns non-zero if value reaches zero CR_INLINE int cri_atomic_dec_and_test(cri_atomic_t *p) { return (__cri_atomic_add_fetch(p, -1) == 0); } // cri_cmp_swap() // // Atomic compare and exchange (swap). // Atomic equivalent of: // if (*p == oldval) { // *p = newval; // return NONZERO; // } else { // return 0; // } // CR_INLINE unsigned int cri_cmp_swap(cri_atomic_t *p, unsigned int oldval, unsigned int newval) { register unsigned int result asm("r0"); register unsigned int _newval asm("r1") = newval; register unsigned int _p asm("r2") = (unsigned long)p; register unsigned int _oldval asm("r4") = oldval; /* Transient failure is possible if interrupted. * Since we can't distinguish the cause of the failure, * we must retry as long as the failure looks "improper" * which is defined as (!swapped && (*p == oldval)) */ __asm__ __volatile__ ( "0: mov r0, r4 @ r0 = oldval \n" " mov r3, #" _STRINGIFY(cri_kuser_base) " \n" #ifdef ARM_HAVE_BLX_REG " sub r3, r3, #" _STRINGIFY(cri_kuser_offset) "\n" " blx r3\n" #else // ARMv4T and below " adr lr, 1f @ lr = return addr \n" " sub pc, r3, #" _STRINGIFY(cri_kuser_offset) "\n" #endif "1: \n" " ite cc @ needed in Thumb2 mode \n" " ldrcc ip, [r2] @ if (!swapped) ip=*p \n" " eorcs ip, r4, #1 @ else ip=oldval^1 \n" " teq r4, ip @ if (ip == oldval) \n" " beq 0b @ then retry " : "=&r" (result) : "r" (_oldval), "r" (_p), "r" (_newval) : "r3", "ip", "lr", "cc", "memory" ); return !result; } #else // The remainder of this file is based on various glibc and // linuxthreads revisions, and on the following post by // Daniel Jacobowitz to the libc-ports mailing list: // http://sourceware.org/ml/libc-ports/2005-10/msg00016.html // As Daniel says: // /* Atomic compare and exchange. These sequences are not actually atomic; there is a race if *MEM != OLDVAL and we are preempted between the two swaps. However, they are very close to atomic, and are the best that a pre-ARMv6 implementation can do without operating system support. LinuxThreads has been using these sequences for many years. */ // // That is true of our inc and dec-and-test as well. // // All of this will fail on ARM1 and ARM2, where SWP is missing. // // For kernel >= 2.6.12, we use __kernel_cmpxchg() (see above) CR_INLINE void cri_atomic_inc(cri_atomic_t *p) { unsigned int tmp1; unsigned int tmp2; unsigned int tmp3; __asm__ __volatile__ ("\n" "0: ldr %0,[%3]\n" // tmp1 = *p " add %1,%0,#1\n" // tmp2 = tmp1 + 1 " swp %2,%1,[%3]\n" // atomically(tmp3 = *p; *p = tmp2) " cmp %0,%2\n" // compare(tmp1, tmp3) " swpne %1,%2,[%3]\n" // if (tmp1 != tmp3) undo the swap... " bne 0b" // ... and restart : "=&r" (tmp1), "=&r" (tmp2), "=&r" (tmp3) : "r" (p) : "cc", "memory"); return; } // Returns non-zero if value reaches zero CR_INLINE int cri_atomic_dec_and_test(cri_atomic_t *p) { unsigned int tmp1; unsigned int tmp2; unsigned int tmp3; __asm__ __volatile__ ("\n" "0: ldr %0,[%3]\n" // tmp1 = *p " sub %1,%0,#1\n" // tmp2 = tmp1 - 1 " swp %2,%1,[%3]\n" // atomically(tmp3 = *p; *p = tmp2) " cmp %0,%2\n" // compare(tmp1, tmp3) " swpne %1,%2,[%3]\n" // if (tmp1 != tmp3) undo the swap... " bne 0b" // ... and restart : "=&r" (tmp1), "=&r" (tmp2), "=&r" (tmp3) : "r" (p) : "cc", "memory"); return( tmp2 == 0 ); } // cri_cmp_swap() // // Atomic compare and exchange (swap). // Atomic equivalent of: // if (*p == oldval) { // *p = newval; // return NONZERO; // } else { // return 0; // } // CR_INLINE unsigned int cri_cmp_swap(cri_atomic_t *p, unsigned int oldval, unsigned int newval) { int readval, tmp; __asm__ __volatile__ ("\n" "0: ldr %1,[%2]\n" // tmp = *p " cmp %1,%4\n" // compare(tmp, oldval) " movne %0,%1\n" // if (tmp != oldval) readval = tmp ... " bne 1f\n" // ... and return " swp %0,%3,[%2]\n" // atomically(readval = *p; *p = newval) " cmp %1,%0\n" // compare(tmp, readval) NOTE: tmp==oldval " swpne %1,%0,[%2]\n" // if (tmp != readval) undo the swap... " bne 0b\n" // ... and restart "1:" : "=&r" (readval), "=&r" (tmp) : "r" (p), "r" (newval), "r" (oldval) : "cc", "memory"); return( readval == oldval ); } #endif /* defined(CR_KCODE___kuser_cmpxchg) */ #endif blcr-0.8.5/libcr/arch/arm/cr_arch.h0000664000000000000000000002113011014612462013672 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2007, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 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 * Library 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * $Id: cr_arch.h,v 1.16 2008/05/20 18:15:14 phargrov Exp $ * * Experimental ARM support contributed by Anton V. Uzunov * of the Australian Government * Department of Defence, Defence Science and Technology Organisation. * * ARM-specific questions should be directed to blcr-arm@hpcrd.lbl.gov. */ #ifndef _CR_ARCH_H #define _CR_ARCH_H 1 // Catch-all file for misc. arch-specific bits // macros for using the syscall instruction (SWI) #if defined(__thumb__) || defined(__ARM_EABI__) # define CRI_SYS_REG(name) register long __sysreg __asm__( "r7" ) = name; # define CRI_SYS_REG_LIST(regs...) "r" (__sysreg) , regs # define CRI_SYS_REG_LIST_EABI_0() "r" (__sysreg) # define CRI_syscall(name) "swi \t 0" # define CRI_ld_r7(__num) "mov r7, #" #__num #else # define CRI_SYS_REG(name) # define CRI_SYS_REG_LIST(regs...) regs # define CRI_SYS_REG_LIST_EABI_0() # define CRI_syscall(name) "swi \t" #name "" # define CRI_ld_r7(__num) #endif #define cri_syscall_return(type, res, errno_p) \ do { \ if ((unsigned long) (res) >= (unsigned long) (-4096)) { \ if (errno_p != NULL) { *errno_p = -res; } \ res = -1; \ } \ return( (type) (res) ); \ } while (0) #define cri_syscall0(type,name,nr) \ type name(int *errno_p) { \ CRI_SYS_REG( nr ) \ register long __res_r0 __asm__( "r0" ); \ long __res; \ __asm__ __volatile__ ( \ CRI_syscall( nr ) \ : "=r" (__res_r0) \ : CRI_SYS_REG_LIST_EABI_0() \ : "memory" ); \ __res = __res_r0; \ cri_syscall_return(type,__res,errno_p); \ } #define cri_syscall1(type,name,nr,type1) \ type name(type1 arg1, int *errno_p) { \ CRI_SYS_REG( nr ) \ register long __r0 __asm__( "r0" ) = (long) arg1; \ register long __res_r0 __asm__( "r0" ); \ long __res; \ __asm__ __volatile__ ( \ CRI_syscall( nr ) \ : "=r" (__res_r0) \ : CRI_SYS_REG_LIST( "0" (__r0) ) \ : "memory" ); \ __res = __res_r0; \ cri_syscall_return(type,__res,errno_p); \ } #define cri_syscall2(type,name,nr,type1,type2) \ type name(type1 arg1,type2 arg2, int *errno_p) { \ CRI_SYS_REG( nr ) \ register long __r0 __asm__( "r0" ) = (long) arg1; \ register long __r1 __asm__( "r1" ) = (long) arg2; \ register long __res_r0 __asm__( "r0" ); \ long __res; \ __asm__ __volatile__ ( \ CRI_syscall( nr ) \ : "=r" (__res_r0) \ : CRI_SYS_REG_LIST( "0" (__r0), "r" (__r1) ) \ : "memory" ); \ __res = __res_r0; \ cri_syscall_return( type, __res, errno_p ); \ } #define cri_syscall3(type,name,nr,type1,type2,type3) \ type name(type1 arg1,type2 arg2,type3 arg3, int *errno_p) { \ CRI_SYS_REG( nr ) \ register long __r0 __asm__( "r0" ) = (long) arg1; \ register long __r1 __asm__( "r1" ) = (long) arg2; \ register long __r2 __asm__( "r2" ) = (long) arg3; \ register long __res_r0 __asm__( "r0" ); \ long __res; \ __asm__ __volatile__ ( \ CRI_syscall( nr ) \ : "=r" (__res_r0) \ : CRI_SYS_REG_LIST( "0" (__r0), "r" (__r1), "r" (__r2) ) \ : "memory" ); \ __res = __res_r0; \ cri_syscall_return( type, __res, errno_p ); \ } #define cri_syscall4(type,name,nr,type1,type2,type3,type4) \ type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, int *errno_p) { \ CRI_SYS_REG( nr ) \ register long __r0 __asm__( "r0" ) = (long) arg1; \ register long __r1 __asm__( "r1" ) = (long) arg2; \ register long __r2 __asm__( "r2" ) = (long) arg3; \ register long __r3 __asm__( "r3" ) = (long) arg4; \ register long __res_r0 __asm__( "r0" ); \ long __res; \ __asm__ __volatile__ ( \ CRI_syscall( nr ) \ : "=r" (__res_r0) \ : CRI_SYS_REG_LIST( "0" (__r0), "r" (__r1), "r" (__r2), "r" (__r3) ) \ : "memory" ); \ __res = __res_r0; \ cri_syscall_return( type, __res, errno_p ); \ } #define cri_syscall5(type,name,nr,type1,type2,type3,type4,type5) \ type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, int *errno_p) { \ CRI_SYS_REG( nr ) \ register long __r0 __asm__( "r0" ) = (long) arg1; \ register long __r1 __asm__( "r1" ) = (long) arg2; \ register long __r2 __asm__( "r2" ) = (long) arg3; \ register long __r3 __asm__( "r3" ) = (long) arg4; \ register long __r4 __asm__( "r4" ) = (long) arg5; \ register long __res_r0 __asm__( "r0" ); \ long __res; \ __asm__ __volatile__ ( \ CRI_syscall( nr ) \ : "=r" (__res_r0) \ : CRI_SYS_REG_LIST( "0" (__r0), "r" (__r1), "r" (__r2), \ "r" (__r3), "r" (__r4) ) \ : "memory" ); \ __res = __res_r0; \ cri_syscall_return( type, __res, errno_p ); \ } #define cri_syscall6(type,name,nr,type1,type2,type3,type4,type5,type6) \ type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, type6 arg6, int *errno_p) { \ CRI_SYS_REG( nr ) \ register long __r0 __asm__( "r0" ) = (long) arg1; \ register long __r1 __asm__( "r1" ) = (long) arg2; \ register long __r2 __asm__( "r2" ) = (long) arg3; \ register long __r3 __asm__( "r3" ) = (long) arg4; \ register long __r4 __asm__( "r4" ) = (long) arg5; \ register long __r5 __asm__( "r5" ) = (long) arg6; \ register long __res_r0 __asm__( "r0" ); \ long __res; \ __asm__ __volatile__ ( \ CRI_syscall( nr ) \ : "=r" (__res_r0) \ : CRI_SYS_REG_LIST( "0" (__r0), "r" (__r1), "r" (__r2), \ "r" (__r3), "r" (__r4), "r" (__r5) ) \ : "memory" ); \ __res = __res_r0; \ cri_syscall_return( type, __res,errno_p ); \ } /* Template to build "micro" handlers */ #define _CR_ASM_HANDLER2(__ioctl,__rt_sigreturn,__name,__op,__arg) \ __asm__( \ " .text\n" \ " .align 2\n" \ " .global " _STRINGIFY(__name) "\n" \ " .type " _STRINGIFY(__name) ", %function\n" \ _STRINGIFY(__name) ":\n" \ " mov r3, r1\n" \ " ldr r0, [r1, #" _STRINGIFY(CR_ASM_SI_PID_OFFSET) "]\n" \ " ldr r1, =" _STRINGIFY(__op) "\n" \ " ldr r2, =" _STRINGIFY(__arg) "\n" \ CRI_ld_r7(__ioctl) "\n\t" \ CRI_syscall(__ioctl) "\n" \ " mov sp, r3\n" \ CRI_ld_r7(__rt_sigreturn) "\n\t" \ CRI_syscall(__rt_sigreturn) "\n" \ " .size " _STRINGIFY(__name) ", .-" _STRINGIFY(__name) \ ); #define _CR_ASM_HANDLER(__name,__op,__arg) \ _CR_ASM_HANDLER2(CR_ASM_NR_ioctl, CR_ASM_NR_rt_sigreturn,__name,__op,__arg) #define CR_RUN_ASM_HANDLER(__name) \ _CR_ASM_HANDLER(__name, CR_ASM_OP_HAND_CHKPT, CR_ASM_CHECKPOINT_STUB) #define CR_OMIT_ASM_HANDLER(__name) \ _CR_ASM_HANDLER(__name, CR_ASM_OP_HAND_ABORT, CR_ASM_CHECKPOINT_OMIT) #define cri_sigreturn2(__siginfo, __number) \ __asm__ __volatile__ ( \ "mov sp, %0\n\t" \ CRI_ld_r7(__number) "\n\t" \ CRI_syscall(__number) \ : : "r" ((unsigned long)(__siginfo))); #define cri_sigreturn(__signr, __siginfo, __context) \ cri_sigreturn2(__siginfo, CR_ASM_NR_rt_sigreturn) // Use our own cri_ksigaction #define CR_USE_SIGACTION 0 #endif // ifdef _CR_ARCH_H blcr-0.8.5/libcr/cr_request.c0000664000000000000000000005072111145431252012755 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2008, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 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 * Library 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * $Id: cr_request.c,v 1.222.4.1 2009/02/14 02:55:38 phargrov Exp $ * * Code for clients to request checkpoints and restarts, poll and forward them. */ #define _LARGEFILE64_SOURCE 1 /* For O_LARGEFILE in LEGACY interfaces */ #include #include #include #include #include #include #include #include "cr_private.h" // // Private variables // // // Public variables // // // Private functions // /* Accessors for fd "component" of the handle. * These are trivial now, but might eventually become less so. */ static inline int cri_chkpt_hndl_get_token(cr_checkpoint_handle_t *handle) { return (int)*handle; } static inline int cri_rstrt_hndl_get_token(cr_restart_handle_t *handle) { return (int)*handle; } static inline void cri_chkpt_hndl_set_token(cr_checkpoint_handle_t *handle, int token) { *handle = token; } static inline void cri_rstrt_hndl_set_token(cr_restart_handle_t *handle, int token) { *handle = token; } static inline int do_wait_fd(int fd, struct timeval *timeout) { fd_set rfds; FD_ZERO(&rfds); FD_SET(fd, &rfds); return select(fd+1, &rfds, NULL, NULL, timeout); } /* This replaced cri_initialize_checkpoint_args_t() in 0.7.0 */ /* This is "semi-private" */ int cri_init_checkpoint_args_t(cr_version_t ver, cr_checkpoint_args_t *cr_args) { cr_args->cr_version = ver; switch (ver) { #if 0 // Not yet case 2: Set fields added in version 2 // fall through to get older fields... #endif case 1: // Interface as of 0.6.0. Still current in 0.7.0 cr_args->cr_scope = -1; // Invalid - user must set cr_args->cr_target = 0; // Default target of zero is 'self' cr_args->cr_fd = -1; // Invalid - user must set cr_args->cr_signal = 0; // Default is no signal cr_args->cr_timeout = 0; // Default is unbounded cr_args->cr_flags = 0; // Default is no special behaviors break; default: // Unknown/unsupported version errno = EINVAL; return -1; } return 0; } /* This is "semi-private" */ int cri_init_restart_args_t(cr_version_t ver, cr_restart_args_t *cr_args) { cr_args->cr_version = ver; switch (ver) { #if 0 // Not yet case 2: Set fields added in version 2 // fall through to get older fields... #endif case 1: cr_args->cr_fd = -1; // Invalid - user must set cr_args->cr_signal = 0; // Default is no signal cr_args->cr_flags = CR_RSTRT_RESTORE_PID; // Default is no special behaviors cr_args->cr_relocate = NULL; // Default is no relocations break; default: // Unknown/unsupported version errno = EINVAL; return -1; } return 0; } static int cri_rstrt_hndl_child_inner(void *arg) { int token = (uintptr_t)arg; int local_errno; int err; /* Now overlay ourselves with the new image */ err = __cri_syscall_token(token, CR_OP_RSTRT_CHILD, CRI_SYSCALL_NOARG, &local_errno); /* Not reached unless we've encountered a fatal error. * ********** Things are hairy here ********** * We may have an incomplete thread environment, so we can't use libc fully. */ /* Don't even try to print an error message */ /* Try to make the entire thread group exit, if supported */ __cri_exit_group(local_errno, NULL); /* We might return here in the case of ENOSYS */ /* Note that this is really _exit() */ __cri_exit(local_errno, NULL); /* NOTREACHED */ return 0; } static int cri_rstrt_hndl_child_main(int token, int threads, int flags) { struct sigaction sa; uintptr_t incr = sysconf(_SC_PAGESIZE); uintptr_t stack; int err; int i; /* To help close the race between creation of our children and * any checkpoint requests, they need to OMIT. However, other than * the first, they don't have a full pthreads library available * (e.g. to pthread_getspecific) to run the normal signal handler. */ sa.sa_sigaction = cri_omit_sig_handler; sa.sa_flags = SA_RESTART | SA_SIGINFO; (void)sigfillset(&sa.sa_mask); (void)sigaction(CR_SIGNUM, &sa, NULL); /* XXX: Add error checking */ if (threads > 1) { stack = (uintptr_t)mmap(0, (threads - 1) * incr, PROT_READ | PROT_WRITE | PROT_EXEC, MAP_PRIVATE | MAP_ANONYMOUS, 0, 0); if ((void *)stack == MAP_FAILED) { fprintf(stderr, "Failed to allocate stack space for child thread(s)\n"); exit(1); } #if (CR_STACK_GROWTH < 0) /* Stack grows down */ stack += incr; #elif (CR_STACK_GROWTH > 0) /* Stack grows up */ /* Nothing to do */ #else #error "Don't know which way the stack grows" #endif for (i = 1; i < threads; ++i) { err = clone(&cri_rstrt_hndl_child_inner, (void *)stack, flags, (void *)(uintptr_t)token); if (err < 0) { fprintf(stderr, "clone() failed while creating child thread(s)\n"); exit(1); } stack += incr; } } cri_rstrt_hndl_child_inner((void *)(uintptr_t)token); /* NOTREACHED */ return 0; } static int do_fetch_log(int token, int op, char **msg_p) { struct cr_log_args req = { 0, NULL }; int rc; rc = cri_syscall_token(token, op, (uintptr_t)&req); if (rc <= 0) { /* Error (<0) or empty (0) */ return rc; } req.len = rc; req.buf = malloc(rc); if (!req.buf) { errno = ENOMEM; return -1; } rc = cri_syscall_token(token, op, (uintptr_t)&req); if (rc < 0) { free(req.buf); return -1; } *msg_p = req.buf; return 0; } #if HAVE_FTB static FTB_event_handle_t cri_my_event; static void my_log_event(const char *name) { // Note: we don't preserve errno here since our callers clobber it cri_info_t *info = cri_info_init(); (void)cri_do_enter(info, CRI_ID_INTERNAL); if (!cri_ftb_init(NULL,NULL)) { (void)cri_ftb_event(&cri_my_event, name, 0, NULL); (void)cri_ftb_fini(); } cri_do_leave(info, CRI_ID_INTERNAL); } static void my_log_event2(const char *name) { int save_errno = errno; cri_info_t *info = cri_info_init(); (void)cri_do_enter(info, CRI_ID_INTERNAL); if (!cri_ftb_init(NULL,NULL)) { (void)cri_ftb_event2(NULL, &cri_my_event, name, 0, NULL); (void)cri_ftb_fini(); } cri_do_leave(info, CRI_ID_INTERNAL); errno = save_errno; } static void my_log_error(const char *name) { int32_t save_errno = errno; cri_info_t *info = cri_info_init(); (void)cri_do_enter(info, CRI_ID_INTERNAL); if (!cri_ftb_init(NULL,NULL)) { (void)cri_ftb_event2(NULL, &cri_my_event, name, 4, &save_errno); (void)cri_ftb_fini(); } cri_do_leave(info, CRI_ID_INTERNAL); errno = save_errno; } #endif // // Public functions // int cr_request_checkpoint(cr_checkpoint_args_t *args, cr_checkpoint_handle_t *handle) { struct cr_chkpt_args req; int rc; int token; #if LIBCR_TRACING int pid = (int)getpid(); #endif rc = -1; errno = EINVAL; if (args->cr_version != CR_CHECKPOINT_ARGS_VERSION) { // XXX: Only support a single version at the moment goto out; } // initialize the handle token = cri_connect_token(); if (token < 0) { goto out; } cri_chkpt_hndl_set_token(handle, token); // initialize the request req.cr_target = args->cr_target; req.cr_scope = args->cr_scope; req.cr_fd = args->cr_fd; req.cr_secs = args->cr_timeout; req.dump_format = cr_format_vmadump; req.signal = args->cr_signal; req.flags = args->cr_flags; #if HAVE_FTB (void)my_log_event("CHKPT_BEGIN"); #endif // issue the request LIBCR_TRACE(LIBCR_TRACE_INFO, "[%d] requesting the checkpoint.", pid); rc = cri_syscall_token(token, CR_OP_CHKPT_REQ, (uintptr_t)&req); if (rc < 0) { cri_disconnect_token(token); /* Might silently fail? */ cri_chkpt_hndl_set_token(handle, -1); goto out; } out: #if HAVE_FTB if (rc < 0) { my_log_error("CHKPT_ERROR"); } #endif LIBCR_TRACE(LIBCR_TRACE_INFO, "[%d] leaving with rc=%d.", pid, rc); return rc; } int cr_forward_checkpoint(cr_scope_t cr_scope, pid_t cr_target) { cri_info_t *info; int rc; struct cr_fwd_args req; #if LIBCR_TRACING int pid = (int)getpid(); #endif // Checks for improper calls info = CRI_CB_INFO_OR_RETURN(-1); // thread-specific req.cr_scope = cr_scope; req.cr_target = cr_target; // forward the checkpoint LIBCR_TRACE(LIBCR_TRACE_INFO, "[%d] forwarding checkpoint.", pid); rc = cri_syscall_token(info->run.token, CR_OP_CHKPT_FWD, (uintptr_t)&req); if (rc < 0) { goto out; } out: LIBCR_TRACE(LIBCR_TRACE_INFO, "[%d] leaving with rc=%d.", pid, rc); return rc; } // Block until the checkpoint is complete or we exceed the timeout int cr_wait_checkpoint(cr_checkpoint_handle_t *handle, struct timeval *timeout) { return do_wait_fd(cri_chkpt_hndl_get_token(handle), timeout); } // Collect log messages int cr_log_checkpoint(cr_checkpoint_handle_t *handle, unsigned int len, char *msg) { int token = cri_chkpt_hndl_get_token(handle); struct cr_log_args req = { len, msg }; return cri_syscall_token(token, CR_OP_CHKPT_LOG, (uintptr_t)&req); } // Collect the result int cr_reap_checkpoint(cr_checkpoint_handle_t *handle) { int token = cri_chkpt_hndl_get_token(handle); int err = cri_syscall_token(token, CR_OP_CHKPT_REAP, CRI_SYSCALL_NOARG); if ((err < 0) && (errno == ENOTTY)) { /* "Bad ioctl()" - this is NOT our handle. So, don't close it. */ } else { cri_disconnect_token(token); /* Might silently fail? */ cri_chkpt_hndl_set_token(handle, -1); } #if HAVE_FTB if (err >= 0) { (void)my_log_event2("CHKPT_END"); } else if ((errno != CR_ERESTARTED) && (errno != EINTR)) { (void)my_log_error("CHKPT_ERROR"); } #endif return err; } // Block until the checkpoint request is complete or we exceed the timeout // then collect log messages and reap result/status int cr_poll_checkpoint_msg(cr_checkpoint_handle_t *handle, struct timeval *timeout, char **msg_p) { int token = cri_chkpt_hndl_get_token(handle); int err; /* Wait/poll for the request to complete */ err = do_wait_fd(token, timeout); if (!err) { return 0; /* Not done */ } else if (err < 0) { #if HAVE_FTB if (errno != EINTR) { my_log_error("CHKPT_ERROR"); } #endif return CR_POLL_CHKPT_ERR_PRE; } /* fall though on > 0 */ /* Fetch the message log if requested */ if (msg_p && (do_fetch_log(token, CR_OP_CHKPT_LOG, msg_p) < 0)) { return CR_POLL_CHKPT_ERR_LOG; } /* Reap the completed request */ err = cr_reap_checkpoint(handle); return (err < 0) ? CR_POLL_CHKPT_ERR_POST : 1; } int cr_poll_checkpoint(cr_checkpoint_handle_t *handle, struct timeval *timeout) { return cr_poll_checkpoint_msg(handle, timeout, NULL); } int cr_request_restart(cr_restart_args_t *args, cr_restart_handle_t *handle) { struct cr_rstrt_args req; struct cr_procs_tbl procs; int token; int err; errno = EINVAL; if (args->cr_version != CR_RESTART_ARGS_VERSION) { // XXX: Only support a single version at the moment return -1; } token = cri_connect_token(); if (token < 0) { return token; } cri_rstrt_hndl_set_token(handle, token); /* ... initialize the request from user's args */ req.cr_fd = args->cr_fd; req.signal = args->cr_signal; req.flags = args->cr_flags; req.relocate = args->cr_relocate; #if HAVE_FTB (void)my_log_event("RSTRT_BEGIN"); #endif /* ... tell the kernel to go off and restart something */ err = cri_syscall_token(token, CR_OP_RSTRT_REQ, (uintptr_t)&req); if (err < 0) { /* The restart request was unsuccessful. */ goto fail; } /* ... fork child(ren) to contain the restarted task(s) * Note that CR_OP_RSTRT_PROCS might block if it cannot yet * be determined if more processes are needed. */ while ((err = cri_syscall_token(token, CR_OP_RSTRT_PROCS, (uintptr_t)&procs)) > 0) { err = fork(); if (err < 0) { /* The fork was unsuccessful. */ goto fail; } else if (err == 0) { cri_rstrt_hndl_child_main(token, procs.threads, procs.clone_flags); /* NOTREACHED */ } } if (err < 0) { goto fail; } return 0; fail: #if HAVE_FTB my_log_error("RSTRT_ERROR"); #endif cri_disconnect_token(token); /* Might silently fail? */ cri_rstrt_hndl_set_token(handle, -1); return -1; } // Block until the restart is complete or we exceed the timeout int cr_wait_restart(cr_restart_handle_t *handle, struct timeval *timeout) { return do_wait_fd(cri_rstrt_hndl_get_token(handle), timeout); } // Collect log messages int cr_log_restart(cr_restart_handle_t *handle, unsigned int len, char *msg) { int token = cri_rstrt_hndl_get_token(handle); struct cr_log_args req = { len, msg }; return cri_syscall_token(token, CR_OP_RSTRT_LOG, (uintptr_t)&req); } // Collect the result int cr_reap_restart(cr_restart_handle_t *handle) { int token = cri_rstrt_hndl_get_token(handle); int err = cri_syscall_token(token, CR_OP_RSTRT_REAP, CRI_SYSCALL_NOARG); if ((err < 0) && (errno == ENOTTY)) { /* "Bad ioctl()" - this is NOT our handle. So, don't close it. */ } else { cri_disconnect_token(token); /* Might silently fail? */ cri_rstrt_hndl_set_token(handle, -1); } #if HAVE_FTB if (err >= 0) { (void)my_log_event2("RSTRT_END"); } else if (errno != EINTR) { (void)my_log_error("RSTRT_ERROR"); } #endif return err; } // Block until the restart request is complete or we exceed the timeout // then collect log messages and reap result/status int cr_poll_restart_msg(cr_restart_handle_t *handle, struct timeval *timeout, char **msg_p) { int token = cri_rstrt_hndl_get_token(handle); int err; /* Wait/poll for the request to complete */ err = do_wait_fd(token, timeout); if (!err) { return 0; /* Not done */ } else if (err < 0) { #if HAVE_FTB if (errno != EINTR) { my_log_error("RSTRT_ERROR"); } #endif return CR_POLL_RSTRT_ERR_PRE; } /* fall though on > 0 */ /* Fetch the message log if requested */ if (msg_p && (do_fetch_log(token, CR_OP_RSTRT_LOG, msg_p) < 0)) { return CR_POLL_RSTRT_ERR_LOG; } /* Reap the completed request */ err = cr_reap_restart(handle); return (err < 0) ? CR_POLL_RSTRT_ERR_POST : err; } int cr_poll_restart(cr_restart_handle_t *handle, struct timeval *timeout) { return cr_poll_restart_msg(handle, timeout, NULL); } // // LEGACY checkpoint request interfaces, in terms of the current ones: // #include #include #ifndef O_LARGEFILE #define O_LARGEFILE 0 #endif static void cri_request(int fd, const char *filename, int scope) { /* Static data: */ static pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER; static char prev_name[PATH_MAX]; static cr_checkpoint_handle_t cr_handle = (cr_checkpoint_handle_t)(-1); int rc; cr_checkpoint_args_t cr_args; /* Serialize */ pthread_mutex_lock(&lock); cr_initialize_checkpoint_args_t(&cr_args); cr_args.cr_scope = scope; cr_args.cr_fd = fd; // If there is a previous request un-reaped then reap it now. if ((int)cr_handle >= 0) { do { rc = cr_poll_checkpoint(&cr_handle, NULL); } while ((rc < 0) && (errno == EINTR)); if (rc < 0) { if ((rc == CR_POLL_CHKPT_ERR_POST) && (errno == CR_ERESTARTED)) { // Previous request was invalidated across a restart - not an error. } else if (prev_name[0]) { // Failed - cleanup file from previous failure LIBCR_TRACE(LIBCR_TRACE_INFO, "Removing supposedly bogus context file " "(%s), because rc=%d and errno=%d (%s)", prev_name, rc, errno, cr_strerror(errno)); if (!strcmp(prev_name, filename)) { /* Don't remove the NEW file */ } else if (unlink(prev_name) < 0) { CRI_ABORT("unable to remove aborted/failed checkpoint file %s: %s\n", prev_name, strerror(errno)); } } } else if (rc == 0) { CRI_ABORT("unexpected/impossible zero return from cr_poll_checkpoint"); } } rc = cr_request_checkpoint(&cr_args, &cr_handle); if (rc) { CRI_ABORT("cr_request_checkpoint returned %d w/ errno=%d (%s)\n", rc, errno, cr_strerror(errno)); } // Don't return until the request is either pending or completed. // This is important; otherwise we would have races with critical // sections which follow the cr_request() call. // // We can detect pending state because the live count is non-zero. // We can detect completed because a reap will succeed (or fail // with an errno other than EAGAIN). // When restarting we expect the reap to fail w/ // errno = CR_ERESTARTED if the fd is restored normally // errno = ENOTTY if the fd is restored to something else // errno = EBADF if the fd is not restored at all rc = 0; CRI_WHILE_COND_YIELD( !cri_atomic_read(&cri_live_count) && ((rc = cri_syscall_token((int)cr_handle, CR_OP_CHKPT_REAP, CRI_SYSCALL_NOARG)) < 0) && errno == EAGAIN ); LIBCR_TRACE(LIBCR_TRACE_INFO, "Reap loop finished with rc=%d and errno=%d (%s)", rc, errno, cr_strerror(errno)); if (filename) { /* Remove checkpoint file if an unexpected error occurred (see above) */ if (rc && (errno != EAGAIN) && (errno != CR_ERESTARTED) && (errno != ENOTTY) && (errno != EBADF)) { LIBCR_TRACE(LIBCR_TRACE_INFO, "Removing supposedly bogus context file " "(%s), because rc=%d and errno=%d (%s)", filename, rc, errno, cr_strerror(errno)); if (unlink(filename) < 0) { CRI_ABORT("unable to remove aborted/failed checkpoint file %s: %s\n", filename, strerror(errno)); } prev_name[0] = '\0'; } else { /* Save name for possible later clean up */ strncpy(prev_name, filename, PATH_MAX); } } else { prev_name[0] = '\0'; } pthread_mutex_unlock(&lock); } static void cri_request_file(const char *filename) { int fd; CRI_EINTR_LOOP((fd = __cri_open(filename, O_WRONLY | O_CREAT | O_TRUNC | O_LARGEFILE, 0600, &errno))); if (fd < 0) { CRI_ABORT("open(%s)", filename); } cri_request(fd, filename, CR_SCOPE_PROC); CRI_EINTR_LOOP(__cri_close(fd, &errno)); /* silent failure possible */ } // Request an application-initiated checkpoint // The actual processing might be delayed by critical sections. // // Thread-safe, but not reentrant void cr_request_fd(int fd) { if (!cri_info_location()) { CRI_ABORT("called w/o first calling cr_init()"); } cri_request(fd, NULL, CR_SCOPE_PROC); } // Request an application-initiated checkpoint of own process // The actual processing might be delayed by critical sections. // // Thread-safe, but not reentrant // XXX: error handling needs work (ABORT is not the best policy) void cr_request_file(const char *filename) { if (!cri_info_location()) { CRI_ABORT("called w/o first calling cr_init()"); } cri_request_file(filename); } // Request an application-initiated checkpoint // The actual processing might be delayed by critical sections. // // Thread-safe, but not reentrant void cr_request(void) { #define CONTEXT_NAMELEN 16 /* context.XXXXX + \0 + extra */ char filename[CONTEXT_NAMELEN]; if (!cri_info_location()) { CRI_ABORT("called w/o first calling cr_init()"); } snprintf(filename, CONTEXT_NAMELEN, "context.%d", (int)getpid()); cri_request_file(filename); #undef CONTEXT_NAMELEN } blcr-0.8.5/libcr/cr_ftb.c0000664000000000000000000001043511120371365012037 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2008, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * 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 * * $Id: cr_ftb.c,v 1.3 2008/12/12 05:13:25 phargrov Exp $ * * FTB interface code common to blrc's utils */ #include #include #include #include "libftb.h" /* Single client using static variables */ static pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER; static FTB_client_t cr_ftb_client_info = { event_space: "FTB.checkpoint_sw.blcr", client_name: "", client_jobid: "", client_subscription_style: "FTB_SUBSCRIPTION_NONE" }; static FTB_event_info_t cr_ftb_event_info[] = { {"CHKPT_BEGIN", "INFO"}, /* No payload */ {"CHKPT_END", "INFO"}, /* payload = event_handle */ {"CHKPT_ERROR", "ERROR"}, /* payload = event_handle + uint32_t errno */ {"RSTRT_BEGIN", "INFO"}, /* No payload */ {"RSTRT_END", "INFO"}, /* payload = event_handle */ {"RSTRT_ERROR", "ERROR"} /* payload = event_handle + uint32_t errno */ }; #define CR_FTB_EVENT_COUNT (sizeof(cr_ftb_event_info) / sizeof(cr_ftb_event_info[0])) static FTB_client_handle_t cr_ftb_client_handle; static int cri_ftb_init_count = 0; int cri_ftb_init(const char *client_name, const char *client_jobid) { int rc = FTB_SUCCESS; pthread_mutex_lock(&lock); if (cri_ftb_init_count++ != 0) goto out; if (client_name) { strncpy(cr_ftb_client_info.client_name, client_name, FTB_MAX_CLIENT_NAME); } if (client_jobid) { strncpy(cr_ftb_client_info.client_jobid, client_jobid, FTB_MAX_CLIENT_JOBID); } rc = FTB_Connect(&cr_ftb_client_info, &cr_ftb_client_handle); if (rc != FTB_SUCCESS) goto out; rc = FTB_Declare_publishable_events(cr_ftb_client_handle, 0, cr_ftb_event_info, CR_FTB_EVENT_COUNT); if (rc == FTB_ERR_DUP_EVENT) { rc = 0; /* Ignore, see CiFTS trac item #44 */ } else if (rc != FTB_SUCCESS) goto out; out: pthread_mutex_unlock(&lock); return rc; } int cri_ftb_fini(void) { int rc = FTB_SUCCESS; pthread_mutex_lock(&lock); if (!cri_ftb_init_count || --cri_ftb_init_count) goto out; rc = FTB_Disconnect(cr_ftb_client_handle); out: pthread_mutex_unlock(&lock); return rc; } int cri_ftb_event(FTB_event_handle_t *event_handle, const char *event_name, int len, const void *data) { FTB_event_properties_t prop; FTB_event_handle_t tmp; if (!cri_ftb_init_count) return -1; if (len) { prop.event_type = 1; memset(prop.event_payload, 0, FTB_MAX_PAYLOAD_DATA); memcpy(prop.event_payload, data, len); } return FTB_Publish(cr_ftb_client_handle, event_name, len ? &prop : NULL, event_handle ? event_handle : &tmp); } int cri_ftb_event2(FTB_event_handle_t *event_handle, const FTB_event_handle_t *orig_handle, const char *event_name, int len, const void *data) { FTB_event_properties_t prop; FTB_event_handle_t tmp; if (!cri_ftb_init_count) return -1; prop.event_type = 2; memset(prop.event_payload, 0, FTB_MAX_PAYLOAD_DATA); memcpy(prop.event_payload, orig_handle, sizeof(FTB_event_handle_t)); if (len) { memcpy(prop.event_payload + sizeof(FTB_event_handle_t), data, len); } return FTB_Publish(cr_ftb_client_handle, event_name, &prop, event_handle ? event_handle : &tmp); } blcr-0.8.5/libcr/cr_strerror.c0000664000000000000000000000317710156104437013155 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2003, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 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 * Library 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * $Id: cr_strerror.c,v 1.4 2004/12/09 17:19:27 phargrov Exp $ */ #include #include "cr_private.h" /* Create array of error descriptions */ #define CR_ERROR_DEF(name, desc) desc, static const char * cr_strerrors[] = { #include "for fussy compilers that don't want to see a comma at the end" }; const char * cr_strerror(int errnum) { if (errnum <= CR_MIN_ERRCODE || errnum >= CR_MAX_ERRCODE) return strerror(errnum); else return cr_strerrors[errnum - (CR_MIN_ERRCODE+1)]; } blcr-0.8.5/libcr/Makefile.am0000664000000000000000000000412012071454771012473 00000000000000lib_LTLIBRARIES = libcr.la libcr_run.la libcr_omit.la CR_LIB_VERSION = -version-info @LIBTOOL_INTERFACE@:@LIBTOOL_REVISION@:@LIBTOOL_AGE@ noinst_HEADERS = \ cr_syscall.h\ cr_private.h\ cr_rb_lock.h\ cr_trace.h\ cr_yield.h if CR_HAVE_FTB libcr_ftb_sources = cr_ftb.c endif libcr_la_SOURCES = \ $(libcr_ftb_sources) \ cr_async.c\ cr_core.c\ cr_cs.c\ cr_pthread.c\ cr_sig_sync.c\ cr_syscall.c\ cr_trace.c\ cr_strerror.c\ cr_request.c\ cr_omit.c\ cr_run.c libcr_la_LIBADD = -ldl -lpthread @CR_FTB_LDADD@ libcr_la_LDFLAGS = $(CR_LIB_VERSION) @CR_FTB_LDFLAGS@ libcr_la_CFLAGS = @CR_LIBCR_CFLAGS@ @CR_FTB_INCLUDES@ $(AM_CFLAGS) if LIBCR_TRACING libcr_tracing = cr_trace.c cr_sig_sync.c endif # "target" libs libcr_run_la_SOURCES = cr_run.c $(libcr_tracing) libcr_run_la_LIBADD = -ldl libcr_run_la_LDFLAGS = $(CR_LIB_VERSION) libcr_run_la_CFLAGS = @CR_LIBCR_CFLAGS@ $(AM_CFLAGS) -DLIBCR_SIGNAL_ONLY libcr_omit_la_SOURCES = cr_omit.c $(libcr_tracing) libcr_omit_la_LIBADD = -ldl libcr_omit_la_LDFLAGS = $(CR_LIB_VERSION) libcr_omit_la_CFLAGS = @CR_LIBCR_CFLAGS@ $(AM_CFLAGS) -DLIBCR_SIGNAL_ONLY if CR_ENABLE_SHARED # XXX: should split off arch-specific portions of the symbol filter cr_lib_check: @if (nm -D .libs/libcr_run.so | egrep -v \ -e ' [^TDB] ' \ -e ' [TDB] \.?crsig_' \ -e ' [TDB] \.?cri?_run_' \ -e ' [TD] \.?_init' \ -e ' [TD] \.?_fini' \ -e ' D __data_start' \ -e ' D _edata' \ -e ' B __bss_start' \ -e ' B _end' \ -e ' T _(save|rest)[gf]pr_[123][0-9](_x)?'); \ then \ echo "ERROR: libcr_run.so leaks symbol(s), above."; \ exit 1; \ fi if CRI_DEBUG # Curently only do this for a debug build, due to fragile nm and grep arguments cr_lib_check = cr_lib_check endif endif INCLUDES =\ -D_GNU_SOURCE\ -D_REENTRANT\ -I$(top_builddir)/include\ -I$(top_srcdir)/include\ -I$(srcdir)/arch/@CR_LIBARCH@/ EXTRA_DIST=arch license.txt cr_libinit.c dist-hook: find $(distdir)/arch -name CVS | xargs rm -rf all-local: $(cr_lib_check) if test -d $(top_builddir)/libcr32/libcr; then $(MAKE) $(AM_MAKEFLAGS) -C $(top_builddir)/libcr32/libcr all; fi blcr-0.8.5/libcr/cr_cs.c0000664000000000000000000003161411625061573011702 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2008, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 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 * Library 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * $Id: cr_cs.c,v 1.67.14.3 2011/08/24 02:35:39 phargrov Exp $ */ #include #include "cr_private.h" // // Private data // #define CRI_CONTEXT_MASK (CR_THREAD_CONTEXT | CR_SIGNAL_CONTEXT) // // Private functions // static inline void poll_checkpoint(cri_info_t *info) { if (cri_atomic_dec_and_test(&info->cr_cs_count)) { cri_black_lock(&cri_cs_lock); cri_start_checkpoint(info); cri_black_unlock(&cri_cs_lock); } } // signal_handler() // // Signal handler for threads w/ signal-context handlers static void my_handler(int signr, siginfo_t *siginfo, void *context) { int saved_errno = errno; cri_info_t *info = cri_info_location(); // thread-specific cri_checkpoint_info_init(info); if (cri_cmp_swap(&info->cr_state, CR_STATE_IDLE, CR_STATE_PENDING)) { cri_atomic_inc(&cri_live_count); poll_checkpoint(info); } errno = saved_errno; } static int do_state(cri_info_t *info) { int state = cri_atomic_read(&info->cr_state); if ((state == CR_STATE_IDLE) && cri_atomic_read(&cri_live_count)) { state = CR_STATE_PENDING; } return state; } // This mess is to prevent starvation by not entering an // outermost critical section when a checkpoint is pending // or running in ANY thread. static int try_enter(cri_info_t *info) { cri_atomic_t *count = &info->cr_cs_count; int old; // First advance the counter do { old = (int)cri_atomic_read(count); } while (!cri_cmp_swap(count, old, old + 1)); if (old > 1) { // Not the outermost, so proceed normally cri_red_lock(&cri_cs_lock); } else if (cri_atomic_read(&cri_live_count) || cri_red_trylock(&cri_cs_lock)) { // PENDING - let it proceed if ready, but retry regardless #if 1 /* XXX: What the heck is this?? This is a no-op that causes the kernel to re-evaluate the set of pending signals. It is a work around for some lost signals I sometimes encounter. The real problem is most likely somewhere on the kernel side of things. */ sigset_t mask; sigemptyset(&mask); sigprocmask(SIG_UNBLOCK, &mask, NULL); #endif poll_checkpoint(info); /* decrements counter as a side effect */ return 0; } // else lock was acquired by the cri_read_trylock in the conditional. return 1; } // XXX: Unused 'id' argument should be used for debugging. // XXX: we could also double check that (id == CR_ID_CALLBACK) // if and only if the state is CR_STATE_ACTIVE. // // Returns the current state. // // Signal safe because if a signal takes us into the ACTIVE state // it will also leave the ACTIVE state before we regain control. // // NOTE: Now "internal" rather than "private" int cri_do_enter(cri_info_t *info, cr_client_id_t id) { int state; state = cri_atomic_read(&info->cr_state); if (state != CR_STATE_ACTIVE) { CRI_WHILE_COND_YIELD(!try_enter(info)); } return state; } // XXX: Unused 'id' argument should be used for debugging. // XXX: we could also double check that (id == CR_ID_CALLBACK) // if and only if the state is CR_STATE_ACTIVE. // // Returns non-zero on successful entry // // Signal safe because if a signal takes us into the ACTIVE state // it will also leave the ACTIVE state before we regain control. // // NOTE: Now "internal" rather than "private" int cri_do_tryenter(cri_info_t *info, cr_client_id_t id) { return ((cri_atomic_read(&info->cr_state) == CR_STATE_ACTIVE) || try_enter(info)); } // XXX: Unused 'id' argument should be used for debugging. // // NOTE: Now "internal" rather than "private" void cri_do_leave(cri_info_t *info, cr_client_id_t id) { if (cri_atomic_read(&info->cr_state) != CR_STATE_ACTIVE) { cri_red_unlock(&cri_cs_lock); poll_checkpoint(info); } } // Not reentrant. Must be called inside a critical section. static cr_callback_id_t cri_register_signal(cri_info_t* info, cr_callback_t func, void* arg, int flags) { return cri_do_register(info, func, arg, flags); } // Not reentrant. Must be called inside a critical section. static int cri_replace_signal(cri_info_t *info, cr_callback_id_t id, cr_callback_t func, void* arg, int flags) { return cri_do_replace(info, id, func, arg, flags); } // // "Public" data // // // "Public" functions // // Not reentrant. Must be called inside a critical section. cr_callback_id_t cri_do_register(cri_info_t *info, cr_callback_t func, void* arg, int flags) { int indx = info->cr_cb_count; if (indx < CR_MAX_CALLBACKS) { int next = indx + 1; // Grow on demand info->cr_cb = realloc(info->cr_cb, next * sizeof(*info->cr_cb)); if (!info->cr_cb) { // Assume that errno==ENOMEM as required Unix98 standard return -1; } // Set entry before advancing the count info->cr_cb[indx].func = func; info->cr_cb[indx].arg = arg; info->cr_cb[indx].flags = flags; info->cr_cb_count = next; return indx; } else { errno = ENOSPC; return -1; } } // Note that we don't replace 'func', 'arg' and 'flags' atomically. // Note that we ensure the context is not changed. // Such atomicity is the responsibility of the caller. // // Not reentrant. Must be called inside a critical section. // Not exposed to user. int cri_do_replace(cri_info_t *info, cr_callback_id_t id, cr_callback_t func, void* arg, int flags) { int retval = -1; errno = EINVAL; if ((flags & CRI_CONTEXT_MASK) == (id & CRI_CONTEXT_MASK)) { id &= ~CRI_CONTEXT_MASK; if ((id >= 0) && (id < info->cr_cb_count)) { info->cr_cb[id].func = func; info->cr_cb[id].arg = arg; info->cr_cb[id].flags = flags; retval = 0; } else { /* id out-of-bounds */ } } else { /* Context mismatch */ } return retval; } cr_callback_id_t cr_register_callback(cr_callback_t func, void* arg, int flags) { cri_info_t *info = CRI_INFO_OR_RETURN(-1); // thread-specific int context = 0; // silence a "used uninitialized" warning int retval = -1; // assume failure int state; state = cri_do_enter(info, CRI_ID_INTERNAL); errno = EBUSY; if (state == CR_STATE_ACTIVE) { // Called from a callback! retval and errno are already set goto out; } errno = EINVAL; context = flags & CRI_CONTEXT_MASK; switch (context) { case CR_SIGNAL_CONTEXT: retval = cri_register_signal(info, func, arg, flags); break; case CR_THREAD_CONTEXT: retval = cri_register_thread(info, func, arg, flags); break; //default: Bad flags! retval and errno are already set } out: cri_do_leave(info, CRI_ID_INTERNAL); return (retval >= 0) ? (retval | context) : retval; } // Not reentrant. int cr_replace_callback(cr_callback_id_t id, cr_callback_t func, void* arg, int flags) { cri_info_t *info = CRI_INFO_OR_RETURN(-1); // thread-specific int retval = -1; // Assume failure int state; state = cri_do_enter(info, CRI_ID_INTERNAL); errno = EBUSY; if (state == CR_STATE_ACTIVE) { // Called from a callback! retval and errno are already set goto out; } errno = EINVAL; switch (flags & CRI_CONTEXT_MASK) { case CR_SIGNAL_CONTEXT: retval = cri_replace_signal(info, id, func, arg, flags); break; case CR_THREAD_CONTEXT: retval = cri_replace_thread(info, id, func, arg, flags); break; //default: Bad flags! retval and errno are already set } out: cri_do_leave(info, CRI_ID_INTERNAL); return retval; } // Not reentrant. int cr_replace_self(cr_callback_t func, void* arg, int flags) { cri_info_t *info = CRI_CB_INFO_OR_RETURN(-1); // thread-specific cr_callback_id_t id; /* form the full id from the index and context */ id = info->run.id; id |= (info->cr_cb[id].flags & CRI_CONTEXT_MASK); return cri_do_replace(info, id, func, arg, flags); } int cr_status(void) { cri_info_t *info = CRI_INFO_OR_RETURN(-1); // thread-specific return do_state(info); } // XXX: Unused 'id' argument should be used for debugging. int cr_enter_cs(cr_client_id_t id) { cri_info_t *info = CRI_INFO_OR_RETURN(-1); // thread-specific cri_do_enter(info, id); return 0; } // XXX: Unused 'id' argument should be used for debugging. int cr_tryenter_cs(cr_client_id_t id) { cri_info_t *info = CRI_INFO_OR_RETURN(-1); // thread-specific return !cri_do_tryenter(info, id); } // XXX: Unused 'id' argument should be used for debugging. int cr_leave_cs(cr_client_id_t id) { cri_info_t *info = CRI_INFO_OR_RETURN(-1); // thread-specific cri_do_leave(info, id); return 0; } // Return address of the per-checkpoint/per-thread info const struct cr_checkpoint_info * cr_get_checkpoint_info(void) { cri_info_t *info = cri_info_location(); // thread-specific struct cr_checkpoint_info *result; if (!info || cri_atomic_read(&info->cr_state) != CR_STATE_ACTIVE) { return NULL; } result = &(info->cr_checkpoint_info); if (result->dest == NULL) { struct cr_chkpt_info tmp; int rc; tmp.dest = info->path; rc = cri_syscall_token(info->run.token, CR_OP_HAND_CHKPT_INFO, (uintptr_t)&tmp); if (rc != 0) { CRI_ABORT("CR_OP_HAND_CHKPT_INFO returned w/ errno=%d", errno); } result->requester = tmp.requester; result->target = tmp.target; result->scope = tmp.scope; result->signal = tmp.signal; result->dest = tmp.dest; LIBCR_TRACE(LIBCR_TRACE_INFO, "requester=%d target=%d scope=%d signal=%d dest='%s'", tmp.requester, tmp.target, tmp.scope, tmp.signal, tmp.dest); } return result; } // Return address of the per-restart/per-thread info const struct cr_restart_info * cr_get_restart_info(void) { cri_info_t *info = cri_info_location(); // thread-specific struct cr_restart_info *result; if (!info || cri_atomic_read(&info->cr_state) != CR_STATE_ACTIVE) { return NULL; } result = &(info->cr_restart_info); result->requester = info->run.rc; // Pid of cr_restart was returned from syscall if (result->src == NULL) { int rc = cri_syscall_token(info->run.token, CR_OP_HAND_SRC, (uintptr_t)info->path); if (rc != 0) { CRI_ABORT("CR_OP_HAND_SRC returned w/ errno=%d", errno); } result->src = info->path; } return result; } // Return a client identifier used to invoke cr_{enter,leave}_cs(). // Also registers the handler on first call per thread. // May later setup additional state. cr_client_id_t cr_init(void) { cri_info_t *info; int token; int rc; // First establish connection to verify that we have kernel support token = cri_connect(); if (token < 0) { return token; } info = cri_info_init(); // thread-specific if (!info->handler) { // Set the handler info->handler = &my_handler; // Register ourself with the kernel do { rc = cri_syscall_token(token, CR_OP_HAND_PHASE2, token); } while ((rc < 0) && (errno == EAGAIN)); if (rc != 0) { CRI_ABORT("CR_OP_HAND_PHASE2 returned w/ errno = %d", errno); } } return info->next_id++; } // Read and potentialy write info->hold // This controls whether the post-handler barrier is blocking or not. int cr_hold_ctrl(int scope, int flags) { cri_info_t *info = CRI_INFO_OR_RETURN(-1); // thread-specific cri_atomic_t *p; int oldval; switch (scope) { case CR_HOLD_SCOPE_THREAD: p = &info->hold; break; case CR_HOLD_SCOPE_INIT: p = &cri_hold_init; break; case CR_HOLD_SCOPE_UNINIT: p = &cri_hold_uninit; break; default: errno = EINVAL; return -1; } oldval = cri_atomic_read(p); if (flags == CR_HOLD_READ) { // Nothing more to do } else if (!(flags & ~CR_HOLD_BOTH) || ((scope == CR_HOLD_SCOPE_THREAD) && (flags == CR_HOLD_DFLT))) { /* ensure meaningful oldval in presence of threads and signals: */ while (!cri_cmp_swap(p, oldval, flags)) { oldval = cri_atomic_read(p); } } else { errno = EINVAL; oldval = -1; } return oldval; } blcr-0.8.5/libcr/cr_sig_sync.c0000664000000000000000000000565410156406451013114 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2003, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 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 * Library 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * $Id: cr_sig_sync.c,v 1.10 2004/12/10 20:55:05 phargrov Exp $ * * * cr_sig_sync.c: routines for signal-safe synchronization */ #include "cr_private.h" #define CRI_SL_DEBUG 0 #define CRI_SL_LOCKED 0x27182818U /* decimal digits of e */ #define CRI_SL_UNLOCKED CR_SPINLOCK_INITIALIZER void cr_spinlock_init(cr_spinlock_t *x) { cri_atomic_t *p = (cri_atomic_t *)x; cri_atomic_write(p, CRI_SL_UNLOCKED); } void cr_spinlock_lock(cr_spinlock_t *x) { cri_atomic_t *p = (cri_atomic_t *)x; if (!cri_cmp_swap(p, CRI_SL_UNLOCKED, CRI_SL_LOCKED)) { #if CRI_SL_DEBUG cri_atomic_t tmp = cri_atomic_read(p); if ((tmp != CRI_SL_LOCKED) && (tmp != CRI_SL_UNLOCKED)) { CRI_ABORT("Spinlock %p has invalid state %x", p, tmp); } #endif CRI_DO_YIELD_WHILE_COND(!cri_cmp_swap(p, CRI_SL_UNLOCKED, CRI_SL_LOCKED)); } } void cr_spinlock_unlock(cr_spinlock_t *x) { cri_atomic_t *p = (cri_atomic_t *)x; #if CRI_SL_DEBUG if (!cri_cmp_swap(p, CRI_SL_LOCKED, CRI_SL_UNLOCKED)) { cri_atomic_t tmp = cri_atomic_read(p); if (tmp == CRI_SL_UNLOCKED) { CRI_ABORT("Spinlock %p is not locked", p); } else { CRI_ABORT("Spinlock %p has invalid state %x", p, tmp); } } #else cri_atomic_write(p, CRI_SL_UNLOCKED); #endif } int cr_spinlock_trylock(cr_spinlock_t *x) { cri_atomic_t *p = (cri_atomic_t *)x; int retval; retval = cri_cmp_swap(p, CRI_SL_UNLOCKED, CRI_SL_LOCKED); #if CRI_SL_DEBUG if (!retval) { cri_atomic_t tmp = cri_atomic_read(p); if ((tmp != CRI_SL_LOCKED) && (tmp != CRI_SL_UNLOCKED)) { CRI_ABORT("Spinlock %p has invalid state %x", p, tmp); } } #endif return retval; } int cri_barrier_enter(cri_atomic_t *p) { int retval; retval = cri_atomic_dec_and_test(p); if (!retval) { CRI_DO_YIELD_WHILE_COND(cri_atomic_read(p)); } return retval; } blcr-0.8.5/libcr/Makefile.in0000664000000000000000000012046212102070010012463 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ 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 = libcr DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/blcr_config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__installdirs = "$(DESTDIR)$(libdir)" LTLIBRARIES = $(lib_LTLIBRARIES) libcr_la_DEPENDENCIES = am__libcr_la_SOURCES_DIST = cr_ftb.c cr_async.c cr_core.c cr_cs.c \ cr_pthread.c cr_sig_sync.c cr_syscall.c cr_trace.c \ cr_strerror.c cr_request.c cr_omit.c cr_run.c @CR_HAVE_FTB_TRUE@am__objects_1 = libcr_la-cr_ftb.lo am_libcr_la_OBJECTS = $(am__objects_1) libcr_la-cr_async.lo \ libcr_la-cr_core.lo libcr_la-cr_cs.lo libcr_la-cr_pthread.lo \ libcr_la-cr_sig_sync.lo libcr_la-cr_syscall.lo \ libcr_la-cr_trace.lo libcr_la-cr_strerror.lo \ libcr_la-cr_request.lo libcr_la-cr_omit.lo libcr_la-cr_run.lo libcr_la_OBJECTS = $(am_libcr_la_OBJECTS) libcr_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(libcr_la_CFLAGS) $(CFLAGS) \ $(libcr_la_LDFLAGS) $(LDFLAGS) -o $@ libcr_omit_la_DEPENDENCIES = am__libcr_omit_la_SOURCES_DIST = cr_omit.c cr_trace.c cr_sig_sync.c @LIBCR_TRACING_TRUE@am__objects_2 = libcr_omit_la-cr_trace.lo \ @LIBCR_TRACING_TRUE@ libcr_omit_la-cr_sig_sync.lo am_libcr_omit_la_OBJECTS = libcr_omit_la-cr_omit.lo $(am__objects_2) libcr_omit_la_OBJECTS = $(am_libcr_omit_la_OBJECTS) libcr_omit_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(libcr_omit_la_CFLAGS) \ $(CFLAGS) $(libcr_omit_la_LDFLAGS) $(LDFLAGS) -o $@ libcr_run_la_DEPENDENCIES = am__libcr_run_la_SOURCES_DIST = cr_run.c cr_trace.c cr_sig_sync.c @LIBCR_TRACING_TRUE@am__objects_3 = libcr_run_la-cr_trace.lo \ @LIBCR_TRACING_TRUE@ libcr_run_la-cr_sig_sync.lo am_libcr_run_la_OBJECTS = libcr_run_la-cr_run.lo $(am__objects_3) libcr_run_la_OBJECTS = $(am_libcr_run_la_OBJECTS) libcr_run_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(libcr_run_la_CFLAGS) \ $(CFLAGS) $(libcr_run_la_LDFLAGS) $(LDFLAGS) -o $@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/./config/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libcr_la_SOURCES) $(libcr_omit_la_SOURCES) \ $(libcr_run_la_SOURCES) DIST_SOURCES = $(am__libcr_la_SOURCES_DIST) \ $(am__libcr_omit_la_SOURCES_DIST) \ $(am__libcr_run_la_SOURCES_DIST) HEADERS = $(noinst_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CONFIGURE_ARGS = @CONFIGURE_ARGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CR_ARCH = @CR_ARCH@ CR_CLIENT_LDADD = @CR_CLIENT_LDADD@ CR_CPU = @CR_CPU@ CR_FTB_INCLUDES = @CR_FTB_INCLUDES@ CR_FTB_LDADD = @CR_FTB_LDADD@ CR_FTB_LDFLAGS = @CR_FTB_LDFLAGS@ CR_KARCH = @CR_KARCH@ CR_KERNEL = @CR_KERNEL@ CR_KERNEL_BASE = @CR_KERNEL_BASE@ CR_LIBARCH = @CR_LIBARCH@ CR_LIBCR_CFLAGS = @CR_LIBCR_CFLAGS@ CR_MODULE_DIR = @CR_MODULE_DIR@ CR_MODULE_MAJOR = @CR_MODULE_MAJOR@ CR_MODULE_MINOR = @CR_MODULE_MINOR@ CR_MODULE_PATCH = @CR_MODULE_PATCH@ CR_MODULE_VERSION = @CR_MODULE_VERSION@ CR_NDEBUG = @CR_NDEBUG@ CR_RELEASE_MAJOR = @CR_RELEASE_MAJOR@ CR_RELEASE_MINOR = @CR_RELEASE_MINOR@ CR_RELEASE_PATCH = @CR_RELEASE_PATCH@ CR_RELEASE_VERSION = @CR_RELEASE_VERSION@ CR_SIGNUM = @CR_SIGNUM@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GMAKE_ELSE = @GMAKE_ELSE@ GMAKE_ENDIF = @GMAKE_ENDIF@ GMAKE_IFEQ = @GMAKE_IFEQ@ GMAKE_IFNEQ = @GMAKE_IFNEQ@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KBUILD_MAK = @KBUILD_MAK@ KBUILD_MAKE_ARGS = @KBUILD_MAKE_ARGS@ KCC = @KCC@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBCR_MAJOR = @LIBCR_MAJOR@ LIBCR_MINOR = @LIBCR_MINOR@ LIBCR_PATCH = @LIBCR_PATCH@ LIBCR_VERSION = @LIBCR_VERSION@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_AGE = @LIBTOOL_AGE@ LIBTOOL_INTERFACE = @LIBTOOL_INTERFACE@ LIBTOOL_REVISION = @LIBTOOL_REVISION@ LINUX_OBJ = @LINUX_OBJ@ LINUX_SRC = @LINUX_SRC@ LINUX_SYMTAB_CMD = @LINUX_SYMTAB_CMD@ LINUX_SYMTAB_CONF = @LINUX_SYMTAB_CONF@ LINUX_SYMTAB_FILE = @LINUX_SYMTAB_FILE@ LINUX_VER = @LINUX_VER@ LINUX_VERSION_H = @LINUX_VERSION_H@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKE = @MAKE@ MAKEINFO = @MAKEINFO@ 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_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PWD_PROG = @PWD_PROG@ RANLIB = @RANLIB@ RPMBUILD = @RPMBUILD@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TOP_BUILDDIR = @TOP_BUILDDIR@ TOP_SRCDIR = @TOP_SRCDIR@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ 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@ lt_ECHO = @lt_ECHO@ 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@ lib_LTLIBRARIES = libcr.la libcr_run.la libcr_omit.la CR_LIB_VERSION = -version-info @LIBTOOL_INTERFACE@:@LIBTOOL_REVISION@:@LIBTOOL_AGE@ noinst_HEADERS = \ cr_syscall.h\ cr_private.h\ cr_rb_lock.h\ cr_trace.h\ cr_yield.h @CR_HAVE_FTB_TRUE@libcr_ftb_sources = cr_ftb.c libcr_la_SOURCES = \ $(libcr_ftb_sources) \ cr_async.c\ cr_core.c\ cr_cs.c\ cr_pthread.c\ cr_sig_sync.c\ cr_syscall.c\ cr_trace.c\ cr_strerror.c\ cr_request.c\ cr_omit.c\ cr_run.c libcr_la_LIBADD = -ldl -lpthread @CR_FTB_LDADD@ libcr_la_LDFLAGS = $(CR_LIB_VERSION) @CR_FTB_LDFLAGS@ libcr_la_CFLAGS = @CR_LIBCR_CFLAGS@ @CR_FTB_INCLUDES@ $(AM_CFLAGS) @LIBCR_TRACING_TRUE@libcr_tracing = cr_trace.c cr_sig_sync.c # "target" libs libcr_run_la_SOURCES = cr_run.c $(libcr_tracing) libcr_run_la_LIBADD = -ldl libcr_run_la_LDFLAGS = $(CR_LIB_VERSION) libcr_run_la_CFLAGS = @CR_LIBCR_CFLAGS@ $(AM_CFLAGS) -DLIBCR_SIGNAL_ONLY libcr_omit_la_SOURCES = cr_omit.c $(libcr_tracing) libcr_omit_la_LIBADD = -ldl libcr_omit_la_LDFLAGS = $(CR_LIB_VERSION) libcr_omit_la_CFLAGS = @CR_LIBCR_CFLAGS@ $(AM_CFLAGS) -DLIBCR_SIGNAL_ONLY # Curently only do this for a debug build, due to fragile nm and grep arguments @CRI_DEBUG_TRUE@@CR_ENABLE_SHARED_TRUE@cr_lib_check = cr_lib_check INCLUDES = \ -D_GNU_SOURCE\ -D_REENTRANT\ -I$(top_builddir)/include\ -I$(top_srcdir)/include\ -I$(srcdir)/arch/@CR_LIBARCH@/ EXTRA_DIST = arch license.txt cr_libinit.c all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign libcr/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign libcr/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) test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)" @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 " $(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)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libcr.la: $(libcr_la_OBJECTS) $(libcr_la_DEPENDENCIES) $(libcr_la_LINK) -rpath $(libdir) $(libcr_la_OBJECTS) $(libcr_la_LIBADD) $(LIBS) libcr_omit.la: $(libcr_omit_la_OBJECTS) $(libcr_omit_la_DEPENDENCIES) $(libcr_omit_la_LINK) -rpath $(libdir) $(libcr_omit_la_OBJECTS) $(libcr_omit_la_LIBADD) $(LIBS) libcr_run.la: $(libcr_run_la_OBJECTS) $(libcr_run_la_DEPENDENCIES) $(libcr_run_la_LINK) -rpath $(libdir) $(libcr_run_la_OBJECTS) $(libcr_run_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcr_la-cr_async.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcr_la-cr_core.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcr_la-cr_cs.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcr_la-cr_ftb.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcr_la-cr_omit.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcr_la-cr_pthread.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcr_la-cr_request.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcr_la-cr_run.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcr_la-cr_sig_sync.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcr_la-cr_strerror.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcr_la-cr_syscall.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcr_la-cr_trace.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcr_omit_la-cr_omit.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcr_omit_la-cr_sig_sync.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcr_omit_la-cr_trace.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcr_run_la-cr_run.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcr_run_la-cr_sig_sync.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcr_run_la-cr_trace.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< libcr_la-cr_ftb.lo: cr_ftb.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcr_la_CFLAGS) $(CFLAGS) -MT libcr_la-cr_ftb.lo -MD -MP -MF $(DEPDIR)/libcr_la-cr_ftb.Tpo -c -o libcr_la-cr_ftb.lo `test -f 'cr_ftb.c' || echo '$(srcdir)/'`cr_ftb.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libcr_la-cr_ftb.Tpo $(DEPDIR)/libcr_la-cr_ftb.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cr_ftb.c' object='libcr_la-cr_ftb.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcr_la_CFLAGS) $(CFLAGS) -c -o libcr_la-cr_ftb.lo `test -f 'cr_ftb.c' || echo '$(srcdir)/'`cr_ftb.c libcr_la-cr_async.lo: cr_async.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcr_la_CFLAGS) $(CFLAGS) -MT libcr_la-cr_async.lo -MD -MP -MF $(DEPDIR)/libcr_la-cr_async.Tpo -c -o libcr_la-cr_async.lo `test -f 'cr_async.c' || echo '$(srcdir)/'`cr_async.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libcr_la-cr_async.Tpo $(DEPDIR)/libcr_la-cr_async.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cr_async.c' object='libcr_la-cr_async.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcr_la_CFLAGS) $(CFLAGS) -c -o libcr_la-cr_async.lo `test -f 'cr_async.c' || echo '$(srcdir)/'`cr_async.c libcr_la-cr_core.lo: cr_core.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcr_la_CFLAGS) $(CFLAGS) -MT libcr_la-cr_core.lo -MD -MP -MF $(DEPDIR)/libcr_la-cr_core.Tpo -c -o libcr_la-cr_core.lo `test -f 'cr_core.c' || echo '$(srcdir)/'`cr_core.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libcr_la-cr_core.Tpo $(DEPDIR)/libcr_la-cr_core.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cr_core.c' object='libcr_la-cr_core.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcr_la_CFLAGS) $(CFLAGS) -c -o libcr_la-cr_core.lo `test -f 'cr_core.c' || echo '$(srcdir)/'`cr_core.c libcr_la-cr_cs.lo: cr_cs.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcr_la_CFLAGS) $(CFLAGS) -MT libcr_la-cr_cs.lo -MD -MP -MF $(DEPDIR)/libcr_la-cr_cs.Tpo -c -o libcr_la-cr_cs.lo `test -f 'cr_cs.c' || echo '$(srcdir)/'`cr_cs.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libcr_la-cr_cs.Tpo $(DEPDIR)/libcr_la-cr_cs.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cr_cs.c' object='libcr_la-cr_cs.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcr_la_CFLAGS) $(CFLAGS) -c -o libcr_la-cr_cs.lo `test -f 'cr_cs.c' || echo '$(srcdir)/'`cr_cs.c libcr_la-cr_pthread.lo: cr_pthread.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcr_la_CFLAGS) $(CFLAGS) -MT libcr_la-cr_pthread.lo -MD -MP -MF $(DEPDIR)/libcr_la-cr_pthread.Tpo -c -o libcr_la-cr_pthread.lo `test -f 'cr_pthread.c' || echo '$(srcdir)/'`cr_pthread.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libcr_la-cr_pthread.Tpo $(DEPDIR)/libcr_la-cr_pthread.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cr_pthread.c' object='libcr_la-cr_pthread.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcr_la_CFLAGS) $(CFLAGS) -c -o libcr_la-cr_pthread.lo `test -f 'cr_pthread.c' || echo '$(srcdir)/'`cr_pthread.c libcr_la-cr_sig_sync.lo: cr_sig_sync.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcr_la_CFLAGS) $(CFLAGS) -MT libcr_la-cr_sig_sync.lo -MD -MP -MF $(DEPDIR)/libcr_la-cr_sig_sync.Tpo -c -o libcr_la-cr_sig_sync.lo `test -f 'cr_sig_sync.c' || echo '$(srcdir)/'`cr_sig_sync.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libcr_la-cr_sig_sync.Tpo $(DEPDIR)/libcr_la-cr_sig_sync.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cr_sig_sync.c' object='libcr_la-cr_sig_sync.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcr_la_CFLAGS) $(CFLAGS) -c -o libcr_la-cr_sig_sync.lo `test -f 'cr_sig_sync.c' || echo '$(srcdir)/'`cr_sig_sync.c libcr_la-cr_syscall.lo: cr_syscall.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcr_la_CFLAGS) $(CFLAGS) -MT libcr_la-cr_syscall.lo -MD -MP -MF $(DEPDIR)/libcr_la-cr_syscall.Tpo -c -o libcr_la-cr_syscall.lo `test -f 'cr_syscall.c' || echo '$(srcdir)/'`cr_syscall.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libcr_la-cr_syscall.Tpo $(DEPDIR)/libcr_la-cr_syscall.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cr_syscall.c' object='libcr_la-cr_syscall.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcr_la_CFLAGS) $(CFLAGS) -c -o libcr_la-cr_syscall.lo `test -f 'cr_syscall.c' || echo '$(srcdir)/'`cr_syscall.c libcr_la-cr_trace.lo: cr_trace.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcr_la_CFLAGS) $(CFLAGS) -MT libcr_la-cr_trace.lo -MD -MP -MF $(DEPDIR)/libcr_la-cr_trace.Tpo -c -o libcr_la-cr_trace.lo `test -f 'cr_trace.c' || echo '$(srcdir)/'`cr_trace.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libcr_la-cr_trace.Tpo $(DEPDIR)/libcr_la-cr_trace.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cr_trace.c' object='libcr_la-cr_trace.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcr_la_CFLAGS) $(CFLAGS) -c -o libcr_la-cr_trace.lo `test -f 'cr_trace.c' || echo '$(srcdir)/'`cr_trace.c libcr_la-cr_strerror.lo: cr_strerror.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcr_la_CFLAGS) $(CFLAGS) -MT libcr_la-cr_strerror.lo -MD -MP -MF $(DEPDIR)/libcr_la-cr_strerror.Tpo -c -o libcr_la-cr_strerror.lo `test -f 'cr_strerror.c' || echo '$(srcdir)/'`cr_strerror.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libcr_la-cr_strerror.Tpo $(DEPDIR)/libcr_la-cr_strerror.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cr_strerror.c' object='libcr_la-cr_strerror.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcr_la_CFLAGS) $(CFLAGS) -c -o libcr_la-cr_strerror.lo `test -f 'cr_strerror.c' || echo '$(srcdir)/'`cr_strerror.c libcr_la-cr_request.lo: cr_request.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcr_la_CFLAGS) $(CFLAGS) -MT libcr_la-cr_request.lo -MD -MP -MF $(DEPDIR)/libcr_la-cr_request.Tpo -c -o libcr_la-cr_request.lo `test -f 'cr_request.c' || echo '$(srcdir)/'`cr_request.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libcr_la-cr_request.Tpo $(DEPDIR)/libcr_la-cr_request.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cr_request.c' object='libcr_la-cr_request.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcr_la_CFLAGS) $(CFLAGS) -c -o libcr_la-cr_request.lo `test -f 'cr_request.c' || echo '$(srcdir)/'`cr_request.c libcr_la-cr_omit.lo: cr_omit.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcr_la_CFLAGS) $(CFLAGS) -MT libcr_la-cr_omit.lo -MD -MP -MF $(DEPDIR)/libcr_la-cr_omit.Tpo -c -o libcr_la-cr_omit.lo `test -f 'cr_omit.c' || echo '$(srcdir)/'`cr_omit.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libcr_la-cr_omit.Tpo $(DEPDIR)/libcr_la-cr_omit.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cr_omit.c' object='libcr_la-cr_omit.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcr_la_CFLAGS) $(CFLAGS) -c -o libcr_la-cr_omit.lo `test -f 'cr_omit.c' || echo '$(srcdir)/'`cr_omit.c libcr_la-cr_run.lo: cr_run.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcr_la_CFLAGS) $(CFLAGS) -MT libcr_la-cr_run.lo -MD -MP -MF $(DEPDIR)/libcr_la-cr_run.Tpo -c -o libcr_la-cr_run.lo `test -f 'cr_run.c' || echo '$(srcdir)/'`cr_run.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libcr_la-cr_run.Tpo $(DEPDIR)/libcr_la-cr_run.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cr_run.c' object='libcr_la-cr_run.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcr_la_CFLAGS) $(CFLAGS) -c -o libcr_la-cr_run.lo `test -f 'cr_run.c' || echo '$(srcdir)/'`cr_run.c libcr_omit_la-cr_omit.lo: cr_omit.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcr_omit_la_CFLAGS) $(CFLAGS) -MT libcr_omit_la-cr_omit.lo -MD -MP -MF $(DEPDIR)/libcr_omit_la-cr_omit.Tpo -c -o libcr_omit_la-cr_omit.lo `test -f 'cr_omit.c' || echo '$(srcdir)/'`cr_omit.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libcr_omit_la-cr_omit.Tpo $(DEPDIR)/libcr_omit_la-cr_omit.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cr_omit.c' object='libcr_omit_la-cr_omit.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcr_omit_la_CFLAGS) $(CFLAGS) -c -o libcr_omit_la-cr_omit.lo `test -f 'cr_omit.c' || echo '$(srcdir)/'`cr_omit.c libcr_omit_la-cr_trace.lo: cr_trace.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcr_omit_la_CFLAGS) $(CFLAGS) -MT libcr_omit_la-cr_trace.lo -MD -MP -MF $(DEPDIR)/libcr_omit_la-cr_trace.Tpo -c -o libcr_omit_la-cr_trace.lo `test -f 'cr_trace.c' || echo '$(srcdir)/'`cr_trace.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libcr_omit_la-cr_trace.Tpo $(DEPDIR)/libcr_omit_la-cr_trace.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cr_trace.c' object='libcr_omit_la-cr_trace.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcr_omit_la_CFLAGS) $(CFLAGS) -c -o libcr_omit_la-cr_trace.lo `test -f 'cr_trace.c' || echo '$(srcdir)/'`cr_trace.c libcr_omit_la-cr_sig_sync.lo: cr_sig_sync.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcr_omit_la_CFLAGS) $(CFLAGS) -MT libcr_omit_la-cr_sig_sync.lo -MD -MP -MF $(DEPDIR)/libcr_omit_la-cr_sig_sync.Tpo -c -o libcr_omit_la-cr_sig_sync.lo `test -f 'cr_sig_sync.c' || echo '$(srcdir)/'`cr_sig_sync.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libcr_omit_la-cr_sig_sync.Tpo $(DEPDIR)/libcr_omit_la-cr_sig_sync.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cr_sig_sync.c' object='libcr_omit_la-cr_sig_sync.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcr_omit_la_CFLAGS) $(CFLAGS) -c -o libcr_omit_la-cr_sig_sync.lo `test -f 'cr_sig_sync.c' || echo '$(srcdir)/'`cr_sig_sync.c libcr_run_la-cr_run.lo: cr_run.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcr_run_la_CFLAGS) $(CFLAGS) -MT libcr_run_la-cr_run.lo -MD -MP -MF $(DEPDIR)/libcr_run_la-cr_run.Tpo -c -o libcr_run_la-cr_run.lo `test -f 'cr_run.c' || echo '$(srcdir)/'`cr_run.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libcr_run_la-cr_run.Tpo $(DEPDIR)/libcr_run_la-cr_run.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cr_run.c' object='libcr_run_la-cr_run.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcr_run_la_CFLAGS) $(CFLAGS) -c -o libcr_run_la-cr_run.lo `test -f 'cr_run.c' || echo '$(srcdir)/'`cr_run.c libcr_run_la-cr_trace.lo: cr_trace.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcr_run_la_CFLAGS) $(CFLAGS) -MT libcr_run_la-cr_trace.lo -MD -MP -MF $(DEPDIR)/libcr_run_la-cr_trace.Tpo -c -o libcr_run_la-cr_trace.lo `test -f 'cr_trace.c' || echo '$(srcdir)/'`cr_trace.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libcr_run_la-cr_trace.Tpo $(DEPDIR)/libcr_run_la-cr_trace.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cr_trace.c' object='libcr_run_la-cr_trace.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcr_run_la_CFLAGS) $(CFLAGS) -c -o libcr_run_la-cr_trace.lo `test -f 'cr_trace.c' || echo '$(srcdir)/'`cr_trace.c libcr_run_la-cr_sig_sync.lo: cr_sig_sync.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcr_run_la_CFLAGS) $(CFLAGS) -MT libcr_run_la-cr_sig_sync.lo -MD -MP -MF $(DEPDIR)/libcr_run_la-cr_sig_sync.Tpo -c -o libcr_run_la-cr_sig_sync.lo `test -f 'cr_sig_sync.c' || echo '$(srcdir)/'`cr_sig_sync.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libcr_run_la-cr_sig_sync.Tpo $(DEPDIR)/libcr_run_la-cr_sig_sync.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cr_sig_sync.c' object='libcr_run_la-cr_sig_sync.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcr_run_la_CFLAGS) $(CFLAGS) -c -o libcr_run_la-cr_sig_sync.lo `test -f 'cr_sig_sync.c' || echo '$(srcdir)/'`cr_sig_sync.c mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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 CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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" 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 $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$(top_distdir)" distdir="$(distdir)" \ dist-hook check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) all-local installdirs: for dir in "$(DESTDIR)$(libdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 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 \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-libLTLIBRARIES install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -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 .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am all-local check check-am clean \ clean-generic clean-libLTLIBRARIES clean-libtool ctags \ dist-hook distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-libLTLIBRARIES install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-libLTLIBRARIES # XXX: should split off arch-specific portions of the symbol filter @CR_ENABLE_SHARED_TRUE@cr_lib_check: @CR_ENABLE_SHARED_TRUE@ @if (nm -D .libs/libcr_run.so | egrep -v \ @CR_ENABLE_SHARED_TRUE@ -e ' [^TDB] ' \ @CR_ENABLE_SHARED_TRUE@ -e ' [TDB] \.?crsig_' \ @CR_ENABLE_SHARED_TRUE@ -e ' [TDB] \.?cri?_run_' \ @CR_ENABLE_SHARED_TRUE@ -e ' [TD] \.?_init' \ @CR_ENABLE_SHARED_TRUE@ -e ' [TD] \.?_fini' \ @CR_ENABLE_SHARED_TRUE@ -e ' D __data_start' \ @CR_ENABLE_SHARED_TRUE@ -e ' D _edata' \ @CR_ENABLE_SHARED_TRUE@ -e ' B __bss_start' \ @CR_ENABLE_SHARED_TRUE@ -e ' B _end' \ @CR_ENABLE_SHARED_TRUE@ -e ' T _(save|rest)[gf]pr_[123][0-9](_x)?'); \ @CR_ENABLE_SHARED_TRUE@ then \ @CR_ENABLE_SHARED_TRUE@ echo "ERROR: libcr_run.so leaks symbol(s), above."; \ @CR_ENABLE_SHARED_TRUE@ exit 1; \ @CR_ENABLE_SHARED_TRUE@ fi dist-hook: find $(distdir)/arch -name CVS | xargs rm -rf all-local: $(cr_lib_check) if test -d $(top_builddir)/libcr32/libcr; then $(MAKE) $(AM_MAKEFLAGS) -C $(top_builddir)/libcr32/libcr all; 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: blcr-0.8.5/libcr/cr_libinit.c0000664000000000000000000002042512065006765012726 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2003, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 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 * Library 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * $Id: cr_libinit.c,v 1.14.6.5 2012/12/21 07:21:25 phargrov Exp $ */ #include #include #include #include #include #include #include #include #include "cr_private.h" #ifdef LIBCR_SIGNAL_ONLY /* Functions for direct syscalls */ /* These don't require any thread environment and use a caller-provided errno */ #include #include #if !CR_USE_SIGACTION cri_syscall4(int, crsig_ksigaction, __NR_rt_sigaction, int, const struct k_sigaction*, struct k_sigaction*, size_t) #endif #if LIBCR_TRACING cri_syscall2(int, crsig_nanosleep, __NR_nanosleep, const struct timespec*, struct timespec*) cri_syscall0(int, crsig_sched_yield, __NR_sched_yield) #endif #endif /* LIBCR_SIGNAL_ONLY */ /* Global var * We want this exactly once in each lib, so here is as good a place as any. */ const int cri_signum = CR_SIGNUM; /* Initialization logic. */ #if CR_USE_SIGACTION #define cri_sigaction sigaction #else #if defined(CRI_SA_RESTORER) CRI_SA_RESTORER #endif static int cri_sigaction(int signum, const struct sigaction *act, struct sigaction *oact) { struct k_sigaction ksa, oksa; int rc; if (act) { ksa.ksa_sigaction = act->sa_sigaction; memcpy(&ksa.ksa_mask, &act->sa_mask, sizeof (sigset_t)); ksa.ksa_flags = act->sa_flags; #if defined(CRI_SA_RESTORER) ksa.ksa_flags |= SA_RESTORER; ksa.ksa_restorer = &cri_sa_restorer; #endif } rc = __cri_ksigaction(signum, (act ? &ksa : NULL), (oact ? &oksa : NULL), (_NSIG/8), &errno); if (oact) { oact->sa_sigaction = oksa.ksa_sigaction; memcpy(&oact->sa_mask, &oksa.ksa_mask, sizeof (sigset_t)); oact->sa_flags = oksa.ksa_flags; oact->sa_restorer = oksa.ksa_restorer; } return rc; } #endif /* Since glibc-2.15 __nss_disable_nscd takes a callback: * void cb(size_t dbidx, struct traced_file *info) * This is our stand-in for that callback. */ static void empty_nscd_cb(size_t dbidx, void *info) { return; } /* Initialization entry point. * * We use the 'constructor' attribute to run at startup. * * TODO: This doesn't completely solve the problem: * 1) When statically linked, if no other functions from this library used, * linker won't link the library into the app, and so constructor not run. * If linking libcr and not calling any functions, then you get what you * deserve. However, since every client of libcr must call cr_init(), * we need only ensure cr_init() will reference something in cr_core.o. * In fact, cr_init() calls cri_info_init() which is in cr_core.o. * Thus we are certain that any client that actually uses the library * will include the constructor. This issue is solved. * 2) If statically linked AND started with cr_run, init function will be run * twice (and with dynamic lib having its own copy of all data structures). * This is now (almost) solved by ensuring that only the statically linked * version is ever run. This works because the shared version will * run its initializer first and the static one will overwrite the * signal handler with the one in the static library. Thus nobody * will ever invoke code in the shared library once the static lib's * constructor has run. Since this is certain to happen before main(), * we are certain that in the unlikely case that a checkpoint is * requested before the static lib's constructor runs, no callbacks * will be missed. XXX: untested * 3) We are unable to interpose on pthread_create, fork or vfork. * * For now we still build only shared libs by default. */ static void __attribute__((constructor)) cri_init(void) { static int raninit = 0; int rc; struct sigaction sa; int signum; if (raninit++) { return; } // // Initialize tracing // LIBCR_TRACE_INIT(); #ifndef LIBCR_SIGNAL_ONLY // // Initialize pthread-dependent parts if appropriate // cri_pthread_init(); #endif /* LIBCR_SIGNAL_ONLY */ // // Setup signal handler, with preference to "full" (as opposed to "stub") lib // if (CR_SIGNUM != __libc_current_sigrtmax()) { // Signal is already allocated. Should we keep or replace? void *full_handler = NULL; void *dlhandle = dlopen(NULL, RTLD_LAZY); if (dlhandle) { // Note that the preloaded one has been name-shifted full_handler = dlsym(dlhandle, "cri_sig_handler"); dlclose(dlhandle); } rc = cri_sigaction(CR_SIGNUM, NULL, &sa); if ((sa.sa_sigaction == CR_SIG_HANDLER) || (full_handler && sa.sa_sigaction == full_handler)) { // Nothing to do return; } #ifndef CR_SIG_IS_FULL // Don't displace an unrecognized handler unless we are the "full" handler else if (CR_SIG_HANDLER != full_handler) { // XXX: This will fire if one tries to preload/link both libcr_run and libcr_omit. // However, we probably need to pick a precedence there too. CRI_ABORT("Failed to reregister signal %d in process %d. " "Saw %p when expecting %p (%s) or %p (cri_sig_handler).", CR_SIGNUM, (int)getpid(), sa.sa_sigaction, CR_SIG_HANDLER, _STRINGIFY(CR_SIG_HANDLER), full_handler); } #endif } else if (CR_SIGNUM != (signum = __libc_allocate_rtsig(0))) { CRI_ABORT("Failed to allocate signal %d in process %d: got signal %d instead", CR_SIGNUM, (int)getpid(), signum); } sa.sa_sigaction = CR_SIG_HANDLER; sa.sa_flags = SA_RESTART | SA_SIGINFO; rc = sigfillset(&sa.sa_mask); if (rc != 0) { CRI_ABORT("sigfillset() failed: %s", strerror(errno)); } rc = cri_sigaction(CR_SIGNUM, &sa, NULL); if (rc != 0) { CRI_ABORT("sigaction() failed: %s", strerror(errno)); } #ifdef CR_BUILDING_OMIT // Don't try to disable NSCD #else // Disable NSCD if requested (bugs 1962 and 2560) { const char *val = getenv("LIBCR_DISABLE_NSCD"); if (val && val[0]) { // Exists and not the empty string #if HAVE___NSS_DISABLE_NSCD && 0 // Cannot use a GLIBC_PRIVATE symbol w/ RPMS __nss_disable_nscd(&empty_nscd_cb); #else // If not found at configure time, try via dynamic linker void *dlhandle = dlopen(NULL, RTLD_LAZY); if (dlhandle) { void (*disable_nscd)(void *) = dlsym(dlhandle, "__nss_disable_nscd"); if (disable_nscd) disable_nscd(&empty_nscd_cb); dlclose(dlhandle); } #endif } } #endif } /* One symbol (different name in each lib) to help with linking the .a * * Given the classic "Hello, World!" program (no calls to BLCR), the following * won't link libcr, since doing so wouldn't resolve any undefined symbols: * $ gcc -o hello hello.c -static -lcr -ldl -lpthread * However, the following do link libcr: * $ gcc -o hello hello.c -static -lcr -ldl -lpthread -u cr_link_me * $ gcc -o hello hello.c -static -lcr_run -ldl -u cr_run_link_me * $ gcc -o hello hello.c -static -lcr_omit -ldl -u cr_omit_link_me * * Strictly speaking, this is only needed w/ the .a, since just mentioning a .so * appears to be sufficient to get all of its constructors run. However, that * might depend on arch or binutils version. So, we provide symbols always. */ #ifndef CR_LINK_ME_VAR #error "CR_LINK_ME_VAR is undefined" #endif int CR_LINK_ME_VAR = 0; blcr-0.8.5/libcr/cr_trace.c0000664000000000000000000000656611055342027012374 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2003, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 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 * Library 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * $Id: cr_trace.c,v 1.12 2008/08/27 21:16:07 phargrov Exp $ */ #include #include #include #include #include #include #include #include #include #include "cr_private.h" #define LIBCR_TRACE_MAX 256 static char libcr_trace_buf1[LIBCR_TRACE_MAX]; static char libcr_trace_buf2[LIBCR_TRACE_MAX]; static int libcr_trace_to_syslog = -1; static int libcr_trace_fd = -1; #if LIBCR_TRACING // CHANGE THIS VALUE TO ENABLE TRACING unsigned int libcr_trace_mask = LIBCR_TRACE_NONE; void libcr_trace_init(void) { const char *mask = getenv("LIBCR_TRACE_MASK"); if (mask) { libcr_trace_mask = strtol(mask, NULL, 0); } } #endif void libcr_trace(const char *filename, int line, const char *function, const char * format, ...) { static cri_atomic_t done_init = {(unsigned int)0}; int saved_errno = errno; char *tmpname, *shortname; va_list args; int len; va_start(args, format); vsnprintf(libcr_trace_buf1, LIBCR_TRACE_MAX, format, args); va_end(args); tmpname = strdup(filename); shortname = basename(tmpname); /* check destination stuff once */ if (!cri_atomic_read(&done_init)) { static cr_spinlock_t lock = CR_SPINLOCK_INITIALIZER; cr_spinlock_lock(&lock); if (!cri_atomic_read(&done_init)) { libcr_trace_to_syslog = (getenv("LIBCR_TRACE_TO_SYSLOG") != NULL); if (!libcr_trace_to_syslog) { char *file = getenv("LIBCR_TRACE_FILE"); if (file) { libcr_trace_fd = open(file, O_WRONLY|O_APPEND|O_CREAT, 0644); } else { libcr_trace_fd = STDERR_FILENO; /* Default to stderr */ } } cri_atomic_write(&done_init, 1); } cr_spinlock_unlock(&lock); } if (libcr_trace_to_syslog) { syslog(LOG_USER|LOG_NOTICE, "[%d] %s:%d %s: %s", (int)getpid(), shortname, line, function, libcr_trace_buf1); } else { len = snprintf(libcr_trace_buf2, LIBCR_TRACE_MAX, "%s:%d %s: %s\n", shortname, line, function, libcr_trace_buf1); if (len > 0) { if (len > LIBCR_TRACE_MAX) { len = LIBCR_TRACE_MAX; } write(libcr_trace_fd, libcr_trace_buf2, len); } } free(tmpname); errno = saved_errno; } blcr-0.8.5/libcr/cr_omit.c0000664000000000000000000000575211616320154012242 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2008, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 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 * Library 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * $Id: cr_omit.c,v 1.12.8.1 2011/08/03 19:24:28 eroman Exp $ * * This file builds the "libcr_omit" target library. */ #include #include #include #include #include #include #include #include #include #include #include "cr_private.h" #define CR_SIG_HANDLER cri_omit_sig_handler #define CR_LINK_ME_VAR cr_omit_link_me #ifdef LIBCR_SIGNAL_ONLY /* Initialization logic. */ #define CR_BUILDING_OMIT #include "cr_libinit.c" #endif /* LIBCR_SIGNAL_ONLY */ // Signal handler to dispatch the request // // WARNING: Must only be called as a signal handler. // Any other calls may not return correctly (see final lines). #ifdef CR_OMIT_ASM_HANDLER CR_OMIT_ASM_HANDLER(CR_SIG_HANDLER) #else cri_syscall3(int, crsig_ioctl, CR_ASM_NR_ioctl, int, int, void*) void CR_SIG_HANDLER(int signr, siginfo_t *siginfo, void *context) { #if LIBCR_TRACING int pid = (int)getpid(); #endif int token = siginfo->si_pid; int rc, local_errno; LIBCR_TRACE(LIBCR_TRACE_INFO, "[%d] signal %d received, fd=%d", pid, signr, token); #ifdef SI_KERNEL if (siginfo->si_code != SI_KERNEL) { LIBCR_TRACE(LIBCR_TRACE_INFO, "[%d] Ignoring false signal", pid); goto out; } #endif LIBCR_TRACE(LIBCR_TRACE_INFO, "[%d] call cr_abort(OMIT)", pid); rc = crsig_ioctl(token, CR_OP_HAND_ABORT, (void *)CR_CHECKPOINT_OMIT, &local_errno); if (rc < 0) { LIBCR_TRACE(LIBCR_TRACE_INFO, "[%d] cr_abort(OMIT) failed w/ errno=%d", pid, local_errno); } LIBCR_TRACE(LIBCR_TRACE_INFO, "[%d] DONE", pid); out: // Ugh!! Bug 2003: sa_restorer might be corrupted. // So, we return "directly" when supported #if defined(cri_sigreturn) cri_sigreturn(signr, siginfo, context); #endif return; /* so "out:" is never the last statement (avoid gcc error) */ } #endif /* CR_OMIT_ASM_HANDLER */ blcr-0.8.5/libcr/cr_rb_lock.h0000664000000000000000000000647110731574442012721 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2003, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 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 * Library 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * $Id: cr_rb_lock.h,v 1.9 2007/12/17 22:33:06 phargrov Exp $ * * * Implement red/black locks * * This is like a reader-writer lock allowing multiple writers. * Red is the readers and Black is the writers. * * State == 0 Nobody holds the lock * State == +n Lock is held by n Reds * State == -n Lock is held by n Blacks */ #ifndef _CR_RB_LOCK_H #define _CR_RB_LOCK_H 1 #include "cr_atomic.h" // for cri_atomic_t // XXX: // If contention is common then look for a way to block rather than spinning // on the value of x. This would be much easier if we stopped allowing // an application/library to enter/leave critical sections from signal context. typedef cri_atomic_t cri_rb_lock_t; #define CRI_RB_LOCK_INITIALIZER {0,} // cri_rb_init() CR_INLINE void cri_rb_init(cri_rb_lock_t *x) { cri_atomic_write(x, 0); } // cri_red_lock() // // Acquires the lock by incrementing x iff (x >= 0) // CR_INLINE void cri_red_lock(cri_rb_lock_t *x) { int old; do { CRI_WHILE_COND_YIELD((old = cri_atomic_read(x)) < 0); } while (!cri_cmp_swap(x, old, old + 1)); } // cri_red_trylock() // // Acquires the lock by incrementing x iff (x >= 0) // Returns 0 on success CR_INLINE int cri_red_trylock(cri_rb_lock_t *x) { int old; do { if ((old = cri_atomic_read(x)) < 0) return 1; } while (!cri_cmp_swap(x, old, old + 1)); return 0; } // cri_red_unlock() // // Releases the lock by decrementing state CR_INLINE void cri_red_unlock(cri_rb_lock_t *x) { (void)cri_atomic_dec_and_test(x); } // cri_black_lock() // // Acquires the lock by decrementing state iff (state <= 0). CR_INLINE void cri_black_lock(cri_rb_lock_t *x) { int old; do { CRI_WHILE_COND_YIELD((old = cri_atomic_read(x)) > 0); } while (!cri_cmp_swap(x, old, old - 1)); } // cri_red_trylock() // // Acquires the lock by decrementing x iff (x <= 0) // Returns 0 on success CR_INLINE int cri_black_trylock(cri_rb_lock_t *x) { int old; do { if ((old = cri_atomic_read(x)) > 0) return 1; } while (!cri_cmp_swap(x, old, old - 1)); return 0; } // cri_black_unlock() // // Releases the lock by incrementing state CR_INLINE void cri_black_unlock(cri_rb_lock_t *x) { cri_atomic_inc(x); } #endif /* _CR_RB_LOCK_H */ blcr-0.8.5/libcr/cr_async.c0000664000000000000000000002115711145431251012402 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2008, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 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 * Library 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * $Id: cr_async.c,v 1.60.8.1 2009/02/14 02:55:37 phargrov Exp $ * * This file deals with the checkpoint thread(s) run to execute callbacks * registered as CR_THREAD_CONTEXT. * The filename "cr_async.c" is legacy from when these callbacks were * known as "asynchronous handlers". */ #include // for sigfillmask() #include // for errno #include // for pid_t #include // for getpid() and sysconf() #include "cr_private.h" // // Private data // enum { CRI_THREAD_STOPPED, CRI_THREAD_STARTING, CRI_THREAD_RUNNING, }; // Stuff for the callback thread, all protected by thread_lock: static cri_info_t *thread_info_p; static pthread_mutex_t thread_lock = PTHREAD_MUTEX_INITIALIZER; static pthread_cond_t thread_init_cond = PTHREAD_COND_INITIALIZER; static int thread_state = CRI_THREAD_STOPPED; static pthread_t my_thread; // // Private functions // // my_handler() // // Signal handler for threads running thread-context callbacks static void my_handler(int signr, siginfo_t *siginfo, void *context) { int saved_errno = errno; cri_info_t *info = cri_info_location(); // thread-specific cri_checkpoint_info_init(info); // Simply enter the PENDING state // The thread will then wake up and run the callback(s) if (cri_cmp_swap(&info->cr_state, CR_STATE_IDLE, CR_STATE_PENDING)) { cri_atomic_inc(&cri_live_count); } errno = saved_errno; } // thread_reset() // // This is a atfork callback to reset the state in the child process static void thread_reset(void) { pthread_mutex_init(&thread_lock, NULL); pthread_cond_init(&thread_init_cond, NULL); thread_state = CRI_THREAD_STOPPED; } // thread_main() // // This is the main loop of a thread running thread-context callbacks static void* thread_main(void* arg) { #if LIBCR_TRACING int pid = (int)getpid(); #endif int token; cri_info_t *info; int rc; // Find the shared fd token = cri_connect(); if (token < 0) { CRI_ABORT("cri_connect() failed"); } // Reduce false wake-ups by blocking all signals. { sigset_t mask; sigfillset(&mask); pthread_sigmask(SIG_SETMASK, &mask, NULL); } // Tell the kernel code we are a Phase I thread. // // If we race against a checkpoint request, then after the // checkpoint has been taken, the cr_syscall() fails w/ // (errno == EAGAIN) and we try again. do { rc = cri_syscall_token(token, CR_OP_HAND_PHASE1, token); } while ((rc < 0) && (errno == EAGAIN)); if (rc != 0) { CRI_ABORT("CR_OP_HAND_PHASE1 failed w/ errno = %d", errno); } // Initialize our cri_info as a PHASE1 thread. // The write to 'handler' is naturally an atomic operation. // // If a request arrives any time before 'info->handler' // is set, then the kernel and/or the signal handler will still // think we are a PHASE II thread and we'll respond to the request // from signal context. This is acceptable since we cannot possibly // have any callbacks registered until after we signal the condition // variable and subsequently release the thread_lock. info = cri_info_init(); info->is_thread = 1; info->handler = &my_handler; LIBCR_TRACE(LIBCR_TRACE_INFO, "[%d] started checkpoint thread", pid); // Wakeup the thread(s) blocked waiting for our initialization. // They can register callbacks only after we release thread_lock. // // NOTE: For the purpose of avoiding "bug2520 deadlock", this use // of pthread_mutex_lock() is equivalent to holding a critical // section because we entered "deferred" mode above when we set // info->handler. pthread_mutex_lock(&thread_lock); thread_info_p = info; thread_state = CRI_THREAD_RUNNING; pthread_cond_broadcast(&thread_init_cond); pthread_mutex_unlock(&thread_lock); while (1) { // Block until the next request (or pthread cancellation) arrives int rc = cri_syscall_token(token, CR_OP_HAND_SUSP, (uintptr_t)NULL); LIBCR_TRACE(LIBCR_TRACE_INFO, "[%d] checkpoint thread woke up", pid); if (rc && (errno != EINTR)) { CRI_ABORT("[%d] checkpoint thread wait failed (rc=%d errno=%d)", (int)getpid(), rc, errno); } // Check for cancellation. pthread_testcancel(); // Get locks cri_black_lock(&cri_cs_lock); // NOTE: For the purpose of avoiding "bug2520 deadlock", this use // of pthread_mutex_lock() is safe because cri_black_lock() has // ensured that no critical sections are held in any thread. pthread_mutex_lock(&thread_lock); // Respond to a request iff one is pending, does nothing otherwise. cri_start_checkpoint(info); // Release locks pthread_mutex_unlock(&thread_lock); cri_black_unlock(&cri_cs_lock); } // NOT REACHED return NULL; } // thread_init() // // Ensure that the thread is started exactly once. // Note that more than one thread might get here between the time the // first enters pthread_cond_wait(), thus dropping the lock, and the // time the thread gets far enough through its initialization // to acquire the lock and signal the condition variable. // // Called w/ thread_lock held and inside a critical section. static void thread_init(void) { if (thread_state != CRI_THREAD_RUNNING) { if (thread_state == CRI_THREAD_STOPPED) { int rc; rc = cri_atfork(NULL, NULL, &thread_reset); if (rc != 0) { CRI_ABORT("cri_atfork() returned %d", rc); } rc = pthread_create(&my_thread, NULL, &thread_main, NULL); #if HAVE_PTHREAD_ATTR_SETSTACKSIZE if (rc == ENOMEM) { // As per bug 2322, we try to use a smaller stack const uintptr_t pagemask = sysconf(_SC_PAGESIZE) - 1; pthread_attr_t my_attr; size_t size; // Start at half the default stack limit rc = pthread_attr_init(&my_attr); if (rc != 0) { CRI_ABORT("pthread_attr_init() returned %d", rc); } rc = pthread_attr_getstacksize(&my_attr, &size); if (rc != 0) { CRI_ABORT("pthread_attr_getstacksize() returned %d", rc); } size = ((size >> 1) + pagemask) & ~pagemask; // half and round // MAX(current, 4MB, PTHREAD_STACK_MIN) if (size < 4 * 1024 * 1024) size = 4 * 1024 * 1024; if (size < PTHREAD_STACK_MIN) size = PTHREAD_STACK_MIN; do { (void)pthread_attr_setstacksize(&my_attr, size); rc = pthread_create(&my_thread, &my_attr, &thread_main, NULL); size = ((size >> 1) + pagemask) & ~pagemask; // half and round } while ((rc == ENOMEM) && (size >= PTHREAD_STACK_MIN)); (void)pthread_attr_destroy(&my_attr); } #endif if (rc != 0) { CRI_ABORT("pthread_create() returned %d", rc); } thread_state = CRI_THREAD_STARTING; } // Wait for the thread to complete initialization before returning. while (thread_state != CRI_THREAD_RUNNING) { pthread_cond_wait(&thread_init_cond, &thread_lock); } } } // // Internal functions // // Not reentrant, but thread safe. // Must be called inside a critical section. cr_callback_id_t cri_register_thread(cri_info_t *info, cr_callback_t func, void* arg, int flags) { cr_callback_id_t result; pthread_mutex_lock(&thread_lock); thread_init(); result = cri_do_register(thread_info_p, func, arg, flags); pthread_mutex_unlock(&thread_lock); return result; } // Not reentrant, but thread safe. // Must be called inside a critical section. int cri_replace_thread(cri_info_t *info, cr_callback_id_t id, cr_callback_t func, void* arg, int flags) { int retval; pthread_mutex_lock(&thread_lock); retval = cri_do_replace(thread_info_p, id, func, arg, flags); pthread_mutex_unlock(&thread_lock); return retval; } blcr-0.8.5/libcr/cr_run.c0000664000000000000000000000567011151723005012071 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2008, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 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 * Library 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * $Id: cr_run.c,v 1.28.8.1 2009/02/27 08:36:21 phargrov Exp $ * * This file builds the "libcr_run" target library */ #include #include #include #include #include #include #include #include #include #include #include "cr_private.h" #define CR_SIG_HANDLER cri_run_sig_handler #define CR_LINK_ME_VAR cr_run_link_me #ifdef LIBCR_SIGNAL_ONLY /* Initialization logic. */ #include "cr_libinit.c" #endif /* LIBCR_SIGNAL_ONLY */ // Signal handler to dispatch the request // // WARNING: Must only be called as a signal handler. // Any other calls may not return correctly (see final lines). #ifdef CR_RUN_ASM_HANDLER CR_RUN_ASM_HANDLER(CR_SIG_HANDLER) #else cri_syscall3X(int, crsig_chkpt, CR_ASM_NR_ioctl, int, int, void*) void CR_SIG_HANDLER(int signr, siginfo_t *siginfo, void *context) { #if LIBCR_TRACING int pid = (int)getpid(); #endif int token = siginfo->si_pid; int rc, local_errno; LIBCR_TRACE(LIBCR_TRACE_INFO, "[%d] signal %d received, fd=%d", pid, signr, token); #ifdef SI_KERNEL if (siginfo->si_code != SI_KERNEL) { LIBCR_TRACE(LIBCR_TRACE_INFO, "[%d] Ignoring false signal", pid); goto out; } #endif LIBCR_TRACE(LIBCR_TRACE_INFO, "[%d] START", pid); rc = crsig_chkpt(token, CR_OP_HAND_CHKPT, (void*)_CR_CHECKPOINT_STUB, &local_errno); if (rc < 0) { LIBCR_TRACE(LIBCR_TRACE_INFO, "[%d] checkpoint failed w/ errno=%d", pid, local_errno); } LIBCR_TRACE(LIBCR_TRACE_INFO, "[%d] DONE", pid); out: // Ugh!! Bug 2003: sa_restorer might be corrupted. // So, we return "directly" when supported #if defined(cri_sigreturn) cri_sigreturn(signr, siginfo, context); #endif return; /* so "out:" is never the last statement (avoid gcc error) */ } #endif /* CR_RUN_ASM_HANDLER */ blcr-0.8.5/libcr/cr_private.h0000664000000000000000000002215612065006765012756 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2003, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 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 * Library 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * $Id: cr_private.h,v 1.107.4.4 2012/12/21 07:21:25 phargrov Exp $ */ #ifndef _CR_PRIVATE_H #define _CR_PRIVATE_H 1 #include "blcr_config.h" #include #include #include // for siginfo_t #include #include // for PATH_MAX #ifndef _STRINGIFY #define _STRINGIFY_HELPER(x) #x #define _STRINGIFY(x) _STRINGIFY_HELPER(x) #endif // Name-shift the preload lib #if defined(LIBCR_SIGNAL_ONLY) #define __cri_ksigaction crsig_ksigaction #if LIBCR_TRACING #define __cri_nanosleep crsig_nanosleep #define __cri_sched_yield crsig_sched_yield #define libcr_trace crsig_trace #define libcr_trace_init crsig_trace_init #define libcr_trace_mask crsig_trace_mask #define cri_barrier_enter crsig_barrier_enter #define cr_spinlock_init crsig_spinlock_init #define cr_spinlock_lock crsig_spinlock_lock #define cr_spinlock_trylock crsig_spinlock_trylock #define cr_spinlock_unlock crsig_spinlock_unlock #endif /* LIBCR_TRACING */ #endif /* defined(LIBCR_SIGNAL_ONLY) */ #include #include "cr_syscall.h" #include "cr_trace.h" #include "cr_atomic.h" #include "cr_yield.h" #include "cr_rb_lock.h" #include "cr_arch.h" // Default to using libc's sigaction (may override in cr_arch.h) #ifndef CR_USE_SIGACTION #define CR_USE_SIGACTION 1 #endif // Default if not provided in cr_arch.h #ifndef cri_syscall3X #define cri_syscall3X cri_syscall3 #endif // Used by internal critical sections #define CRI_ID_INTERNAL ((cr_client_id_t)(-2)) typedef void (*cri_sighandler_t)(int sig, siginfo_t *info, void *context); typedef struct cri_info_s { /* Current state */ cri_atomic_t cr_state; /* Count of critical sections */ cri_atomic_t cr_cs_count; /* Vector of registered checkpoint callbacks and their private data */ unsigned int cr_cb_count; struct { cr_callback_t func; // The function to invoke void* arg; // The argument to the function int flags; // The flags } *cr_cb; /* What identifier to return next from cr_init() */ cr_client_id_t next_id; /* What signal handler to run for this thread? */ cri_sighandler_t handler; /* Are we the thread to run thread-context callbacks? */ int is_thread; /* Hold flags for CR_OP_HAND_DONE */ cri_atomic_t hold; /* Data needed to invoke all the callbacks in order */ struct { int token; int index; /* Counts down only */ int id; /* Tracks id of running callback (down and up again) */ int rc; /* Saves the return code */ } run; /* Thread-local info about the checkpoint request */ struct cr_checkpoint_info cr_checkpoint_info; /* Thread-local info about the restart request */ struct cr_restart_info cr_restart_info; /* Do we need to keep the info past thread destruction? */ int persist; /* Space for the cr_checkpoint_info.dest and cr_restart_info.src */ char path[PATH_MAX]; } cri_info_t; // How many threads are actively trying to checkpoint (PENDING + ACTIVE) extern cri_atomic_t cri_live_count; // GLOBAL // Red-black lock for critical sections extern cri_rb_lock_t cri_cs_lock; // GLOBAL // Thread-specific data key for cr_info extern pthread_key_t cri_info_key; // GLOBAL // Default values for hold flags extern cri_atomic_t cri_hold_init; // GLOBAL extern cri_atomic_t cri_hold_uninit; // GLOBAL // Table of hooks and a macro to invoke them extern volatile cr_hook_fn_t cri_hook_tbl[CR_NUM_HOOKS]; // GLOBAL #if CRI_DEBUG #define CRI_CHECK_HOOK(_event) do { \ int _e2 = (int)(_event); \ if ((_e2 < 0) || (_e2 >= CR_NUM_HOOKS)) { \ CRI_ABORT("Invalid event number %d", _e2); \ } \ } while (0) #else #define CRI_CHECK_HOOK(_event) do {} while (0) #endif #define CRI_RUN_HOOK(_event) do { \ int _e = (int)(_event); \ cr_hook_fn_t _fn; \ CRI_CHECK_HOOK(_e); \ _fn = cri_hook_tbl[_e]; \ if (_fn) (_fn)(_e); \ } while (0) // Location of the (possibly thread-specific) cr_info #define cri_info_location() ((cri_info_t *)pthread_getspecific(cri_info_key)) // Error-handling wrappers for cri_info_location() #define CRI_INFO_OR_RETURN(_val) ({ \ cri_info_t *_tmp = cri_info_location(); \ if (!_tmp) { \ LIBCR_TRACE(LIBCR_TRACE_INFO, \ "[%d] FAIL w/ errno=CR_ENOINIT", getpid()); \ errno = CR_ENOINIT; \ return (_val); \ } \ _tmp; \ }) #define CRI_CB_INFO_OR_RETURN(_val) ({ \ cri_info_t *_tmp = cri_info_location(); \ if (!_tmp || (cri_atomic_read(&_tmp->cr_state) != CR_STATE_ACTIVE)) { \ LIBCR_TRACE(LIBCR_TRACE_INFO, \ "[%d] FAIL w/ errno=CR_ENOTCB", getpid()); \ errno = CR_ENOTCB; \ return (_val); \ } \ _tmp; \ }) // Start the checkpoint extern void cri_start_checkpoint(cri_info_t *info); // Perform pthreads-related initialization if needed. extern void cri_pthread_init(void); #if PIC && HAVE___REGISTER_ATFORK extern int cri_atfork(void (*prepare)(void), void (*parent)(void), void (*child)(void)); #else #define cri_atfork pthread_atfork #endif // Register a callback extern cr_callback_id_t cri_do_register(cri_info_t*, cr_callback_t, void*, int); extern cr_callback_id_t cri_register_thread(cri_info_t*, cr_callback_t, void*, int); // Replace a callback extern int cri_do_replace(cri_info_t*, cr_callback_id_t, cr_callback_t, void*, int); extern int cri_replace_thread(cri_info_t*, cr_callback_id_t, cr_callback_t, void*, int); // Enter/leave a critical section extern int cri_do_enter(cri_info_t *info, cr_client_id_t id); extern int cri_do_tryenter(cri_info_t *info, cr_client_id_t id); extern void cri_do_leave(cri_info_t *info, cr_client_id_t id); // Create or destroy cri_info_t extern cri_info_t* cri_info_init(void); extern void cri_info_free(void *); // Initialize checkpoint info extern void cri_checkpoint_info_init(cri_info_t *info); // cr_sig_sync.c extern int cri_barrier_enter(cri_atomic_t *x); // libc/libpthread internal routines: extern int __libc_current_sigrtmax(void); extern int __libc_allocate_rtsig(int); extern pid_t __fork(void); extern void __nss_disable_nscd(void *); // Alternate signal handlers extern void cri_run_sig_handler(int, siginfo_t *, void *); extern void cri_omit_sig_handler(int, siginfo_t *, void *); // FTB support #if HAVE_FTB && !defined(LIBCR_SIGNAL_ONLY) #include extern int cri_ftb_init(const char *client_name, const char *client_jobid); extern int cri_ftb_fini(void); extern int cri_ftb_event(FTB_event_handle_t *event_handle, const char *event_name, int len, const void *data); extern int cri_ftb_event2(FTB_event_handle_t *event_handle, const FTB_event_handle_t *orig_handle, const char *event_name, int len, const void *data); #endif // Magic voodoo to produce weak aliases with gcc > 2.7 #ifndef weak_alias # define weak_alias(name, aname) \ extern __typeof (name) aname __attribute__ ((weak, alias (#name))); #endif // Macros for making calls and looping on negative return w/ errno == EINTR #define CRI_EINTR_LOOP(__the_call) \ while (((__the_call) < 0) && (errno == EINTR)) { /* empty */ } #define __CRI_EINTR_LOOP(__the_call, __errno_p) \ while (((__the_call) < 0) && (*(__errno_p) == EINTR)) { /* empty */ } #endif blcr-0.8.5/libcr/license.txt0000664000000000000000000000147307755231454012636 00000000000000This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 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 Library 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA If you are recieving this as part of BLCR, you will find the GNU LGPL in the file COPYING.LIB in the top-level BLCR directory. blcr-0.8.5/libcr/cr_yield.h0000664000000000000000000000537111003511507012374 00000000000000/* * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c) * 2003, The Regents of the University of California, through Lawrence * Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. * * Portions may be copyrighted by others, as may be noted in specific * copyright notices within specific files. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 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 * Library 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * $Id: cr_yield.h,v 1.11 2008/04/23 01:39:19 phargrov Exp $ * * * cr_yield.h: macros for yielding */ #ifndef _CR_YIELD_H #define _CR_YIELD_H 1 #include "blcr_config.h" #include #include /* how many calls to cri_sched_yield() before sleeping */ #define CRI_MAX_YIELD 50 /* times to yield before sleeping */ /* How many nanoseconds to sleep, must be larger than 2ms or the kernel might just busy wait without yielding. */ #define CRI_SLEEP_NS 2000001 CR_INLINE void cri_yield(int *count) { static const struct timespec ts = {tv_sec: 0, tv_nsec: CRI_SLEEP_NS}; if ((*count)++ < CRI_MAX_YIELD) { /* Try to yielding to allow the lock to be released. If we have higher priority than the thread which holds the lock then this won't actually let that thread run. */ (void)__cri_sched_yield(NULL); } else { /* Try sleeping to allow the lock to be released. By sleeping for > 2ms we ensure that the kernel will actually sleep, rather than busy wait as it may for some realtime threads. */ (void)__cri_nanosleep(&ts, NULL, NULL); *count = 0; } } #if 0 # include # define CRI_YIELD_DEBUG(COND) fprintf(stderr, "Yield: " #COND "\n") #else # define CRI_YIELD_DEBUG(COND) do {} while (0) #endif #define CRI_DO_YIELD_WHILE_COND(COND) \ do { \ int _count = 0; \ do { \ CRI_YIELD_DEBUG(COND); \ cri_yield(&_count); \ } while (COND); \ } while(0) #define CRI_WHILE_COND_YIELD(COND) \ do { \ int _count = 0; \ while (COND) { \ CRI_YIELD_DEBUG(COND); \ cri_yield(&_count); \ } \ } while(0) #endif /* _CR_YIELD_H */