Codebase list libseccomp / 72de132
New upstream version 2.3.3 Felix Geyer 6 years ago
86 changed file(s) with 2796 addition(s) and 1343 deletion(s). Raw diff Collapse all Expand all
00 libseccomp: Releases
11 ===============================================================================
22 https://github.com/seccomp/libseccomp
3
4 * Version 2.3.3 - January 10, 2018
5 - Updated the syscall table for Linux v4.15-rc7
6
7 * Version 2.3.2 - February 27, 2017
8 - Achieved full compliance with the CII Best Practices program
9 - Added Travis CI builds to the GitHub repository
10 - Added code coverage reporting with the "--enable-code-coverage" configure
11 flag and added Coveralls to the GitHub repository
12 - Updated the syscall tables to match Linux v4.10-rc6+
13 - Support for building with Python v3.x
14 - Allow rules with the -1 syscall if the SCMP\_FLTATR\_API\_TSKIP attribute is
15 set to true
16 - Several small documentation fixes
317
418 * Version 2.3.1 - April 20, 2016
519 - Fixed a problem with 32-bit x86 socket syscalls on some systems
00 libseccomp: Contributors
1 ===============================================================================
1 ========================================================================
22 https://github.com/seccomp/libseccomp
33
44 Andrew Jones <drjones@redhat.com>
88 Brian Cain <brian.cain@gmail.com>
99 Colin Walters <walters@verbum.org>
1010 Corey Bryant <coreyb@linux.vnet.ibm.com>
11 David Drysdale <drysdale@google.com>
1112 Eduardo Otubo <otubo@linux.vnet.ibm.com>
1213 Eric Paris <eparis@redhat.com>
1314 Heiko Carstens <heiko.carstens@de.ibm.com>
15 Helge Deller <deller@gmx.de>
1416 Jake Edge <jake@lwn.net>
1517 Jan Engelhardt <jengelh@inai.de>
1618 Jan Willeke <willeke@linux.vnet.ibm.com>
19 Jay Guo <guojiannan@cn.ibm.com>
20 Jiannan Guo <guojiannan1101@gmail.com>
1721 Joe MacDonald <joe@deserted.net>
22 Justin Cormack <justin.cormack@docker.com>
1823 Kees Cook <keescook@chromium.org>
24 Kyle R. Conway <kyle.r.conway@gmail.com>
25 Luca Bruno <lucab@debian.org>
1926 Marcin Juszkiewicz <mjuszkiewicz@redhat.com>
2027 Marcus Meissner <meissner@suse.de>
2128 Markos Chandras <markos.chandras@imgtec.com>
2532 Mike Strosaker <strosake@linux.vnet.ibm.com>
2633 Paul Moore <paul@paul-moore.com>
2734 Serge Hallyn <serge.hallyn@ubuntu.com>
35 Tobias Klauser <tklauser@distanz.ch>
2836 Thiago Marcos P. Santos <thiago.santos@intel.com>
37 valoq <valoq@mailbox.org>
2938 Vicente Olivert Riera <Vincent.Riera@imgtec.com>
3039 Vitaly Vi Shukela <vi0oss@gmail.com>
40 Vladimir Rutsky <rutsky@users.noreply.github.com>
2121 pkgconfdir = ${libdir}/pkgconfig
2222 pkgconf_DATA = libseccomp.pc
2323
24 EXTRA_DIST = CHANGELOG CREDITS LICENSE README SUBMITTING_PATCHES
24 EXTRA_DIST = CHANGELOG CREDITS LICENSE README.md SUBMITTING_PATCHES
2525
2626 # support silent builds
2727 AM_MAKEFLAGS_0 = --quiet --no-print-directory
3535
3636 check-syntax:
3737 @./tools/check-syntax
38
39 check-code-coverage: check-build
40 ${MAKE} ${AM_MAKEFLAGS} -C tests check-code-coverage
3841
3942 if COVERITY
4043 coverity-build: clean
0 # Makefile.in generated by automake 1.14.1 from Makefile.am.
0 # Makefile.in generated by automake 1.15.1 from Makefile.am.
11 # @configure_input@
22
3 # Copyright (C) 1994-2013 Free Software Foundation, Inc.
3 # Copyright (C) 1994-2017 Free Software Foundation, Inc.
44
55 # This Makefile.in is free software; the Free Software Foundation
66 # gives unlimited permission to copy and/or distribute it,
3232 #
3333
3434 VPATH = @srcdir@
35 am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
35 am__is_gnu_make = { \
36 if test -z '$(MAKELEVEL)'; then \
37 false; \
38 elif test -n '$(MAKE_HOST)'; then \
39 true; \
40 elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
41 true; \
42 else \
43 false; \
44 fi; \
45 }
3646 am__make_running_with_option = \
3747 case $${target_option-} in \
3848 ?) ;; \
96106 build_triplet = @build@
97107 host_triplet = @host@
98108 subdir = .
99 DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
100 $(top_srcdir)/configure $(am__configure_deps) \
101 $(srcdir)/configure.h.in $(srcdir)/libseccomp.pc.in README \
102 build-aux/ar-lib build-aux/compile build-aux/config.guess \
103 build-aux/config.sub build-aux/depcomp build-aux/install-sh \
104 build-aux/missing build-aux/ltmain.sh \
105 $(top_srcdir)/build-aux/ar-lib $(top_srcdir)/build-aux/compile \
106 $(top_srcdir)/build-aux/config.guess \
107 $(top_srcdir)/build-aux/config.sub \
108 $(top_srcdir)/build-aux/install-sh \
109 $(top_srcdir)/build-aux/ltmain.sh \
110 $(top_srcdir)/build-aux/missing
111109 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
112 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
113 $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
114 $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
115 $(top_srcdir)/configure.ac
110 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_code_coverage.m4 \
111 $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
112 $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
113 $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac
116114 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
117115 $(ACLOCAL_M4)
116 DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \
117 $(am__configure_deps) $(am__DIST_COMMON)
118118 am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
119119 configure.lineno config.status.lineno
120120 mkinstalldirs = $(install_sh) -d
207207 CTAGS = ctags
208208 CSCOPE = cscope
209209 DIST_SUBDIRS = $(SUBDIRS)
210 am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/configure.h.in \
211 $(srcdir)/libseccomp.pc.in $(top_srcdir)/build-aux/ar-lib \
212 $(top_srcdir)/build-aux/compile \
213 $(top_srcdir)/build-aux/config.guess \
214 $(top_srcdir)/build-aux/config.sub \
215 $(top_srcdir)/build-aux/install-sh \
216 $(top_srcdir)/build-aux/ltmain.sh \
217 $(top_srcdir)/build-aux/missing build-aux/ar-lib \
218 build-aux/compile build-aux/config.guess build-aux/config.sub \
219 build-aux/install-sh build-aux/ltmain.sh build-aux/missing
210220 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
211221 distdir = $(PACKAGE)-$(VERSION)
212222 top_distdir = $(distdir)
263273 CC = @CC@
264274 CCDEPMODE = @CCDEPMODE@
265275 CFLAGS = @CFLAGS@
276 CODE_COVERAGE_CFLAGS = @CODE_COVERAGE_CFLAGS@
277 CODE_COVERAGE_CPPFLAGS = @CODE_COVERAGE_CPPFLAGS@
278 CODE_COVERAGE_CXXFLAGS = @CODE_COVERAGE_CXXFLAGS@
279 CODE_COVERAGE_ENABLED = @CODE_COVERAGE_ENABLED@
280 CODE_COVERAGE_LDFLAGS = @CODE_COVERAGE_LDFLAGS@
281 CODE_COVERAGE_LIBS = @CODE_COVERAGE_LIBS@
266282 CPP = @CPP@
267283 CPPFLAGS = @CPPFLAGS@
268284 CYGPATH_W = @CYGPATH_W@
277293 EGREP = @EGREP@
278294 EXEEXT = @EXEEXT@
279295 FGREP = @FGREP@
296 GCOV = @GCOV@
297 GENHTML = @GENHTML@
280298 GREP = @GREP@
281299 INSTALL = @INSTALL@
282300 INSTALL_DATA = @INSTALL_DATA@
283301 INSTALL_PROGRAM = @INSTALL_PROGRAM@
284302 INSTALL_SCRIPT = @INSTALL_SCRIPT@
285303 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
304 LCOV = @LCOV@
286305 LD = @LD@
287306 LDFLAGS = @LDFLAGS@
288307 LIBOBJS = @LIBOBJS@
376395 SUBDIRS = include src tools tests doc
377396 pkgconfdir = ${libdir}/pkgconfig
378397 pkgconf_DATA = libseccomp.pc
379 EXTRA_DIST = CHANGELOG CREDITS LICENSE README SUBMITTING_PATCHES
398 EXTRA_DIST = CHANGELOG CREDITS LICENSE README.md SUBMITTING_PATCHES
380399
381400 # support silent builds
382401 AM_MAKEFLAGS_0 = --quiet --no-print-directory
402421 echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
403422 $(am__cd) $(top_srcdir) && \
404423 $(AUTOMAKE) --foreign Makefile
405 .PRECIOUS: Makefile
406424 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
407425 @case '$?' in \
408426 *config.status*) \
640658 ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
641659 || chmod -R a+r "$(distdir)"
642660 dist-gzip: distdir
643 tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
661 tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz
644662 $(am__post_remove_distdir)
645663
646664 dist-bzip2: distdir
656674 $(am__post_remove_distdir)
657675
658676 dist-tarZ: distdir
677 @echo WARNING: "Support for distribution archives compressed with" \
678 "legacy program 'compress' is deprecated." >&2
679 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2
680 tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
681 $(am__post_remove_distdir)
682
683 dist-shar: distdir
659684 @echo WARNING: "Support for shar distribution archives is" \
660685 "deprecated." >&2
661686 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2
662 tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
663 $(am__post_remove_distdir)
664
665 dist-shar: distdir
666 @echo WARNING: "Support for distribution archives compressed with" \
667 "legacy program 'compress' is deprecated." >&2
668 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2
669 shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
687 shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz
670688 $(am__post_remove_distdir)
671689
672690 dist-zip: distdir
684702 distcheck: dist
685703 case '$(DIST_ARCHIVES)' in \
686704 *.tar.gz*) \
687 GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
705 eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\
688706 *.tar.bz2*) \
689707 bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
690708 *.tar.lz*) \
694712 *.tar.Z*) \
695713 uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
696714 *.shar.gz*) \
697 GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\
715 eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\
698716 *.zip*) \
699717 unzip $(distdir).zip ;;\
700718 esac
701719 chmod -R a-w $(distdir)
702720 chmod u+w $(distdir)
703 mkdir $(distdir)/_build $(distdir)/_inst
721 mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst
704722 chmod a-w $(distdir)
705723 test -d $(distdir)/_build || exit 0; \
706724 dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
707725 && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
708726 && am__cwd=`pwd` \
709 && $(am__cd) $(distdir)/_build \
710 && ../configure \
727 && $(am__cd) $(distdir)/_build/sub \
728 && ../../configure \
711729 $(AM_DISTCHECK_CONFIGURE_FLAGS) \
712730 $(DISTCHECK_CONFIGURE_FLAGS) \
713 --srcdir=.. --prefix="$$dc_install_base" \
731 --srcdir=../.. --prefix="$$dc_install_base" \
714732 && $(MAKE) $(AM_MAKEFLAGS) \
715733 && $(MAKE) $(AM_MAKEFLAGS) dvi \
716734 && $(MAKE) $(AM_MAKEFLAGS) check \
891909 ps ps-am tags tags-am uninstall uninstall-am \
892910 uninstall-pkgconfDATA
893911
912 .PRECIOUS: Makefile
913
894914
895915 check-build: all
896916 ${MAKE} ${AM_MAKEFLAGS} -C src check-build
898918
899919 check-syntax:
900920 @./tools/check-syntax
921
922 check-code-coverage: check-build
923 ${MAKE} ${AM_MAKEFLAGS} -C tests check-code-coverage
901924
902925 @COVERITY_TRUE@coverity-build: clean
903926 @COVERITY_TRUE@ cov-build --dir cov-int ${MAKE} ${AM_MAKEFLAGS} check-build
+0
-65
README less more
0 libseccomp: An Enhanced Seccomp (mode 2) Helper Library
1 ===============================================================================
2 https://github.com/seccomp/libseccomp
3
4 The libseccomp library provides an easy to use, platform independent, interface
5 to the Linux Kernel's syscall filtering mechanism. The libseccomp API is
6 designed to abstract away the underlying BPF based syscall filter language and
7 present a more conventional function-call based filtering interface that should
8 be familiar to, and easily adopted by, application developers.
9
10 * Online Resources
11
12 The library source repository currently lives on GitHub at the following URL:
13
14 -> https://github.com/seccomp/libseccomp
15
16 The project mailing list is currently hosted on Google Groups at the URL below,
17 please note that a Google account is not required to subscribe to the mailing
18 list.
19
20 -> https://groups.google.com/forum/#!forum/libseccomp
21 -> https://groups.google.com/forum/#!forum/libseccomp/join
22
23 * Documentation
24
25 The "doc/" directory contains all of the currently available documentation,
26 mostly in the form of manpages. The top level directory also contains a README
27 file (this file) as well as the LICENSE, CREDITS, SUBMITTING_PATCHES, and
28 CHANGELOG files.
29
30 Those who are interested in contributing to the the project are encouraged to
31 read the SUBMITTING_PATCHES in the top level directory.
32
33 * Building and Installing the Library
34
35 If you are building the libseccomp library from an official release tarball,
36 you should follow the familiar three step process used by most autotools based
37 applications:
38
39 # ./configure
40 # make [V=0|1]
41 # make install
42
43 However, if you are building the library from sources retrieved from the source
44 repository you may need to run the autogen.sh script before running configure.
45 In both cases, running "./configure -h" will display a list of build-time
46 configuration options.
47
48 * Testing the Library
49
50 There are a number of tests located in the "tests/" directory and a make target
51 which can be used to help automate their execution. If you want to run the
52 standard regression tests you can execute the following after building the
53 library:
54
55 # make check
56
57 Be warned that the test run can take a while to run and produces a lot of
58 output.
59
60 * Other Useful Tools
61
62 The "tools/" directory includes a number of tools which may be helpful in the
63 development of the library, or applications using the library. Not all of
64 these tools are installed by default.
0 An Enhanced Seccomp (seccomp-bpf) Helper Library
1 ===============================================================================
2 https://github.com/seccomp/libseccomp
3
4 [![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/608/badge)](https://bestpractices.coreinfrastructure.org/projects/608)
5 [![Build Status](https://travis-ci.org/seccomp/libseccomp.svg?branch=release-2.3)](https://travis-ci.org/seccomp/libseccomp)
6 [![Coverage Status](https://coveralls.io/repos/github/seccomp/libseccomp/badge.svg?branch=release-2.3)](https://coveralls.io/github/seccomp/libseccomp?branch=release-2.3)
7
8 The libseccomp library provides an easy to use, platform independent, interface
9 to the Linux Kernel's syscall filtering mechanism. The libseccomp API is
10 designed to abstract away the underlying BPF based syscall filter language and
11 present a more conventional function-call based filtering interface that should
12 be familiar to, and easily adopted by, application developers.
13
14 ## Online Resources
15
16 The library source repository currently lives on GitHub at the following URL:
17
18 * https://github.com/seccomp/libseccomp
19
20 The project mailing list is currently hosted on Google Groups at the URL below,
21 please note that a Google account is not required to subscribe to the mailing
22 list.
23
24 * https://groups.google.com/forum/#!forum/libseccomp
25 * https://groups.google.com/forum/#!forum/libseccomp/join
26
27 ## Documentation
28
29 The "doc/" directory contains all of the currently available documentation,
30 mostly in the form of manpages. The top level directory also contains a README
31 file (this file) as well as the LICENSE, CREDITS, SUBMITTING_PATCHES, and
32 CHANGELOG files.
33
34 Those who are interested in contributing to the the project are encouraged to
35 read the SUBMITTING_PATCHES in the top level directory.
36
37 ## Building and Installing the Library
38
39 If you are building the libseccomp library from an official release tarball,
40 you should follow the familiar three step process used by most autotools based
41 applications:
42
43 # ./configure
44 # make [V=0|1]
45 # make install
46
47 However, if you are building the library from sources retrieved from the source
48 repository you may need to run the autogen.sh script before running configure.
49 In both cases, running "./configure -h" will display a list of build-time
50 configuration options.
51
52 ## Testing the Library
53
54 There are a number of tests located in the "tests/" directory and a make target
55 which can be used to help automate their execution. If you want to run the
56 standard regression tests you can execute the following after building the
57 library:
58
59 # make check
60
61 Be warned that the test run can take a while to run and produces a lot of
62 output.
63
64 ## Developer Tools
65
66 The "tools/" directory includes a number of tools which may be helpful in the
67 development of the library, or applications using the library. Not all of
68 these tools are installed by default.
69
70 ## Bug and Vulnerability Reporting
71
72 Problems with the libseccomp library can be reported using the GitHub issue
73 tracking system or the mailing list. Those who wish to privately report
74 potential vulnerabilities can send mail to paul@paul-moore.com.
0 # generated automatically by aclocal 1.14.1 -*- Autoconf -*-
1
2 # Copyright (C) 1996-2013 Free Software Foundation, Inc.
0 # generated automatically by aclocal 1.15.1 -*- Autoconf -*-
1
2 # Copyright (C) 1996-2017 Free Software Foundation, Inc.
33
44 # This file is free software; the Free Software Foundation
55 # gives unlimited permission to copy and/or distribute it,
1919 If you have problems, you may need to regenerate the build system entirely.
2020 To do so, use the procedure documented by the package, typically 'autoreconf'.])])
2121
22 # Copyright (C) 2002-2013 Free Software Foundation, Inc.
22 # Copyright (C) 2002-2017 Free Software Foundation, Inc.
2323 #
2424 # This file is free software; the Free Software Foundation
2525 # gives unlimited permission to copy and/or distribute it,
3131 # generated from the m4 files accompanying Automake X.Y.
3232 # (This private macro should not be called outside this file.)
3333 AC_DEFUN([AM_AUTOMAKE_VERSION],
34 [am__api_version='1.14'
34 [am__api_version='1.15'
3535 dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
3636 dnl require some minimum version. Point them to the right macro.
37 m4_if([$1], [1.14.1], [],
37 m4_if([$1], [1.15.1], [],
3838 [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
3939 ])
4040
5050 # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
5151 # This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
5252 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
53 [AM_AUTOMAKE_VERSION([1.14.1])dnl
53 [AM_AUTOMAKE_VERSION([1.15.1])dnl
5454 m4_ifndef([AC_AUTOCONF_VERSION],
5555 [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
5656 _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
5757
58 # Copyright (C) 2011-2013 Free Software Foundation, Inc.
58 # Copyright (C) 2011-2017 Free Software Foundation, Inc.
5959 #
6060 # This file is free software; the Free Software Foundation
6161 # gives unlimited permission to copy and/or distribute it,
117117
118118 # AM_AUX_DIR_EXPAND -*- Autoconf -*-
119119
120 # Copyright (C) 2001-2013 Free Software Foundation, Inc.
120 # Copyright (C) 2001-2017 Free Software Foundation, Inc.
121121 #
122122 # This file is free software; the Free Software Foundation
123123 # gives unlimited permission to copy and/or distribute it,
162162 # configured tree to be moved without reconfiguration.
163163
164164 AC_DEFUN([AM_AUX_DIR_EXPAND],
165 [dnl Rely on autoconf to set up CDPATH properly.
166 AC_PREREQ([2.50])dnl
167 # expand $ac_aux_dir to an absolute path
168 am_aux_dir=`cd $ac_aux_dir && pwd`
165 [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
166 # Expand $ac_aux_dir to an absolute path.
167 am_aux_dir=`cd "$ac_aux_dir" && pwd`
169168 ])
170169
171170 # AM_CONDITIONAL -*- Autoconf -*-
172171
173 # Copyright (C) 1997-2013 Free Software Foundation, Inc.
172 # Copyright (C) 1997-2017 Free Software Foundation, Inc.
174173 #
175174 # This file is free software; the Free Software Foundation
176175 # gives unlimited permission to copy and/or distribute it,
201200 Usually this means the macro was only invoked conditionally.]])
202201 fi])])
203202
204 # Copyright (C) 1999-2013 Free Software Foundation, Inc.
203 # Copyright (C) 1999-2017 Free Software Foundation, Inc.
205204 #
206205 # This file is free software; the Free Software Foundation
207206 # gives unlimited permission to copy and/or distribute it,
392391
393392 # Generate code to set up dependency tracking. -*- Autoconf -*-
394393
395 # Copyright (C) 1999-2013 Free Software Foundation, Inc.
394 # Copyright (C) 1999-2017 Free Software Foundation, Inc.
396395 #
397396 # This file is free software; the Free Software Foundation
398397 # gives unlimited permission to copy and/or distribute it,
468467
469468 # Do all the work for Automake. -*- Autoconf -*-
470469
471 # Copyright (C) 1996-2013 Free Software Foundation, Inc.
470 # Copyright (C) 1996-2017 Free Software Foundation, Inc.
472471 #
473472 # This file is free software; the Free Software Foundation
474473 # gives unlimited permission to copy and/or distribute it,
558557 # <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
559558 # <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
560559 AC_SUBST([mkdir_p], ['$(MKDIR_P)'])
561 # We need awk for the "check" target. The system "awk" is bad on
562 # some platforms.
560 # We need awk for the "check" target (and possibly the TAP driver). The
561 # system "awk" is bad on some platforms.
563562 AC_REQUIRE([AC_PROG_AWK])dnl
564563 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
565564 AC_REQUIRE([AM_SET_LEADING_DOT])dnl
632631 END
633632 AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
634633 fi
635 fi])
634 fi
635 dnl The trailing newline in this macro's definition is deliberate, for
636 dnl backward compatibility and to allow trailing 'dnl'-style comments
637 dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841.
638 ])
636639
637640 dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not
638641 dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
661664 done
662665 echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
663666
664 # Copyright (C) 2001-2013 Free Software Foundation, Inc.
667 # Copyright (C) 2001-2017 Free Software Foundation, Inc.
665668 #
666669 # This file is free software; the Free Software Foundation
667670 # gives unlimited permission to copy and/or distribute it,
672675 # Define $install_sh.
673676 AC_DEFUN([AM_PROG_INSTALL_SH],
674677 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
675 if test x"${install_sh}" != xset; then
678 if test x"${install_sh+set}" != xset; then
676679 case $am_aux_dir in
677680 *\ * | *\ *)
678681 install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
682685 fi
683686 AC_SUBST([install_sh])])
684687
685 # Copyright (C) 2003-2013 Free Software Foundation, Inc.
688 # Copyright (C) 2003-2017 Free Software Foundation, Inc.
686689 #
687690 # This file is free software; the Free Software Foundation
688691 # gives unlimited permission to copy and/or distribute it,
703706
704707 # Check to see how 'make' treats includes. -*- Autoconf -*-
705708
706 # Copyright (C) 2001-2013 Free Software Foundation, Inc.
709 # Copyright (C) 2001-2017 Free Software Foundation, Inc.
707710 #
708711 # This file is free software; the Free Software Foundation
709712 # gives unlimited permission to copy and/or distribute it,
753756
754757 # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
755758
756 # Copyright (C) 1997-2013 Free Software Foundation, Inc.
759 # Copyright (C) 1997-2017 Free Software Foundation, Inc.
757760 #
758761 # This file is free software; the Free Software Foundation
759762 # gives unlimited permission to copy and/or distribute it,
792795
793796 # Helper functions for option handling. -*- Autoconf -*-
794797
795 # Copyright (C) 2001-2013 Free Software Foundation, Inc.
798 # Copyright (C) 2001-2017 Free Software Foundation, Inc.
796799 #
797800 # This file is free software; the Free Software Foundation
798801 # gives unlimited permission to copy and/or distribute it,
821824 AC_DEFUN([_AM_IF_OPTION],
822825 [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
823826
824 # Copyright (C) 1999-2013 Free Software Foundation, Inc.
827 # Copyright (C) 1999-2017 Free Software Foundation, Inc.
825828 #
826829 # This file is free software; the Free Software Foundation
827830 # gives unlimited permission to copy and/or distribute it,
868871 # For backward compatibility.
869872 AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
870873
871 # Copyright (C) 2001-2013 Free Software Foundation, Inc.
874 # Copyright (C) 2001-2017 Free Software Foundation, Inc.
872875 #
873876 # This file is free software; the Free Software Foundation
874877 # gives unlimited permission to copy and/or distribute it,
887890
888891 # Check to make sure that the build environment is sane. -*- Autoconf -*-
889892
890 # Copyright (C) 1996-2013 Free Software Foundation, Inc.
893 # Copyright (C) 1996-2017 Free Software Foundation, Inc.
891894 #
892895 # This file is free software; the Free Software Foundation
893896 # gives unlimited permission to copy and/or distribute it,
968971 rm -f conftest.file
969972 ])
970973
971 # Copyright (C) 2009-2013 Free Software Foundation, Inc.
974 # Copyright (C) 2009-2017 Free Software Foundation, Inc.
972975 #
973976 # This file is free software; the Free Software Foundation
974977 # gives unlimited permission to copy and/or distribute it,
10281031 _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
10291032 ])
10301033
1031 # Copyright (C) 2001-2013 Free Software Foundation, Inc.
1034 # Copyright (C) 2001-2017 Free Software Foundation, Inc.
10321035 #
10331036 # This file is free software; the Free Software Foundation
10341037 # gives unlimited permission to copy and/or distribute it,
10561059 INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
10571060 AC_SUBST([INSTALL_STRIP_PROGRAM])])
10581061
1059 # Copyright (C) 2006-2013 Free Software Foundation, Inc.
1062 # Copyright (C) 2006-2017 Free Software Foundation, Inc.
10601063 #
10611064 # This file is free software; the Free Software Foundation
10621065 # gives unlimited permission to copy and/or distribute it,
10751078
10761079 # Check how to create a tarball. -*- Autoconf -*-
10771080
1078 # Copyright (C) 2004-2013 Free Software Foundation, Inc.
1081 # Copyright (C) 2004-2017 Free Software Foundation, Inc.
10791082 #
10801083 # This file is free software; the Free Software Foundation
10811084 # gives unlimited permission to copy and/or distribute it,
12061209 AC_SUBST([am__untar])
12071210 ]) # _AM_PROG_TAR
12081211
1212 m4_include([m4/ax_code_coverage.m4])
12091213 m4_include([m4/libtool.m4])
12101214 m4_include([m4/ltoptions.m4])
12111215 m4_include([m4/ltsugar.m4])
33 me=ar-lib
44 scriptversion=2012-03-01.08; # UTC
55
6 # Copyright (C) 2010-2013 Free Software Foundation, Inc.
6 # Copyright (C) 2010-2017 Free Software Foundation, Inc.
77 # Written by Peter Rosin <peda@lysator.liu.se>.
88 #
99 # This program is free software; you can redistribute it and/or modify
00 #! /bin/sh
11 # Wrapper for compilers which do not understand '-c -o'.
22
3 scriptversion=2012-10-14.11; # UTC
4
5 # Copyright (C) 1999-2013 Free Software Foundation, Inc.
3 scriptversion=2016-01-11.22; # UTC
4
5 # Copyright (C) 1999-2017 Free Software Foundation, Inc.
66 # Written by Tom Tromey <tromey@cygnus.com>.
77 #
88 # This program is free software; you can redistribute it and/or modify
254254 echo "compile $scriptversion"
255255 exit $?
256256 ;;
257 cl | *[/\\]cl | cl.exe | *[/\\]cl.exe )
257 cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \
258 icl | *[/\\]icl | icl.exe | *[/\\]icl.exe )
258259 func_cl_wrapper "$@" # Doesn't return...
259260 ;;
260261 esac
341342 # eval: (add-hook 'write-file-hooks 'time-stamp)
342343 # time-stamp-start: "scriptversion="
343344 # time-stamp-format: "%:y-%02m-%02d.%02H"
344 # time-stamp-time-zone: "UTC"
345 # time-stamp-time-zone: "UTC0"
345346 # time-stamp-end: "; # UTC"
346347 # End:
00 #! /bin/sh
11 # Attempt to guess a canonical system name.
2 # Copyright 1992-2015 Free Software Foundation, Inc.
3
4 timestamp='2015-12-14'
2 # Copyright 1992-2017 Free Software Foundation, Inc.
3
4 timestamp='2017-05-27'
55
66 # This file is free software; you can redistribute it and/or modify it
77 # under the terms of the GNU General Public License as published by
2626 # Originally written by Per Bothner; maintained since 2000 by Ben Elliston.
2727 #
2828 # You can get the latest version of this script from:
29 # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
29 # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
3030 #
3131 # Please send patches to <config-patches@gnu.org>.
3232
4949 GNU config.guess ($timestamp)
5050
5151 Originally written by Per Bothner.
52 Copyright 1992-2015 Free Software Foundation, Inc.
52 Copyright 1992-2017 Free Software Foundation, Inc.
5353
5454 This is free software; see the source for copying conditions. There is NO
5555 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
185185 *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
186186 esac
187187 # The Operating System including object format, if it has switched
188 # to ELF recently, or will in the future.
188 # to ELF recently (or will in the future) and ABI.
189189 case "${UNAME_MACHINE_ARCH}" in
190 arm*|earm*|i386|m68k|ns32k|sh3*|sparc|vax)
190 earm*)
191 os=netbsdelf
192 ;;
193 arm*|i386|m68k|ns32k|sh3*|sparc|vax)
191194 eval $set_cc_for_build
192195 if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
193196 | grep -q __ELF__
236239 UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
237240 echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
238241 exit ;;
242 *:LibertyBSD:*:*)
243 UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'`
244 echo ${UNAME_MACHINE_ARCH}-unknown-libertybsd${UNAME_RELEASE}
245 exit ;;
239246 *:ekkoBSD:*:*)
240247 echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
241248 exit ;;
267274 ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
268275 case "$ALPHA_CPU_TYPE" in
269276 "EV4 (21064)")
270 UNAME_MACHINE="alpha" ;;
277 UNAME_MACHINE=alpha ;;
271278 "EV4.5 (21064)")
272 UNAME_MACHINE="alpha" ;;
279 UNAME_MACHINE=alpha ;;
273280 "LCA4 (21066/21068)")
274 UNAME_MACHINE="alpha" ;;
281 UNAME_MACHINE=alpha ;;
275282 "EV5 (21164)")
276 UNAME_MACHINE="alphaev5" ;;
283 UNAME_MACHINE=alphaev5 ;;
277284 "EV5.6 (21164A)")
278 UNAME_MACHINE="alphaev56" ;;
285 UNAME_MACHINE=alphaev56 ;;
279286 "EV5.6 (21164PC)")
280 UNAME_MACHINE="alphapca56" ;;
287 UNAME_MACHINE=alphapca56 ;;
281288 "EV5.7 (21164PC)")
282 UNAME_MACHINE="alphapca57" ;;
289 UNAME_MACHINE=alphapca57 ;;
283290 "EV6 (21264)")
284 UNAME_MACHINE="alphaev6" ;;
291 UNAME_MACHINE=alphaev6 ;;
285292 "EV6.7 (21264A)")
286 UNAME_MACHINE="alphaev67" ;;
293 UNAME_MACHINE=alphaev67 ;;
287294 "EV6.8CB (21264C)")
288 UNAME_MACHINE="alphaev68" ;;
295 UNAME_MACHINE=alphaev68 ;;
289296 "EV6.8AL (21264B)")
290 UNAME_MACHINE="alphaev68" ;;
297 UNAME_MACHINE=alphaev68 ;;
291298 "EV6.8CX (21264D)")
292 UNAME_MACHINE="alphaev68" ;;
299 UNAME_MACHINE=alphaev68 ;;
293300 "EV6.9A (21264/EV69A)")
294 UNAME_MACHINE="alphaev69" ;;
301 UNAME_MACHINE=alphaev69 ;;
295302 "EV7 (21364)")
296 UNAME_MACHINE="alphaev7" ;;
303 UNAME_MACHINE=alphaev7 ;;
297304 "EV7.9 (21364A)")
298 UNAME_MACHINE="alphaev79" ;;
305 UNAME_MACHINE=alphaev79 ;;
299306 esac
300307 # A Pn.n version is a patched version.
301308 # A Vn.n version is a released version.
302309 # A Tn.n version is a released field test version.
303310 # A Xn.n version is an unreleased experimental baselevel.
304311 # 1.2 uses "1.2" for uname -r.
305 echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
312 echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
306313 # Reset EXIT trap before exiting to avoid spurious non-zero exit code.
307314 exitcode=$?
308315 trap '' 0
375382 exit ;;
376383 i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
377384 eval $set_cc_for_build
378 SUN_ARCH="i386"
385 SUN_ARCH=i386
379386 # If there is a compiler, see if it is configured for 64-bit objects.
380387 # Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
381388 # This test works for both compilers.
382 if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
389 if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
383390 if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
384 (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
391 (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
385392 grep IS_64BIT_ARCH >/dev/null
386393 then
387 SUN_ARCH="x86_64"
394 SUN_ARCH=x86_64
388395 fi
389396 fi
390397 echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
409416 exit ;;
410417 sun*:*:4.2BSD:*)
411418 UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
412 test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
419 test "x${UNAME_RELEASE}" = x && UNAME_RELEASE=3
413420 case "`/bin/arch`" in
414421 sun3)
415422 echo m68k-sun-sunos${UNAME_RELEASE}
634641 sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
635642 sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
636643 case "${sc_cpu_version}" in
637 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
638 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
644 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0
645 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1
639646 532) # CPU_PA_RISC2_0
640647 case "${sc_kernel_bits}" in
641 32) HP_ARCH="hppa2.0n" ;;
642 64) HP_ARCH="hppa2.0w" ;;
643 '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
648 32) HP_ARCH=hppa2.0n ;;
649 64) HP_ARCH=hppa2.0w ;;
650 '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20
644651 esac ;;
645652 esac
646653 fi
679686 exit (0);
680687 }
681688 EOF
682 (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
689 (CCOPTS="" $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
683690 test -z "$HP_ARCH" && HP_ARCH=hppa
684691 fi ;;
685692 esac
686 if [ ${HP_ARCH} = "hppa2.0w" ]
693 if [ ${HP_ARCH} = hppa2.0w ]
687694 then
688695 eval $set_cc_for_build
689696
696703 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
697704 # => hppa64-hp-hpux11.23
698705
699 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
706 if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) |
700707 grep -q __LP64__
701708 then
702 HP_ARCH="hppa2.0w"
709 HP_ARCH=hppa2.0w
703710 else
704 HP_ARCH="hppa64"
711 HP_ARCH=hppa64
705712 fi
706713 fi
707714 echo ${HP_ARCH}-hp-hpux${HPUX_REV}
806813 echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
807814 exit ;;
808815 F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
809 FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
810 FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
816 FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
817 FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
811818 FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
812819 echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
813820 exit ;;
814821 5000:UNIX_System_V:4.*:*)
815 FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
816 FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
822 FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
823 FUJITSU_REL=`echo ${UNAME_RELEASE} | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'`
817824 echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
818825 exit ;;
819826 i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
829836 UNAME_PROCESSOR=`/usr/bin/uname -p`
830837 case ${UNAME_PROCESSOR} in
831838 amd64)
832 echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
833 *)
834 echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
839 UNAME_PROCESSOR=x86_64 ;;
840 i386)
841 UNAME_PROCESSOR=i586 ;;
835842 esac
843 echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
836844 exit ;;
837845 i*:CYGWIN*:*)
838846 echo ${UNAME_MACHINE}-pc-cygwin
895903 exit ;;
896904 *:GNU/*:*:*)
897905 # other systems with GNU libc and userland
898 echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}
906 echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}
899907 exit ;;
900908 i*86:Minix:*:*)
901909 echo ${UNAME_MACHINE}-pc-minix
918926 EV68*) UNAME_MACHINE=alphaev68 ;;
919927 esac
920928 objdump --private-headers /bin/sh | grep -q ld.so.1
921 if test "$?" = 0 ; then LIBC="gnulibc1" ; fi
929 if test "$?" = 0 ; then LIBC=gnulibc1 ; fi
922930 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
923931 exit ;;
924932 arc:Linux:*:* | arceb:Linux:*:*)
9921000 eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
9931001 test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
9941002 ;;
1003 mips64el:Linux:*:*)
1004 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
1005 exit ;;
9951006 openrisc*:Linux:*:*)
9961007 echo or1k-unknown-linux-${LIBC}
9971008 exit ;;
10241035 ppcle:Linux:*:*)
10251036 echo powerpcle-unknown-linux-${LIBC}
10261037 exit ;;
1038 riscv32:Linux:*:* | riscv64:Linux:*:*)
1039 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
1040 exit ;;
10271041 s390:Linux:*:* | s390x:Linux:*:*)
10281042 echo ${UNAME_MACHINE}-ibm-linux-${LIBC}
10291043 exit ;;
10431057 echo ${UNAME_MACHINE}-dec-linux-${LIBC}
10441058 exit ;;
10451059 x86_64:Linux:*:*)
1046 eval $set_cc_for_build
1047 X86_64_ABI=
1048 # If there is a compiler, see if it is configured for 32-bit objects.
1049 if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
1050 if (echo '#ifdef __ILP32__'; echo IS_X32; echo '#endif') | \
1051 (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
1052 grep IS_X32 >/dev/null
1053 then
1054 X86_64_ABI=x32
1055 fi
1056 fi
1057 echo ${UNAME_MACHINE}-pc-linux-${LIBC}${X86_64_ABI}
1060 echo ${UNAME_MACHINE}-pc-linux-${LIBC}
10581061 exit ;;
10591062 xtensa*:Linux:*:*)
10601063 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
12821285 SX-8R:SUPER-UX:*:*)
12831286 echo sx8r-nec-superux${UNAME_RELEASE}
12841287 exit ;;
1288 SX-ACE:SUPER-UX:*:*)
1289 echo sxace-nec-superux${UNAME_RELEASE}
1290 exit ;;
12851291 Power*:Rhapsody:*:*)
12861292 echo powerpc-apple-rhapsody${UNAME_RELEASE}
12871293 exit ;;
12951301 UNAME_PROCESSOR=powerpc
12961302 fi
12971303 if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then
1298 if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
1304 if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
12991305 if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
1300 (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
1301 grep IS_64BIT_ARCH >/dev/null
1306 (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
1307 grep IS_64BIT_ARCH >/dev/null
13021308 then
13031309 case $UNAME_PROCESSOR in
13041310 i386) UNAME_PROCESSOR=x86_64 ;;
13051311 powerpc) UNAME_PROCESSOR=powerpc64 ;;
13061312 esac
1313 fi
1314 # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc
1315 if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \
1316 (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
1317 grep IS_PPC >/dev/null
1318 then
1319 UNAME_PROCESSOR=powerpc
13071320 fi
13081321 fi
13091322 elif test "$UNAME_PROCESSOR" = i386 ; then
13191332 exit ;;
13201333 *:procnto*:*:* | *:QNX:[0123456789]*:*)
13211334 UNAME_PROCESSOR=`uname -p`
1322 if test "$UNAME_PROCESSOR" = "x86"; then
1335 if test "$UNAME_PROCESSOR" = x86; then
13231336 UNAME_PROCESSOR=i386
13241337 UNAME_MACHINE=pc
13251338 fi
13281341 *:QNX:*:4*)
13291342 echo i386-pc-qnx
13301343 exit ;;
1331 NEO-?:NONSTOP_KERNEL:*:*)
1344 NEO-*:NONSTOP_KERNEL:*:*)
13321345 echo neo-tandem-nsk${UNAME_RELEASE}
13331346 exit ;;
13341347 NSE-*:NONSTOP_KERNEL:*:*)
13351348 echo nse-tandem-nsk${UNAME_RELEASE}
13361349 exit ;;
1337 NSR-?:NONSTOP_KERNEL:*:*)
1350 NSR-*:NONSTOP_KERNEL:*:*)
13381351 echo nsr-tandem-nsk${UNAME_RELEASE}
1352 exit ;;
1353 NSX-*:NONSTOP_KERNEL:*:*)
1354 echo nsx-tandem-nsk${UNAME_RELEASE}
13391355 exit ;;
13401356 *:NonStop-UX:*:*)
13411357 echo mips-compaq-nonstopux
13501366 # "uname -m" is not consistent, so use $cputype instead. 386
13511367 # is converted to i386 for consistency with other x86
13521368 # operating systems.
1353 if test "$cputype" = "386"; then
1369 if test "$cputype" = 386; then
13541370 UNAME_MACHINE=i386
13551371 else
13561372 UNAME_MACHINE="$cputype"
13921408 echo i386-pc-xenix
13931409 exit ;;
13941410 i*86:skyos:*:*)
1395 echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
1411 echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE} | sed -e 's/ .*$//'`
13961412 exit ;;
13971413 i*86:rdos:*:*)
13981414 echo ${UNAME_MACHINE}-pc-rdos
14111427 cat >&2 <<EOF
14121428 $0: unable to guess system type
14131429
1414 This script, last modified $timestamp, has failed to recognize
1415 the operating system you are using. It is advised that you
1416 download the most up to date version of the config scripts from
1417
1418 http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
1430 This script (version $timestamp), has failed to recognize the
1431 operating system you are using. If your script is old, overwrite
1432 config.guess and config.sub with the latest versions from:
1433
1434 http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
14191435 and
1420 http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
1421
1422 If the version you run ($0) is already up to date, please
1423 send the following data and any information you think might be
1424 pertinent to <config-patches@gnu.org> in order to provide the needed
1425 information to handle your system.
1436 http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
1437
1438 If $0 has already been updated, send the following data and any
1439 information you think might be pertinent to config-patches@gnu.org to
1440 provide the necessary information to handle your system.
14261441
14271442 config.guess timestamp = $timestamp
14281443
00 #! /bin/sh
11 # Configuration validation subroutine script.
2 # Copyright 1992-2015 Free Software Foundation, Inc.
3
4 timestamp='2015-12-14'
2 # Copyright 1992-2017 Free Software Foundation, Inc.
3
4 timestamp='2017-04-02'
55
66 # This file is free software; you can redistribute it and/or modify it
77 # under the terms of the GNU General Public License as published by
3232 # Otherwise, we print the canonical config type on stdout and succeed.
3333
3434 # You can get the latest version of this script from:
35 # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
35 # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
3636
3737 # This file is supposed to be the same for all GNU packages
3838 # and recognize all the CPU types, system types and aliases
6666 version="\
6767 GNU config.sub ($timestamp)
6868
69 Copyright 1992-2015 Free Software Foundation, Inc.
69 Copyright 1992-2017 Free Software Foundation, Inc.
7070
7171 This is free software; see the source for copying conditions. There is NO
7272 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
116116 nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
117117 linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
118118 knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \
119 kopensolaris*-gnu* | \
119 kopensolaris*-gnu* | cloudabi*-eabi* | \
120120 storm-chaos* | os2-emx* | rtmk-nova*)
121121 os=-$maybe_os
122122 basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
257257 | be32 | be64 \
258258 | bfin \
259259 | c4x | c8051 | clipper \
260 | d10v | d30v | dlx | dsp16xx | dvp \
260 | d10v | d30v | dlx | dsp16xx \
261261 | e2k | epiphany \
262262 | fido | fr30 | frv | ft32 \
263263 | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
264264 | hexagon \
265 | i370 | i860 | i960 | ia64 \
265 | i370 | i860 | i960 | ia16 | ia64 \
266266 | ip2k | iq2000 \
267267 | k1om \
268268 | le32 | le64 \
300300 | open8 | or1k | or1knd | or32 \
301301 | pdp10 | pdp11 | pj | pjl \
302302 | powerpc | powerpc64 | powerpc64le | powerpcle \
303 | pru \
303304 | pyramid \
304305 | riscv32 | riscv64 \
305306 | rl78 | rx \
313314 | ubicom32 \
314315 | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
315316 | visium \
317 | wasm32 \
316318 | we32k \
317319 | x86 | xc16x | xstormy16 | xtensa \
318320 | z8k | z80)
386388 | h8300-* | h8500-* \
387389 | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
388390 | hexagon-* \
389 | i*86-* | i860-* | i960-* | ia64-* \
391 | i*86-* | i860-* | i960-* | ia16-* | ia64-* \
390392 | ip2k-* | iq2000-* \
391393 | k1om-* \
392394 | le32-* | le64-* \
427429 | orion-* \
428430 | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
429431 | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
432 | pru-* \
430433 | pyramid-* \
431434 | riscv32-* | riscv64-* \
432435 | rl78-* | romp-* | rs6000-* | rx-* \
443446 | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
444447 | vax-* \
445448 | visium-* \
449 | wasm32-* \
446450 | we32k-* \
447451 | x86-* | x86_64-* | xc16x-* | xps100-* \
448452 | xstormy16-* | xtensa*-* \
641645 dpx2* | dpx2*-bull)
642646 basic_machine=m68k-bull
643647 os=-sysv3
648 ;;
649 e500v[12])
650 basic_machine=powerpc-unknown
651 os=$os"spe"
652 ;;
653 e500v[12]-*)
654 basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
655 os=$os"spe"
644656 ;;
645657 ebmon29k)
646658 basic_machine=a29k-amd
826838 *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
827839 basic_machine=m68k-atari
828840 os=-mint
829 ;;
830 mipsEE* | ee | ps2)
831 basic_machine=mips64r5900el-scei
832 case $os in
833 -linux*)
834 ;;
835 *)
836 os=-elf
837 ;;
838 esac
839 ;;
840 iop)
841 basic_machine=mipsel-scei
842 os=-irx
843 ;;
844 dvp)
845 basic_machine=dvp-scei
846 os=-elf
847841 ;;
848842 mips3*-*)
849843 basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
955949 nsr-tandem)
956950 basic_machine=nsr-tandem
957951 ;;
952 nsx-tandem)
953 basic_machine=nsx-tandem
954 ;;
958955 op50n-* | op60c-*)
959956 basic_machine=hppa1.1-oki
960957 os=-proelf
10391036 ppc-* | ppcbe-*)
10401037 basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
10411038 ;;
1042 ppcle | powerpclittle | ppc-le | powerpc-little)
1039 ppcle | powerpclittle)
10431040 basic_machine=powerpcle-unknown
10441041 ;;
10451042 ppcle-* | powerpclittle-*)
10491046 ;;
10501047 ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
10511048 ;;
1052 ppc64le | powerpc64little | ppc64-le | powerpc64-little)
1049 ppc64le | powerpc64little)
10531050 basic_machine=powerpc64le-unknown
10541051 ;;
10551052 ppc64le-* | powerpc64little-*)
12491246 vxworks29k)
12501247 basic_machine=a29k-wrs
12511248 os=-vxworks
1249 ;;
1250 wasm32)
1251 basic_machine=wasm32-unknown
12521252 ;;
12531253 w65*)
12541254 basic_machine=w65-wdc
13991399 | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
14001400 | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
14011401 | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
1402 | -bitrig* | -openbsd* | -solidbsd* \
1402 | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \
14031403 | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
14041404 | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
14051405 | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
14061406 | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
1407 | -chorusos* | -chorusrdb* | -cegcc* \
1407 | -chorusos* | -chorusrdb* | -cegcc* | -glidix* \
14081408 | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
1409 | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
1409 | -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
14101410 | -linux-newlib* | -linux-musl* | -linux-uclibc* \
14111411 | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \
14121412 | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
14131413 | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
1414 | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* | -irx* \
1414 | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
14151415 | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
14161416 | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
14171417 | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
14181418 | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \
1419 | -onefs* | -tirtos*)
1419 | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox*)
14201420 # Remember, each alternative MUST END IN *, to match a version number.
14211421 ;;
14221422 -qnx*)
15481548 ;;
15491549 -nacl*)
15501550 ;;
1551 -ios)
1552 ;;
15511553 -none)
15521554 ;;
15531555 *)
16421644 ;;
16431645 sparc-* | *-sun)
16441646 os=-sunos4.1.1
1647 ;;
1648 pru-*)
1649 os=-elf
16451650 ;;
16461651 *-be)
16471652 os=-beos
00 #! /bin/sh
11 # depcomp - compile a program generating dependencies as side-effects
22
3 scriptversion=2013-05-30.07; # UTC
4
5 # Copyright (C) 1999-2013 Free Software Foundation, Inc.
3 scriptversion=2016-01-11.22; # UTC
4
5 # Copyright (C) 1999-2017 Free Software Foundation, Inc.
66
77 # This program is free software; you can redistribute it and/or modify
88 # it under the terms of the GNU General Public License as published by
785785 # eval: (add-hook 'write-file-hooks 'time-stamp)
786786 # time-stamp-start: "scriptversion="
787787 # time-stamp-format: "%:y-%02m-%02d.%02H"
788 # time-stamp-time-zone: "UTC"
788 # time-stamp-time-zone: "UTC0"
789789 # time-stamp-end: "; # UTC"
790790 # End:
00 #!/bin/sh
11 # install - install a program, script, or datafile
22
3 scriptversion=2011-11-20.07; # UTC
3 scriptversion=2016-01-11.22; # UTC
44
55 # This originates from X11R5 (mit/util/scripts/install.sh), which was
66 # later released in X11R6 (xc/config/util/install.sh) with the
4040 # This script is compatible with the BSD install script, but was written
4141 # from scratch.
4242
43 tab=' '
4344 nl='
4445 '
45 IFS=" "" $nl"
46
47 # set DOITPROG to echo to test this script
48
49 # Don't use :- since 4.3BSD and earlier shells don't like it.
46 IFS=" $tab$nl"
47
48 # Set DOITPROG to "echo" to test this script.
49
5050 doit=${DOITPROG-}
51 if test -z "$doit"; then
52 doit_exec=exec
53 else
54 doit_exec=$doit
55 fi
51 doit_exec=${doit:-exec}
5652
5753 # Put in absolute file names if you don't have them in your path;
5854 # or use environment vars.
6763 rmprog=${RMPROG-rm}
6864 stripprog=${STRIPPROG-strip}
6965
70 posix_glob='?'
71 initialize_posix_glob='
72 test "$posix_glob" != "?" || {
73 if (set -f) 2>/dev/null; then
74 posix_glob=
75 else
76 posix_glob=:
77 fi
78 }
79 '
80
8166 posix_mkdir=
8267
8368 # Desired mode of installed file.
9681 dst_arg=
9782
9883 copy_on_change=false
99 no_target_directory=
84 is_target_a_directory=possibly
10085
10186 usage="\
10287 Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
136121 -d) dir_arg=true;;
137122
138123 -g) chgrpcmd="$chgrpprog $2"
139 shift;;
124 shift;;
140125
141126 --help) echo "$usage"; exit $?;;
142127
143128 -m) mode=$2
144 case $mode in
145 *' '* | *' '* | *'
146 '* | *'*'* | *'?'* | *'['*)
147 echo "$0: invalid mode: $mode" >&2
148 exit 1;;
149 esac
150 shift;;
129 case $mode in
130 *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*)
131 echo "$0: invalid mode: $mode" >&2
132 exit 1;;
133 esac
134 shift;;
151135
152136 -o) chowncmd="$chownprog $2"
153 shift;;
137 shift;;
154138
155139 -s) stripcmd=$stripprog;;
156140
157 -t) dst_arg=$2
158 # Protect names problematic for 'test' and other utilities.
159 case $dst_arg in
160 -* | [=\(\)!]) dst_arg=./$dst_arg;;
161 esac
162 shift;;
163
164 -T) no_target_directory=true;;
141 -t)
142 is_target_a_directory=always
143 dst_arg=$2
144 # Protect names problematic for 'test' and other utilities.
145 case $dst_arg in
146 -* | [=\(\)!]) dst_arg=./$dst_arg;;
147 esac
148 shift;;
149
150 -T) is_target_a_directory=never;;
165151
166152 --version) echo "$0 $scriptversion"; exit $?;;
167153
168 --) shift
169 break;;
170
171 -*) echo "$0: invalid option: $1" >&2
172 exit 1;;
154 --) shift
155 break;;
156
157 -*) echo "$0: invalid option: $1" >&2
158 exit 1;;
173159
174160 *) break;;
175161 esac
176162 shift
177163 done
164
165 # We allow the use of options -d and -T together, by making -d
166 # take the precedence; this is for compatibility with GNU install.
167
168 if test -n "$dir_arg"; then
169 if test -n "$dst_arg"; then
170 echo "$0: target directory not allowed when installing a directory." >&2
171 exit 1
172 fi
173 fi
178174
179175 if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
180176 # When -d is used, all remaining arguments are directories to create.
207203 fi
208204
209205 if test -z "$dir_arg"; then
206 if test $# -gt 1 || test "$is_target_a_directory" = always; then
207 if test ! -d "$dst_arg"; then
208 echo "$0: $dst_arg: Is not a directory." >&2
209 exit 1
210 fi
211 fi
212 fi
213
214 if test -z "$dir_arg"; then
210215 do_exit='(exit $ret); exit $ret'
211216 trap "ret=129; $do_exit" 1
212217 trap "ret=130; $do_exit" 2
222227
223228 *[0-7])
224229 if test -z "$stripcmd"; then
225 u_plus_rw=
230 u_plus_rw=
226231 else
227 u_plus_rw='% 200'
232 u_plus_rw='% 200'
228233 fi
229234 cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
230235 *)
231236 if test -z "$stripcmd"; then
232 u_plus_rw=
237 u_plus_rw=
233238 else
234 u_plus_rw=,u+rw
239 u_plus_rw=,u+rw
235240 fi
236241 cp_umask=$mode$u_plus_rw;;
237242 esac
268273 # If destination is a directory, append the input filename; won't work
269274 # if double slashes aren't ignored.
270275 if test -d "$dst"; then
271 if test -n "$no_target_directory"; then
272 echo "$0: $dst_arg: Is a directory" >&2
273 exit 1
276 if test "$is_target_a_directory" = never; then
277 echo "$0: $dst_arg: Is a directory" >&2
278 exit 1
274279 fi
275280 dstdir=$dst
276281 dst=$dstdir/`basename "$src"`
277282 dstdir_status=0
278283 else
279 # Prefer dirname, but fall back on a substitute if dirname fails.
280 dstdir=`
281 (dirname "$dst") 2>/dev/null ||
282 expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
283 X"$dst" : 'X\(//\)[^/]' \| \
284 X"$dst" : 'X\(//\)$' \| \
285 X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
286 echo X"$dst" |
287 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
288 s//\1/
289 q
290 }
291 /^X\(\/\/\)[^/].*/{
292 s//\1/
293 q
294 }
295 /^X\(\/\/\)$/{
296 s//\1/
297 q
298 }
299 /^X\(\/\).*/{
300 s//\1/
301 q
302 }
303 s/.*/./; q'
304 `
305
284 dstdir=`dirname "$dst"`
306285 test -d "$dstdir"
307286 dstdir_status=$?
308287 fi
313292 if test $dstdir_status != 0; then
314293 case $posix_mkdir in
315294 '')
316 # Create intermediate dirs using mode 755 as modified by the umask.
317 # This is like FreeBSD 'install' as of 1997-10-28.
318 umask=`umask`
319 case $stripcmd.$umask in
320 # Optimize common cases.
321 *[2367][2367]) mkdir_umask=$umask;;
322 .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
323
324 *[0-7])
325 mkdir_umask=`expr $umask + 22 \
326 - $umask % 100 % 40 + $umask % 20 \
327 - $umask % 10 % 4 + $umask % 2
328 `;;
329 *) mkdir_umask=$umask,go-w;;
330 esac
331
332 # With -d, create the new directory with the user-specified mode.
333 # Otherwise, rely on $mkdir_umask.
334 if test -n "$dir_arg"; then
335 mkdir_mode=-m$mode
336 else
337 mkdir_mode=
338 fi
339
340 posix_mkdir=false
341 case $umask in
342 *[123567][0-7][0-7])
343 # POSIX mkdir -p sets u+wx bits regardless of umask, which
344 # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
345 ;;
346 *)
347 tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
348 trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
349
350 if (umask $mkdir_umask &&
351 exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
352 then
353 if test -z "$dir_arg" || {
354 # Check for POSIX incompatibilities with -m.
355 # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
356 # other-writable bit of parent directory when it shouldn't.
357 # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
358 ls_ld_tmpdir=`ls -ld "$tmpdir"`
359 case $ls_ld_tmpdir in
360 d????-?r-*) different_mode=700;;
361 d????-?--*) different_mode=755;;
362 *) false;;
363 esac &&
364 $mkdirprog -m$different_mode -p -- "$tmpdir" && {
365 ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
366 test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
367 }
368 }
369 then posix_mkdir=:
370 fi
371 rmdir "$tmpdir/d" "$tmpdir"
372 else
373 # Remove any dirs left behind by ancient mkdir implementations.
374 rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
375 fi
376 trap '' 0;;
377 esac;;
295 # Create intermediate dirs using mode 755 as modified by the umask.
296 # This is like FreeBSD 'install' as of 1997-10-28.
297 umask=`umask`
298 case $stripcmd.$umask in
299 # Optimize common cases.
300 *[2367][2367]) mkdir_umask=$umask;;
301 .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
302
303 *[0-7])
304 mkdir_umask=`expr $umask + 22 \
305 - $umask % 100 % 40 + $umask % 20 \
306 - $umask % 10 % 4 + $umask % 2
307 `;;
308 *) mkdir_umask=$umask,go-w;;
309 esac
310
311 # With -d, create the new directory with the user-specified mode.
312 # Otherwise, rely on $mkdir_umask.
313 if test -n "$dir_arg"; then
314 mkdir_mode=-m$mode
315 else
316 mkdir_mode=
317 fi
318
319 posix_mkdir=false
320 case $umask in
321 *[123567][0-7][0-7])
322 # POSIX mkdir -p sets u+wx bits regardless of umask, which
323 # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
324 ;;
325 *)
326 tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
327 trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
328
329 if (umask $mkdir_umask &&
330 exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
331 then
332 if test -z "$dir_arg" || {
333 # Check for POSIX incompatibilities with -m.
334 # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
335 # other-writable bit of parent directory when it shouldn't.
336 # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
337 ls_ld_tmpdir=`ls -ld "$tmpdir"`
338 case $ls_ld_tmpdir in
339 d????-?r-*) different_mode=700;;
340 d????-?--*) different_mode=755;;
341 *) false;;
342 esac &&
343 $mkdirprog -m$different_mode -p -- "$tmpdir" && {
344 ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
345 test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
346 }
347 }
348 then posix_mkdir=:
349 fi
350 rmdir "$tmpdir/d" "$tmpdir"
351 else
352 # Remove any dirs left behind by ancient mkdir implementations.
353 rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
354 fi
355 trap '' 0;;
356 esac;;
378357 esac
379358
380359 if
381360 $posix_mkdir && (
382 umask $mkdir_umask &&
383 $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
361 umask $mkdir_umask &&
362 $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
384363 )
385364 then :
386365 else
390369 # directory the slow way, step by step, checking for races as we go.
391370
392371 case $dstdir in
393 /*) prefix='/';;
394 [-=\(\)!]*) prefix='./';;
395 *) prefix='';;
372 /*) prefix='/';;
373 [-=\(\)!]*) prefix='./';;
374 *) prefix='';;
396375 esac
397
398 eval "$initialize_posix_glob"
399376
400377 oIFS=$IFS
401378 IFS=/
402 $posix_glob set -f
379 set -f
403380 set fnord $dstdir
404381 shift
405 $posix_glob set +f
382 set +f
406383 IFS=$oIFS
407384
408385 prefixes=
409386
410387 for d
411388 do
412 test X"$d" = X && continue
413
414 prefix=$prefix$d
415 if test -d "$prefix"; then
416 prefixes=
417 else
418 if $posix_mkdir; then
419 (umask=$mkdir_umask &&
420 $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
421 # Don't fail if two instances are running concurrently.
422 test -d "$prefix" || exit 1
423 else
424 case $prefix in
425 *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
426 *) qprefix=$prefix;;
427 esac
428 prefixes="$prefixes '$qprefix'"
429 fi
430 fi
431 prefix=$prefix/
389 test X"$d" = X && continue
390
391 prefix=$prefix$d
392 if test -d "$prefix"; then
393 prefixes=
394 else
395 if $posix_mkdir; then
396 (umask=$mkdir_umask &&
397 $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
398 # Don't fail if two instances are running concurrently.
399 test -d "$prefix" || exit 1
400 else
401 case $prefix in
402 *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
403 *) qprefix=$prefix;;
404 esac
405 prefixes="$prefixes '$qprefix'"
406 fi
407 fi
408 prefix=$prefix/
432409 done
433410
434411 if test -n "$prefixes"; then
435 # Don't fail if two instances are running concurrently.
436 (umask $mkdir_umask &&
437 eval "\$doit_exec \$mkdirprog $prefixes") ||
438 test -d "$dstdir" || exit 1
439 obsolete_mkdir_used=true
412 # Don't fail if two instances are running concurrently.
413 (umask $mkdir_umask &&
414 eval "\$doit_exec \$mkdirprog $prefixes") ||
415 test -d "$dstdir" || exit 1
416 obsolete_mkdir_used=true
440417 fi
441418 fi
442419 fi
471448
472449 # If -C, don't bother to copy if it wouldn't change the file.
473450 if $copy_on_change &&
474 old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
475 new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
476
477 eval "$initialize_posix_glob" &&
478 $posix_glob set -f &&
451 old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
452 new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
453 set -f &&
479454 set X $old && old=:$2:$4:$5:$6 &&
480455 set X $new && new=:$2:$4:$5:$6 &&
481 $posix_glob set +f &&
482
456 set +f &&
483457 test "$old" = "$new" &&
484458 $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
485459 then
492466 # to itself, or perhaps because mv is so ancient that it does not
493467 # support -f.
494468 {
495 # Now remove or move aside any old file at destination location.
496 # We try this two ways since rm can't unlink itself on some
497 # systems and the destination file might be busy for other
498 # reasons. In this case, the final cleanup might fail but the new
499 # file should still install successfully.
500 {
501 test ! -f "$dst" ||
502 $doit $rmcmd -f "$dst" 2>/dev/null ||
503 { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
504 { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
505 } ||
506 { echo "$0: cannot unlink or rename $dst" >&2
507 (exit 1); exit 1
508 }
509 } &&
510
511 # Now rename the file to the real destination.
512 $doit $mvcmd "$dsttmp" "$dst"
469 # Now remove or move aside any old file at destination location.
470 # We try this two ways since rm can't unlink itself on some
471 # systems and the destination file might be busy for other
472 # reasons. In this case, the final cleanup might fail but the new
473 # file should still install successfully.
474 {
475 test ! -f "$dst" ||
476 $doit $rmcmd -f "$dst" 2>/dev/null ||
477 { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
478 { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
479 } ||
480 { echo "$0: cannot unlink or rename $dst" >&2
481 (exit 1); exit 1
482 }
483 } &&
484
485 # Now rename the file to the real destination.
486 $doit $mvcmd "$dsttmp" "$dst"
513487 }
514488 fi || exit 1
515489
521495 # eval: (add-hook 'write-file-hooks 'time-stamp)
522496 # time-stamp-start: "scriptversion="
523497 # time-stamp-format: "%:y-%02m-%02d.%02H"
524 # time-stamp-time-zone: "UTC"
498 # time-stamp-time-zone: "UTC0"
525499 # time-stamp-end: "; # UTC"
526500 # End:
00 #! /bin/sh
11 ## DO NOT EDIT - This file generated from ./build-aux/ltmain.in
2 ## by inline-source v2014-01-03.01
3
4 # libtool (GNU libtool) 2.4.6
2 ## by inline-source v2016-02-21.11
3
4 # libtool (GNU libtool) 2.4.6.40-6ca5-dirty
55 # Provide generalized library-building support services.
66 # Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
77
8 # Copyright (C) 1996-2015 Free Software Foundation, Inc.
8 # Copyright (C) 1996-2017 Free Software Foundation, Inc.
99 # This is free software; see the source for copying conditions. There is NO
1010 # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
1111
3030
3131 PROGRAM=libtool
3232 PACKAGE=libtool
33 VERSION=2.4.6
34 package_revision=2.4.6
33 VERSION=2.4.6.40-6ca5-dirty
34 package_revision=2.4.6.40
3535
3636
3737 ## ------ ##
6363 # libraries, which are installed to $pkgauxdir.
6464
6565 # Set a version string for this script.
66 scriptversion=2015-10-04.22; # UTC
66 scriptversion=2017-04-19.12; # UTC
6767
6868 # General shell script boiler plate, and helper functions.
6969 # Written by Gary V. Vaughan, 2004
7070
71 # Copyright (C) 2004-2015 Free Software Foundation, Inc.
72 # This is free software; see the source for copying conditions. There is NO
73 # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
74
75 # This program is free software; you can redistribute it and/or modify
76 # it under the terms of the GNU General Public License as published by
77 # the Free Software Foundation; either version 3 of the License, or
78 # (at your option) any later version.
79
80 # As a special exception to the GNU General Public License, if you distribute
81 # this file as part of a program or library that is built using GNU Libtool,
82 # you may include this file under the same distribution terms that you use
83 # for the rest of that program.
84
85 # This program is distributed in the hope that it will be useful,
86 # but WITHOUT ANY WARRANTY; without even the implied warranty of
87 # MERCHANTABILITY or FITNES FOR A PARTICULAR PURPOSE. See the GNU
88 # General Public License for more details.
89
90 # You should have received a copy of the GNU General Public License
91 # along with this program. If not, see <http://www.gnu.org/licenses/>.
92
93 # Please report bugs or propose patches to gary@gnu.org.
71 # This is free software. There is NO warranty; not even for
72 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
73 #
74 # Copyright (C) 2004-2017 Bootstrap Authors
75 #
76 # This file is dual licensed under the terms of the MIT license
77 # <https://opensource.org/license/MIT>, and GPL version 3 or later
78 # <http://www.gnu.org/licenses/gpl-2.0.html>. You must apply one of
79 # these licenses when using or redistributing this software or any of
80 # the files within it. See the URLs above, or the file `LICENSE`
81 # included in the Bootstrap distribution for the full license texts.
82
83 # Please report bugs or propose patches to:
84 # <https://github.com/gnulib-modules/bootstrap/issues>
9485
9586
9687 ## ------ ##
139130 fi"
140131 done
141132
142 # CDPATH.
143 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
144
145133 # Make sure IFS has a sensible default
146134 sp=' '
147135 nl='
157145 }
158146 fi
159147
148
149 # func_unset VAR
150 # --------------
151 # Portably unset VAR.
152 # In some shells, an 'unset VAR' statement leaves a non-zero return
153 # status if VAR is already unset, which might be problematic if the
154 # statement is used at the end of a function (thus poisoning its return
155 # value) or when 'set -e' is active (causing even a spurious abort of
156 # the script in this case).
157 func_unset ()
158 {
159 { eval $1=; (eval unset $1) >/dev/null 2>&1 && eval unset $1 || : ; }
160 }
161
162
163 # Make sure CDPATH doesn't cause `cd` commands to output the target dir.
164 func_unset CDPATH
165
166 # Make sure ${,E,F}GREP behave sanely.
167 func_unset GREP_OPTIONS
160168
161169
162170 ## ------------------------- ##
258266 rm -f conftest.in conftest.tmp conftest.nl conftest.out
259267 }
260268
261 func_path_progs "sed gsed" func_check_prog_sed $PATH:/usr/xpg4/bin
269 func_path_progs "sed gsed" func_check_prog_sed "$PATH:/usr/xpg4/bin"
262270 rm -f conftest.sed
263271 SED=$func_path_progs_result
264272 }
294302 rm -f conftest.in conftest.tmp conftest.nl conftest.out
295303 }
296304
297 func_path_progs "grep ggrep" func_check_prog_grep $PATH:/usr/xpg4/bin
305 func_path_progs "grep ggrep" func_check_prog_grep "$PATH:/usr/xpg4/bin"
298306 GREP=$func_path_progs_result
299307 }
300308
579587 {
580588 $debug_cmd
581589
582 func_quote_for_eval "$2"
583 eval "$1+=\\ \$func_quote_for_eval_result"
590 func_quote_arg pretty "$2"
591 eval "$1+=\\ \$func_quote_arg_result"
584592 }'
585593 else
586594 func_append_quoted ()
587595 {
588596 $debug_cmd
589597
590 func_quote_for_eval "$2"
591 eval "$1=\$$1\\ \$func_quote_for_eval_result"
598 func_quote_arg pretty "$2"
599 eval "$1=\$$1\\ \$func_quote_arg_result"
592600 }
593601 fi
594602
10901098 }
10911099
10921100
1093 # func_quote ARG
1094 # --------------
1095 # Aesthetically quote one ARG, store the result into $func_quote_result. Note
1096 # that we keep attention to performance here (so far O(N) complexity as long as
1097 # func_append is O(1)).
1098 func_quote ()
1101 # func_quote_portable EVAL ARG
1102 # ----------------------------
1103 # Internal function to portably implement func_quote_arg. Note that we still
1104 # keep attention to performance here so we as much as possible try to avoid
1105 # calling sed binary (so far O(N) complexity as long as func_append is O(1)).
1106 func_quote_portable ()
10991107 {
11001108 $debug_cmd
11011109
1102 func_quote_result=$1
1103
1104 case $func_quote_result in
1105 *[\\\`\"\$]*)
1106 case $func_quote_result in
1107 *[\[\*\?]*)
1108 func_quote_result=`$ECHO "$func_quote_result" | $SED "$sed_quote_subst"`
1109 return 0
1110 ;;
1111 esac
1112
1113 func_quote_old_IFS=$IFS
1114 for _G_char in '\' '`' '"' '$'
1115 do
1116 # STATE($1) PREV($2) SEPARATOR($3)
1117 set start "" ""
1118 func_quote_result=dummy"$_G_char$func_quote_result$_G_char"dummy
1119 IFS=$_G_char
1120 for _G_part in $func_quote_result
1110 func_quote_portable_result=$2
1111
1112 # one-time-loop (easy break)
1113 while true
1114 do
1115 if $1; then
1116 func_quote_portable_result=`$ECHO "$2" | $SED \
1117 -e "$sed_double_quote_subst" -e "$sed_double_backslash"`
1118 break
1119 fi
1120
1121 # Quote for eval.
1122 case $func_quote_portable_result in
1123 *[\\\`\"\$]*)
1124 case $func_quote_portable_result in
1125 *[\[\*\?]*)
1126 func_quote_portable_result=`$ECHO "$func_quote_portable_result" \
1127 | $SED "$sed_quote_subst"`
1128 break
1129 ;;
1130 esac
1131
1132 func_quote_portable_old_IFS=$IFS
1133 for _G_char in '\' '`' '"' '$'
11211134 do
1122 case $1 in
1123 quote)
1124 func_append func_quote_result "$3$2"
1125 set quote "$_G_part" "\\$_G_char"
1126 ;;
1127 start)
1128 set first "" ""
1129 func_quote_result=
1130 ;;
1131 first)
1132 set quote "$_G_part" ""
1133 ;;
1134 esac
1135 # STATE($1) PREV($2) SEPARATOR($3)
1136 set start "" ""
1137 func_quote_portable_result=dummy"$_G_char$func_quote_portable_result$_G_char"dummy
1138 IFS=$_G_char
1139 for _G_part in $func_quote_portable_result
1140 do
1141 case $1 in
1142 quote)
1143 func_append func_quote_portable_result "$3$2"
1144 set quote "$_G_part" "\\$_G_char"
1145 ;;
1146 start)
1147 set first "" ""
1148 func_quote_portable_result=
1149 ;;
1150 first)
1151 set quote "$_G_part" ""
1152 ;;
1153 esac
1154 done
11351155 done
1136 IFS=$func_quote_old_IFS
1137 done
1156 IFS=$func_quote_portable_old_IFS
1157 ;;
1158 *) ;;
1159 esac
1160 break
1161 done
1162
1163 func_quote_portable_unquoted_result=$func_quote_portable_result
1164 case $func_quote_portable_result in
1165 # double-quote args containing shell metacharacters to delay
1166 # word splitting, command substitution and variable expansion
1167 # for a subsequent eval.
1168 # many bourne shells cannot handle close brackets correctly
1169 # in scan sets, so we specify it separately.
1170 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1171 func_quote_portable_result=\"$func_quote_portable_result\"
11381172 ;;
1139 *) ;;
11401173 esac
11411174 }
11421175
11431176
1144 # func_quote_for_eval ARG...
1145 # --------------------------
1146 # Aesthetically quote ARGs to be evaled later.
1147 # This function returns two values:
1148 # i) func_quote_for_eval_result
1149 # double-quoted, suitable for a subsequent eval
1150 # ii) func_quote_for_eval_unquoted_result
1151 # has all characters that are still active within double
1152 # quotes backslashified.
1153 func_quote_for_eval ()
1154 {
1155 $debug_cmd
1156
1157 func_quote_for_eval_unquoted_result=
1158 func_quote_for_eval_result=
1159 while test 0 -lt $#; do
1160 func_quote "$1"
1161 _G_unquoted_arg=$func_quote_result
1162 if test -n "$func_quote_for_eval_unquoted_result"; then
1163 func_append func_quote_for_eval_unquoted_result " $_G_unquoted_arg"
1164 else
1165 func_append func_quote_for_eval_unquoted_result "$_G_unquoted_arg"
1166 fi
1167
1168 case $_G_unquoted_arg in
1169 # Double-quote args containing shell metacharacters to delay
1170 # word splitting, command substitution and variable expansion
1171 # for a subsequent eval.
1172 # Many Bourne shells cannot handle close brackets correctly
1173 # in scan sets, so we specify it separately.
1174 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1175 _G_quoted_arg=\"$_G_unquoted_arg\"
1177 # func_quotefast_eval ARG
1178 # -----------------------
1179 # Quote one ARG (internal). This is equivalent to 'func_quote_arg eval ARG',
1180 # but optimized for speed. Result is stored in $func_quotefast_eval.
1181 if test xyes = `(x=; printf -v x %q yes; echo x"$x") 2>/dev/null`; then
1182 printf -v _GL_test_printf_tilde %q '~'
1183 if test '\~' = "$_GL_test_printf_tilde"; then
1184 func_quotefast_eval ()
1185 {
1186 printf -v func_quotefast_eval_result %q "$1"
1187 }
1188 else
1189 # Broken older Bash implementations. Make those faster too if possible.
1190 func_quotefast_eval ()
1191 {
1192 case $1 in
1193 '~'*)
1194 func_quote_portable false "$1"
1195 func_quotefast_eval_result=$func_quote_portable_result
11761196 ;;
11771197 *)
1178 _G_quoted_arg=$_G_unquoted_arg
1179 ;;
1198 printf -v func_quotefast_eval_result %q "$1"
1199 ;;
11801200 esac
1181
1182 if test -n "$func_quote_for_eval_result"; then
1183 func_append func_quote_for_eval_result " $_G_quoted_arg"
1201 }
1202 fi
1203 else
1204 func_quotefast_eval ()
1205 {
1206 func_quote_portable false "$1"
1207 func_quotefast_eval_result=$func_quote_portable_result
1208 }
1209 fi
1210
1211
1212 # func_quote_arg MODEs ARG
1213 # ------------------------
1214 # Quote one ARG to be evaled later. MODEs argument may contain zero or more
1215 # specifiers listed below separated by ',' character. This function returns two
1216 # values:
1217 # i) func_quote_arg_result
1218 # double-quoted (when needed), suitable for a subsequent eval
1219 # ii) func_quote_arg_unquoted_result
1220 # has all characters that are still active within double
1221 # quotes backslashified. Available only if 'unquoted' is specified.
1222 #
1223 # Available modes:
1224 # ----------------
1225 # 'eval' (default)
1226 # - escape shell special characters
1227 # 'expand'
1228 # - the same as 'eval'; but do not quote variable references
1229 # 'pretty'
1230 # - request aesthetic output, i.e. '"a b"' instead of 'a\ b'. This might
1231 # be used later in func_quote to get output like: 'echo "a b"' instead
1232 # of 'echo a\ b'. This is slower than default on some shells.
1233 # 'unquoted'
1234 # - produce also $func_quote_arg_unquoted_result which does not contain
1235 # wrapping double-quotes.
1236 #
1237 # Examples for 'func_quote_arg pretty,unquoted string':
1238 #
1239 # string | *_result | *_unquoted_result
1240 # ------------+-----------------------+-------------------
1241 # " | \" | \"
1242 # a b | "a b" | a b
1243 # "a b" | "\"a b\"" | \"a b\"
1244 # * | "*" | *
1245 # z="${x-$y}" | "z=\"\${x-\$y}\"" | z=\"\${x-\$y}\"
1246 #
1247 # Examples for 'func_quote_arg pretty,unquoted,expand string':
1248 #
1249 # string | *_result | *_unquoted_result
1250 # --------------+---------------------+--------------------
1251 # z="${x-$y}" | "z=\"${x-$y}\"" | z=\"${x-$y}\"
1252 func_quote_arg ()
1253 {
1254 _G_quote_expand=false
1255 case ,$1, in
1256 *,expand,*)
1257 _G_quote_expand=:
1258 ;;
1259 esac
1260
1261 case ,$1, in
1262 *,pretty,*|*,expand,*|*,unquoted,*)
1263 func_quote_portable $_G_quote_expand "$2"
1264 func_quote_arg_result=$func_quote_portable_result
1265 func_quote_arg_unquoted_result=$func_quote_portable_unquoted_result
1266 ;;
1267 *)
1268 # Faster quote-for-eval for some shells.
1269 func_quotefast_eval "$2"
1270 func_quote_arg_result=$func_quotefast_eval_result
1271 ;;
1272 esac
1273 }
1274
1275
1276 # func_quote MODEs ARGs...
1277 # ------------------------
1278 # Quote all ARGs to be evaled later and join them into single command. See
1279 # func_quote_arg's description for more info.
1280 func_quote ()
1281 {
1282 $debug_cmd
1283 _G_func_quote_mode=$1 ; shift
1284 func_quote_result=
1285 while test 0 -lt $#; do
1286 func_quote_arg "$_G_func_quote_mode" "$1"
1287 if test -n "$func_quote_result"; then
1288 func_append func_quote_result " $func_quote_arg_result"
11841289 else
1185 func_append func_quote_for_eval_result "$_G_quoted_arg"
1290 func_append func_quote_result "$func_quote_arg_result"
11861291 fi
11871292 shift
11881293 done
1189 }
1190
1191
1192 # func_quote_for_expand ARG
1193 # -------------------------
1194 # Aesthetically quote ARG to be evaled later; same as above,
1195 # but do not quote variable references.
1196 func_quote_for_expand ()
1197 {
1198 $debug_cmd
1199
1200 case $1 in
1201 *[\\\`\"]*)
1202 _G_arg=`$ECHO "$1" | $SED \
1203 -e "$sed_double_quote_subst" -e "$sed_double_backslash"` ;;
1204 *)
1205 _G_arg=$1 ;;
1206 esac
1207
1208 case $_G_arg in
1209 # Double-quote args containing shell metacharacters to delay
1210 # word splitting and command substitution for a subsequent eval.
1211 # Many Bourne shells cannot handle close brackets correctly
1212 # in scan sets, so we specify it separately.
1213 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1214 _G_arg=\"$_G_arg\"
1215 ;;
1216 esac
1217
1218 func_quote_for_expand_result=$_G_arg
12191294 }
12201295
12211296
12611336 _G_cmd=$1
12621337 _G_fail_exp=${2-':'}
12631338
1264 func_quote_for_expand "$_G_cmd"
1265 eval "func_notquiet $func_quote_for_expand_result"
1339 func_quote_arg pretty,expand "$_G_cmd"
1340 eval "func_notquiet $func_quote_arg_result"
12661341
12671342 $opt_dry_run || {
12681343 eval "$_G_cmd"
12871362 _G_fail_exp=${2-':'}
12881363
12891364 $opt_quiet || {
1290 func_quote_for_expand "$_G_cmd"
1291 eval "func_echo $func_quote_for_expand_result"
1365 func_quote_arg expand,pretty "$_G_cmd"
1366 eval "func_echo $func_quote_arg_result"
12921367 }
12931368
12941369 $opt_dry_run || {
14151490 # End:
14161491 #! /bin/sh
14171492
1418 # Set a version string for this script.
1419 scriptversion=2014-01-07.03; # UTC
1420
14211493 # A portable, pluggable option parser for Bourne shell.
14221494 # Written by Gary V. Vaughan, 2010
14231495
1424 # Copyright (C) 2010-2015 Free Software Foundation, Inc.
1425 # This is free software; see the source for copying conditions. There is NO
1426 # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
1427
1428 # This program is free software: you can redistribute it and/or modify
1429 # it under the terms of the GNU General Public License as published by
1430 # the Free Software Foundation, either version 3 of the License, or
1431 # (at your option) any later version.
1432
1433 # This program is distributed in the hope that it will be useful,
1434 # but WITHOUT ANY WARRANTY; without even the implied warranty of
1435 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1436 # GNU General Public License for more details.
1437
1438 # You should have received a copy of the GNU General Public License
1439 # along with this program. If not, see <http://www.gnu.org/licenses/>.
1440
1441 # Please report bugs or propose patches to gary@gnu.org.
1496 # This is free software. There is NO warranty; not even for
1497 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
1498 #
1499 # Copyright (C) 2010-2017 Bootstrap Authors
1500 #
1501 # This file is dual licensed under the terms of the MIT license
1502 # <https://opensource.org/license/MIT>, and GPL version 3 or later
1503 # <http://www.gnu.org/licenses/gpl-2.0.html>. You must apply one of
1504 # these licenses when using or redistributing this software or any of
1505 # the files within it. See the URLs above, or the file `LICENSE`
1506 # included in the Bootstrap distribution for the full license texts.
1507
1508 # Please report bugs or propose patches to:
1509 # <https://github.com/gnulib-modules/bootstrap/issues>
1510
1511 # Set a version string for this script.
1512 scriptversion=2016-03-06.01; # UTC
14421513
14431514
14441515 ## ------ ##
14611532 #
14621533 # In order for the '--version' option to work, you will need to have a
14631534 # suitably formatted comment like the one at the top of this file
1464 # starting with '# Written by ' and ending with '# warranty; '.
1535 # starting with '# Written by ' and ending with '# Copyright'.
14651536 #
14661537 # For '-h' and '--help' to work, you will also need a one line
14671538 # description of your script's purpose in a comment directly above the
14731544 # to display verbose messages only when your user has specified
14741545 # '--verbose'.
14751546 #
1476 # After sourcing this file, you can plug processing for additional
1547 # After sourcing this file, you can plug in processing for additional
14771548 # options by amending the variables from the 'Configuration' section
14781549 # below, and following the instructions in the 'Option parsing'
14791550 # section further down.
15221593 ## ------------------------- ##
15231594
15241595 # This section contains functions for adding, removing, and running hooks
1525 # to the main code. A hook is just a named list of of function, that can
1526 # be run in order later on.
1596 # in the main code. A hook is just a list of function names that can be
1597 # run in order later on.
15271598
15281599 # func_hookable FUNC_NAME
15291600 # -----------------------
15561627
15571628 # func_remove_hook FUNC_NAME HOOK_FUNC
15581629 # ------------------------------------
1559 # Remove HOOK_FUNC from the list of functions called by FUNC_NAME.
1630 # Remove HOOK_FUNC from the list of hook functions to be called by
1631 # FUNC_NAME.
15601632 func_remove_hook ()
15611633 {
15621634 $debug_cmd
15631635
15641636 eval ${1}_hooks='`$ECHO "\$'$1'_hooks" |$SED "s| '$2'||"`'
1637 }
1638
1639
1640 # func_propagate_result FUNC_NAME_A FUNC_NAME_B
1641 # ---------------------------------------------
1642 # If the *_result variable of FUNC_NAME_A _is set_, assign its value to
1643 # *_result variable of FUNC_NAME_B.
1644 func_propagate_result ()
1645 {
1646 $debug_cmd
1647
1648 func_propagate_result_result=:
1649 if eval "test \"\${${1}_result+set}\" = set"
1650 then
1651 eval "${2}_result=\$${1}_result"
1652 else
1653 func_propagate_result_result=false
1654 fi
15651655 }
15661656
15671657
15681658 # func_run_hooks FUNC_NAME [ARG]...
15691659 # ---------------------------------
15701660 # Run all hook functions registered to FUNC_NAME.
1571 # It is assumed that the list of hook functions contains nothing more
1661 # It's assumed that the list of hook functions contains nothing more
15721662 # than a whitespace-delimited list of legal shell function names, and
15731663 # no effort is wasted trying to catch shell meta-characters or preserve
15741664 # whitespace.
15781668
15791669 case " $hookable_fns " in
15801670 *" $1 "*) ;;
1581 *) func_fatal_error "'$1' does not support hook funcions.n" ;;
1671 *) func_fatal_error "'$1' does not support hook functions." ;;
15821672 esac
15831673
15841674 eval _G_hook_fns=\$$1_hooks; shift
15851675
15861676 for _G_hook in $_G_hook_fns; do
1587 eval $_G_hook '"$@"'
1588
1589 # store returned options list back into positional
1590 # parameters for next 'cmd' execution.
1591 eval _G_hook_result=\$${_G_hook}_result
1592 eval set dummy "$_G_hook_result"; shift
1677 func_unset "${_G_hook}_result"
1678 eval $_G_hook '${1+"$@"}'
1679 func_propagate_result $_G_hook func_run_hooks
1680 if $func_propagate_result_result; then
1681 eval set dummy "$func_run_hooks_result"; shift
1682 fi
15931683 done
1594
1595 func_quote_for_eval ${1+"$@"}
1596 func_run_hooks_result=$func_quote_for_eval_result
15971684 }
15981685
15991686
16031690 ## --------------- ##
16041691
16051692 # In order to add your own option parsing hooks, you must accept the
1606 # full positional parameter list in your hook function, remove any
1607 # options that you action, and then pass back the remaining unprocessed
1608 # options in '<hooked_function_name>_result', escaped suitably for
1609 # 'eval'. Like this:
1693 # full positional parameter list from your hook function. You may remove
1694 # or edit any options that you action, and then pass back the remaining
1695 # unprocessed options in '<hooked_function_name>_result', escaped
1696 # suitably for 'eval'.
1697 #
1698 # The '<hooked_function_name>_result' variable is automatically unset
1699 # before your hook gets called; for best performance, only set the
1700 # *_result variable when necessary (i.e. don't call the 'func_quote'
1701 # function unnecessarily because it can be an expensive operation on some
1702 # machines).
1703 #
1704 # Like this:
16101705 #
16111706 # my_options_prep ()
16121707 # {
16161711 # usage_message=$usage_message'
16171712 # -s, --silent don'\''t print informational messages
16181713 # '
1619 #
1620 # func_quote_for_eval ${1+"$@"}
1621 # my_options_prep_result=$func_quote_for_eval_result
1714 # # No change in '$@' (ignored completely by this hook). Leave
1715 # # my_options_prep_result variable intact.
16221716 # }
16231717 # func_add_hook func_options_prep my_options_prep
16241718 #
16271721 # {
16281722 # $debug_cmd
16291723 #
1630 # # Note that for efficiency, we parse as many options as we can
1724 # args_changed=false
1725 #
1726 # # Note that, for efficiency, we parse as many options as we can
16311727 # # recognise in a loop before passing the remainder back to the
16321728 # # caller on the first unrecognised argument we encounter.
16331729 # while test $# -gt 0; do
16341730 # opt=$1; shift
16351731 # case $opt in
1636 # --silent|-s) opt_silent=: ;;
1732 # --silent|-s) opt_silent=:
1733 # args_changed=:
1734 # ;;
16371735 # # Separate non-argument short options:
16381736 # -s*) func_split_short_opt "$_G_opt"
16391737 # set dummy "$func_split_short_opt_name" \
16401738 # "-$func_split_short_opt_arg" ${1+"$@"}
16411739 # shift
1740 # args_changed=:
16421741 # ;;
1643 # *) set dummy "$_G_opt" "$*"; shift; break ;;
1742 # *) # Make sure the first unrecognised option "$_G_opt"
1743 # # is added back to "$@" in case we need it later,
1744 # # if $args_changed was set to 'true'.
1745 # set dummy "$_G_opt" ${1+"$@"}; shift; break ;;
16441746 # esac
16451747 # done
16461748 #
1647 # func_quote_for_eval ${1+"$@"}
1648 # my_silent_option_result=$func_quote_for_eval_result
1749 # # Only call 'func_quote' here if we processed at least one argument.
1750 # if $args_changed; then
1751 # func_quote eval ${1+"$@"}
1752 # my_silent_option_result=$func_quote_result
1753 # fi
16491754 # }
16501755 # func_add_hook func_parse_options my_silent_option
16511756 #
16561761 #
16571762 # $opt_silent && $opt_verbose && func_fatal_help "\
16581763 # '--silent' and '--verbose' options are mutually exclusive."
1659 #
1660 # func_quote_for_eval ${1+"$@"}
1661 # my_option_validation_result=$func_quote_for_eval_result
16621764 # }
16631765 # func_add_hook func_validate_options my_option_validation
16641766 #
1665 # You'll alse need to manually amend $usage_message to reflect the extra
1767 # You'll also need to manually amend $usage_message to reflect the extra
16661768 # options you parse. It's preferable to append if you can, so that
16671769 # multiple option parsing hooks can be added safely.
1770
1771
1772 # func_options_finish [ARG]...
1773 # ----------------------------
1774 # Finishing the option parse loop (call 'func_options' hooks ATM).
1775 func_options_finish ()
1776 {
1777 $debug_cmd
1778
1779 func_run_hooks func_options ${1+"$@"}
1780 func_propagate_result func_run_hooks func_options_finish
1781 }
16681782
16691783
16701784 # func_options [ARG]...
16761790 {
16771791 $debug_cmd
16781792
1679 func_options_prep ${1+"$@"}
1680 eval func_parse_options \
1681 ${func_options_prep_result+"$func_options_prep_result"}
1682 eval func_validate_options \
1683 ${func_parse_options_result+"$func_parse_options_result"}
1684
1685 eval func_run_hooks func_options \
1686 ${func_validate_options_result+"$func_validate_options_result"}
1687
1688 # save modified positional parameters for caller
1689 func_options_result=$func_run_hooks_result
1793 _G_options_quoted=false
1794
1795 for my_func in options_prep parse_options validate_options options_finish
1796 do
1797 func_unset func_${my_func}_result
1798 func_unset func_run_hooks_result
1799 eval func_$my_func '${1+"$@"}'
1800 func_propagate_result func_$my_func func_options
1801 if $func_propagate_result_result; then
1802 eval set dummy "$func_options_result"; shift
1803 _G_options_quoted=:
1804 fi
1805 done
1806
1807 $_G_options_quoted || {
1808 # As we (func_options) are top-level options-parser function and
1809 # nobody quoted "$@" for us yet, we need to do it explicitly for
1810 # caller.
1811 func_quote eval ${1+"$@"}
1812 func_options_result=$func_quote_result
1813 }
16901814 }
16911815
16921816
16951819 # All initialisations required before starting the option parse loop.
16961820 # Note that when calling hook functions, we pass through the list of
16971821 # positional parameters. If a hook function modifies that list, and
1698 # needs to propogate that back to rest of this script, then the complete
1699 # modified list must be put in 'func_run_hooks_result' before
1700 # returning.
1822 # needs to propagate that back to rest of this script, then the complete
1823 # modified list must be put in 'func_run_hooks_result' before returning.
17011824 func_hookable func_options_prep
17021825 func_options_prep ()
17031826 {
17081831 opt_warning_types=
17091832
17101833 func_run_hooks func_options_prep ${1+"$@"}
1711
1712 # save modified positional parameters for caller
1713 func_options_prep_result=$func_run_hooks_result
1834 func_propagate_result func_run_hooks func_options_prep
17141835 }
17151836
17161837
17221843 {
17231844 $debug_cmd
17241845
1725 func_parse_options_result=
1726
1846 _G_parse_options_requote=false
17271847 # this just eases exit handling
17281848 while test $# -gt 0; do
17291849 # Defer to hook functions for initial option parsing, so they
17301850 # get priority in the event of reusing an option name.
17311851 func_run_hooks func_parse_options ${1+"$@"}
1732
1733 # Adjust func_parse_options positional parameters to match
1734 eval set dummy "$func_run_hooks_result"; shift
1852 func_propagate_result func_run_hooks func_parse_options
1853 if $func_propagate_result_result; then
1854 eval set dummy "$func_parse_options_result"; shift
1855 # Even though we may have changed "$@", we passed the "$@" array
1856 # down into the hook and it quoted it for us (because we are in
1857 # this if-branch). No need to quote it again.
1858 _G_parse_options_requote=false
1859 fi
17351860
17361861 # Break out of the loop if we already parsed every option.
17371862 test $# -gt 0 || break
17381863
1864 # We expect that one of the options parsed in this function matches
1865 # and thus we remove _G_opt from "$@" and need to re-quote.
1866 _G_match_parse_options=:
17391867 _G_opt=$1
17401868 shift
17411869 case $_G_opt in
17421870 --debug|-x) debug_cmd='set -x'
1743 func_echo "enabling shell trace mode"
1871 func_echo "enabling shell trace mode" >&2
17441872 $debug_cmd
17451873 ;;
17461874
17501878 ;;
17511879
17521880 --warnings|--warning|-W)
1753 test $# = 0 && func_missing_arg $_G_opt && break
1881 if test $# = 0 && func_missing_arg $_G_opt; then
1882 _G_parse_options_requote=:
1883 break
1884 fi
17541885 case " $warning_categories $1" in
17551886 *" $1 "*)
17561887 # trailing space prevents matching last $1 above
18031934 shift
18041935 ;;
18051936
1806 --) break ;;
1937 --) _G_parse_options_requote=: ; break ;;
18071938 -*) func_fatal_help "unrecognised option: '$_G_opt'" ;;
1808 *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;;
1939 *) set dummy "$_G_opt" ${1+"$@"}; shift
1940 _G_match_parse_options=false
1941 break
1942 ;;
18091943 esac
1944
1945 if $_G_match_parse_options; then
1946 _G_parse_options_requote=:
1947 fi
18101948 done
18111949
1812 # save modified positional parameters for caller
1813 func_quote_for_eval ${1+"$@"}
1814 func_parse_options_result=$func_quote_for_eval_result
1950 if $_G_parse_options_requote; then
1951 # save modified positional parameters for caller
1952 func_quote eval ${1+"$@"}
1953 func_parse_options_result=$func_quote_result
1954 fi
18151955 }
18161956
18171957
18281968 test -n "$opt_warning_types" || opt_warning_types=" $warning_categories"
18291969
18301970 func_run_hooks func_validate_options ${1+"$@"}
1971 func_propagate_result func_run_hooks func_validate_options
18311972
18321973 # Bail if the options were screwed!
18331974 $exit_cmd $EXIT_FAILURE
1834
1835 # save modified positional parameters for caller
1836 func_validate_options_result=$func_run_hooks_result
18371975 }
18381976
18391977
18892027
18902028 # func_split_equals STRING
18912029 # ------------------------
1892 # Set func_split_equals_lhs and func_split_equals_rhs shell variables after
1893 # splitting STRING at the '=' sign.
2030 # Set func_split_equals_lhs and func_split_equals_rhs shell variables
2031 # after splitting STRING at the '=' sign.
18942032 test -z "$_G_HAVE_XSI_OPS" \
18952033 && (eval 'x=a/b/c;
18962034 test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \
19052043
19062044 func_split_equals_lhs=${1%%=*}
19072045 func_split_equals_rhs=${1#*=}
1908 test "x$func_split_equals_lhs" = "x$1" \
1909 && func_split_equals_rhs=
2046 if test "x$func_split_equals_lhs" = "x$1"; then
2047 func_split_equals_rhs=
2048 fi
19102049 }'
19112050 else
19122051 # ...otherwise fall back to using expr, which is often a shell builtin.
19842123 # func_version
19852124 # ------------
19862125 # Echo version message to standard output and exit.
2126 # The version message is extracted from the calling file's header
2127 # comments, with leading '# ' stripped:
2128 # 1. First display the progname and version
2129 # 2. Followed by the header comment line matching /^# Written by /
2130 # 3. Then a blank line followed by the first following line matching
2131 # /^# Copyright /
2132 # 4. Immediately followed by any lines between the previous matches,
2133 # except lines preceding the intervening completely blank line.
2134 # For example, see the header comments of this file.
19872135 func_version ()
19882136 {
19892137 $debug_cmd
19902138
19912139 printf '%s\n' "$progname $scriptversion"
19922140 $SED -n '
1993 /(C)/!b go
1994 :more
1995 /\./!{
1996 N
1997 s|\n# | |
1998 b more
2141 /^# Written by /!b
2142 s|^# ||; p; n
2143
2144 :fwd2blnk
2145 /./ {
2146 n
2147 b fwd2blnk
19992148 }
2000 :go
2001 /^# Written by /,/# warranty; / {
2002 s|^# ||
2003 s|^# *$||
2004 s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2|
2005 p
2149 p; n
2150
2151 :holdwrnt
2152 s|^# ||
2153 s|^# *$||
2154 /^Copyright /!{
2155 /./H
2156 n
2157 b holdwrnt
20062158 }
2007 /^# Written by / {
2008 s|^# ||
2009 p
2010 }
2011 /^warranty; /q' < "$progpath"
2159
2160 s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2|
2161 G
2162 s|\(\n\)\n*|\1|g
2163 p; q' < "$progpath"
20122164
20132165 exit $?
20142166 }
20232175 # End:
20242176
20252177 # Set a version string.
2026 scriptversion='(GNU libtool) 2.4.6'
2178 scriptversion='(GNU libtool) 2.4.6.40-6ca5-dirty'
20272179
20282180
20292181 # func_echo ARG...
21142266 compiler: $LTCC
21152267 compiler flags: $LTCFLAGS
21162268 linker: $LD (gnu? $with_gnu_ld)
2117 version: $progname (GNU libtool) 2.4.6
2269 version: $progname (GNU libtool) 2.4.6.40-6ca5-dirty
21182270 automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q`
21192271 autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q`
21202272
21212273 Report bugs to <bug-libtool@gnu.org>.
2122 GNU libtool home page: <http://www.gnu.org/software/libtool/>.
2274 GNU libtool home page: <http://www.gnu.org/s/libtool/>.
21232275 General help using GNU software: <http://www.gnu.org/gethelp/>."
21242276 exit 0
21252277 }
21702322 # a configuration failure hint, and exit.
21712323 func_fatal_configuration ()
21722324 {
2173 func__fatal_error ${1+"$@"} \
2325 func_fatal_error ${1+"$@"} \
21742326 "See the $PACKAGE documentation for more information." \
21752327 "Fatal configuration error."
21762328 }
23162468 nonopt=
23172469 preserve_args=
23182470
2471 _G_rc_lt_options_prep=:
2472
23192473 # Shorthand for --mode=foo, only valid as the first argument
23202474 case $1 in
23212475 clean|clea|cle|cl)
23392493 uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
23402494 shift; set dummy --mode uninstall ${1+"$@"}; shift
23412495 ;;
2496 *)
2497 _G_rc_lt_options_prep=false
2498 ;;
23422499 esac
23432500
2344 # Pass back the list of options.
2345 func_quote_for_eval ${1+"$@"}
2346 libtool_options_prep_result=$func_quote_for_eval_result
2501 if $_G_rc_lt_options_prep; then
2502 # Pass back the list of options.
2503 func_quote eval ${1+"$@"}
2504 libtool_options_prep_result=$func_quote_result
2505 fi
23472506 }
23482507 func_add_hook func_options_prep libtool_options_prep
23492508
23552514 {
23562515 $debug_cmd
23572516
2517 _G_rc_lt_parse_options=false
2518
23582519 # Perform our own loop to consume as many options as possible in
23592520 # each iteration.
23602521 while test $# -gt 0; do
2522 _G_match_lt_parse_options=:
23612523 _G_opt=$1
23622524 shift
23632525 case $_G_opt in
24322594 func_append preserve_args " $_G_opt"
24332595 ;;
24342596
2435 # An option not handled by this hook function:
2436 *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;;
2597 # An option not handled by this hook function:
2598 *) set dummy "$_G_opt" ${1+"$@"} ; shift
2599 _G_match_lt_parse_options=false
2600 break
2601 ;;
24372602 esac
2603 $_G_match_lt_parse_options && _G_rc_lt_parse_options=:
24382604 done
24392605
2440
2441 # save modified positional parameters for caller
2442 func_quote_for_eval ${1+"$@"}
2443 libtool_parse_options_result=$func_quote_for_eval_result
2606 if $_G_rc_lt_parse_options; then
2607 # save modified positional parameters for caller
2608 func_quote eval ${1+"$@"}
2609 libtool_parse_options_result=$func_quote_result
2610 fi
24442611 }
24452612 func_add_hook func_parse_options libtool_parse_options
24462613
24972664 }
24982665
24992666 # Pass back the unparsed argument list
2500 func_quote_for_eval ${1+"$@"}
2501 libtool_validate_options_result=$func_quote_for_eval_result
2667 func_quote eval ${1+"$@"}
2668 libtool_validate_options_result=$func_quote_result
25022669 }
25032670 func_add_hook func_validate_options libtool_validate_options
25042671
34643631 esac
34653632 done
34663633
3467 func_quote_for_eval "$libobj"
3468 test "X$libobj" != "X$func_quote_for_eval_result" \
3634 func_quote_arg pretty "$libobj"
3635 test "X$libobj" != "X$func_quote_arg_result" \
34693636 && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \
34703637 && func_warning "libobj name '$libobj' may not contain shell special characters."
34713638 func_dirname_and_basename "$obj" "/" ""
35383705
35393706 func_to_tool_file "$srcfile" func_convert_file_msys_to_w32
35403707 srcfile=$func_to_tool_file_result
3541 func_quote_for_eval "$srcfile"
3542 qsrcfile=$func_quote_for_eval_result
3708 func_quote_arg pretty "$srcfile"
3709 qsrcfile=$func_quote_arg_result
35433710
35443711 # Only build a PIC object if we are building libtool libraries.
35453712 if test yes = "$build_libtool_libs"; then
41424309 case $nonopt in *shtool*) :;; *) false;; esac
41434310 then
41444311 # Aesthetically quote it.
4145 func_quote_for_eval "$nonopt"
4146 install_prog="$func_quote_for_eval_result "
4312 func_quote_arg pretty "$nonopt"
4313 install_prog="$func_quote_arg_result "
41474314 arg=$1
41484315 shift
41494316 else
41534320
41544321 # The real first argument should be the name of the installation program.
41554322 # Aesthetically quote it.
4156 func_quote_for_eval "$arg"
4157 func_append install_prog "$func_quote_for_eval_result"
4323 func_quote_arg pretty "$arg"
4324 func_append install_prog "$func_quote_arg_result"
41584325 install_shared_prog=$install_prog
41594326 case " $install_prog " in
41604327 *[\\\ /]cp\ *) install_cp=: ;;
42114378 esac
42124379
42134380 # Aesthetically quote the argument.
4214 func_quote_for_eval "$arg"
4215 func_append install_prog " $func_quote_for_eval_result"
4381 func_quote_arg pretty "$arg"
4382 func_append install_prog " $func_quote_arg_result"
42164383 if test -n "$arg2"; then
4217 func_quote_for_eval "$arg2"
4384 func_quote_arg pretty "$arg2"
42184385 fi
4219 func_append install_shared_prog " $func_quote_for_eval_result"
4386 func_append install_shared_prog " $func_quote_arg_result"
42204387 done
42214388
42224389 test -z "$install_prog" && \
42274394
42284395 if test -n "$install_override_mode" && $no_mode; then
42294396 if $install_cp; then :; else
4230 func_quote_for_eval "$install_override_mode"
4231 func_append install_shared_prog " -m $func_quote_for_eval_result"
4397 func_quote_arg pretty "$install_override_mode"
4398 func_append install_shared_prog " -m $func_quote_arg_result"
42324399 fi
42334400 fi
42344401
45244691 relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'`
45254692
45264693 $opt_quiet || {
4527 func_quote_for_expand "$relink_command"
4528 eval "func_echo $func_quote_for_expand_result"
4694 func_quote_arg expand,pretty "$relink_command"
4695 eval "func_echo $func_quote_arg_result"
45294696 }
45304697 if eval "$relink_command"; then :
45314698 else
53045471 if test \"\$libtool_execute_magic\" != \"$magic\"; then
53055472 file=\"\$0\""
53065473
5307 func_quote "$ECHO"
5308 qECHO=$func_quote_result
5474 func_quote_arg pretty "$ECHO"
5475 qECHO=$func_quote_arg_result
53095476 $ECHO "\
53105477
53115478 # A function that is used when there is no print builtin or printf.
53155482 \$1
53165483 _LTECHO_EOF'
53175484 }
5318 ECHO=\"$qECHO\"
5485 ECHO=$qECHO
53195486 fi
53205487
53215488 # Very basic option parsing. These options are (a) specific to
66586825 while test "$#" -gt 0; do
66596826 arg=$1
66606827 shift
6661 func_quote_for_eval "$arg"
6662 qarg=$func_quote_for_eval_unquoted_result
6663 func_append libtool_args " $func_quote_for_eval_result"
6828 func_quote_arg pretty,unquoted "$arg"
6829 qarg=$func_quote_arg_unquoted_result
6830 func_append libtool_args " $func_quote_arg_result"
66646831
66656832 # If the previous option needs an argument, assign it.
66666833 if test -n "$prev"; then
72587425 save_ifs=$IFS; IFS=,
72597426 for flag in $args; do
72607427 IFS=$save_ifs
7261 func_quote_for_eval "$flag"
7262 func_append arg " $func_quote_for_eval_result"
7263 func_append compiler_flags " $func_quote_for_eval_result"
7428 func_quote_arg pretty "$flag"
7429 func_append arg " $func_quote_arg_result"
7430 func_append compiler_flags " $func_quote_arg_result"
72647431 done
72657432 IFS=$save_ifs
72667433 func_stripname ' ' '' "$arg"
72747441 save_ifs=$IFS; IFS=,
72757442 for flag in $args; do
72767443 IFS=$save_ifs
7277 func_quote_for_eval "$flag"
7278 func_append arg " $wl$func_quote_for_eval_result"
7279 func_append compiler_flags " $wl$func_quote_for_eval_result"
7280 func_append linker_flags " $func_quote_for_eval_result"
7444 func_quote_arg pretty "$flag"
7445 func_append arg " $wl$func_quote_arg_result"
7446 func_append compiler_flags " $wl$func_quote_arg_result"
7447 func_append linker_flags " $func_quote_arg_result"
72817448 done
72827449 IFS=$save_ifs
72837450 func_stripname ' ' '' "$arg"
73017468
73027469 # -msg_* for osf cc
73037470 -msg_*)
7304 func_quote_for_eval "$arg"
7305 arg=$func_quote_for_eval_result
7471 func_quote_arg pretty "$arg"
7472 arg=$func_quote_arg_result
73067473 ;;
73077474
73087475 # Flags to be passed through unchanged, with rationale:
73277494 -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
73287495 -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \
73297496 -specs=*|-fsanitize=*|-fuse-ld=*)
7330 func_quote_for_eval "$arg"
7331 arg=$func_quote_for_eval_result
7497 func_quote_arg pretty "$arg"
7498 arg=$func_quote_arg_result
73327499 func_append compile_command " $arg"
73337500 func_append finalize_command " $arg"
73347501 func_append compiler_flags " $arg"
73497516 continue
73507517 else
73517518 # Otherwise treat like 'Some other compiler flag' below
7352 func_quote_for_eval "$arg"
7353 arg=$func_quote_for_eval_result
7519 func_quote_arg pretty "$arg"
7520 arg=$func_quote_arg_result
73547521 fi
73557522 ;;
73567523
73577524 # Some other compiler flag.
73587525 -* | +*)
7359 func_quote_for_eval "$arg"
7360 arg=$func_quote_for_eval_result
7526 func_quote_arg pretty "$arg"
7527 arg=$func_quote_arg_result
73617528 ;;
73627529
73637530 *.$objext)
74777644 *)
74787645 # Unknown arguments in both finalize_command and compile_command need
74797646 # to be aesthetically quoted because they are evaled later.
7480 func_quote_for_eval "$arg"
7481 arg=$func_quote_for_eval_result
7647 func_quote_arg pretty "$arg"
7648 arg=$func_quote_arg_result
74827649 ;;
74837650 esac # arg
74847651
998410151 for cmd in $concat_cmds; do
998510152 IFS=$save_ifs
998610153 $opt_quiet || {
9987 func_quote_for_expand "$cmd"
9988 eval "func_echo $func_quote_for_expand_result"
10154 func_quote_arg expand,pretty "$cmd"
10155 eval "func_echo $func_quote_arg_result"
998910156 }
999010157 $opt_dry_run || eval "$cmd" || {
999110158 lt_exit=$?
1007810245 eval cmd=\"$cmd\"
1007910246 IFS=$save_ifs
1008010247 $opt_quiet || {
10081 func_quote_for_expand "$cmd"
10082 eval "func_echo $func_quote_for_expand_result"
10248 func_quote_arg expand,pretty "$cmd"
10249 eval "func_echo $func_quote_arg_result"
1008310250 }
1008410251 $opt_dry_run || eval "$cmd" || {
1008510252 lt_exit=$?
1055310720 elif eval var_value=\$$var; test -z "$var_value"; then
1055410721 relink_command="$var=; export $var; $relink_command"
1055510722 else
10556 func_quote_for_eval "$var_value"
10557 relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
10723 func_quote_arg pretty "$var_value"
10724 relink_command="$var=$func_quote_arg_result; export $var; $relink_command"
1055810725 fi
1055910726 done
10560 func_quote "(cd `pwd`; $relink_command)"
10561 relink_command=$func_quote_result
10727 func_quote eval cd "`pwd`"
10728 func_quote_arg pretty,unquoted "($func_quote_result; $relink_command)"
10729 relink_command=$func_quote_arg_unquoted_result
1056210730 fi
1056310731
1056410732 # Only actually do things if not in dry run mode.
1079810966 elif eval var_value=\$$var; test -z "$var_value"; then
1079910967 relink_command="$var=; export $var; $relink_command"
1080010968 else
10801 func_quote_for_eval "$var_value"
10802 relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
10969 func_quote_arg pretty,unquoted "$var_value"
10970 relink_command="$var=$func_quote_arg_unquoted_result; export $var; $relink_command"
1080310971 fi
1080410972 done
1080510973 # Quote the link command for shipping.
10806 relink_command="(cd `pwd`; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
10807 func_quote "$relink_command"
10808 relink_command=$func_quote_result
10974 func_quote eval cd "`pwd`"
10975 relink_command="($func_quote_result; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
10976 func_quote_arg pretty,unquoted "$relink_command"
10977 relink_command=$func_quote_arg_unquoted_result
1080910978 if test yes = "$hardcode_automatic"; then
1081010979 relink_command=
1081110980 fi
00 #! /bin/sh
11 # Common wrapper for a few potentially missing GNU programs.
22
3 scriptversion=2013-10-28.13; # UTC
4
5 # Copyright (C) 1996-2013 Free Software Foundation, Inc.
3 scriptversion=2016-01-11.22; # UTC
4
5 # Copyright (C) 1996-2017 Free Software Foundation, Inc.
66 # Originally written by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
77
88 # This program is free software; you can redistribute it and/or modify
209209 # eval: (add-hook 'write-file-hooks 'time-stamp)
210210 # time-stamp-start: "scriptversion="
211211 # time-stamp-format: "%:y-%02m-%02d.%02H"
212 # time-stamp-time-zone: "UTC"
212 # time-stamp-time-zone: "UTC0"
213213 # time-stamp-end: "; # UTC"
214214 # End:
00 #! /bin/sh
11 # Guess values for system-dependent variables and create Makefiles.
2 # Generated by GNU Autoconf 2.69 for libseccomp 2.3.1.
2 # Generated by GNU Autoconf 2.69 for libseccomp 2.3.3.
33 #
44 #
55 # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
586586 # Identity of this package.
587587 PACKAGE_NAME='libseccomp'
588588 PACKAGE_TARNAME='libseccomp'
589 PACKAGE_VERSION='2.3.1'
590 PACKAGE_STRING='libseccomp 2.3.1'
589 PACKAGE_VERSION='2.3.3'
590 PACKAGE_STRING='libseccomp 2.3.3'
591591 PACKAGE_BUGREPORT=''
592592 PACKAGE_URL=''
593593
632632 am__EXEEXT_TRUE
633633 LTLIBOBJS
634634 LIBOBJS
635 CODE_COVERAGE_RULES
636 CODE_COVERAGE_LDFLAGS
637 CODE_COVERAGE_LIBS
638 CODE_COVERAGE_CXXFLAGS
639 CODE_COVERAGE_CFLAGS
640 CODE_COVERAGE_CPPFLAGS
641 GENHTML
642 LCOV
643 GCOV
644 CODE_COVERAGE_ENABLED
645 CODE_COVERAGE_ENABLED_FALSE
646 CODE_COVERAGE_ENABLED_TRUE
635647 COVERITY_FALSE
636648 COVERITY_TRUE
637649 have_coverity
771783 with_sysroot
772784 enable_libtool_lock
773785 enable_python
786 with_gcov
787 enable_code_coverage
774788 '
775789 ac_precious_vars='build_alias
776790 host_alias
13221336 # Omit some internal or obsolete options to make the list less imposing.
13231337 # This message is too long to be a string in the A/UX 3.1 sh.
13241338 cat <<_ACEOF
1325 \`configure' configures libseccomp 2.3.1 to adapt to many kinds of systems.
1339 \`configure' configures libseccomp 2.3.3 to adapt to many kinds of systems.
13261340
13271341 Usage: $0 [OPTION]... [VAR=VALUE]...
13281342
13921406
13931407 if test -n "$ac_init_help"; then
13941408 case $ac_init_help in
1395 short | recursive ) echo "Configuration of libseccomp 2.3.1:";;
1409 short | recursive ) echo "Configuration of libseccomp 2.3.3:";;
13961410 esac
13971411 cat <<\_ACEOF
13981412
14121426 optimize for fast installation [default=yes]
14131427 --disable-libtool-lock avoid locking (might break parallel builds)
14141428 --enable-python build the python bindings, requires cython
1429 --enable-code-coverage Whether to enable code coverage support
14151430
14161431 Optional Packages:
14171432 --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
14241439 --with-gnu-ld assume the C compiler uses GNU ld [default=no]
14251440 --with-sysroot[=DIR] Search for dependent libraries within DIR (or the
14261441 compiler's sysroot if not specified).
1442 --with-gcov=GCOV use given GCOV for coverage (GCOV=gcov).
14271443
14281444 Some influential environment variables:
14291445 CC C compiler command
15031519 test -n "$ac_init_help" && exit $ac_status
15041520 if $ac_init_version; then
15051521 cat <<\_ACEOF
1506 libseccomp configure 2.3.1
1522 libseccomp configure 2.3.3
15071523 generated by GNU Autoconf 2.69
15081524
15091525 Copyright (C) 2012 Free Software Foundation, Inc.
17811797 This file contains any messages produced by compilers while
17821798 running configure, to aid debugging if configure makes a mistake.
17831799
1784 It was created by libseccomp $as_me 2.3.1, which was
1800 It was created by libseccomp $as_me 2.3.3, which was
17851801 generated by GNU Autoconf 2.69. Invocation command line was
17861802
17871803 $ $0 $@
21652181
21662182
21672183
2168 am__api_version='1.14'
2184 am__api_version='1.15'
21692185
21702186 # Find a good install program. We prefer a C program (faster),
21712187 # so one script is as good as another. But avoid the broken or
23372353 ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
23382354 program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
23392355
2340 # expand $ac_aux_dir to an absolute path
2341 am_aux_dir=`cd $ac_aux_dir && pwd`
2356 # Expand $ac_aux_dir to an absolute path.
2357 am_aux_dir=`cd "$ac_aux_dir" && pwd`
23422358
23432359 if test x"${MISSING+set}" != xset; then
23442360 case $am_aux_dir in
23572373 $as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;}
23582374 fi
23592375
2360 if test x"${install_sh}" != xset; then
2376 if test x"${install_sh+set}" != xset; then
23612377 case $am_aux_dir in
23622378 *\ * | *\ *)
23632379 install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
26512667
26522668 # Define the identity of the package.
26532669 PACKAGE='libseccomp'
2654 VERSION='2.3.1'
2670 VERSION='2.3.3'
26552671
26562672
26572673 cat >>confdefs.h <<_ACEOF
26852701 # <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
26862702 mkdir_p='$(MKDIR_P)'
26872703
2688 # We need awk for the "check" target. The system "awk" is bad on
2689 # some platforms.
2704 # We need awk for the "check" target (and possibly the TAP driver). The
2705 # system "awk" is bad on some platforms.
26902706 # Always define AMTAR for backward compatibility. Yes, it's still used
26912707 # in the wild :-( We should find a proper way to deprecate it ...
26922708 AMTAR='$${TAR-tar}'
28282844 as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5
28292845 fi
28302846 fi
2847
28312848
28322849 ac_ext=c
28332850 ac_cpp='$CPP $CPPFLAGS'
40504067
40514068
40524069
4053 macro_version='2.4.6'
4054 macro_revision='2.4.6'
4070 macro_version='2.4.6.40-6ca5-dirty'
4071 macro_revision='2.4.6.40'
40554072
40564073
40574074
57135730 fi
57145731
57155732 : ${AR=ar}
5716 : ${AR_FLAGS=cru}
5717
5718
5719
5720
5721
5733
5734
5735
5736
5737
5738
5739 # Use ARFLAGS variable as AR's operation code to sync the variable naming with
5740 # Automake. If both AR_FLAGS and ARFLAGS are specified, AR_FLAGS should have
5741 # higher priority because thats what people were doing historically (setting
5742 # ARFLAGS for automake and AR_FLAGS for libtool). FIXME: Make the AR_FLAGS
5743 # variable obsoleted/removed.
5744
5745 test ${AR_FLAGS+y} || AR_FLAGS=${ARFLAGS-cr}
5746 lt_ar_flags=$AR_FLAGS
5747
5748
5749
5750
5751
5752
5753 # Make AR_FLAGS overridable by 'make ARFLAGS='. Don't try to run-time override
5754 # by AR_FLAGS because that was never working and AR_FLAGS is about to die.
57225755
57235756
57245757
74377470 _LT_EOF
74387471 echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5
74397472 $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5
7440 echo "$AR cru libconftest.a conftest.o" >&5
7441 $AR cru libconftest.a conftest.o 2>&5
7473 echo "$AR $AR_FLAGS libconftest.a conftest.o" >&5
7474 $AR $AR_FLAGS libconftest.a conftest.o 2>&5
74427475 echo "$RANLIB libconftest.a" >&5
74437476 $RANLIB libconftest.a 2>&5
74447477 cat > conftest.c << _LT_EOF
91999232 emximp -o $lib $output_objdir/$libname.def'
92009233 old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
92019234 enable_shared_with_static_runtimes=yes
9235 file_list_spec='@'
92029236 ;;
92039237
92049238 interix[3-9]*)
94169450 if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
94179451 export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols'
94189452 else
9419 export_symbols_cmds='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
9453 export_symbols_cmds='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
94209454 fi
94219455 aix_use_runtimelinking=no
94229456
1005310087 emximp -o $lib $output_objdir/$libname.def'
1005410088 old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
1005510089 enable_shared_with_static_runtimes=yes
10090 file_list_spec='@'
1005610091 ;;
1005710092
1005810093 osf3*)
1086110896 *) objformat=elf ;;
1086210897 esac
1086310898 fi
10864 # Handle Gentoo/FreeBSD as it was Linux
10865 case $host_vendor in
10866 gentoo)
10867 version_type=linux ;;
10868 *)
10869 version_type=freebsd-$objformat ;;
10870 esac
10871
10899 version_type=freebsd-$objformat
1087210900 case $version_type in
1087310901 freebsd-elf*)
1087410902 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
1087910907 freebsd-*)
1088010908 library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
1088110909 need_version=yes
10882 ;;
10883 linux)
10884 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
10885 soname_spec='${libname}${release}${shared_ext}$major'
10886 need_lib_prefix=no
10887 need_version=no
1088810910 ;;
1088910911 esac
1089010912 shlibpath_var=LD_LIBRARY_PATH
1200912031 old_striplib=
1201012032 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5
1201112033 $as_echo_n "checking whether stripping libraries is possible... " >&6; }
12012 if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
12013 test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
12014 test -z "$striplib" && striplib="$STRIP --strip-unneeded"
12015 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
12034 if test -z "$STRIP"; then
12035 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
12036 $as_echo "no" >&6; }
12037 else
12038 if $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
12039 old_striplib="$STRIP --strip-debug"
12040 striplib="$STRIP --strip-unneeded"
12041 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
1201612042 $as_echo "yes" >&6; }
12017 else
12018 # FIXME - insert some real tests, host_os isn't really good enough
12019 case $host_os in
12020 darwin*)
12021 if test -n "$STRIP"; then
12043 else
12044 case $host_os in
12045 darwin*)
12046 # FIXME - insert some real tests, host_os isn't really good enough
1202212047 striplib="$STRIP -x"
1202312048 old_striplib="$STRIP -S"
1202412049 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
1202512050 $as_echo "yes" >&6; }
12026 else
12051 ;;
12052 freebsd*)
12053 if $STRIP -V 2>&1 | $GREP "elftoolchain" >/dev/null; then
12054 old_striplib="$STRIP --strip-debug"
12055 striplib="$STRIP --strip-unneeded"
12056 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
12057 $as_echo "yes" >&6; }
12058 else
12059 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
12060 $as_echo "no" >&6; }
12061 fi
12062 ;;
12063 *)
1202712064 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
1202812065 $as_echo "no" >&6; }
12029 fi
12030 ;;
12031 *)
12032 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
12033 $as_echo "no" >&6; }
12034 ;;
12035 esac
12066 ;;
12067 esac
12068 fi
1203612069 fi
1203712070
1203812071
1232212355 COVERITY_TRUE='#'
1232312356 COVERITY_FALSE=
1232412357 fi
12358
12359
12360
12361
12362
12363 # allow to override gcov location
12364
12365 # Check whether --with-gcov was given.
12366 if test "${with_gcov+set}" = set; then :
12367 withval=$with_gcov; _AX_CODE_COVERAGE_GCOV_PROG_WITH=$with_gcov
12368 else
12369 _AX_CODE_COVERAGE_GCOV_PROG_WITH=gcov
12370 fi
12371
12372
12373 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with code coverage support" >&5
12374 $as_echo_n "checking whether to build with code coverage support... " >&6; }
12375 # Check whether --enable-code-coverage was given.
12376 if test "${enable_code_coverage+set}" = set; then :
12377 enableval=$enable_code_coverage;
12378 else
12379 enable_code_coverage=no
12380 fi
12381
12382
12383 if test x$enable_code_coverage = xyes; then
12384 CODE_COVERAGE_ENABLED_TRUE=
12385 CODE_COVERAGE_ENABLED_FALSE='#'
12386 else
12387 CODE_COVERAGE_ENABLED_TRUE='#'
12388 CODE_COVERAGE_ENABLED_FALSE=
12389 fi
12390
12391 CODE_COVERAGE_ENABLED=$enable_code_coverage
12392
12393 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_code_coverage" >&5
12394 $as_echo "$enable_code_coverage" >&6; }
12395
12396 if test "$enable_code_coverage" = "yes" ; then :
12397
12398 # check for gcov
12399 if test -n "$ac_tool_prefix"; then
12400 # Extract the first word of "${ac_tool_prefix}$_AX_CODE_COVERAGE_GCOV_PROG_WITH", so it can be a program name with args.
12401 set dummy ${ac_tool_prefix}$_AX_CODE_COVERAGE_GCOV_PROG_WITH; ac_word=$2
12402 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
12403 $as_echo_n "checking for $ac_word... " >&6; }
12404 if ${ac_cv_prog_GCOV+:} false; then :
12405 $as_echo_n "(cached) " >&6
12406 else
12407 if test -n "$GCOV"; then
12408 ac_cv_prog_GCOV="$GCOV" # Let the user override the test.
12409 else
12410 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
12411 for as_dir in $PATH
12412 do
12413 IFS=$as_save_IFS
12414 test -z "$as_dir" && as_dir=.
12415 for ac_exec_ext in '' $ac_executable_extensions; do
12416 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
12417 ac_cv_prog_GCOV="${ac_tool_prefix}$_AX_CODE_COVERAGE_GCOV_PROG_WITH"
12418 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
12419 break 2
12420 fi
12421 done
12422 done
12423 IFS=$as_save_IFS
12424
12425 fi
12426 fi
12427 GCOV=$ac_cv_prog_GCOV
12428 if test -n "$GCOV"; then
12429 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GCOV" >&5
12430 $as_echo "$GCOV" >&6; }
12431 else
12432 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
12433 $as_echo "no" >&6; }
12434 fi
12435
12436
12437 fi
12438 if test -z "$ac_cv_prog_GCOV"; then
12439 ac_ct_GCOV=$GCOV
12440 # Extract the first word of "$_AX_CODE_COVERAGE_GCOV_PROG_WITH", so it can be a program name with args.
12441 set dummy $_AX_CODE_COVERAGE_GCOV_PROG_WITH; ac_word=$2
12442 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
12443 $as_echo_n "checking for $ac_word... " >&6; }
12444 if ${ac_cv_prog_ac_ct_GCOV+:} false; then :
12445 $as_echo_n "(cached) " >&6
12446 else
12447 if test -n "$ac_ct_GCOV"; then
12448 ac_cv_prog_ac_ct_GCOV="$ac_ct_GCOV" # Let the user override the test.
12449 else
12450 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
12451 for as_dir in $PATH
12452 do
12453 IFS=$as_save_IFS
12454 test -z "$as_dir" && as_dir=.
12455 for ac_exec_ext in '' $ac_executable_extensions; do
12456 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
12457 ac_cv_prog_ac_ct_GCOV="$_AX_CODE_COVERAGE_GCOV_PROG_WITH"
12458 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
12459 break 2
12460 fi
12461 done
12462 done
12463 IFS=$as_save_IFS
12464
12465 fi
12466 fi
12467 ac_ct_GCOV=$ac_cv_prog_ac_ct_GCOV
12468 if test -n "$ac_ct_GCOV"; then
12469 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_GCOV" >&5
12470 $as_echo "$ac_ct_GCOV" >&6; }
12471 else
12472 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
12473 $as_echo "no" >&6; }
12474 fi
12475
12476 if test "x$ac_ct_GCOV" = x; then
12477 GCOV=":"
12478 else
12479 case $cross_compiling:$ac_tool_warned in
12480 yes:)
12481 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
12482 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
12483 ac_tool_warned=yes ;;
12484 esac
12485 GCOV=$ac_ct_GCOV
12486 fi
12487 else
12488 GCOV="$ac_cv_prog_GCOV"
12489 fi
12490
12491 if test "X$GCOV" = "X:"; then :
12492 as_fn_error $? "gcov is needed to do coverage" "$LINENO" 5
12493 fi
12494
12495
12496 if test "$GCC" = "no" ; then :
12497
12498 as_fn_error $? "not compiling with gcc, which is required for gcov code coverage" "$LINENO" 5
12499
12500 fi
12501
12502 # Extract the first word of "lcov", so it can be a program name with args.
12503 set dummy lcov; ac_word=$2
12504 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
12505 $as_echo_n "checking for $ac_word... " >&6; }
12506 if ${ac_cv_prog_LCOV+:} false; then :
12507 $as_echo_n "(cached) " >&6
12508 else
12509 if test -n "$LCOV"; then
12510 ac_cv_prog_LCOV="$LCOV" # Let the user override the test.
12511 else
12512 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
12513 for as_dir in $PATH
12514 do
12515 IFS=$as_save_IFS
12516 test -z "$as_dir" && as_dir=.
12517 for ac_exec_ext in '' $ac_executable_extensions; do
12518 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
12519 ac_cv_prog_LCOV="lcov"
12520 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
12521 break 2
12522 fi
12523 done
12524 done
12525 IFS=$as_save_IFS
12526
12527 fi
12528 fi
12529 LCOV=$ac_cv_prog_LCOV
12530 if test -n "$LCOV"; then
12531 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LCOV" >&5
12532 $as_echo "$LCOV" >&6; }
12533 else
12534 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
12535 $as_echo "no" >&6; }
12536 fi
12537
12538
12539 # Extract the first word of "genhtml", so it can be a program name with args.
12540 set dummy genhtml; ac_word=$2
12541 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
12542 $as_echo_n "checking for $ac_word... " >&6; }
12543 if ${ac_cv_prog_GENHTML+:} false; then :
12544 $as_echo_n "(cached) " >&6
12545 else
12546 if test -n "$GENHTML"; then
12547 ac_cv_prog_GENHTML="$GENHTML" # Let the user override the test.
12548 else
12549 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
12550 for as_dir in $PATH
12551 do
12552 IFS=$as_save_IFS
12553 test -z "$as_dir" && as_dir=.
12554 for ac_exec_ext in '' $ac_executable_extensions; do
12555 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
12556 ac_cv_prog_GENHTML="genhtml"
12557 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
12558 break 2
12559 fi
12560 done
12561 done
12562 IFS=$as_save_IFS
12563
12564 fi
12565 fi
12566 GENHTML=$ac_cv_prog_GENHTML
12567 if test -n "$GENHTML"; then
12568 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GENHTML" >&5
12569 $as_echo "$GENHTML" >&6; }
12570 else
12571 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
12572 $as_echo "no" >&6; }
12573 fi
12574
12575
12576
12577 if test -z "$LCOV" ; then :
12578
12579 as_fn_error $? "To enable code coverage reporting you must have lcov installed" "$LINENO" 5
12580
12581 fi
12582
12583 if test -z "$GENHTML" ; then :
12584
12585 as_fn_error $? "Could not find genhtml from the lcov package" "$LINENO" 5
12586
12587 fi
12588
12589 CODE_COVERAGE_CPPFLAGS="-DNDEBUG"
12590 CODE_COVERAGE_CFLAGS="-O0 -g -fprofile-arcs -ftest-coverage"
12591 CODE_COVERAGE_CXXFLAGS="-O0 -g -fprofile-arcs -ftest-coverage"
12592 CODE_COVERAGE_LIBS="-lgcov"
12593 CODE_COVERAGE_LDFLAGS="$CODE_COVERAGE_LIBS"
12594
12595
12596
12597
12598
12599
12600
12601 CODE_COVERAGE_RULES_CHECK='
12602 -$(A''M_V_at)$(MAKE) $(AM_MAKEFLAGS) -k check
12603 $(A''M_V_at)$(MAKE) $(AM_MAKEFLAGS) code-coverage-capture
12604 '
12605 CODE_COVERAGE_RULES_CAPTURE='
12606 $(code_coverage_v_lcov_cap)$(LCOV) $(code_coverage_quiet) $(addprefix --directory ,$(CODE_COVERAGE_DIRECTORY)) --capture --output-file "$(CODE_COVERAGE_OUTPUT_FILE).tmp" --test-name "$(call code_coverage_sanitize,$(PACKAGE_NAME)-$(PACKAGE_VERSION))" --no-checksum --compat-libtool $(CODE_COVERAGE_LCOV_SHOPTS) $(CODE_COVERAGE_LCOV_OPTIONS)
12607 $(code_coverage_v_lcov_ign)$(LCOV) $(code_coverage_quiet) $(addprefix --directory ,$(CODE_COVERAGE_DIRECTORY)) --remove "$(CODE_COVERAGE_OUTPUT_FILE).tmp" "/tmp/*" $(CODE_COVERAGE_IGNORE_PATTERN) --output-file "$(CODE_COVERAGE_OUTPUT_FILE)" $(CODE_COVERAGE_LCOV_SHOPTS) $(CODE_COVERAGE_LCOV_RMOPTS)
12608 -@rm -f $(CODE_COVERAGE_OUTPUT_FILE).tmp
12609 $(code_coverage_v_genhtml)LANG=C $(GENHTML) $(code_coverage_quiet) $(addprefix --prefix ,$(CODE_COVERAGE_DIRECTORY)) --output-directory "$(CODE_COVERAGE_OUTPUT_DIRECTORY)" --title "$(PACKAGE_NAME)-$(PACKAGE_VERSION) Code Coverage" --legend --show-details "$(CODE_COVERAGE_OUTPUT_FILE)" $(CODE_COVERAGE_GENHTML_OPTIONS)
12610 @echo "file://$(abs_builddir)/$(CODE_COVERAGE_OUTPUT_DIRECTORY)/index.html"
12611 '
12612 CODE_COVERAGE_RULES_CLEAN='
12613 clean: code-coverage-clean
12614 distclean: code-coverage-clean
12615 code-coverage-clean:
12616 -$(LCOV) --directory $(top_builddir) -z
12617 -rm -rf $(CODE_COVERAGE_OUTPUT_FILE) $(CODE_COVERAGE_OUTPUT_FILE).tmp $(CODE_COVERAGE_OUTPUT_DIRECTORY)
12618 -find . \( -name "*.gcda" -o -name "*.gcno" -o -name "*.gcov" \) -delete
12619 '
12620
12621 else
12622
12623 CODE_COVERAGE_RULES_CHECK='
12624 @echo "Need to reconfigure with --enable-code-coverage"
12625 '
12626 CODE_COVERAGE_RULES_CAPTURE="$CODE_COVERAGE_RULES_CHECK"
12627 CODE_COVERAGE_RULES_CLEAN=''
12628
12629 fi
12630
12631 CODE_COVERAGE_RULES='
12632 # Code coverage
12633 #
12634 # Optional:
12635 # - CODE_COVERAGE_DIRECTORY: Top-level directory for code coverage reporting.
12636 # Multiple directories may be specified, separated by whitespace.
12637 # (Default: $(top_builddir))
12638 # - CODE_COVERAGE_OUTPUT_FILE: Filename and path for the .info file generated
12639 # by lcov for code coverage. (Default:
12640 # $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage.info)
12641 # - CODE_COVERAGE_OUTPUT_DIRECTORY: Directory for generated code coverage
12642 # reports to be created. (Default:
12643 # $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage)
12644 # - CODE_COVERAGE_BRANCH_COVERAGE: Set to 1 to enforce branch coverage,
12645 # set to 0 to disable it and leave empty to stay with the default.
12646 # (Default: empty)
12647 # - CODE_COVERAGE_LCOV_SHOPTS_DEFAULT: Extra options shared between both lcov
12648 # instances. (Default: based on $CODE_COVERAGE_BRANCH_COVERAGE)
12649 # - CODE_COVERAGE_LCOV_SHOPTS: Extra options to shared between both lcov
12650 # instances. (Default: $CODE_COVERAGE_LCOV_SHOPTS_DEFAULT)
12651 # - CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH: --gcov-tool pathtogcov
12652 # - CODE_COVERAGE_LCOV_OPTIONS_DEFAULT: Extra options to pass to the
12653 # collecting lcov instance. (Default: $CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH)
12654 # - CODE_COVERAGE_LCOV_OPTIONS: Extra options to pass to the collecting lcov
12655 # instance. (Default: $CODE_COVERAGE_LCOV_OPTIONS_DEFAULT)
12656 # - CODE_COVERAGE_LCOV_RMOPTS_DEFAULT: Extra options to pass to the filtering
12657 # lcov instance. (Default: empty)
12658 # - CODE_COVERAGE_LCOV_RMOPTS: Extra options to pass to the filtering lcov
12659 # instance. (Default: $CODE_COVERAGE_LCOV_RMOPTS_DEFAULT)
12660 # - CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT: Extra options to pass to the
12661 # genhtml instance. (Default: based on $CODE_COVERAGE_BRANCH_COVERAGE)
12662 # - CODE_COVERAGE_GENHTML_OPTIONS: Extra options to pass to the genhtml
12663 # instance. (Default: $CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT)
12664 # - CODE_COVERAGE_IGNORE_PATTERN: Extra glob pattern of files to ignore
12665 #
12666 # The generated report will be titled using the $(PACKAGE_NAME) and
12667 # $(PACKAGE_VERSION). In order to add the current git hash to the title,
12668 # use the git-version-gen script, available online.
12669
12670 # Optional variables
12671 CODE_COVERAGE_DIRECTORY ?= $(top_builddir)
12672 CODE_COVERAGE_OUTPUT_FILE ?= $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage.info
12673 CODE_COVERAGE_OUTPUT_DIRECTORY ?= $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage
12674 CODE_COVERAGE_BRANCH_COVERAGE ?=
12675 CODE_COVERAGE_LCOV_SHOPTS_DEFAULT ?= $(if $(CODE_COVERAGE_BRANCH_COVERAGE),\
12676 --rc lcov_branch_coverage=$(CODE_COVERAGE_BRANCH_COVERAGE))
12677 CODE_COVERAGE_LCOV_SHOPTS ?= $(CODE_COVERAGE_LCOV_SHOPTS_DEFAULT)
12678 CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH ?= --gcov-tool "$(GCOV)"
12679 CODE_COVERAGE_LCOV_OPTIONS_DEFAULT ?= $(CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH)
12680 CODE_COVERAGE_LCOV_OPTIONS ?= $(CODE_COVERAGE_LCOV_OPTIONS_DEFAULT)
12681 CODE_COVERAGE_LCOV_RMOPTS_DEFAULT ?=
12682 CODE_COVERAGE_LCOV_RMOPTS ?= $(CODE_COVERAGE_LCOV_RMOPTS_DEFAULT)
12683 CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT ?=\
12684 $(if $(CODE_COVERAGE_BRANCH_COVERAGE),\
12685 --rc genhtml_branch_coverage=$(CODE_COVERAGE_BRANCH_COVERAGE))
12686 CODE_COVERAGE_GENHTML_OPTIONS ?= $(CODE_COVERAGE_GENHTML_OPTIONS_DEFAULTS)
12687 CODE_COVERAGE_IGNORE_PATTERN ?=
12688
12689 code_coverage_v_lcov_cap = $(code_coverage_v_lcov_cap_$(V))
12690 code_coverage_v_lcov_cap_ = $(code_coverage_v_lcov_cap_$(AM_DEFAULT_VERBOSITY))
12691 code_coverage_v_lcov_cap_0 = @echo " LCOV --capture"\
12692 $(CODE_COVERAGE_OUTPUT_FILE);
12693 code_coverage_v_lcov_ign = $(code_coverage_v_lcov_ign_$(V))
12694 code_coverage_v_lcov_ign_ = $(code_coverage_v_lcov_ign_$(AM_DEFAULT_VERBOSITY))
12695 code_coverage_v_lcov_ign_0 = @echo " LCOV --remove /tmp/*"\
12696 $(CODE_COVERAGE_IGNORE_PATTERN);
12697 code_coverage_v_genhtml = $(code_coverage_v_genhtml_$(V))
12698 code_coverage_v_genhtml_ = $(code_coverage_v_genhtml_$(AM_DEFAULT_VERBOSITY))
12699 code_coverage_v_genhtml_0 = @echo " GEN " $(CODE_COVERAGE_OUTPUT_DIRECTORY);
12700 code_coverage_quiet = $(code_coverage_quiet_$(V))
12701 code_coverage_quiet_ = $(code_coverage_quiet_$(AM_DEFAULT_VERBOSITY))
12702 code_coverage_quiet_0 = --quiet
12703
12704 # sanitizes the test-name: replaces with underscores: dashes and dots
12705 code_coverage_sanitize = $(subst -,_,$(subst .,_,$(1)))
12706
12707 # Use recursive makes in order to ignore errors during check
12708 check-code-coverage:'"$CODE_COVERAGE_RULES_CHECK"'
12709
12710 # Capture code coverage data
12711 code-coverage-capture: code-coverage-capture-hook'"$CODE_COVERAGE_RULES_CAPTURE"'
12712
12713 # Hook rule executed before code-coverage-capture, overridable by the user
12714 code-coverage-capture-hook:
12715
12716 '"$CODE_COVERAGE_RULES_CLEAN"'
12717
12718 GITIGNOREFILES ?=
12719 GITIGNOREFILES += $(CODE_COVERAGE_OUTPUT_FILE) $(CODE_COVERAGE_OUTPUT_DIRECTORY)
12720
12721 A''M_DISTCHECK_CONFIGURE_FLAGS ?=
12722 A''M_DISTCHECK_CONFIGURE_FLAGS += --disable-code-coverage
12723
12724 .PHONY: check-code-coverage code-coverage-capture code-coverage-capture-hook code-coverage-clean
12725 '
12726
12727
12728
1232512729
1232612730
1232712731 ac_config_files="$ac_config_files libseccomp.pc include/seccomp.h"
1247112875 as_fn_error $? "conditional \"COVERITY\" was never defined.
1247212876 Usually this means the macro was only invoked conditionally." "$LINENO" 5
1247312877 fi
12878 if test -z "${CODE_COVERAGE_ENABLED_TRUE}" && test -z "${CODE_COVERAGE_ENABLED_FALSE}"; then
12879 as_fn_error $? "conditional \"CODE_COVERAGE_ENABLED\" was never defined.
12880 Usually this means the macro was only invoked conditionally." "$LINENO" 5
12881 fi
1247412882
1247512883 : "${CONFIG_STATUS=./config.status}"
1247612884 ac_write_fail=0
1286813276 # report actual input values of CONFIG_FILES etc. instead of their
1286913277 # values after options handling.
1287013278 ac_log="
12871 This file was extended by libseccomp $as_me 2.3.1, which was
13279 This file was extended by libseccomp $as_me 2.3.3, which was
1287213280 generated by GNU Autoconf 2.69. Invocation command line was
1287313281
1287413282 CONFIG_FILES = $CONFIG_FILES
1293413342 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
1293513343 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
1293613344 ac_cs_version="\\
12937 libseccomp config.status 2.3.1
13345 libseccomp config.status 2.3.3
1293813346 configured by $0, generated by GNU Autoconf 2.69,
1293913347 with options \\"\$ac_cs_config\\"
1294013348
1310513513 DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`'
1310613514 sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`'
1310713515 AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`'
13516 lt_ar_flags='`$ECHO "$lt_ar_flags" | $SED "$delay_single_quote_subst"`'
1310813517 AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`'
1310913518 archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`'
1311013519 STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`'
1323313642 DLLTOOL \
1323413643 sharedlib_from_linklib_cmd \
1323513644 AR \
13236 AR_FLAGS \
1323713645 archiver_list_spec \
1323813646 STRIP \
1323913647 RANLIB \
1420514613 # The archiver.
1420614614 AR=$lt_AR
1420714615
14616 # Flags to create an archive (by configure).
14617 lt_ar_flags=$lt_ar_flags
14618
1420814619 # Flags to create an archive.
14209 AR_FLAGS=$lt_AR_FLAGS
14620 AR_FLAGS=\${ARFLAGS-"\$lt_ar_flags"}
1421014621
1421114622 # How to feed a file listing to the archiver.
1421214623 archiver_list_spec=$lt_archiver_list_spec
1818 dnl ####
1919 dnl libseccomp defines
2020 dnl ####
21 AC_INIT([libseccomp], [2.3.1])
21 AC_INIT([libseccomp], [2.3.3])
2222
2323 dnl ####
2424 dnl autoconf configuration
124124 AM_CONDITIONAL(COVERITY, test "$have_coverity" = yes)
125125
126126 dnl ####
127 dnl code coverage checks
128 dnl -> https://www.gnu.org/software/autoconf-archive/ax_code_coverage.html
129 dnl ####
130 AX_CODE_COVERAGE
131
132 dnl ####
127133 dnl version dependent files
128134 dnl ####
129135 AC_CONFIG_FILES([
0 # Makefile.in generated by automake 1.14.1 from Makefile.am.
0 # Makefile.in generated by automake 1.15.1 from Makefile.am.
11 # @configure_input@
22
3 # Copyright (C) 1994-2013 Free Software Foundation, Inc.
3 # Copyright (C) 1994-2017 Free Software Foundation, Inc.
44
55 # This Makefile.in is free software; the Free Software Foundation
66 # gives unlimited permission to copy and/or distribute it,
3131 # along with this library; if not, see <http://www.gnu.org/licenses>.
3232 #
3333 VPATH = @srcdir@
34 am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
34 am__is_gnu_make = { \
35 if test -z '$(MAKELEVEL)'; then \
36 false; \
37 elif test -n '$(MAKE_HOST)'; then \
38 true; \
39 elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
40 true; \
41 else \
42 false; \
43 fi; \
44 }
3545 am__make_running_with_option = \
3646 case $${target_option-} in \
3747 ?) ;; \
95105 build_triplet = @build@
96106 host_triplet = @host@
97107 subdir = doc
98 DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
99 $(dist_man1_MANS) $(dist_man3_MANS)
100108 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
101 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
102 $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
103 $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
104 $(top_srcdir)/configure.ac
109 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_code_coverage.m4 \
110 $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
111 $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
112 $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac
105113 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
106114 $(ACLOCAL_M4)
115 DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
107116 mkinstalldirs = $(install_sh) -d
108117 CONFIG_HEADER = $(top_builddir)/configure.h
109118 CONFIG_CLEAN_FILES =
160169 NROFF = nroff
161170 MANS = $(dist_man1_MANS) $(dist_man3_MANS)
162171 am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
172 am__DIST_COMMON = $(dist_man1_MANS) $(dist_man3_MANS) \
173 $(srcdir)/Makefile.in
163174 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
164175 ACLOCAL = @ACLOCAL@
165176 AMTAR = @AMTAR@
175186 CC = @CC@
176187 CCDEPMODE = @CCDEPMODE@
177188 CFLAGS = @CFLAGS@
189 CODE_COVERAGE_CFLAGS = @CODE_COVERAGE_CFLAGS@
190 CODE_COVERAGE_CPPFLAGS = @CODE_COVERAGE_CPPFLAGS@
191 CODE_COVERAGE_CXXFLAGS = @CODE_COVERAGE_CXXFLAGS@
192 CODE_COVERAGE_ENABLED = @CODE_COVERAGE_ENABLED@
193 CODE_COVERAGE_LDFLAGS = @CODE_COVERAGE_LDFLAGS@
194 CODE_COVERAGE_LIBS = @CODE_COVERAGE_LIBS@
178195 CPP = @CPP@
179196 CPPFLAGS = @CPPFLAGS@
180197 CYGPATH_W = @CYGPATH_W@
189206 EGREP = @EGREP@
190207 EXEEXT = @EXEEXT@
191208 FGREP = @FGREP@
209 GCOV = @GCOV@
210 GENHTML = @GENHTML@
192211 GREP = @GREP@
193212 INSTALL = @INSTALL@
194213 INSTALL_DATA = @INSTALL_DATA@
195214 INSTALL_PROGRAM = @INSTALL_PROGRAM@
196215 INSTALL_SCRIPT = @INSTALL_SCRIPT@
197216 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
217 LCOV = @LCOV@
198218 LD = @LD@
199219 LDFLAGS = @LDFLAGS@
200220 LIBOBJS = @LIBOBJS@
328348 echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign doc/Makefile'; \
329349 $(am__cd) $(top_srcdir) && \
330350 $(AUTOMAKE) --foreign doc/Makefile
331 .PRECIOUS: Makefile
332351 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
333352 @case '$?' in \
334353 *config.status*) \
591610 mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \
592611 uninstall-am uninstall-man uninstall-man1 uninstall-man3
593612
613 .PRECIOUS: Makefile
614
594615
595616 # Tell versions [3.59,3.63) of GNU make to not export all variables.
596617 # Otherwise a system limit (for SysV at least) may be exceeded.
127127 .\" //////////////////////////////////////////////////////////////////////////
128128 .BR seccomp_init (3),
129129 .BR seccomp_reset (3),
130 .BR seccom_merge (3)
130 .BR seccomp_merge (3)
7575 error being returned. Defaults to off (
7676 .I value
7777 == 0).
78 .TP
79 .B SCMP_FLTATR_ATL_TSKIP
80 A flag to specify if libseccomp should allow filter rules to be created for
81 the -1 syscall. The -1 syscall value can be used by tracer programs to skip
82 specific syscall invocations, see
83 .BR seccomp (2)
84 for more information. Defaults to off (
85 .I value
86 == 0).
7887 .\" //////////////////////////////////////////////////////////////////////////
7988 .SH RETURN VALUE
8089 .\" //////////////////////////////////////////////////////////////////////////
128137 .\" //////////////////////////////////////////////////////////////////////////
129138 .BR seccomp_init (3),
130139 .BR seccomp_reset (3),
131 .BR seccomp_load (3)
140 .BR seccomp_load (3),
141 .BR seccomp (2)
5252 and
5353 .BR seccomp_rule_add_array ()
5454 functions will make a "best effort" to add the rule as specified, but may alter
55 the rule slightly due to architecture specifics, e.g. socket and ipc functions
56 on x86. The
55 the rule slightly due to architecture specifics (e.g. internal rewriting of
56 multiplexed syscalls, like socket and ipc functions on x86). The
5757 .BR seccomp_rule_add_exact ()
5858 and
5959 .BR seccomp_rule_add_exact_array ()
8989 .BR SCMP_SYS ()
9090 macro instead. See the EXAMPLES section below.
9191 .P
92 Starting with Linux v4.8, there may be a need to create a rule with a syscall
93 value of -1 to allow tracing programs to skip a syscall invocation; in order
94 to create a rule with a -1 syscall value it is necessary to first set the
95 .B SCMP_FLTATR_API_TSKIP
96 attribute. See
97 .BR seccomp_attr_set (3)
98 for more information.
99 .P
92100 The filter context
93101 .I ctx
94102 is the value returned by the call to
99107 values are as follows:
100108 .TP
101109 .B SCMP_ACT_KILL
102 The thread will be killed by the kernel when it calls a syscall that does not
103 match any of the configured seccomp filter rules.
110 The thread will be killed by the kernel when it calls a syscall that matches
111 the filter rule.
104112 .TP
105113 .B SCMP_ACT_TRAP
106 The thread will throw a SIGSYS signal when it calls a syscall that does not
107 match any of the configured seccomp filter rules.
114 The thread will throw a SIGSYS signal when it calls a syscall that matches the
115 filter rule.
108116 .TP
109117 .B SCMP_ACT_ERRNO(uint16_t errno)
110118 The thread will receive a return value of
111119 .I errno
112 when it calls a syscall that does not match any of the configured seccomp filter
113 rules.
120 when it calls a syscall that matches the filter rule.
114121 .TP
115122 .B SCMP_ACT_TRACE(uint16_t msg_num)
116123 If the thread is being traced and the tracing process specified the
127134 .TP
128135 .B SCMP_ACT_ALLOW
129136 The seccomp filter will have no effect on the thread calling the syscall if it
130 does not match any of the configured seccomp filter rules.
137 matches the filter rule.
131138 .P
132139 Valid comparison
133140 .I op
290297 .\" //////////////////////////////////////////////////////////////////////////
291298 .SH SEE ALSO
292299 .\" //////////////////////////////////////////////////////////////////////////
300 .BR seccomp_syscall_resolve_name_rewrite (3),
293301 .BR seccomp_syscall_priority (3),
294 .BR seccomp_load (3)
302 .BR seccomp_load (3),
303 .BR seccomp_attr_set (3)
2929 functions resolve the commonly used syscall name to the syscall number used by
3030 the kernel and the rest of the libseccomp API, with
3131 .BR seccomp_syscall_resolve_name_rewrite()
32 rewriting the syscall number for architectures that modify the syscall. The
32 rewriting the syscall number for architectures that modify the syscall. Syscall
33 rewriting typically happens in case of a multiplexed syscall, like
34 .BR socketcall (2)
35 or
36 .BR ipc (2)
37 on x86.
3338 .BR seccomp_syscall_resolve_num_arch()
3439 function resolves the syscall number used by the kernel to the commonly used
3540 syscall name.
99104 .SH NOTES
100105 .\" //////////////////////////////////////////////////////////////////////////
101106 .P
107 In case of bare syscalls implemented on top of a multiplexed syscall,
108 .BR seccomp_syscall_resolve_name()
109 and
110 .BR seccomp_syscall_resolve_name_arch()
111 can be used to verify if a bare syscall is implemented for a specific
112 architecture, while
113 .BR seccomp_syscall_resolve_name_rewrite()
114 can be used to determine the underlying multiplexed syscall.
115 .P
102116 While the seccomp filter can be generated independent of the kernel, kernel
103117 support is required to load and enforce the seccomp filter generated by
104118 libseccomp.
0 # Makefile.in generated by automake 1.14.1 from Makefile.am.
0 # Makefile.in generated by automake 1.15.1 from Makefile.am.
11 # @configure_input@
22
3 # Copyright (C) 1994-2013 Free Software Foundation, Inc.
3 # Copyright (C) 1994-2017 Free Software Foundation, Inc.
44
55 # This Makefile.in is free software; the Free Software Foundation
66 # gives unlimited permission to copy and/or distribute it,
3232 #
3333
3434 VPATH = @srcdir@
35 am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
35 am__is_gnu_make = { \
36 if test -z '$(MAKELEVEL)'; then \
37 false; \
38 elif test -n '$(MAKE_HOST)'; then \
39 true; \
40 elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
41 true; \
42 else \
43 false; \
44 fi; \
45 }
3646 am__make_running_with_option = \
3747 case $${target_option-} in \
3848 ?) ;; \
96106 build_triplet = @build@
97107 host_triplet = @host@
98108 subdir = include
99 DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
100 $(srcdir)/seccomp.h.in $(include_HEADERS)
101109 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
102 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
103 $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
104 $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
105 $(top_srcdir)/configure.ac
110 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_code_coverage.m4 \
111 $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
112 $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
113 $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac
106114 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
107115 $(ACLOCAL_M4)
116 DIST_COMMON = $(srcdir)/Makefile.am $(include_HEADERS) \
117 $(am__DIST_COMMON)
108118 mkinstalldirs = $(install_sh) -d
109119 CONFIG_HEADER = $(top_builddir)/configure.h
110120 CONFIG_CLEAN_FILES = seccomp.h
176186 done | $(am__uniquify_input)`
177187 ETAGS = etags
178188 CTAGS = ctags
189 am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/seccomp.h.in
179190 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
180191 ACLOCAL = @ACLOCAL@
181192 AMTAR = @AMTAR@
191202 CC = @CC@
192203 CCDEPMODE = @CCDEPMODE@
193204 CFLAGS = @CFLAGS@
205 CODE_COVERAGE_CFLAGS = @CODE_COVERAGE_CFLAGS@
206 CODE_COVERAGE_CPPFLAGS = @CODE_COVERAGE_CPPFLAGS@
207 CODE_COVERAGE_CXXFLAGS = @CODE_COVERAGE_CXXFLAGS@
208 CODE_COVERAGE_ENABLED = @CODE_COVERAGE_ENABLED@
209 CODE_COVERAGE_LDFLAGS = @CODE_COVERAGE_LDFLAGS@
210 CODE_COVERAGE_LIBS = @CODE_COVERAGE_LIBS@
194211 CPP = @CPP@
195212 CPPFLAGS = @CPPFLAGS@
196213 CYGPATH_W = @CYGPATH_W@
205222 EGREP = @EGREP@
206223 EXEEXT = @EXEEXT@
207224 FGREP = @FGREP@
225 GCOV = @GCOV@
226 GENHTML = @GENHTML@
208227 GREP = @GREP@
209228 INSTALL = @INSTALL@
210229 INSTALL_DATA = @INSTALL_DATA@
211230 INSTALL_PROGRAM = @INSTALL_PROGRAM@
212231 INSTALL_SCRIPT = @INSTALL_SCRIPT@
213232 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
233 LCOV = @LCOV@
214234 LD = @LD@
215235 LDFLAGS = @LDFLAGS@
216236 LIBOBJS = @LIBOBJS@
316336 echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign include/Makefile'; \
317337 $(am__cd) $(top_srcdir) && \
318338 $(AUTOMAKE) --foreign include/Makefile
319 .PRECIOUS: Makefile
320339 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
321340 @case '$?' in \
322341 *config.status*) \
565584 ps ps-am tags tags-am uninstall uninstall-am \
566585 uninstall-includeHEADERS
567586
587 .PRECIOUS: Makefile
588
568589
569590 # Tell versions [3.59,3.63) of GNU make to not export all variables.
570591 # Otherwise a system limit (for SysV at least) may be exceeded.
3636
3737 #define SCMP_VER_MAJOR 2
3838 #define SCMP_VER_MINOR 3
39 #define SCMP_VER_MICRO 1
39 #define SCMP_VER_MICRO 3
4040
4141 struct scmp_version {
4242 unsigned int major;
6262 SCMP_FLTATR_ACT_BADARCH = 2, /**< bad architecture action */
6363 SCMP_FLTATR_CTL_NNP = 3, /**< set NO_NEW_PRIVS on filter load */
6464 SCMP_FLTATR_CTL_TSYNC = 4, /**< sync threads on filter load */
65 SCMP_FLTATR_API_TSKIP = 5, /**< allow rules with a -1 syscall */
6566 _SCMP_FLTATR_MAX,
6667 };
6768
16021603 #define __NR_userfaultfd __PNR_userfaultfd
16031604 #endif /* __NR_userfaultfd */
16041605
1606 #define __PNR_pkey_mprotect -10201
1607 #ifndef __NR_pkey_mprotect
1608 #define __NR_pkey_mprotect __PNR_pkey_mprotect
1609 #endif /* __NR_pkey_mprotect */
1610
1611 #define __PNR_pkey_alloc -10202
1612 #ifndef __NR_pkey_alloc
1613 #define __NR_pkey_alloc __PNR_pkey_alloc
1614 #endif /* __NR_pkey_alloc */
1615
1616 #define __PNR_pkey_free -10203
1617 #ifndef __NR_pkey_free
1618 #define __NR_pkey_free __PNR_pkey_free
1619 #endif /* __NR_pkey_free */
1620
1621 #define __PNR_get_tls -10204
1622 #ifndef __NR_get_tls
1623 #ifdef __ARM_NR_get_tls
1624 #define __NR_get_tls __ARM_NR_get_tls
1625 #else
1626 #define __NR_get_tls __PNR_get_tls
1627 #endif
1628 #endif /* __NR_get_tls */
1629
1630 #define __PNR_s390_guarded_storage -10205
1631 #ifndef __NR_s390_guarded_storage
1632 #define __NR_s390_guarded_storage __PNR_s390_guarded_storage
1633 #endif /* __NR_s390_guarded_storage */
1634
1635 #define __PNR_s390_sthyi -10206
1636 #ifndef __NR_s390_sthyi
1637 #define __NR_s390_sthyi __PNR_s390_sthyi
1638 #endif /* __NR_s390_sthyi */
1639
16051640 #ifdef __cplusplus
16061641 }
16071642 #endif
6262 SCMP_FLTATR_ACT_BADARCH = 2, /**< bad architecture action */
6363 SCMP_FLTATR_CTL_NNP = 3, /**< set NO_NEW_PRIVS on filter load */
6464 SCMP_FLTATR_CTL_TSYNC = 4, /**< sync threads on filter load */
65 SCMP_FLTATR_API_TSKIP = 5, /**< allow rules with a -1 syscall */
6566 _SCMP_FLTATR_MAX,
6667 };
6768
16021603 #define __NR_userfaultfd __PNR_userfaultfd
16031604 #endif /* __NR_userfaultfd */
16041605
1606 #define __PNR_pkey_mprotect -10201
1607 #ifndef __NR_pkey_mprotect
1608 #define __NR_pkey_mprotect __PNR_pkey_mprotect
1609 #endif /* __NR_pkey_mprotect */
1610
1611 #define __PNR_pkey_alloc -10202
1612 #ifndef __NR_pkey_alloc
1613 #define __NR_pkey_alloc __PNR_pkey_alloc
1614 #endif /* __NR_pkey_alloc */
1615
1616 #define __PNR_pkey_free -10203
1617 #ifndef __NR_pkey_free
1618 #define __NR_pkey_free __PNR_pkey_free
1619 #endif /* __NR_pkey_free */
1620
1621 #define __PNR_get_tls -10204
1622 #ifndef __NR_get_tls
1623 #ifdef __ARM_NR_get_tls
1624 #define __NR_get_tls __ARM_NR_get_tls
1625 #else
1626 #define __NR_get_tls __PNR_get_tls
1627 #endif
1628 #endif /* __NR_get_tls */
1629
1630 #define __PNR_s390_guarded_storage -10205
1631 #ifndef __NR_s390_guarded_storage
1632 #define __NR_s390_guarded_storage __PNR_s390_guarded_storage
1633 #endif /* __NR_s390_guarded_storage */
1634
1635 #define __PNR_s390_sthyi -10206
1636 #ifndef __NR_s390_sthyi
1637 #define __NR_s390_sthyi __PNR_s390_sthyi
1638 #endif /* __NR_s390_sthyi */
1639
16051640 #ifdef __cplusplus
16061641 }
16071642 #endif
0 # ===========================================================================
1 # http://www.gnu.org/software/autoconf-archive/ax_code_coverage.html
2 # ===========================================================================
3 #
4 # SYNOPSIS
5 #
6 # AX_CODE_COVERAGE()
7 #
8 # DESCRIPTION
9 #
10 # Defines CODE_COVERAGE_CPPFLAGS, CODE_COVERAGE_CFLAGS,
11 # CODE_COVERAGE_CXXFLAGS and CODE_COVERAGE_LIBS which should be included
12 # in the CPPFLAGS, CFLAGS CXXFLAGS and LIBS/LIBADD variables of every
13 # build target (program or library) which should be built with code
14 # coverage support. Also defines CODE_COVERAGE_RULES which should be
15 # substituted in your Makefile; and $enable_code_coverage which can be
16 # used in subsequent configure output. CODE_COVERAGE_ENABLED is defined
17 # and substituted, and corresponds to the value of the
18 # --enable-code-coverage option, which defaults to being disabled.
19 #
20 # Test also for gcov program and create GCOV variable that could be
21 # substituted.
22 #
23 # Note that all optimisation flags in CFLAGS must be disabled when code
24 # coverage is enabled.
25 #
26 # Usage example:
27 #
28 # configure.ac:
29 #
30 # AX_CODE_COVERAGE
31 #
32 # Makefile.am:
33 #
34 # @CODE_COVERAGE_RULES@
35 # my_program_LIBS = ... $(CODE_COVERAGE_LIBS) ...
36 # my_program_CPPFLAGS = ... $(CODE_COVERAGE_CPPFLAGS) ...
37 # my_program_CFLAGS = ... $(CODE_COVERAGE_CFLAGS) ...
38 # my_program_CXXFLAGS = ... $(CODE_COVERAGE_CXXFLAGS) ...
39 #
40 # This results in a "check-code-coverage" rule being added to any
41 # Makefile.am which includes "@CODE_COVERAGE_RULES@" (assuming the module
42 # has been configured with --enable-code-coverage). Running `make
43 # check-code-coverage` in that directory will run the module's test suite
44 # (`make check`) and build a code coverage report detailing the code which
45 # was touched, then print the URI for the report.
46 #
47 # In earlier versions of this macro, CODE_COVERAGE_LDFLAGS was defined
48 # instead of CODE_COVERAGE_LIBS. They are both still defined, but use of
49 # CODE_COVERAGE_LIBS is preferred for clarity; CODE_COVERAGE_LDFLAGS is
50 # deprecated. They have the same value.
51 #
52 # This code was derived from Makefile.decl in GLib, originally licenced
53 # under LGPLv2.1+.
54 #
55 # LICENSE
56 #
57 # Copyright (c) 2012, 2016 Philip Withnall
58 # Copyright (c) 2012 Xan Lopez
59 # Copyright (c) 2012 Christian Persch
60 # Copyright (c) 2012 Paolo Borelli
61 # Copyright (c) 2012 Dan Winship
62 # Copyright (c) 2015 Bastien ROUCARIES
63 #
64 # This library is free software; you can redistribute it and/or modify it
65 # under the terms of the GNU Lesser General Public License as published by
66 # the Free Software Foundation; either version 2.1 of the License, or (at
67 # your option) any later version.
68 #
69 # This library is distributed in the hope that it will be useful, but
70 # WITHOUT ANY WARRANTY; without even the implied warranty of
71 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
72 # General Public License for more details.
73 #
74 # You should have received a copy of the GNU Lesser General Public License
75 # along with this program. If not, see <http://www.gnu.org/licenses/>.
76
77 #serial 20
78
79 AC_DEFUN([AX_CODE_COVERAGE],[
80 dnl Check for --enable-code-coverage
81 AC_REQUIRE([AC_PROG_SED])
82
83 # allow to override gcov location
84 AC_ARG_WITH([gcov],
85 [AS_HELP_STRING([--with-gcov[=GCOV]], [use given GCOV for coverage (GCOV=gcov).])],
86 [_AX_CODE_COVERAGE_GCOV_PROG_WITH=$with_gcov],
87 [_AX_CODE_COVERAGE_GCOV_PROG_WITH=gcov])
88
89 AC_MSG_CHECKING([whether to build with code coverage support])
90 AC_ARG_ENABLE([code-coverage],
91 AS_HELP_STRING([--enable-code-coverage],
92 [Whether to enable code coverage support]),,
93 enable_code_coverage=no)
94
95 AM_CONDITIONAL([CODE_COVERAGE_ENABLED], [test x$enable_code_coverage = xyes])
96 AC_SUBST([CODE_COVERAGE_ENABLED], [$enable_code_coverage])
97 AC_MSG_RESULT($enable_code_coverage)
98
99 AS_IF([ test "$enable_code_coverage" = "yes" ], [
100 # check for gcov
101 AC_CHECK_TOOL([GCOV],
102 [$_AX_CODE_COVERAGE_GCOV_PROG_WITH],
103 [:])
104 AS_IF([test "X$GCOV" = "X:"],
105 [AC_MSG_ERROR([gcov is needed to do coverage])])
106 AC_SUBST([GCOV])
107
108 dnl Check if gcc is being used
109 AS_IF([ test "$GCC" = "no" ], [
110 AC_MSG_ERROR([not compiling with gcc, which is required for gcov code coverage])
111 ])
112
113 AC_CHECK_PROG([LCOV], [lcov], [lcov])
114 AC_CHECK_PROG([GENHTML], [genhtml], [genhtml])
115
116 AS_IF([ test -z "$LCOV" ], [
117 AC_MSG_ERROR([To enable code coverage reporting you must have lcov installed])
118 ])
119
120 AS_IF([ test -z "$GENHTML" ], [
121 AC_MSG_ERROR([Could not find genhtml from the lcov package])
122 ])
123
124 dnl Build the code coverage flags
125 dnl Define CODE_COVERAGE_LDFLAGS for backwards compatibility
126 CODE_COVERAGE_CPPFLAGS="-DNDEBUG"
127 CODE_COVERAGE_CFLAGS="-O0 -g -fprofile-arcs -ftest-coverage"
128 CODE_COVERAGE_CXXFLAGS="-O0 -g -fprofile-arcs -ftest-coverage"
129 CODE_COVERAGE_LIBS="-lgcov"
130 CODE_COVERAGE_LDFLAGS="$CODE_COVERAGE_LIBS"
131
132 AC_SUBST([CODE_COVERAGE_CPPFLAGS])
133 AC_SUBST([CODE_COVERAGE_CFLAGS])
134 AC_SUBST([CODE_COVERAGE_CXXFLAGS])
135 AC_SUBST([CODE_COVERAGE_LIBS])
136 AC_SUBST([CODE_COVERAGE_LDFLAGS])
137
138 [CODE_COVERAGE_RULES_CHECK='
139 -$(A''M_V_at)$(MAKE) $(AM_MAKEFLAGS) -k check
140 $(A''M_V_at)$(MAKE) $(AM_MAKEFLAGS) code-coverage-capture
141 ']
142 [CODE_COVERAGE_RULES_CAPTURE='
143 $(code_coverage_v_lcov_cap)$(LCOV) $(code_coverage_quiet) $(addprefix --directory ,$(CODE_COVERAGE_DIRECTORY)) --capture --output-file "$(CODE_COVERAGE_OUTPUT_FILE).tmp" --test-name "$(call code_coverage_sanitize,$(PACKAGE_NAME)-$(PACKAGE_VERSION))" --no-checksum --compat-libtool $(CODE_COVERAGE_LCOV_SHOPTS) $(CODE_COVERAGE_LCOV_OPTIONS)
144 $(code_coverage_v_lcov_ign)$(LCOV) $(code_coverage_quiet) $(addprefix --directory ,$(CODE_COVERAGE_DIRECTORY)) --remove "$(CODE_COVERAGE_OUTPUT_FILE).tmp" "/tmp/*" $(CODE_COVERAGE_IGNORE_PATTERN) --output-file "$(CODE_COVERAGE_OUTPUT_FILE)" $(CODE_COVERAGE_LCOV_SHOPTS) $(CODE_COVERAGE_LCOV_RMOPTS)
145 -@rm -f $(CODE_COVERAGE_OUTPUT_FILE).tmp
146 $(code_coverage_v_genhtml)LANG=C $(GENHTML) $(code_coverage_quiet) $(addprefix --prefix ,$(CODE_COVERAGE_DIRECTORY)) --output-directory "$(CODE_COVERAGE_OUTPUT_DIRECTORY)" --title "$(PACKAGE_NAME)-$(PACKAGE_VERSION) Code Coverage" --legend --show-details "$(CODE_COVERAGE_OUTPUT_FILE)" $(CODE_COVERAGE_GENHTML_OPTIONS)
147 @echo "file://$(abs_builddir)/$(CODE_COVERAGE_OUTPUT_DIRECTORY)/index.html"
148 ']
149 [CODE_COVERAGE_RULES_CLEAN='
150 clean: code-coverage-clean
151 distclean: code-coverage-clean
152 code-coverage-clean:
153 -$(LCOV) --directory $(top_builddir) -z
154 -rm -rf $(CODE_COVERAGE_OUTPUT_FILE) $(CODE_COVERAGE_OUTPUT_FILE).tmp $(CODE_COVERAGE_OUTPUT_DIRECTORY)
155 -find . \( -name "*.gcda" -o -name "*.gcno" -o -name "*.gcov" \) -delete
156 ']
157 ], [
158 [CODE_COVERAGE_RULES_CHECK='
159 @echo "Need to reconfigure with --enable-code-coverage"
160 ']
161 CODE_COVERAGE_RULES_CAPTURE="$CODE_COVERAGE_RULES_CHECK"
162 CODE_COVERAGE_RULES_CLEAN=''
163 ])
164
165 [CODE_COVERAGE_RULES='
166 # Code coverage
167 #
168 # Optional:
169 # - CODE_COVERAGE_DIRECTORY: Top-level directory for code coverage reporting.
170 # Multiple directories may be specified, separated by whitespace.
171 # (Default: $(top_builddir))
172 # - CODE_COVERAGE_OUTPUT_FILE: Filename and path for the .info file generated
173 # by lcov for code coverage. (Default:
174 # $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage.info)
175 # - CODE_COVERAGE_OUTPUT_DIRECTORY: Directory for generated code coverage
176 # reports to be created. (Default:
177 # $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage)
178 # - CODE_COVERAGE_BRANCH_COVERAGE: Set to 1 to enforce branch coverage,
179 # set to 0 to disable it and leave empty to stay with the default.
180 # (Default: empty)
181 # - CODE_COVERAGE_LCOV_SHOPTS_DEFAULT: Extra options shared between both lcov
182 # instances. (Default: based on $CODE_COVERAGE_BRANCH_COVERAGE)
183 # - CODE_COVERAGE_LCOV_SHOPTS: Extra options to shared between both lcov
184 # instances. (Default: $CODE_COVERAGE_LCOV_SHOPTS_DEFAULT)
185 # - CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH: --gcov-tool pathtogcov
186 # - CODE_COVERAGE_LCOV_OPTIONS_DEFAULT: Extra options to pass to the
187 # collecting lcov instance. (Default: $CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH)
188 # - CODE_COVERAGE_LCOV_OPTIONS: Extra options to pass to the collecting lcov
189 # instance. (Default: $CODE_COVERAGE_LCOV_OPTIONS_DEFAULT)
190 # - CODE_COVERAGE_LCOV_RMOPTS_DEFAULT: Extra options to pass to the filtering
191 # lcov instance. (Default: empty)
192 # - CODE_COVERAGE_LCOV_RMOPTS: Extra options to pass to the filtering lcov
193 # instance. (Default: $CODE_COVERAGE_LCOV_RMOPTS_DEFAULT)
194 # - CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT: Extra options to pass to the
195 # genhtml instance. (Default: based on $CODE_COVERAGE_BRANCH_COVERAGE)
196 # - CODE_COVERAGE_GENHTML_OPTIONS: Extra options to pass to the genhtml
197 # instance. (Default: $CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT)
198 # - CODE_COVERAGE_IGNORE_PATTERN: Extra glob pattern of files to ignore
199 #
200 # The generated report will be titled using the $(PACKAGE_NAME) and
201 # $(PACKAGE_VERSION). In order to add the current git hash to the title,
202 # use the git-version-gen script, available online.
203
204 # Optional variables
205 CODE_COVERAGE_DIRECTORY ?= $(top_builddir)
206 CODE_COVERAGE_OUTPUT_FILE ?= $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage.info
207 CODE_COVERAGE_OUTPUT_DIRECTORY ?= $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage
208 CODE_COVERAGE_BRANCH_COVERAGE ?=
209 CODE_COVERAGE_LCOV_SHOPTS_DEFAULT ?= $(if $(CODE_COVERAGE_BRANCH_COVERAGE),\
210 --rc lcov_branch_coverage=$(CODE_COVERAGE_BRANCH_COVERAGE))
211 CODE_COVERAGE_LCOV_SHOPTS ?= $(CODE_COVERAGE_LCOV_SHOPTS_DEFAULT)
212 CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH ?= --gcov-tool "$(GCOV)"
213 CODE_COVERAGE_LCOV_OPTIONS_DEFAULT ?= $(CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH)
214 CODE_COVERAGE_LCOV_OPTIONS ?= $(CODE_COVERAGE_LCOV_OPTIONS_DEFAULT)
215 CODE_COVERAGE_LCOV_RMOPTS_DEFAULT ?=
216 CODE_COVERAGE_LCOV_RMOPTS ?= $(CODE_COVERAGE_LCOV_RMOPTS_DEFAULT)
217 CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT ?=\
218 $(if $(CODE_COVERAGE_BRANCH_COVERAGE),\
219 --rc genhtml_branch_coverage=$(CODE_COVERAGE_BRANCH_COVERAGE))
220 CODE_COVERAGE_GENHTML_OPTIONS ?= $(CODE_COVERAGE_GENHTML_OPTIONS_DEFAULTS)
221 CODE_COVERAGE_IGNORE_PATTERN ?=
222
223 code_coverage_v_lcov_cap = $(code_coverage_v_lcov_cap_$(V))
224 code_coverage_v_lcov_cap_ = $(code_coverage_v_lcov_cap_$(AM_DEFAULT_VERBOSITY))
225 code_coverage_v_lcov_cap_0 = @echo " LCOV --capture"\
226 $(CODE_COVERAGE_OUTPUT_FILE);
227 code_coverage_v_lcov_ign = $(code_coverage_v_lcov_ign_$(V))
228 code_coverage_v_lcov_ign_ = $(code_coverage_v_lcov_ign_$(AM_DEFAULT_VERBOSITY))
229 code_coverage_v_lcov_ign_0 = @echo " LCOV --remove /tmp/*"\
230 $(CODE_COVERAGE_IGNORE_PATTERN);
231 code_coverage_v_genhtml = $(code_coverage_v_genhtml_$(V))
232 code_coverage_v_genhtml_ = $(code_coverage_v_genhtml_$(AM_DEFAULT_VERBOSITY))
233 code_coverage_v_genhtml_0 = @echo " GEN " $(CODE_COVERAGE_OUTPUT_DIRECTORY);
234 code_coverage_quiet = $(code_coverage_quiet_$(V))
235 code_coverage_quiet_ = $(code_coverage_quiet_$(AM_DEFAULT_VERBOSITY))
236 code_coverage_quiet_0 = --quiet
237
238 # sanitizes the test-name: replaces with underscores: dashes and dots
239 code_coverage_sanitize = $(subst -,_,$(subst .,_,$(1)))
240
241 # Use recursive makes in order to ignore errors during check
242 check-code-coverage:'"$CODE_COVERAGE_RULES_CHECK"'
243
244 # Capture code coverage data
245 code-coverage-capture: code-coverage-capture-hook'"$CODE_COVERAGE_RULES_CAPTURE"'
246
247 # Hook rule executed before code-coverage-capture, overridable by the user
248 code-coverage-capture-hook:
249
250 '"$CODE_COVERAGE_RULES_CLEAN"'
251
252 GITIGNOREFILES ?=
253 GITIGNOREFILES += $(CODE_COVERAGE_OUTPUT_FILE) $(CODE_COVERAGE_OUTPUT_DIRECTORY)
254
255 A''M_DISTCHECK_CONFIGURE_FLAGS ?=
256 A''M_DISTCHECK_CONFIGURE_FLAGS += --disable-code-coverage
257
258 .PHONY: check-code-coverage code-coverage-capture code-coverage-capture-hook code-coverage-clean
259 ']
260
261 AC_SUBST([CODE_COVERAGE_RULES])
262 m4_ifdef([_AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE([CODE_COVERAGE_RULES])])
263 ])
00 # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
11 #
2 # Copyright (C) 1996-2001, 2003-2015 Free Software Foundation, Inc.
2 # Copyright (C) 1996-2001, 2003-2017 Free Software Foundation, Inc.
33 # Written by Gordon Matzigkeit, 1996
44 #
55 # This file is free software; the Free Software Foundation gives
10411041 _LT_EOF
10421042 echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
10431043 $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
1044 echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
1045 $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
1044 echo "$AR $AR_FLAGS libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
1045 $AR $AR_FLAGS libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
10461046 echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
10471047 $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
10481048 cat > conftest.c << _LT_EOF
14921492 m4_defun([_LT_PROG_AR],
14931493 [AC_CHECK_TOOLS(AR, [ar], false)
14941494 : ${AR=ar}
1495 : ${AR_FLAGS=cru}
14961495 _LT_DECL([], [AR], [1], [The archiver])
1497 _LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive])
1496
1497 # Use ARFLAGS variable as AR's operation code to sync the variable naming with
1498 # Automake. If both AR_FLAGS and ARFLAGS are specified, AR_FLAGS should have
1499 # higher priority because thats what people were doing historically (setting
1500 # ARFLAGS for automake and AR_FLAGS for libtool). FIXME: Make the AR_FLAGS
1501 # variable obsoleted/removed.
1502
1503 test ${AR_FLAGS+y} || AR_FLAGS=${ARFLAGS-cr}
1504 lt_ar_flags=$AR_FLAGS
1505 _LT_DECL([], [lt_ar_flags], [0], [Flags to create an archive (by configure)])
1506
1507 # Make AR_FLAGS overridable by 'make ARFLAGS='. Don't try to run-time override
1508 # by AR_FLAGS because that was never working and AR_FLAGS is about to die.
1509 _LT_DECL([], [AR_FLAGS], [\@S|@{ARFLAGS-"\@S|@lt_ar_flags"}],
1510 [Flags to create an archive])
14981511
14991512 AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
15001513 [lt_cv_ar_at_file=no
22062219 striplib=
22072220 old_striplib=
22082221 AC_MSG_CHECKING([whether stripping libraries is possible])
2209 if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
2210 test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
2211 test -z "$striplib" && striplib="$STRIP --strip-unneeded"
2212 AC_MSG_RESULT([yes])
2222 if test -z "$STRIP"; then
2223 AC_MSG_RESULT([no])
22132224 else
2214 # FIXME - insert some real tests, host_os isn't really good enough
2215 case $host_os in
2216 darwin*)
2217 if test -n "$STRIP"; then
2225 if $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
2226 old_striplib="$STRIP --strip-debug"
2227 striplib="$STRIP --strip-unneeded"
2228 AC_MSG_RESULT([yes])
2229 else
2230 case $host_os in
2231 darwin*)
2232 # FIXME - insert some real tests, host_os isn't really good enough
22182233 striplib="$STRIP -x"
22192234 old_striplib="$STRIP -S"
22202235 AC_MSG_RESULT([yes])
2221 else
2236 ;;
2237 freebsd*)
2238 if $STRIP -V 2>&1 | $GREP "elftoolchain" >/dev/null; then
2239 old_striplib="$STRIP --strip-debug"
2240 striplib="$STRIP --strip-unneeded"
2241 AC_MSG_RESULT([yes])
2242 else
2243 AC_MSG_RESULT([no])
2244 fi
2245 ;;
2246 *)
22222247 AC_MSG_RESULT([no])
2223 fi
2224 ;;
2225 *)
2226 AC_MSG_RESULT([no])
2227 ;;
2228 esac
2248 ;;
2249 esac
2250 fi
22292251 fi
22302252 _LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
22312253 _LT_DECL([], [striplib], [1])
26652687 *) objformat=elf ;;
26662688 esac
26672689 fi
2668 # Handle Gentoo/FreeBSD as it was Linux
2669 case $host_vendor in
2670 gentoo)
2671 version_type=linux ;;
2672 *)
2673 version_type=freebsd-$objformat ;;
2674 esac
2675
2690 version_type=freebsd-$objformat
26762691 case $version_type in
26772692 freebsd-elf*)
26782693 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
26832698 freebsd-*)
26842699 library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
26852700 need_version=yes
2686 ;;
2687 linux)
2688 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
2689 soname_spec='${libname}${release}${shared_ext}$major'
2690 need_lib_prefix=no
2691 need_version=no
26922701 ;;
26932702 esac
26942703 shlibpath_var=LD_LIBRARY_PATH
49314940 if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
49324941 _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols'
49334942 else
4934 _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
4943 _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
49354944 fi
49364945 ;;
49374946 pw32*)
51685177 emximp -o $lib $output_objdir/$libname.def'
51695178 _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
51705179 _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5180 _LT_TAGVAR(file_list_spec, $1)='@'
51715181 ;;
51725182
51735183 interix[[3-9]]*)
53855395 if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
53865396 _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols'
53875397 else
5388 _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
5398 _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
53895399 fi
53905400 aix_use_runtimelinking=no
53915401
58735883 emximp -o $lib $output_objdir/$libname.def'
58745884 _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
58755885 _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5886 _LT_TAGVAR(file_list_spec, $1)='@'
58765887 ;;
58775888
58785889 osf3*)
67426753 emximp -o $lib $output_objdir/$libname.def'
67436754 _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
67446755 _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
6756 _LT_TAGVAR(file_list_spec, $1)='@'
67456757 ;;
67466758
67476759 dgux*)
00 # Helper functions for option handling. -*- Autoconf -*-
11 #
2 # Copyright (C) 2004-2005, 2007-2009, 2011-2015 Free Software
2 # Copyright (C) 2004-2005, 2007-2009, 2011-2017 Free Software
33 # Foundation, Inc.
44 # Written by Gary V. Vaughan, 2004
55 #
00 # ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*-
11 #
2 # Copyright (C) 2004-2005, 2007-2008, 2011-2015 Free Software
2 # Copyright (C) 2004-2005, 2007-2008, 2011-2017 Free Software
33 # Foundation, Inc.
44 # Written by Gary V. Vaughan, 2004
55 #
00 # ltversion.m4 -- version numbers -*- Autoconf -*-
11 #
2 # Copyright (C) 2004, 2011-2015 Free Software Foundation, Inc.
2 # Copyright (C) 2004, 2011-2017 Free Software Foundation, Inc.
33 # Written by Scott James Remnant, 2004
44 #
55 # This file is free software; the Free Software Foundation gives
88
99 # @configure_input@
1010
11 # serial 4179 ltversion.m4
11 # serial 4219 ltversion.m4
1212 # This file is part of GNU Libtool
1313
14 m4_define([LT_PACKAGE_VERSION], [2.4.6])
15 m4_define([LT_PACKAGE_REVISION], [2.4.6])
14 m4_define([LT_PACKAGE_VERSION], [2.4.6.40-6ca5-dirty])
15 m4_define([LT_PACKAGE_REVISION], [2.4.6.40])
1616
1717 AC_DEFUN([LTVERSION_VERSION],
18 [macro_version='2.4.6'
19 macro_revision='2.4.6'
18 [macro_version='2.4.6.40-6ca5-dirty'
19 macro_revision='2.4.6.40'
2020 _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
2121 _LT_DECL(, macro_revision, 0)
2222 ])
00 # lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*-
11 #
2 # Copyright (C) 2004-2005, 2007, 2009, 2011-2015 Free Software
2 # Copyright (C) 2004-2005, 2007, 2009, 2011-2017 Free Software
33 # Foundation, Inc.
44 # Written by Scott James Remnant, 2004.
55 #
5252 arch_syscall_check_SOURCES = arch-syscall-check.c ${SOURCES_ALL}
5353
5454 libseccomp_la_SOURCES = ${SOURCES_ALL}
55 libseccomp_la_CPPFLAGS = ${AM_CPPFLAGS} -I${top_builddir}/include
56 libseccomp_la_CFLAGS = ${AM_CFLAGS} ${CFLAGS} -fPIC -DPIC -fvisibility=hidden
57 libseccomp_la_LDFLAGS = ${AM_LDFLAGS} ${LDFLAGS} \
55 libseccomp_la_CPPFLAGS = ${AM_CPPFLAGS} ${CODE_COVERAGE_CPPFLAGS} \
56 -I${top_builddir}/include
57 libseccomp_la_CFLAGS = ${AM_CFLAGS} ${CODE_COVERAGE_CFLAGS} ${CFLAGS} \
58 -fPIC -DPIC -fvisibility=hidden
59 libseccomp_la_LDFLAGS = ${AM_LDFLAGS} ${CODE_COVERAGE_LDFLAGS} ${LDFLAGS} \
5860 -version-number ${VERSION_MAJOR}:${VERSION_MINOR}:${VERSION_MICRO}
5961
6062 check-build:
0 # Makefile.in generated by automake 1.14.1 from Makefile.am.
0 # Makefile.in generated by automake 1.15.1 from Makefile.am.
11 # @configure_input@
22
3 # Copyright (C) 1994-2013 Free Software Foundation, Inc.
3 # Copyright (C) 1994-2017 Free Software Foundation, Inc.
44
55 # This Makefile.in is free software; the Free Software Foundation
66 # gives unlimited permission to copy and/or distribute it,
3232 #
3333
3434 VPATH = @srcdir@
35 am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
35 am__is_gnu_make = { \
36 if test -z '$(MAKELEVEL)'; then \
37 false; \
38 elif test -n '$(MAKE_HOST)'; then \
39 true; \
40 elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
41 true; \
42 else \
43 false; \
44 fi; \
45 }
3646 am__make_running_with_option = \
3747 case $${target_option-} in \
3848 ?) ;; \
100110 check_PROGRAMS = arch-syscall-check$(EXEEXT) \
101111 arch-syscall-dump$(EXEEXT)
102112 subdir = src
103 DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
104 $(top_srcdir)/build-aux/depcomp
105113 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
106 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
107 $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
108 $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
109 $(top_srcdir)/configure.ac
114 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_code_coverage.m4 \
115 $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
116 $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
117 $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac
110118 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
111119 $(ACLOCAL_M4)
120 DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
112121 mkinstalldirs = $(install_sh) -d
113122 CONFIG_HEADER = $(top_builddir)/configure.h
114123 CONFIG_CLEAN_FILES =
297306 fi; \
298307 }
299308 DIST_SUBDIRS = . python
309 am__DIST_COMMON = $(srcdir)/Makefile.in \
310 $(top_srcdir)/build-aux/depcomp
300311 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
301312 am__relativize = \
302313 dir0=`pwd`; \
337348 CC = @CC@
338349 CCDEPMODE = @CCDEPMODE@
339350 CFLAGS = @CFLAGS@
351 CODE_COVERAGE_CFLAGS = @CODE_COVERAGE_CFLAGS@
352 CODE_COVERAGE_CPPFLAGS = @CODE_COVERAGE_CPPFLAGS@
353 CODE_COVERAGE_CXXFLAGS = @CODE_COVERAGE_CXXFLAGS@
354 CODE_COVERAGE_ENABLED = @CODE_COVERAGE_ENABLED@
355 CODE_COVERAGE_LDFLAGS = @CODE_COVERAGE_LDFLAGS@
356 CODE_COVERAGE_LIBS = @CODE_COVERAGE_LIBS@
340357 CPP = @CPP@
341358 CPPFLAGS = @CPPFLAGS@
342359 CYGPATH_W = @CYGPATH_W@
351368 EGREP = @EGREP@
352369 EXEEXT = @EXEEXT@
353370 FGREP = @FGREP@
371 GCOV = @GCOV@
372 GENHTML = @GENHTML@
354373 GREP = @GREP@
355374 INSTALL = @INSTALL@
356375 INSTALL_DATA = @INSTALL_DATA@
357376 INSTALL_PROGRAM = @INSTALL_PROGRAM@
358377 INSTALL_SCRIPT = @INSTALL_SCRIPT@
359378 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
379 LCOV = @LCOV@
360380 LD = @LD@
361381 LDFLAGS = @LDFLAGS@
362382 LIBOBJS = @LIBOBJS@
471491 arch_syscall_dump_SOURCES = arch-syscall-dump.c ${SOURCES_ALL}
472492 arch_syscall_check_SOURCES = arch-syscall-check.c ${SOURCES_ALL}
473493 libseccomp_la_SOURCES = ${SOURCES_ALL}
474 libseccomp_la_CPPFLAGS = ${AM_CPPFLAGS} -I${top_builddir}/include
475 libseccomp_la_CFLAGS = ${AM_CFLAGS} ${CFLAGS} -fPIC -DPIC -fvisibility=hidden
476 libseccomp_la_LDFLAGS = ${AM_LDFLAGS} ${LDFLAGS} \
494 libseccomp_la_CPPFLAGS = ${AM_CPPFLAGS} ${CODE_COVERAGE_CPPFLAGS} \
495 -I${top_builddir}/include
496
497 libseccomp_la_CFLAGS = ${AM_CFLAGS} ${CODE_COVERAGE_CFLAGS} ${CFLAGS} \
498 -fPIC -DPIC -fvisibility=hidden
499
500 libseccomp_la_LDFLAGS = ${AM_LDFLAGS} ${CODE_COVERAGE_LDFLAGS} ${LDFLAGS} \
477501 -version-number ${VERSION_MAJOR}:${VERSION_MINOR}:${VERSION_MICRO}
478502
479503 all: all-recursive
492516 echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Makefile'; \
493517 $(am__cd) $(top_srcdir) && \
494518 $(AUTOMAKE) --foreign src/Makefile
495 .PRECIOUS: Makefile
496519 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
497520 @case '$?' in \
498521 *config.status*) \
12601283 pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \
12611284 uninstall-libLTLIBRARIES
12621285
1286 .PRECIOUS: Makefile
1287
12631288
12641289 check-build:
12651290 ${MAKE} ${AM_MAKEFLAGS} ${check_PROGRAMS}
6464 * syscall appears valid, negative values on failure.
6565 *
6666 */
67 static int _syscall_valid(int syscall)
68 {
67 static int _syscall_valid(const struct db_filter_col *col, int syscall)
68 {
69 /* syscall -1 is used by tracers to skip the syscall */
70 if (col->attr.api_tskip && syscall == -1)
71 return 0;
6972 if (syscall <= -1 && syscall >= -99)
7073 return -EINVAL;
7174 return 0;
310313 {
311314 struct db_filter_col *col = (struct db_filter_col *)ctx;
312315
313 if (db_col_valid(col) || _syscall_valid(syscall))
316 if (db_col_valid(col) || _syscall_valid(col, syscall))
314317 return -EINVAL;
315318
316319 return db_col_syscall_priority(col, syscall, priority);
330333 if (arg_cnt > 0 && arg_array == NULL)
331334 return -EINVAL;
332335
333 if (db_col_valid(col) || _syscall_valid(syscall))
336 if (db_col_valid(col) || _syscall_valid(col, syscall))
334337 return -EINVAL;
335338
336339 rc = db_action_valid(action);
379382 if (arg_cnt > 0 && arg_array == NULL)
380383 return -EINVAL;
381384
382 if (db_col_valid(col) || _syscall_valid(syscall))
385 if (db_col_valid(col) || _syscall_valid(col, syscall))
383386 return -EINVAL;
384387
385388 rc = db_action_valid(action);
2525 #include "arch.h"
2626 #include "arch-aarch64.h"
2727
28 /* NOTE: based on Linux 4.5-rc4 */
28 /* NOTE: based on Linux 4.15-rc7 */
2929 const struct arch_syscall_def aarch64_syscall_table[] = { \
3030 { "_llseek", __PNR__llseek },
3131 { "_newselect", __PNR__newselect },
121121 { "get_mempolicy", 236 },
122122 { "get_robust_list", 100 },
123123 { "get_thread_area", __PNR_get_thread_area },
124 { "get_tls", __PNR_get_tls },
124125 { "getcpu", 168 },
125126 { "getcwd", 17 },
126127 { "getdents", __PNR_getdents },
253254 { "pipe", __PNR_pipe },
254255 { "pipe2", 59 },
255256 { "pivot_root", 41 },
257 { "pkey_alloc", 289 },
258 { "pkey_free", 290 },
259 { "pkey_mprotect", 288 },
256260 { "poll", __PNR_poll },
257261 { "ppoll", 73 },
258262 { "prctl", 167 },
259263 { "pread64", 67 },
260264 { "preadv", 69 },
265 { "preadv2", 286 },
261266 { "prlimit64", 261 },
262267 { "process_vm_readv", 270 },
263268 { "process_vm_writev", 271 },
268273 { "putpmsg", __PNR_putpmsg },
269274 { "pwrite64", 68 },
270275 { "pwritev", 70 },
276 { "pwritev2", 287 },
271277 { "query_module", __PNR_query_module },
272278 { "quotactl", 60 },
273279 { "read", 63 },
298304 { "rt_sigtimedwait", 137 },
299305 { "rt_tgsigqueueinfo", 240 },
300306 { "rtas", __PNR_rtas },
307 { "s390_guarded_storage", __PNR_s390_guarded_storage },
301308 { "s390_pci_mmio_read", __PNR_s390_pci_mmio_read },
302309 { "s390_pci_mmio_write", __PNR_s390_pci_mmio_write },
303310 { "s390_runtime_instr", __PNR_s390_runtime_instr },
311 { "s390_sthyi", __PNR_s390_sthyi },
304312 { "sched_get_priority_max", 125 },
305313 { "sched_get_priority_min", 126 },
306314 { "sched_getaffinity", 123 },
386394 { "stat64", __PNR_stat64 },
387395 { "statfs", 43 },
388396 { "statfs64", __PNR_statfs64 },
397 { "statx", 291 },
389398 { "stime", __PNR_stime },
390399 { "stty", __PNR_stty },
391400 { "subpage_prot", __PNR_subpage_prot },
501510
502511
503512 /**
504 * Iterate through the syscall table and return the syscall name
513 * Iterate through the syscall table and return the syscall mapping
505514 * @param spot the offset into the syscall table
506515 *
507 * Return the syscall name at position @spot or NULL on failure. This function
508 * should only ever be used internally by libseccomp.
516 * Return the syscall mapping at position @spot or NULL on failure. This
517 * function should only ever be used internally by libseccomp.
509518 *
510519 */
511 const char *aarch64_syscall_iterate_name(unsigned int spot)
520 const struct arch_syscall_def *aarch64_syscall_iterate(unsigned int spot)
512521 {
513522 /* XXX - no safety checks here */
514 return aarch64_syscall_table[spot].name;
523 return &aarch64_syscall_table[spot];
515524 }
3131 int aarch64_syscall_resolve_name(const char *name);
3232 const char *aarch64_syscall_resolve_num(int num);
3333
34 const char *aarch64_syscall_iterate_name(unsigned int spot);
34 const struct arch_syscall_def *aarch64_syscall_iterate(unsigned int spot);
35
3536 #endif
3636 #define __SCMP_NR_BASE __SCMP_NR_OABI_SYSCALL_BASE
3737 #endif
3838
39 /* NOTE: based on Linux 4.5-rc4 */
39 /* NOTE: based on Linux 4.15-rc7 */
4040 const struct arch_syscall_def arm_syscall_table[] = { \
4141 /* NOTE: arm_sync_file_range() and sync_file_range2() share values */
4242 { "_llseek", (__SCMP_NR_BASE + 140) },
133133 { "get_mempolicy", (__SCMP_NR_BASE + 320) },
134134 { "get_robust_list", (__SCMP_NR_BASE + 339) },
135135 { "get_thread_area", __PNR_get_thread_area },
136 { "get_tls", (__SCMP_NR_BASE + (__SCMP_ARM_NR_BASE + 6)) },
136137 { "getcpu", (__SCMP_NR_BASE + 345) },
137138 { "getcwd", (__SCMP_NR_BASE + 183) },
138139 { "getdents", (__SCMP_NR_BASE + 141) },
265266 { "pipe", (__SCMP_NR_BASE + 42) },
266267 { "pipe2", (__SCMP_NR_BASE + 359) },
267268 { "pivot_root", (__SCMP_NR_BASE + 218) },
269 { "pkey_alloc", (__SCMP_NR_BASE + 395) },
270 { "pkey_free", (__SCMP_NR_BASE + 396) },
271 { "pkey_mprotect", (__SCMP_NR_BASE + 394) },
268272 { "poll", (__SCMP_NR_BASE + 168) },
269273 { "ppoll", (__SCMP_NR_BASE + 336) },
270274 { "prctl", (__SCMP_NR_BASE + 172) },
271275 { "pread64", (__SCMP_NR_BASE + 180) },
272276 { "preadv", (__SCMP_NR_BASE + 361) },
277 { "preadv2", (__SCMP_NR_BASE + 392) },
273278 { "prlimit64", (__SCMP_NR_BASE + 369) },
274279 { "process_vm_readv", (__SCMP_NR_BASE + 376) },
275280 { "process_vm_writev", (__SCMP_NR_BASE + 377) },
280285 { "putpmsg", __PNR_putpmsg },
281286 { "pwrite64", (__SCMP_NR_BASE + 181) },
282287 { "pwritev", (__SCMP_NR_BASE + 362) },
288 { "pwritev2", (__SCMP_NR_BASE + 393) },
283289 { "query_module", __PNR_query_module },
284290 { "quotactl", (__SCMP_NR_BASE + 131) },
285291 { "read", (__SCMP_NR_BASE + 3) },
310316 { "rt_sigtimedwait", (__SCMP_NR_BASE + 177) },
311317 { "rt_tgsigqueueinfo", (__SCMP_NR_BASE + 363) },
312318 { "rtas", __PNR_rtas },
319 { "s390_guarded_storage", __PNR_s390_guarded_storage },
313320 { "s390_pci_mmio_read", __PNR_s390_pci_mmio_read },
314321 { "s390_pci_mmio_write", __PNR_s390_pci_mmio_write },
315322 { "s390_runtime_instr", __PNR_s390_runtime_instr },
323 { "s390_sthyi", __PNR_s390_sthyi },
316324 { "sched_get_priority_max", (__SCMP_NR_BASE + 159) },
317325 { "sched_get_priority_min", (__SCMP_NR_BASE + 160) },
318326 { "sched_getaffinity", (__SCMP_NR_BASE + 242) },
398406 { "stat64", (__SCMP_NR_BASE + 195) },
399407 { "statfs", (__SCMP_NR_BASE + 99) },
400408 { "statfs64", (__SCMP_NR_BASE + 266) },
409 { "statx", (__SCMP_NR_BASE + 397) },
401410 { "stime", __PNR_stime },
402411 { "stty", __PNR_stty },
403412 { "subpage_prot", __PNR_subpage_prot },
512521 }
513522
514523 /**
515 * Iterate through the syscall table and return the syscall name
524 * Iterate through the syscall table and return the syscall mapping
516525 * @param spot the offset into the syscall table
517526 *
518 * Return the syscall name at position @spot or NULL on failure. This function
519 * should only ever be used internally by libseccomp.
527 * Return the syscall mapping at position @spot or NULL on failure. This
528 * function should only ever be used internally by libseccomp.
520529 *
521530 */
522 const char *arm_syscall_iterate_name(unsigned int spot)
531 const struct arch_syscall_def *arm_syscall_iterate(unsigned int spot)
523532 {
524533 /* XXX - no safety checks here */
525 return arm_syscall_table[spot].name;
534 return &arm_syscall_table[spot];
526535 }
3131 int arm_syscall_resolve_name(const char *name);
3232 const char *arm_syscall_resolve_num(int num);
3333
34 const char *arm_syscall_iterate_name(unsigned int spot);
34 const struct arch_syscall_def *arm_syscall_iterate(unsigned int spot);
3535
3636 #endif
2929 /* O32 ABI */
3030 #define __SCMP_NR_BASE 4000
3131
32 /* NOTE: based on Linux 4.5-rc4 */
32 /* NOTE: based on Linux 4.15-rc7 */
3333 const struct arch_syscall_def mips_syscall_table[] = { \
3434 { "_llseek", (__SCMP_NR_BASE + 140) },
3535 { "_newselect", (__SCMP_NR_BASE + 142) },
125125 { "get_mempolicy", (__SCMP_NR_BASE + 269) },
126126 { "get_robust_list", (__SCMP_NR_BASE + 310) },
127127 { "get_thread_area", __PNR_get_thread_area },
128 { "get_tls", __PNR_get_tls },
128129 { "getcpu", (__SCMP_NR_BASE + 312) },
129130 { "getcwd", (__SCMP_NR_BASE + 203) },
130131 { "getdents", (__SCMP_NR_BASE + 141) },
257258 { "pipe", (__SCMP_NR_BASE + 42) },
258259 { "pipe2", (__SCMP_NR_BASE + 328) },
259260 { "pivot_root", (__SCMP_NR_BASE + 216) },
261 { "pkey_alloc", (__SCMP_NR_BASE + 364) },
262 { "pkey_free", (__SCMP_NR_BASE + 365) },
263 { "pkey_mprotect", (__SCMP_NR_BASE + 363) },
260264 { "poll", (__SCMP_NR_BASE + 188) },
261265 { "ppoll", (__SCMP_NR_BASE + 302) },
262266 { "prctl", (__SCMP_NR_BASE + 192) },
263267 { "pread64", (__SCMP_NR_BASE + 200) },
264268 { "preadv", (__SCMP_NR_BASE + 330) },
269 { "preadv2", (__SCMP_NR_BASE + 361) },
265270 { "prlimit64", (__SCMP_NR_BASE + 338) },
266271 { "process_vm_readv", (__SCMP_NR_BASE + 345) },
267272 { "process_vm_writev", (__SCMP_NR_BASE + 346) },
272277 { "putpmsg", (__SCMP_NR_BASE + 209) },
273278 { "pwrite64", (__SCMP_NR_BASE + 201) },
274279 { "pwritev", (__SCMP_NR_BASE + 331) },
280 { "pwritev2", (__SCMP_NR_BASE + 362) },
275281 { "query_module", (__SCMP_NR_BASE + 187) },
276282 { "quotactl", (__SCMP_NR_BASE + 131) },
277283 { "read", (__SCMP_NR_BASE + 3) },
302308 { "rt_sigtimedwait", (__SCMP_NR_BASE + 197) },
303309 { "rt_tgsigqueueinfo", (__SCMP_NR_BASE + 332) },
304310 { "rtas", __PNR_rtas },
311 { "s390_guarded_storage", __PNR_s390_guarded_storage },
305312 { "s390_pci_mmio_read", __PNR_s390_pci_mmio_read },
306313 { "s390_pci_mmio_write", __PNR_s390_pci_mmio_write },
307314 { "s390_runtime_instr", __PNR_s390_runtime_instr },
315 { "s390_sthyi", __PNR_s390_sthyi },
308316 { "sched_get_priority_max", (__SCMP_NR_BASE + 163) },
309317 { "sched_get_priority_min", (__SCMP_NR_BASE + 164) },
310318 { "sched_getaffinity", (__SCMP_NR_BASE + 240) },
390398 { "stat64", (__SCMP_NR_BASE + 213) },
391399 { "statfs", (__SCMP_NR_BASE + 99) },
392400 { "statfs64", (__SCMP_NR_BASE + 255) },
401 { "statx", (__SCMP_NR_BASE + 366) },
393402 { "stime", (__SCMP_NR_BASE + 25) },
394403 { "stty", (__SCMP_NR_BASE + 31) },
395404 { "subpage_prot", __PNR_subpage_prot },
504513 }
505514
506515 /**
507 * Iterate through the syscall table and return the syscall name
516 * Iterate through the syscall table and return the syscall mapping
508517 * @param spot the offset into the syscall table
509518 *
510 * Return the syscall name at position @spot or NULL on failure. This function
511 * should only ever be used internally by libseccomp.
519 * Return the syscall mapping at position @spot or NULL on failure. This
520 * function should only ever be used internally by libseccomp.
512521 *
513522 */
514 const char *mips_syscall_iterate_name(unsigned int spot)
523 const struct arch_syscall_def *mips_syscall_iterate(unsigned int spot)
515524 {
516525 /* XXX - no safety checks here */
517 return mips_syscall_table[spot].name;
526 return &mips_syscall_table[spot];
518527 }
3333 int mips_syscall_resolve_name(const char *name);
3434 const char *mips_syscall_resolve_num(int num);
3535
36 const char *mips_syscall_iterate_name(unsigned int spot);
36 const struct arch_syscall_def *mips_syscall_iterate(unsigned int spot);
3737
3838 #endif
2929 /* 64 ABI */
3030 #define __SCMP_NR_BASE 5000
3131
32 /* NOTE: based on Linux 4.5-rc4 */
32 /* NOTE: based on Linux 4.15-rc7 */
3333 const struct arch_syscall_def mips64_syscall_table[] = { \
3434 { "_llseek", __PNR__llseek },
3535 { "_newselect", (__SCMP_NR_BASE + 22) },
125125 { "get_mempolicy", (__SCMP_NR_BASE + 228) },
126126 { "get_robust_list", (__SCMP_NR_BASE + 269) },
127127 { "get_thread_area", __PNR_get_thread_area },
128 { "get_tls", __PNR_get_tls },
128129 { "getcpu", (__SCMP_NR_BASE + 271) },
129130 { "getcwd", (__SCMP_NR_BASE + 77) },
130131 { "getdents", (__SCMP_NR_BASE + 76) },
257258 { "pipe", (__SCMP_NR_BASE + 21) },
258259 { "pipe2", (__SCMP_NR_BASE + 287) },
259260 { "pivot_root", (__SCMP_NR_BASE + 151) },
261 { "pkey_alloc", (__SCMP_NR_BASE + 324) },
262 { "pkey_free", (__SCMP_NR_BASE + 325) },
263 { "pkey_mprotect", (__SCMP_NR_BASE + 323) },
260264 { "poll", (__SCMP_NR_BASE + 7) },
261265 { "ppoll", (__SCMP_NR_BASE + 261) },
262266 { "prctl", (__SCMP_NR_BASE + 153) },
263267 { "pread64", (__SCMP_NR_BASE + 16) },
264268 { "preadv", (__SCMP_NR_BASE + 289) },
269 { "preadv2", (__SCMP_NR_BASE + 321) },
265270 { "prlimit64", (__SCMP_NR_BASE + 297) },
266271 { "process_vm_readv", (__SCMP_NR_BASE + 304) },
267272 { "process_vm_writev", (__SCMP_NR_BASE + 305) },
272277 { "putpmsg", (__SCMP_NR_BASE + 175) },
273278 { "pwrite64", (__SCMP_NR_BASE + 17) },
274279 { "pwritev", (__SCMP_NR_BASE + 290) },
280 { "pwritev2", (__SCMP_NR_BASE + 322) },
275281 { "query_module", (__SCMP_NR_BASE + 171) },
276282 { "quotactl", (__SCMP_NR_BASE + 172) },
277283 { "read", (__SCMP_NR_BASE + 0) },
302308 { "rt_sigtimedwait", (__SCMP_NR_BASE + 126) },
303309 { "rt_tgsigqueueinfo", (__SCMP_NR_BASE + 291) },
304310 { "rtas", __PNR_rtas },
311 { "s390_guarded_storage", __PNR_s390_guarded_storage },
305312 { "s390_pci_mmio_read", __PNR_s390_pci_mmio_read },
306313 { "s390_pci_mmio_write", __PNR_s390_pci_mmio_write },
307314 { "s390_runtime_instr", __PNR_s390_runtime_instr },
315 { "s390_sthyi", __PNR_s390_sthyi },
308316 { "sched_get_priority_max", (__SCMP_NR_BASE + 143) },
309317 { "sched_get_priority_min", (__SCMP_NR_BASE + 144) },
310318 { "sched_getaffinity", (__SCMP_NR_BASE + 196) },
390398 { "stat64", __PNR_stat64 },
391399 { "statfs", (__SCMP_NR_BASE + 134) },
392400 { "statfs64", __PNR_statfs64 },
401 { "statx", (__SCMP_NR_BASE + 326) },
393402 { "stime", __PNR_stime },
394403 { "stty", __PNR_stty },
395404 { "subpage_prot", __PNR_subpage_prot },
504513 }
505514
506515 /**
507 * Iterate through the syscall table and return the syscall name
516 * Iterate through the syscall table and return the syscall mapping
508517 * @param spot the offset into the syscall table
509518 *
510 * Return the syscall name at position @spot or NULL on failure. This function
511 * should only ever be used internally by libseccomp.
519 * Return the syscall mapping at position @spot or NULL on failure. This
520 * function should only ever be used internally by libseccomp.
512521 *
513522 */
514 const char *mips64_syscall_iterate_name(unsigned int spot)
523 const struct arch_syscall_def *mips64_syscall_iterate(unsigned int spot)
515524 {
516525 /* XXX - no safety checks here */
517 return mips64_syscall_table[spot].name;
526 return &mips64_syscall_table[spot];
518527 }
3333 int mips64_syscall_resolve_name(const char *name);
3434 const char *mips64_syscall_resolve_num(int num);
3535
36 const char *mips64_syscall_iterate_name(unsigned int spot);
36 const struct arch_syscall_def *mips64_syscall_iterate(unsigned int spot);
3737
3838 #endif
2929 /* N32 ABI */
3030 #define __SCMP_NR_BASE 6000
3131
32 /* NOTE: based on Linux 4.5-rc4 */
32 /* NOTE: based on Linux 4.15-rc7 */
3333 const struct arch_syscall_def mips64n32_syscall_table[] = { \
3434 { "_llseek", __PNR__llseek },
3535 { "_newselect", (__SCMP_NR_BASE + 22) },
125125 { "get_mempolicy", (__SCMP_NR_BASE + 232) },
126126 { "get_robust_list", (__SCMP_NR_BASE + 273) },
127127 { "get_thread_area", __PNR_get_thread_area },
128 { "get_tls", __PNR_get_tls },
128129 { "getcpu", (__SCMP_NR_BASE + 275) },
129130 { "getcwd", (__SCMP_NR_BASE + 77) },
130131 { "getdents", (__SCMP_NR_BASE + 76) },
257258 { "pipe", (__SCMP_NR_BASE + 21) },
258259 { "pipe2", (__SCMP_NR_BASE + 291) },
259260 { "pivot_root", (__SCMP_NR_BASE + 151) },
261 { "pkey_alloc", (__SCMP_NR_BASE + 328) },
262 { "pkey_free", (__SCMP_NR_BASE + 329) },
263 { "pkey_mprotect", (__SCMP_NR_BASE + 327) },
260264 { "poll", (__SCMP_NR_BASE + 7) },
261265 { "ppoll", (__SCMP_NR_BASE + 265) },
262266 { "prctl", (__SCMP_NR_BASE + 153) },
263267 { "pread64", (__SCMP_NR_BASE + 16) },
264268 { "preadv", (__SCMP_NR_BASE + 293) },
269 { "preadv2", (__SCMP_NR_BASE + 325) },
265270 { "prlimit64", (__SCMP_NR_BASE + 302) },
266271 { "process_vm_readv", (__SCMP_NR_BASE + 309) },
267272 { "process_vm_writev", (__SCMP_NR_BASE + 310) },
272277 { "putpmsg", (__SCMP_NR_BASE + 175) },
273278 { "pwrite64", (__SCMP_NR_BASE + 17) },
274279 { "pwritev", (__SCMP_NR_BASE + 294) },
280 { "pwritev2", (__SCMP_NR_BASE + 326) },
275281 { "query_module", (__SCMP_NR_BASE + 171) },
276282 { "quotactl", (__SCMP_NR_BASE + 172) },
277283 { "read", (__SCMP_NR_BASE + 0) },
302308 { "rt_sigtimedwait", (__SCMP_NR_BASE + 126) },
303309 { "rt_tgsigqueueinfo", (__SCMP_NR_BASE + 295) },
304310 { "rtas", __PNR_rtas },
311 { "s390_guarded_storage", __PNR_s390_guarded_storage },
305312 { "s390_pci_mmio_read", __PNR_s390_pci_mmio_read },
306313 { "s390_pci_mmio_write", __PNR_s390_pci_mmio_write },
307314 { "s390_runtime_instr", __PNR_s390_runtime_instr },
315 { "s390_sthyi", __PNR_s390_sthyi },
308316 { "sched_get_priority_max", (__SCMP_NR_BASE + 143) },
309317 { "sched_get_priority_min", (__SCMP_NR_BASE + 144) },
310318 { "sched_getaffinity", (__SCMP_NR_BASE + 196) },
390398 { "stat64", __PNR_stat64 },
391399 { "statfs", (__SCMP_NR_BASE + 134) },
392400 { "statfs64", (__SCMP_NR_BASE + 217) },
401 { "statx", (__SCMP_NR_BASE + 330) },
393402 { "stime", __PNR_stime },
394403 { "stty", __PNR_stty },
395404 { "subpage_prot", __PNR_subpage_prot },
504513 }
505514
506515 /**
507 * Iterate through the syscall table and return the syscall name
516 * Iterate through the syscall table and return the syscall mapping
508517 * @param spot the offset into the syscall table
509518 *
510 * Return the syscall name at position @spot or NULL on failure. This function
511 * should only ever be used internally by libseccomp.
519 * Return the syscall mapping at position @spot or NULL on failure. This
520 * function should only ever be used internally by libseccomp.
512521 *
513522 */
514 const char *mips64n32_syscall_iterate_name(unsigned int spot)
523 const struct arch_syscall_def *mips64n32_syscall_iterate(unsigned int spot)
515524 {
516525 /* XXX - no safety checks here */
517 return mips64n32_syscall_table[spot].name;
526 return &mips64n32_syscall_table[spot];
518527 }
3333 int mips64n32_syscall_resolve_name(const char *name);
3434 const char *mips64n32_syscall_resolve_num(int num);
3535
36 const char *mips64n32_syscall_iterate_name(unsigned int spot);
36 const struct arch_syscall_def *mips64n32_syscall_iterate(unsigned int spot);
3737
3838 #endif
2626 #include "arch.h"
2727 #include "arch-ppc.h"
2828
29 /* NOTE: based on Linux 4.5-rc4 */
29 /* NOTE: based on Linux 4.15-rc7 */
3030 const struct arch_syscall_def ppc_syscall_table[] = { \
3131 { "_llseek", 140 },
3232 { "_newselect", 142 },
122122 { "get_mempolicy", 260 },
123123 { "get_robust_list", 299 },
124124 { "get_thread_area", __PNR_get_thread_area },
125 { "get_tls", __PNR_get_tls },
125126 { "getcpu", 302 },
126127 { "getcwd", 182 },
127128 { "getdents", 141 },
176177 { "ioprio_set", 273 },
177178 { "ipc", 117 },
178179 { "kcmp", 354 },
179 { "kexec_file_load", __PNR_kexec_file_load },
180 { "kexec_file_load", 382 },
180181 { "kexec_load", 268 },
181182 { "keyctl", 271 },
182183 { "kill", 37 },
254255 { "pipe", 42 },
255256 { "pipe2", 317 },
256257 { "pivot_root", 203 },
258 { "pkey_alloc", __PNR_pkey_alloc },
259 { "pkey_free", __PNR_pkey_free },
260 { "pkey_mprotect", __PNR_pkey_mprotect },
257261 { "poll", 167 },
258262 { "ppoll", 281 },
259263 { "prctl", 171 },
260264 { "pread64", 179 },
261265 { "preadv", 320 },
266 { "preadv2", 380 },
262267 { "prlimit64", 325 },
263268 { "process_vm_readv", 351 },
264269 { "process_vm_writev", 352 },
269274 { "putpmsg", 188 },
270275 { "pwrite64", 180 },
271276 { "pwritev", 321 },
277 { "pwritev2", 381 },
272278 { "query_module", 166 },
273279 { "quotactl", 131 },
274280 { "read", 3 },
299305 { "rt_sigtimedwait", 176 },
300306 { "rt_tgsigqueueinfo", 322 },
301307 { "rtas", 255 },
308 { "s390_guarded_storage", __PNR_s390_guarded_storage },
302309 { "s390_pci_mmio_read", __PNR_s390_pci_mmio_read },
303310 { "s390_pci_mmio_write", __PNR_s390_pci_mmio_write },
304311 { "s390_runtime_instr", __PNR_s390_runtime_instr },
312 { "s390_sthyi", __PNR_s390_sthyi },
305313 { "sched_get_priority_max", 159 },
306314 { "sched_get_priority_min", 160 },
307315 { "sched_getaffinity", 223 },
387395 { "stat64", 195 },
388396 { "statfs", 99 },
389397 { "statfs64", 252 },
398 { "statx", 383},
390399 { "stime", 25 },
391400 { "stty", 31 },
392401 { "subpage_prot", 310 },
501510 }
502511
503512 /**
504 * Iterate through the syscall table and return the syscall name
513 * Iterate through the syscall table and return the syscall mapping
505514 * @param spot the offset into the syscall table
506515 *
507 * Return the syscall name at position @spot or NULL on failure. This function
508 * should only ever be used internally by libseccomp.
516 * Return the syscall mapping at position @spot or NULL on failure. This
517 * function should only ever be used internally by libseccomp.
509518 *
510519 */
511 const char *ppc_syscall_iterate_name(unsigned int spot)
520 const struct arch_syscall_def *ppc_syscall_iterate(unsigned int spot)
512521 {
513522 /* XXX - no safety checks here */
514 return ppc_syscall_table[spot].name;
523 return &ppc_syscall_table[spot];
515524 }
3232 int ppc_syscall_resolve_name(const char *name);
3333 const char *ppc_syscall_resolve_num(int num);
3434
35 const char *ppc_syscall_iterate_name(unsigned int spot);
35 const struct arch_syscall_def *ppc_syscall_iterate(unsigned int spot);
3636
3737 #endif
2626 #include "arch.h"
2727 #include "arch-ppc64.h"
2828
29 /* NOTE: based on Linux 4.5-rc4 */
29 /* NOTE: based on Linux 4.15-rc7 */
3030 const struct arch_syscall_def ppc64_syscall_table[] = { \
3131 { "_llseek", 140 },
3232 { "_newselect", 142 },
122122 { "get_mempolicy", 260 },
123123 { "get_robust_list", 299 },
124124 { "get_thread_area", __PNR_get_thread_area },
125 { "get_tls", __PNR_get_tls },
125126 { "getcpu", 302 },
126127 { "getcwd", 182 },
127128 { "getdents", 141 },
176177 { "ioprio_set", 273 },
177178 { "ipc", 117 },
178179 { "kcmp", 354 },
179 { "kexec_file_load", __PNR_kexec_file_load },
180 { "kexec_file_load", 382 },
180181 { "kexec_load", 268 },
181182 { "keyctl", 271 },
182183 { "kill", 37 },
254255 { "pipe", 42 },
255256 { "pipe2", 317 },
256257 { "pivot_root", 203 },
258 { "pkey_alloc", __PNR_pkey_alloc },
259 { "pkey_free", __PNR_pkey_free },
260 { "pkey_mprotect", __PNR_pkey_mprotect },
257261 { "poll", 167 },
258262 { "ppoll", 281 },
259263 { "prctl", 171 },
260264 { "pread64", 179 },
261265 { "preadv", 320 },
266 { "preadv2", 380 },
262267 { "prlimit64", 325 },
263268 { "process_vm_readv", 351 },
264269 { "process_vm_writev", 352 },
269274 { "putpmsg", 188 },
270275 { "pwrite64", 180 },
271276 { "pwritev", 321 },
277 { "pwritev2", 381 },
272278 { "query_module", 166 },
273279 { "quotactl", 131 },
274280 { "read", 3 },
299305 { "rt_sigtimedwait", 176 },
300306 { "rt_tgsigqueueinfo", 322 },
301307 { "rtas", 255 },
308 { "s390_guarded_storage", __PNR_s390_guarded_storage },
302309 { "s390_pci_mmio_read", __PNR_s390_pci_mmio_read },
303310 { "s390_pci_mmio_write", __PNR_s390_pci_mmio_write },
304311 { "s390_runtime_instr", __PNR_s390_runtime_instr },
312 { "s390_sthyi", __PNR_s390_sthyi },
305313 { "sched_get_priority_max", 159 },
306314 { "sched_get_priority_min", 160 },
307315 { "sched_getaffinity", 223 },
387395 { "stat64", __PNR_stat64 },
388396 { "statfs", 99 },
389397 { "statfs64", 252 },
398 { "statx", 383},
390399 { "stime", 25 },
391400 { "stty", 31 },
392401 { "subpage_prot", 310 },
501510 }
502511
503512 /**
504 * Iterate through the syscall table and return the syscall name
513 * Iterate through the syscall table and return the syscall mapping
505514 * @param spot the offset into the syscall table
506515 *
507 * Return the syscall name at position @spot or NULL on failure. This function
508 * should only ever be used internally by libseccomp.
516 * Return the syscall mapping at position @spot or NULL on failure. This
517 * function should only ever be used internally by libseccomp.
509518 *
510519 */
511 const char *ppc64_syscall_iterate_name(unsigned int spot)
520 const struct arch_syscall_def *ppc64_syscall_iterate(unsigned int spot)
512521 {
513522 /* XXX - no safety checks here */
514 return ppc64_syscall_table[spot].name;
523 return &ppc64_syscall_table[spot];
515524 }
3333 int ppc64_syscall_resolve_name(const char *name);
3434 const char *ppc64_syscall_resolve_num(int num);
3535
36 const char *ppc64_syscall_iterate_name(unsigned int spot);
36 const struct arch_syscall_def *ppc64_syscall_iterate(unsigned int spot);
3737
3838 #endif
99 #include "arch.h"
1010 #include "arch-s390.h"
1111
12 /* NOTE: based on Linux 4.5-rc4 */
12 /* NOTE: based on Linux 4.15-rc7 */
1313 const struct arch_syscall_def s390_syscall_table[] = { \
1414 { "_llseek", 140 },
1515 { "_newselect", 142 },
105105 { "get_mempolicy", 269 },
106106 { "get_robust_list", 305 },
107107 { "get_thread_area", __PNR_get_thread_area },
108 { "get_tls", __PNR_get_tls },
108109 { "getcpu", 311 },
109110 { "getcwd", 183 },
110111 { "getdents", 141 },
237238 { "pipe", 42 },
238239 { "pipe2", 325 },
239240 { "pivot_root", 217 },
241 { "pkey_alloc", __PNR_pkey_alloc },
242 { "pkey_free", __PNR_pkey_free },
243 { "pkey_mprotect", __PNR_pkey_mprotect },
240244 { "poll", 168 },
241245 { "ppoll", 302 },
242246 { "prctl", 172 },
243247 { "pread64", 180 },
244248 { "preadv", 328 },
249 { "preadv2", 376 },
245250 { "prlimit64", 334 },
246251 { "process_vm_readv", 340 },
247252 { "process_vm_writev", 341 },
252257 { "putpmsg", 189 },
253258 { "pwrite64", 181 },
254259 { "pwritev", 329 },
260 { "pwritev2", 377 },
255261 { "query_module", 167 },
256262 { "quotactl", 131 },
257263 { "read", 3 },
282288 { "rt_sigtimedwait", 177 },
283289 { "rt_tgsigqueueinfo", 330 },
284290 { "rtas", __PNR_rtas },
291 { "s390_guarded_storage", 378 },
285292 { "s390_pci_mmio_read", 353 },
286293 { "s390_pci_mmio_write", 352 },
287294 { "s390_runtime_instr", 342 },
295 { "s390_sthyi", 380 },
288296 { "sched_get_priority_max", 159 },
289297 { "sched_get_priority_min", 160 },
290298 { "sched_getaffinity", 240 },
370378 { "stat64", 195 },
371379 { "statfs", 99 },
372380 { "statfs64", 265 },
381 { "statx", 379 },
373382 { "stime", 25 },
374383 { "stty", __PNR_stty },
375384 { "subpage_prot", __PNR_subpage_prot },
566575
567576 return NULL;
568577 }
578
569579 /**
570 * Iterate through the syscall table and return the syscall name
580 * Iterate through the syscall table and return the syscall mapping
571581 * @param spot the offset into the syscall table
572582 *
573 * Return the syscall name at position @spot or NULL on failure. This function
574 * should only ever be used internally by libseccomp.
583 * Return the syscall mapping at position @spot or NULL on failure. This
584 * function should only ever be used internally by libseccomp.
575585 *
576586 */
577 const char *s390_syscall_iterate_name(unsigned int spot)
587 const struct arch_syscall_def *s390_syscall_iterate(unsigned int spot)
578588 {
579589 /* XXX - no safety checks here */
580 return s390_syscall_table[spot].name;
590 return &s390_syscall_table[spot];
581591 }
208208 {
209209 int rc;
210210 unsigned int iter;
211 size_t args_size;
212211 int sys = rule->syscall;
213212 int sys_a, sys_b;
214213 struct db_api_rule_list *rule_a, *rule_b;
218217 (359 to 373) : direct socket syscalls, Linux 4.3+ */
219218
220219 /* strict check for the multiplexed socket syscalls */
221 for (iter = 0; iter < rule->args_cnt; iter++) {
220 for (iter = 0; iter < ARG_COUNT_MAX; iter++) {
222221 if ((rule->args[iter].valid != 0) && (strict))
223222 return -EINVAL;
224223 }
248247 } else {
249248 /* need two rules, dup the first and link together */
250249 rule_a = rule;
251 rule_b = malloc(sizeof(*rule_b));
250 rule_b = db_rule_dup(rule_a);
252251 if (rule_b == NULL)
253252 return -ENOMEM;
254 args_size = sizeof(*rule_b->args) * rule_a->args_cnt;
255 rule_b->args = malloc(args_size);
256 if (rule_b->args == NULL) {
257 free(rule_b);
258 return -ENOMEM;
259 }
260 rule_b->action = rule_a->action;
261 rule_b->syscall = rule_a->syscall;
262 rule_b->args_cnt = rule_a->args_cnt;
263 memcpy(rule_b->args, rule_a->args, args_size);
264253 rule_b->prev = rule_a;
265254 rule_b->next = NULL;
266255 rule_a->next = rule_b;
1919 int s390_syscall_resolve_name(const char *name);
2020 const char *s390_syscall_resolve_num(int num);
2121
22 const char *s390_syscall_iterate_name(unsigned int spot);
22 const struct arch_syscall_def *s390_syscall_iterate(unsigned int spot);
2323
2424 int s390_syscall_rewrite(int *syscall);
2525
99 #include "arch.h"
1010 #include "arch-s390x.h"
1111
12 /* NOTE: based on Linux 4.5-rc4 */
12 /* NOTE: based on Linux 4.15-rc7 */
1313 const struct arch_syscall_def s390x_syscall_table[] = { \
1414 { "_llseek", __PNR__llseek },
1515 { "_newselect", __PNR__newselect },
105105 { "get_mempolicy", 269 },
106106 { "get_robust_list", 305 },
107107 { "get_thread_area", __PNR_get_thread_area },
108 { "get_tls", __PNR_get_tls },
108109 { "getcpu", 311 },
109110 { "getcwd", 183 },
110111 { "getdents", 141 },
237238 { "pipe", 42 },
238239 { "pipe2", 325 },
239240 { "pivot_root", 217 },
241 { "pkey_alloc", __PNR_pkey_alloc },
242 { "pkey_free", __PNR_pkey_free },
243 { "pkey_mprotect", __PNR_pkey_mprotect },
240244 { "poll", 168 },
241245 { "ppoll", 302 },
242246 { "prctl", 172 },
243247 { "pread64", 180 },
244248 { "preadv", 328 },
249 { "preadv2", 376 },
245250 { "prlimit64", 334 },
246251 { "process_vm_readv", 340 },
247252 { "process_vm_writev", 341 },
252257 { "putpmsg", 189 },
253258 { "pwrite64", 181 },
254259 { "pwritev", 329 },
260 { "pwritev2", 377 },
255261 { "query_module", 167 },
256262 { "quotactl", 131 },
257263 { "read", 3 },
282288 { "rt_sigtimedwait", 177 },
283289 { "rt_tgsigqueueinfo", 330 },
284290 { "rtas", __PNR_rtas },
291 { "s390_guarded_storage", 378 },
285292 { "s390_pci_mmio_read", 353 },
286293 { "s390_pci_mmio_write", 352 },
287294 { "s390_runtime_instr", 342 },
295 { "s390_sthyi", 380 },
288296 { "sched_get_priority_max", 159 },
289297 { "sched_get_priority_min", 160 },
290298 { "sched_getaffinity", 240 },
370378 { "stat64", __PNR_stat64 },
371379 { "statfs", 99 },
372380 { "statfs64", 265 },
381 { "statx", 379 },
373382 { "stime", __PNR_stime },
374383 { "stty", __PNR_stty },
375384 { "subpage_prot", __PNR_subpage_prot },
568577 }
569578
570579 /**
571 * Iterate through the syscall table and return the syscall name
580 * Iterate through the syscall table and return the syscall mapping
572581 * @param spot the offset into the syscall table
573582 *
574 * Return the syscall name at position @spot or NULL on failure. This function
575 * should only ever be used internally by libseccomp.
583 * Return the syscall mapping at position @spot or NULL on failure. This
584 * function should only ever be used internally by libseccomp.
576585 *
577586 */
578 const char *s390x_syscall_iterate_name(unsigned int spot)
587 const struct arch_syscall_def *s390x_syscall_iterate(unsigned int spot)
579588 {
580589 /* XXX - no safety checks here */
581 return s390x_syscall_table[spot].name;
590 return &s390x_syscall_table[spot];
582591 }
208208 {
209209 int rc;
210210 unsigned int iter;
211 size_t args_size;
212211 int sys = rule->syscall;
213212 int sys_a, sys_b;
214213 struct db_api_rule_list *rule_a, *rule_b;
218217 (359 to 373) : direct socket syscalls, Linux 4.3+ */
219218
220219 /* strict check for the multiplexed socket syscalls */
221 for (iter = 0; iter < rule->args_cnt; iter++) {
220 for (iter = 0; iter < ARG_COUNT_MAX; iter++) {
222221 if ((rule->args[iter].valid != 0) && (strict))
223222 return -EINVAL;
224223 }
248247 } else {
249248 /* need two rules, dup the first and link together */
250249 rule_a = rule;
251 rule_b = malloc(sizeof(*rule_b));
250 rule_b = db_rule_dup(rule_a);
252251 if (rule_b == NULL)
253252 return -ENOMEM;
254 args_size = sizeof(*rule_b->args) * rule_a->args_cnt;
255 rule_b->args = malloc(args_size);
256 if (rule_b->args == NULL) {
257 free(rule_b);
258 return -ENOMEM;
259 }
260 rule_b->action = rule_a->action;
261 rule_b->syscall = rule_a->syscall;
262 rule_b->args_cnt = rule_a->args_cnt;
263 memcpy(rule_b->args, rule_a->args, args_size);
264253 rule_b->prev = rule_a;
265254 rule_b->next = NULL;
266255 rule_a->next = rule_b;
2222 int s390x_syscall_resolve_name(const char *name);
2323 const char *s390x_syscall_resolve_num(int num);
2424
25 const char *s390x_syscall_iterate_name(unsigned int spot);
25 const struct arch_syscall_def *s390x_syscall_iterate(unsigned int spot);
2626
2727 int s390x_syscall_rewrite(int *syscall);
2828
4848 *
4949 */
5050 void syscall_check(char *str_miss, const char *syscall,
51 const char *arch_name, const char *arch_sys)
51 const char *arch_name, const struct arch_syscall_def *sys)
5252 {
53 if (strcmp(syscall, arch_sys)) {
53 if (strcmp(syscall, sys->name)) {
5454 if (str_miss[0] != '\0')
5555 strcat(str_miss, ",");
5656 strcat(str_miss, arch_name);
7474 int i_ppc64 = 0;
7575 int i_s390 = 0;
7676 int i_s390x = 0;
77 char str_miss[256];
7778 const char *sys_name;
78 char str_miss[256];
79 const struct arch_syscall_def *sys;
7980
8081 do {
8182 str_miss[0] = '\0';
82 sys_name = x86_syscall_iterate_name(i_x86);
83 if (sys_name == NULL) {
83 sys = x86_syscall_iterate(i_x86);
84 if (sys == NULL || sys->name == NULL) {
8485 printf("FAULT\n");
8586 return 1;
8687 }
88 sys_name = sys->name;
8789
8890 /* check each arch using x86 as the reference */
8991 syscall_check(str_miss, sys_name, "x86_64",
90 x86_64_syscall_iterate_name(i_x86_64));
92 x86_64_syscall_iterate(i_x86_64));
9193 syscall_check(str_miss, sys_name, "x32",
92 x32_syscall_iterate_name(i_x32));
94 x32_syscall_iterate(i_x32));
9395 syscall_check(str_miss, sys_name, "arm",
94 arm_syscall_iterate_name(i_arm));
96 arm_syscall_iterate(i_arm));
9597 syscall_check(str_miss, sys_name, "aarch64",
96 aarch64_syscall_iterate_name(i_aarch64));
98 aarch64_syscall_iterate(i_aarch64));
9799 syscall_check(str_miss, sys_name, "mips",
98 mips_syscall_iterate_name(i_mips));
100 mips_syscall_iterate(i_mips));
99101 syscall_check(str_miss, sys_name, "mips64",
100 mips64_syscall_iterate_name(i_mips64));
102 mips64_syscall_iterate(i_mips64));
101103 syscall_check(str_miss, sys_name, "mips64n32",
102 mips64n32_syscall_iterate_name(i_mips64n32));
104 mips64n32_syscall_iterate(i_mips64n32));
103105 syscall_check(str_miss, sys_name, "ppc",
104 ppc_syscall_iterate_name(i_ppc));
106 ppc_syscall_iterate(i_ppc));
105107 syscall_check(str_miss, sys_name, "ppc64",
106 ppc64_syscall_iterate_name(i_ppc64));
108 ppc64_syscall_iterate(i_ppc64));
107109 syscall_check(str_miss, sys_name, "s390",
108 s390_syscall_iterate_name(i_s390));
110 s390_syscall_iterate(i_s390));
109111 syscall_check(str_miss, sys_name, "s390x",
110 s390x_syscall_iterate_name(i_s390x));
112 s390x_syscall_iterate(i_s390x));
111113
112114 /* output the results */
113115 printf("%s: ", sys_name);
118120 printf("OK\n");
119121
120122 /* next */
121 if (x86_syscall_iterate_name(i_x86 + 1))
123 if (x86_syscall_iterate(i_x86 + 1)->name)
122124 i_x86++;
123 if (!x86_64_syscall_iterate_name(++i_x86_64))
125 if (!x86_64_syscall_iterate(++i_x86_64)->name)
124126 i_x86_64 = -1;
125 if (!x32_syscall_iterate_name(++i_x32))
127 if (!x32_syscall_iterate(++i_x32)->name)
126128 i_x32 = -1;
127 if (!arm_syscall_iterate_name(++i_arm))
129 if (!arm_syscall_iterate(++i_arm)->name)
128130 i_arm = -1;
129 if (!aarch64_syscall_iterate_name(++i_aarch64))
131 if (!aarch64_syscall_iterate(++i_aarch64)->name)
130132 i_aarch64 = -1;
131 if (!mips_syscall_iterate_name(++i_mips))
133 if (!mips_syscall_iterate(++i_mips)->name)
132134 i_mips = -1;
133 if (!mips64_syscall_iterate_name(++i_mips64))
135 if (!mips64_syscall_iterate(++i_mips64)->name)
134136 i_mips64 = -1;
135 if (!mips64n32_syscall_iterate_name(++i_mips64n32))
137 if (!mips64n32_syscall_iterate(++i_mips64n32)->name)
136138 i_mips64n32 = -1;
137 if (!ppc_syscall_iterate_name(++i_ppc))
139 if (!ppc_syscall_iterate(++i_ppc)->name)
138140 i_ppc = -1;
139 if (!ppc64_syscall_iterate_name(++i_ppc64))
141 if (!ppc64_syscall_iterate(++i_ppc64)->name)
140142 i_ppc64 = -1;
141 if (!s390_syscall_iterate_name(++i_s390))
143 if (!s390_syscall_iterate(++i_s390)->name)
142144 i_s390 = -1;
143 if (!s390x_syscall_iterate_name(++i_s390x))
145 if (!s390x_syscall_iterate(++i_s390x)->name)
144146 i_s390x = -1;
145147 } while (i_x86_64 >= 0 && i_x32 >= 0 &&
146148 i_arm >= 0 && i_aarch64 >= 0 &&
149151 i_s390 >= 0 && i_s390x >= 0);
150152
151153 /* check for any leftovers */
152 sys_name = x86_syscall_iterate_name(i_x86 + 1);
153 if (sys_name) {
154 printf("%s: ERROR, x86 has additional syscalls\n", sys_name);
154 sys = x86_syscall_iterate(i_x86 + 1);
155 if (sys->name) {
156 printf("ERROR, x86 has additional syscalls\n");
155157 return 1;
156158 }
157159 if (i_x86_64 >= 0) {
158 printf("%s: ERROR, x86_64 has additional syscalls\n",
159 x86_64_syscall_iterate_name(i_x86_64));
160 printf("ERROR, x86_64 has additional syscalls\n");
160161 return 1;
161162 }
162163 if (i_x32 >= 0) {
163 printf("%s: ERROR, x32 has additional syscalls\n",
164 x32_syscall_iterate_name(i_x32));
164 printf("ERROR, x32 has additional syscalls\n");
165165 return 1;
166166 }
167167 if (i_arm >= 0) {
168 printf("%s: ERROR, arm has additional syscalls\n",
169 arm_syscall_iterate_name(i_arm));
168 printf("ERROR, arm has additional syscalls\n");
170169 return 1;
171170 }
172171 if (i_aarch64 >= 0) {
173 printf("%s: ERROR, aarch64 has additional syscalls\n",
174 aarch64_syscall_iterate_name(i_aarch64));
172 printf("ERROR, aarch64 has additional syscalls\n");
175173 return 1;
176174 }
177175 if (i_mips >= 0) {
178 printf("%s: ERROR, mips has additional syscalls\n",
179 mips_syscall_iterate_name(i_mips));
176 printf("ERROR, mips has additional syscalls\n");
180177 return 1;
181178 }
182179 if (i_mips64 >= 0) {
183 printf("%s: ERROR, mips64 has additional syscalls\n",
184 mips64_syscall_iterate_name(i_mips64));
180 printf("ERROR, mips64 has additional syscalls\n");
185181 return 1;
186182 }
187183 if (i_mips64n32 >= 0) {
188 printf("%s: ERROR, mips64n32 has additional syscalls\n",
189 mips64n32_syscall_iterate_name(i_mips64n32));
184 printf("ERROR, mips64n32 has additional syscalls\n");
190185 return 1;
191186 }
192187 if (i_ppc >= 0) {
193 printf("%s: ERROR, ppc has additional syscalls\n",
194 ppc_syscall_iterate_name(i_ppc));
188 printf("ERROR, ppc has additional syscalls\n");
189 return 1;
195190 }
196191 if (i_ppc64 >= 0) {
197 printf("%s: ERROR, ppc64 has additional syscalls\n",
198 ppc64_syscall_iterate_name(i_ppc64));
192 printf("ERROR, ppc64 has additional syscalls\n");
199193 return 1;
200194 }
201195 if (i_s390 >= 0) {
202 printf("%s: ERROR, s390 has additional syscalls\n",
203 s390_syscall_iterate_name(i_s390));
196 printf("ERROR, s390 has additional syscalls\n");
204197 return 1;
205198 }
206199 if (i_s390x >= 0) {
207 printf("%s: ERROR, s390x has additional syscalls\n",
208 s390x_syscall_iterate_name(i_s390x));
200 printf("ERROR, s390x has additional syscalls\n");
209201 return 1;
210202 }
211203
6464 const struct arch_def *arch = arch_def_native;
6565 int offset = 0;
6666 int iter;
67 int sys_num;
68 const char *sys_name;
67 const struct arch_syscall_def *sys;
6968
7069 /* parse the command line */
7170 while ((opt = getopt(argc, argv, "a:o:h")) > 0) {
8988 do {
9089 switch (arch->token) {
9190 case SCMP_ARCH_X86:
92 sys_name = x86_syscall_iterate_name(iter);
91 sys = x86_syscall_iterate(iter);
9392 break;
9493 case SCMP_ARCH_X86_64:
95 sys_name = x86_64_syscall_iterate_name(iter);
94 sys = x86_64_syscall_iterate(iter);
9695 break;
9796 case SCMP_ARCH_X32:
98 sys_name = x32_syscall_iterate_name(iter);
97 sys = x32_syscall_iterate(iter);
9998 break;
10099 case SCMP_ARCH_ARM:
101 sys_name = arm_syscall_iterate_name(iter);
100 sys = arm_syscall_iterate(iter);
102101 break;
103102 case SCMP_ARCH_AARCH64:
104 sys_name = aarch64_syscall_iterate_name(iter);
103 sys = aarch64_syscall_iterate(iter);
105104 break;
106105 case SCMP_ARCH_MIPS:
107106 case SCMP_ARCH_MIPSEL:
108 sys_name = mips_syscall_iterate_name(iter);
107 sys = mips_syscall_iterate(iter);
109108 break;
110109 case SCMP_ARCH_MIPS64:
111110 case SCMP_ARCH_MIPSEL64:
112 sys_name = mips64_syscall_iterate_name(iter);
111 sys = mips64_syscall_iterate(iter);
113112 break;
114113 case SCMP_ARCH_MIPS64N32:
115114 case SCMP_ARCH_MIPSEL64N32:
116 sys_name = mips64n32_syscall_iterate_name(iter);
115 sys = mips64n32_syscall_iterate(iter);
117116 break;
118117 case SCMP_ARCH_PPC:
119 sys_name = ppc_syscall_iterate_name(iter);
118 sys = ppc_syscall_iterate(iter);
120119 break;
121120 case SCMP_ARCH_PPC64:
122121 case SCMP_ARCH_PPC64LE:
123 sys_name = ppc64_syscall_iterate_name(iter);
122 sys = ppc64_syscall_iterate(iter);
124123 break;
125124 case SCMP_ARCH_S390:
126 sys_name = s390_syscall_iterate_name(iter);
125 sys = s390_syscall_iterate(iter);
127126 break;
128127 case SCMP_ARCH_S390X:
129 sys_name = s390x_syscall_iterate_name(iter);
128 sys = s390x_syscall_iterate(iter);
130129 break;
131130 default:
132131 /* invalid arch */
133132 exit_usage(argv[0]);
134133 }
135 if (sys_name != NULL) {
136 sys_num = arch_syscall_resolve_name(arch, sys_name);
134 if (sys->name != NULL) {
135 int sys_num = sys->num;
136
137137 if (offset > 0 && sys_num > 0)
138138 sys_num -= offset;
139139
140140 /* output the results */
141 printf("%s\t%d\n", sys_name, sys_num);
141 printf("%s\t%d\n", sys->name, sys_num);
142142
143143 /* next */
144144 iter++;
145145 }
146 } while (sys_name != NULL);
146 } while (sys->name != NULL);
147147
148148 return 0;
149149 }
8383 [[ -z $1 ]] && return
8484
8585 [[ -n $2 ]] && offset_str="-o $2"
86 $LIB_SYS_DUMP -a $1 $offset_str | sed -e '/[^\t]\+\t-[0-9]\+/d'
86 $LIB_SYS_DUMP -a $1 $offset_str | sed -e '/[^\t]\+\t-[0-9]\+/d' | sort
8787 }
8888
8989 #
165165 # Dump the architecture's syscall table to stdout.
166166 #
167167 function dump_sys_arm() {
168 # NOTE: arm_sync_file_range() and sync_file_range2() share values
169 gcc -E -dM -D__ARM_EABI__ $1/arch/arm/include/uapi/asm/unistd.h | \
170 grep "^#define __\(ARM_\)*NR_" | \
171 grep -v "^#define __NR_OABI_SYSCALL_BASE" | \
172 grep -v "^#define __NR_SYSCALL_BASE" | \
173 grep -v "^#define __ARM_NR_BASE" | \
174 sed -e 's/#define[ \t]\+__NR_\([^ \t]\+\)[ \t]\+(__NR_SYSCALL_BASE[ \t]*+[ \t]*\([0-9]\+\)).*/\1\t\2/;s/#define[ \t]\+__ARM_NR_\([^ \t]\+\)[ \t]\+(__ARM_NR_BASE[ \t]*+[ \t]*\([0-9]\+\)).*/\1\t983040 + \2/' | \
175 while read line; do \
176 if echo "$line" | grep -q "+"; then \
177 echo "$line" | awk '{ print $1"\t"$2+$4 }'; \
178 else \
179 echo "$line"; \
180 fi; \
181 done | \
182 sed -e '/#define __NR_sync_file_range2[ \t]\+__NR_arm_sync_file_range/d' | \
183 sort
168 cat $1/arch/arm/tools/syscall.tbl | grep -v "^#" | \
169 sed -ne "/[0-9]\+[ \t]\+\(common\|eabi\)/p" | \
170 awk '{ print $3"\t"$1 }' | sort | (cat -; \
171 (cat $1/arch/arm/include/uapi/asm/unistd.h | \
172 grep "^#define __ARM_NR_" | grep -v "^#define __ARM_NR_BASE" | \
173 sed -e 's/#define __ARM_NR_\([a-z0-9_]*\)[ \t]\+(__ARM_NR_BASE+\(.*\))/\1 983040 + \2/' | \
174 awk '{ print $1"\t"$2+$4 }')) | sort
184175 }
185176
186177 #
202193 # Dump the architecture's syscall table to stdout.
203194 #
204195 function dump_sys_aarch64() {
205 gcc -E -dM -I$1/include/uapi -D__BITS_PER_LONG=64 $1/include/uapi/asm-generic/unistd.h | \
196 gcc -E -dM -I$1/include/uapi \
197 -D__BITS_PER_LONG=64 -D__ARCH_WANT_RENAMEAT \
198 $1/include/uapi/asm-generic/unistd.h | \
206199 grep "^#define __NR_" | \
207200 sed -e '/__NR_syscalls/d' | \
208201 sed -e '/__NR_arch_specific_syscall/d' | \
2525 #include "arch.h"
2626 #include "arch-x32.h"
2727
28 /* NOTE: based on Linux 4.5-rc4 */
28 /* NOTE: based on Linux 4.15-rc7 */
2929 const struct arch_syscall_def x32_syscall_table[] = { \
3030 { "_llseek", __PNR__llseek },
3131 { "_newselect", __PNR__newselect },
121121 { "get_mempolicy", (X32_SYSCALL_BIT + 239) },
122122 { "get_robust_list", (X32_SYSCALL_BIT + 531) },
123123 { "get_thread_area", __PNR_get_thread_area },
124 { "get_tls", __PNR_get_tls },
124125 { "getcpu", (X32_SYSCALL_BIT + 309) },
125126 { "getcwd", (X32_SYSCALL_BIT + 79) },
126127 { "getdents", (X32_SYSCALL_BIT + 78) },
253254 { "pipe", (X32_SYSCALL_BIT + 22) },
254255 { "pipe2", (X32_SYSCALL_BIT + 293) },
255256 { "pivot_root", (X32_SYSCALL_BIT + 155) },
257 { "pkey_alloc", (X32_SYSCALL_BIT + 330) },
258 { "pkey_free", (X32_SYSCALL_BIT + 331) },
259 { "pkey_mprotect", (X32_SYSCALL_BIT + 329) },
256260 { "poll", (X32_SYSCALL_BIT + 7) },
257261 { "ppoll", (X32_SYSCALL_BIT + 271) },
258262 { "prctl", (X32_SYSCALL_BIT + 157) },
259263 { "pread64", (X32_SYSCALL_BIT + 17) },
260264 { "preadv", (X32_SYSCALL_BIT + 534) },
265 { "preadv2", (X32_SYSCALL_BIT + 546) },
261266 { "prlimit64", (X32_SYSCALL_BIT + 302) },
262267 { "process_vm_readv", (X32_SYSCALL_BIT + 539) },
263268 { "process_vm_writev", (X32_SYSCALL_BIT + 540) },
268273 { "putpmsg", (X32_SYSCALL_BIT + 182) },
269274 { "pwrite64", (X32_SYSCALL_BIT + 18) },
270275 { "pwritev", (X32_SYSCALL_BIT + 535) },
276 { "pwritev2", (X32_SYSCALL_BIT + 547) },
271277 { "query_module", __PNR_query_module },
272278 { "quotactl", (X32_SYSCALL_BIT + 179) },
273279 { "read", (X32_SYSCALL_BIT + 0) },
298304 { "rt_sigtimedwait", (X32_SYSCALL_BIT + 523) },
299305 { "rt_tgsigqueueinfo", (X32_SYSCALL_BIT + 536) },
300306 { "rtas", __PNR_rtas },
307 { "s390_guarded_storage", __PNR_s390_guarded_storage },
301308 { "s390_pci_mmio_read", __PNR_s390_pci_mmio_read },
302309 { "s390_pci_mmio_write", __PNR_s390_pci_mmio_write },
303310 { "s390_runtime_instr", __PNR_s390_runtime_instr },
311 { "s390_sthyi", __PNR_s390_sthyi },
304312 { "sched_get_priority_max", (X32_SYSCALL_BIT + 146) },
305313 { "sched_get_priority_min", (X32_SYSCALL_BIT + 147) },
306314 { "sched_getaffinity", (X32_SYSCALL_BIT + 204) },
386394 { "stat64", __PNR_stat64 },
387395 { "statfs", (X32_SYSCALL_BIT + 137) },
388396 { "statfs64", __PNR_statfs64 },
397 { "statx", (X32_SYSCALL_BIT + 332) },
389398 { "stime", __PNR_stime },
390399 { "stty", __PNR_stty },
391400 { "subpage_prot", __PNR_subpage_prot },
500509 }
501510
502511 /**
503 * Iterate through the syscall table and return the syscall name
512 * Iterate through the syscall table and return the syscall mapping
504513 * @param spot the offset into the syscall table
505514 *
506 * Return the syscall name at position @spot or NULL on failure. This function
507 * should only ever be used internally by libseccomp.
515 * Return the syscall mapping at position @spot or NULL on failure. This
516 * function should only ever be used internally by libseccomp.
508517 *
509518 */
510 const char *x32_syscall_iterate_name(unsigned int spot)
519 const struct arch_syscall_def *x32_syscall_iterate(unsigned int spot)
511520 {
512521 /* XXX - no safety checks here */
513 return x32_syscall_table[spot].name;
522 return &x32_syscall_table[spot];
514523 }
3333 int x32_syscall_resolve_name(const char *name);
3434 const char *x32_syscall_resolve_num(int num);
3535
36 const char *x32_syscall_iterate_name(unsigned int spot);
36 const struct arch_syscall_def *x32_syscall_iterate(unsigned int spot);
3737
3838 #endif
2525 #include "arch.h"
2626 #include "arch-x86.h"
2727
28 /* NOTE: based on Linux 4.5-rc4 */
28 /* NOTE: based on Linux 4.15-rc7 */
2929 const struct arch_syscall_def x86_syscall_table[] = { \
3030 { "_llseek", 140 },
3131 { "_newselect", 142 },
4040 { "alarm", 27 },
4141 { "arm_fadvise64_64", __PNR_arm_fadvise64_64 },
4242 { "arm_sync_file_range", __PNR_arm_sync_file_range },
43 { "arch_prctl", __PNR_arch_prctl },
43 { "arch_prctl", 384 },
4444 { "bdflush", 134 },
4545 { "bind", 361 },
4646 { "bpf", 357 },
121121 { "get_mempolicy", 275 },
122122 { "get_robust_list", 312 },
123123 { "get_thread_area", 244 },
124 { "get_tls", __PNR_get_tls },
124125 { "getcpu", 318 },
125126 { "getcwd", 183 },
126127 { "getdents", 141 },
253254 { "pipe", 42 },
254255 { "pipe2", 331 },
255256 { "pivot_root", 217 },
257 { "pkey_alloc", 381 },
258 { "pkey_free", 382 },
259 { "pkey_mprotect", 380 },
256260 { "poll", 168 },
257261 { "ppoll", 309 },
258262 { "prctl", 172 },
259263 { "pread64", 180 },
260264 { "preadv", 333 },
265 { "preadv2", 378 },
261266 { "prlimit64", 340 },
262267 { "process_vm_readv", 347 },
263268 { "process_vm_writev", 348 },
268273 { "putpmsg", 189 },
269274 { "pwrite64", 181 },
270275 { "pwritev", 334 },
276 { "pwritev2", 379 },
271277 { "query_module", 167 },
272278 { "quotactl", 131 },
273279 { "read", 3 },
298304 { "rt_sigtimedwait", 177 },
299305 { "rt_tgsigqueueinfo", 335 },
300306 { "rtas", __PNR_rtas },
307 { "s390_guarded_storage", __PNR_s390_guarded_storage },
301308 { "s390_pci_mmio_read", __PNR_s390_pci_mmio_read },
302309 { "s390_pci_mmio_write", __PNR_s390_pci_mmio_write },
303310 { "s390_runtime_instr", __PNR_s390_runtime_instr },
311 { "s390_sthyi", __PNR_s390_sthyi },
304312 { "sched_get_priority_max", 159 },
305313 { "sched_get_priority_min", 160 },
306314 { "sched_getaffinity", 242 },
386394 { "stat64", 195 },
387395 { "statfs", 99 },
388396 { "statfs64", 268 },
397 { "statx", 383 },
389398 { "stime", 25 },
390399 { "stty", 31 },
391400 { "subpage_prot", __PNR_subpage_prot },
584593 }
585594
586595 /**
587 * Iterate through the syscall table and return the syscall name
596 * Iterate through the syscall table and return the syscall mapping
588597 * @param spot the offset into the syscall table
589598 *
590 * Return the syscall name at position @spot or NULL on failure. This function
591 * should only ever be used internally by libseccomp.
599 * Return the syscall mapping at position @spot or NULL on failure. This
600 * function should only ever be used internally by libseccomp.
592601 *
593602 */
594 const char *x86_syscall_iterate_name(unsigned int spot)
603 const struct arch_syscall_def *x86_syscall_iterate(unsigned int spot)
595604 {
596605 /* XXX - no safety checks here */
597 return x86_syscall_table[spot].name;
606 return &x86_syscall_table[spot];
598607 }
224224 {
225225 int rc;
226226 unsigned int iter;
227 size_t args_size;
228227 int sys = rule->syscall;
229228 int sys_a, sys_b;
230229 struct db_api_rule_list *rule_a, *rule_b;
234233 (359 to 373) : direct socket syscalls, Linux 4.3+ */
235234
236235 /* strict check for the multiplexed socket syscalls */
237 for (iter = 0; iter < rule->args_cnt; iter++) {
236 for (iter = 0; iter < ARG_COUNT_MAX; iter++) {
238237 if ((rule->args[iter].valid != 0) && (strict))
239238 return -EINVAL;
240239 }
264263 } else {
265264 /* need two rules, dup the first and link together */
266265 rule_a = rule;
267 rule_b = malloc(sizeof(*rule_b));
266 rule_b = db_rule_dup(rule_a);
268267 if (rule_b == NULL)
269268 return -ENOMEM;
270 args_size = sizeof(*rule_b->args) * rule_a->args_cnt;
271 rule_b->args = malloc(args_size);
272 if (rule_b->args == NULL) {
273 free(rule_b);
274 return -ENOMEM;
275 }
276 rule_b->action = rule_a->action;
277 rule_b->syscall = rule_a->syscall;
278 rule_b->args_cnt = rule_a->args_cnt;
279 memcpy(rule_b->args, rule_a->args, args_size);
280269 rule_b->prev = rule_a;
281270 rule_b->next = NULL;
282271 rule_a->next = rule_b;
3232 int x86_syscall_resolve_name(const char *name);
3333 const char *x86_syscall_resolve_num(int num);
3434
35 const char *x86_syscall_iterate_name(unsigned int spot);
35 const struct arch_syscall_def *x86_syscall_iterate(unsigned int spot);
3636
3737 int x86_syscall_rewrite(int *syscall);
3838
2525 #include "arch.h"
2626 #include "arch-x86_64.h"
2727
28 /* NOTE: based on Linux 4.5-rc4 */
28 /* NOTE: based on Linux 4.15-rc7 */
2929 const struct arch_syscall_def x86_64_syscall_table[] = { \
3030 { "_llseek", __PNR__llseek },
3131 { "_newselect", __PNR__newselect },
121121 { "get_mempolicy", 239 },
122122 { "get_robust_list", 274 },
123123 { "get_thread_area", 211 },
124 { "get_tls", __PNR_get_tls },
124125 { "getcpu", 309 },
125126 { "getcwd", 79 },
126127 { "getdents", 78 },
253254 { "pipe", 22 },
254255 { "pipe2", 293 },
255256 { "pivot_root", 155 },
257 { "pkey_alloc", 330 },
258 { "pkey_free", 331 },
259 { "pkey_mprotect", 329 },
256260 { "poll", 7 },
257261 { "ppoll", 271 },
258262 { "prctl", 157 },
259263 { "pread64", 17 },
260264 { "preadv", 295 },
265 { "preadv2", 327 },
261266 { "prlimit64", 302 },
262267 { "process_vm_readv", 310 },
263268 { "process_vm_writev", 311 },
268273 { "putpmsg", 182 },
269274 { "pwrite64", 18 },
270275 { "pwritev", 296 },
276 { "pwritev2", 328 },
271277 { "query_module", 178 },
272278 { "quotactl", 179 },
273279 { "read", 0 },
298304 { "rt_sigtimedwait", 128 },
299305 { "rt_tgsigqueueinfo", 297 },
300306 { "rtas", __PNR_rtas },
307 { "s390_guarded_storage", __PNR_s390_guarded_storage },
301308 { "s390_pci_mmio_read", __PNR_s390_pci_mmio_read },
302309 { "s390_pci_mmio_write", __PNR_s390_pci_mmio_write },
303310 { "s390_runtime_instr", __PNR_s390_runtime_instr },
311 { "s390_sthyi", __PNR_s390_sthyi },
304312 { "sched_get_priority_max", 146 },
305313 { "sched_get_priority_min", 147 },
306314 { "sched_getaffinity", 204 },
386394 { "stat64", __PNR_stat64 },
387395 { "statfs", 137 },
388396 { "statfs64", __PNR_statfs64 },
397 { "statx", 332 },
389398 { "stime", __PNR_stime },
390399 { "stty", __PNR_stty },
391400 { "subpage_prot", __PNR_subpage_prot },
500509 }
501510
502511 /**
503 * Iterate through the syscall table and return the syscall name
512 * Iterate through the syscall table and return the syscall mapping
504513 * @param spot the offset into the syscall table
505514 *
506 * Return the syscall name at position @spot or NULL on failure. This function
507 * should only ever be used internally by libseccomp.
515 * Return the syscall mapping at position @spot or NULL on failure. This
516 * function should only ever be used internally by libseccomp.
508517 *
509518 */
510 const char *x86_64_syscall_iterate_name(unsigned int spot)
519 const struct arch_syscall_def *x86_64_syscall_iterate(unsigned int spot)
511520 {
512521 /* XXX - no safety checks here */
513 return x86_64_syscall_table[spot].name;
522 return &x86_64_syscall_table[spot];
514523 }
515524
3131 int x86_64_syscall_resolve_name(const char *name);
3232 const char *x86_64_syscall_resolve_num(int num);
3333
34 const char *x86_64_syscall_iterate_name(unsigned int spot);
34 const struct arch_syscall_def *x86_64_syscall_iterate(unsigned int spot);
3535
3636 #endif
4343 #include "arch-s390x.h"
4444 #include "db.h"
4545 #include "system.h"
46
47 #define default_arg_count_max 6
4846
4947 #define default_arg_offset(x) (offsetof(struct seccomp_data, args[x]))
5048
199197 }
200198
201199 /**
202 * Determine the maximum number of syscall arguments
203 * @param arch the architecture definition
204 *
205 * Determine the maximum number of syscall arguments for the given architecture.
206 * Returns the number of arguments on success, negative values on failure.
207 *
208 */
209 int arch_arg_count_max(const struct arch_def *arch)
210 {
211 return (arch_valid(arch->token) == 0 ? default_arg_count_max : -EDOM);
212 }
213
214 /**
215200 * Determine the argument offset for the lower 32 bits
216201 * @param arch the architecture definition
217202 * @param arg the argument number
331316 int sc_num;
332317 const char *sc_name;
333318
319 /* special handling for syscall -1 */
320 if (*syscall == -1)
321 return 0;
322
334323 if (arch->token != arch_def_native->token) {
335324 sc_name = arch_syscall_resolve_num(arch_def_native, *syscall);
336325 if (sc_name == NULL)
361350 {
362351 int sys = *syscall;
363352
364 if (sys >= 0) {
353 if (sys >= -1) {
365354 /* we shouldn't be here - no rewrite needed */
366355 return 0;
367 } else if (sys < 0 && sys > -100) {
356 } else if (sys < -1 && sys > -100) {
368357 /* reserved values */
369358 return -EINVAL;
370359 } else if (sys <= -100 && sys > -10000) {
400389 */
401390 int arch_filter_rule_add(struct db_filter_col *col, struct db_filter *db,
402391 bool strict, uint32_t action, int syscall,
403 unsigned int chain_len, struct db_api_arg *chain)
392 struct db_api_arg *chain)
404393 {
405394 int rc;
406 size_t chain_size = sizeof(*chain) * chain_len;
407395 struct db_api_rule_list *rule, *rule_tail;
408
409 /* ensure we aren't using any reserved syscall values */
410 if (syscall < 0 && syscall > -100)
411 return -EINVAL;
412396
413397 /* translate the syscall */
414398 rc = arch_syscall_translate(db->arch, &syscall);
419403 rule = malloc(sizeof(*rule));
420404 if (rule == NULL)
421405 return -ENOMEM;
422 rule->args = malloc(chain_size);
423 if (rule->args == NULL) {
424 free(rule);
425 return -ENOMEM;
426 }
427406 rule->action = action;
428407 rule->syscall = syscall;
429 rule->args_cnt = chain_len;
430 memcpy(rule->args, chain, chain_size);
408 memcpy(rule->args, chain, sizeof(*chain) * ARG_COUNT_MAX);
431409 rule->prev = NULL;
432410 rule->next = NULL;
433411
434412 /* add the new rule to the existing filter */
435 if (db->arch->rule_add == NULL) {
436 /* negative syscalls require a db->arch->rule_add() function */
437 if (syscall < 0 && strict) {
413 if (syscall == -1 || db->arch->rule_add == NULL) {
414 /* syscalls < -1 require a db->arch->rule_add() function */
415 if (syscall < -1 && strict) {
438416 rc = -EDOM;
439417 goto rule_add_failure;
440418 }
465443 do {
466444 rule_tail = rule;
467445 rule = rule->next;
468 free(rule_tail->args);
469446 free(rule_tail);
470447 } while (rule);
471448 return rc;
5959 /* arch_def for the current architecture */
6060 extern const struct arch_def *arch_def_native;
6161
62 /* NOTE: Syscall mappings can be found by running the following commands
63 * on the specific architecture's include file:
64 * # gcc -E -dM <file> | grep '__NR_'
65 * where <file> in many cases is /usr/include/asm/unistd.h, however,
66 * depending on the architecture you may need to use a different header.
67 * Further, you can automatically format this list for use as a struct
68 * initializer with the following command:
69 * # gcc -E -dM <file> | grep '__NR_' | \
70 * sed -e 's/#define[ \t]\+__NR_//' | sort | \
71 * sed -e 's/\([^ \t]\+\)\([ \t]\+\)\([0-9]\+\)/\t{ \"\1\", \3 },/'
72 * Finally, when creating a table/array of this structure, the final
73 * sentinel entry should be "{ NULL, __NR_SCMP_ERROR }"; see the existing
74 * tables as an example.
75 */
62 /* syscall name/num mapping */
7663 struct arch_syscall_def {
7764 const char *name;
7865 unsigned int num;
8976 const struct arch_def *arch_def_lookup(uint32_t token);
9077 const struct arch_def *arch_def_lookup_name(const char *arch_name);
9178
92 int arch_arg_count_max(const struct arch_def *arch);
93
9479 int arch_arg_offset_lo(const struct arch_def *arch, unsigned int arg);
9580 int arch_arg_offset_hi(const struct arch_def *arch, unsigned int arg);
9681 int arch_arg_offset(const struct arch_def *arch, unsigned int arg);
10388
10489 int arch_filter_rule_add(struct db_filter_col *col, struct db_filter *db,
10590 bool strict, uint32_t action, int syscall,
106 unsigned int chain_len, struct db_api_arg *chain);
91 struct db_api_arg *chain);
10792
10893 #endif
380380 r_iter = db->rules;
381381 while (r_iter != NULL) {
382382 db->rules = r_iter->next;
383 free(r_iter->args);
384383 free(r_iter);
385384 r_iter = db->rules;
386385 }
512511 }
513512
514513 /**
514 * Duplicate an existing filter rule
515 * @param src the rule to duplicate
516 *
517 * This function makes an exact copy of the given rule, but does not add it
518 * to any lists. Returns a pointer to the new rule on success, NULL on
519 * failure.
520 *
521 */
522 struct db_api_rule_list *db_rule_dup(const struct db_api_rule_list *src)
523 {
524 struct db_api_rule_list *dest;
525
526 dest = malloc(sizeof(*dest));
527 if (dest == NULL)
528 return NULL;
529 memcpy(dest, src, sizeof(*dest));
530 dest->prev = NULL;
531 dest->next = NULL;
532
533 return dest;
534 }
535
536 /**
515537 * Free and reset the seccomp filter collection
516538 * @param col the seccomp filter collection
517539 * @param def_action the default filter action
547569 col->attr.act_badarch = SCMP_ACT_KILL;
548570 col->attr.nnp_enable = 1;
549571 col->attr.tsync_enable = 0;
572 col->attr.api_tskip = 0;
550573
551574 /* set the state */
552575 col->state = _DB_STA_VALID;
770793 break;
771794 case SCMP_FLTATR_CTL_TSYNC:
772795 *value = col->attr.tsync_enable;
796 break;
797 case SCMP_FLTATR_API_TSKIP:
798 *value = col->attr.api_tskip;
773799 break;
774800 default:
775801 rc = -EEXIST;
818844 /* unsupported */
819845 rc = -EOPNOTSUPP;
820846 break;
847 case SCMP_FLTATR_API_TSKIP:
848 col->attr.api_tskip = (value ? 1 : 0);
849 break;
821850 default:
822851 rc = -EEXIST;
823852 break;
9881017 static struct db_sys_list *_db_rule_gen_64(const struct arch_def *arch,
9891018 uint32_t action,
9901019 unsigned int syscall,
991 struct db_api_arg *chain)
1020 const struct db_api_arg *chain)
9921021 {
9931022 unsigned int iter;
994 int chain_len_max;
9951023 struct db_sys_list *s_new;
9961024 struct db_arg_chain_tree *c_iter_hi = NULL, *c_iter_lo = NULL;
9971025 struct db_arg_chain_tree *c_prev_hi = NULL, *c_prev_lo = NULL;
10041032 s_new->num = syscall;
10051033 s_new->valid = true;
10061034 /* run through the argument chain */
1007 chain_len_max = arch_arg_count_max(arch);
1008 if (chain_len_max < 0)
1009 goto gen_64_failure;
1010 for (iter = 0; iter < chain_len_max; iter++) {
1035 for (iter = 0; iter < ARG_COUNT_MAX; iter++) {
10111036 if (chain[iter].valid == 0)
10121037 continue;
10131038
11281153 static struct db_sys_list *_db_rule_gen_32(const struct arch_def *arch,
11291154 uint32_t action,
11301155 unsigned int syscall,
1131 struct db_api_arg *chain)
1156 const struct db_api_arg *chain)
11321157 {
11331158 unsigned int iter;
1134 int chain_len_max;
11351159 struct db_sys_list *s_new;
11361160 struct db_arg_chain_tree *c_iter = NULL, *c_prev = NULL;
11371161 bool tf_flag;
11431167 s_new->num = syscall;
11441168 s_new->valid = true;
11451169 /* run through the argument chain */
1146 chain_len_max = arch_arg_count_max(arch);
1147 if (chain_len_max < 0)
1148 goto gen_32_failure;
1149 for (iter = 0; iter < chain_len_max; iter++) {
1170 for (iter = 0; iter < ARG_COUNT_MAX; iter++) {
11501171 if (chain[iter].valid == 0)
11511172 continue;
11521173
12371258 int rc = -ENOMEM;
12381259 int syscall = rule->syscall;
12391260 uint32_t action = rule->action;
1240 struct db_api_arg *chain = rule->args;
1261 const struct db_api_arg *chain = rule->args;
12411262 struct db_sys_list *s_new, *s_iter, *s_prev = NULL;
12421263 struct db_arg_chain_tree *c_iter = NULL, *c_prev = NULL;
12431264 struct db_arg_chain_tree *ec_iter;
15191540 if (rc_tmp < 0)
15201541 goto priority_failure;
15211542
1522 /* if this is a pseudo syscall (syscall < 0) then we need to
1523 * rewrite the syscall for some arch specific reason */
1524 if (sc_tmp < 0) {
1543 /* if this is a pseudo syscall then we need to rewrite the
1544 * syscall for some arch specific reason, don't forget the
1545 * special handling for syscall -1 */
1546 if (sc_tmp < -1) {
15251547 /* we set this as a strict op - we don't really care
15261548 * since priorities are a "best effort" thing - as we
15271549 * want to catch the -EDOM error and bail on this
15671589 {
15681590 int rc = 0, rc_tmp;
15691591 unsigned int iter;
1570 unsigned int chain_len;
15711592 unsigned int arg_num;
15721593 size_t chain_size;
15731594 struct db_api_arg *chain = NULL;
15741595 struct scmp_arg_cmp arg_data;
15751596
15761597 /* collect the arguments for the filter rule */
1577 chain_len = ARG_COUNT_MAX;
1578 chain_size = sizeof(*chain) * chain_len;
1598 chain_size = sizeof(*chain) * ARG_COUNT_MAX;
15791599 chain = malloc(chain_size);
15801600 if (chain == NULL)
15811601 return -ENOMEM;
15831603 for (iter = 0; iter < arg_cnt; iter++) {
15841604 arg_data = arg_array[iter];
15851605 arg_num = arg_data.arg;
1586 if (arg_num < chain_len && chain[arg_num].valid == 0) {
1606 if (arg_num < ARG_COUNT_MAX && chain[arg_num].valid == 0) {
15871607 chain[arg_num].valid = 1;
15881608 chain[arg_num].arg = arg_num;
15891609 chain[arg_num].op = arg_data.op;
16151635
16161636 for (iter = 0; iter < col->filter_cnt; iter++) {
16171637 rc_tmp = arch_filter_rule_add(col, col->filters[iter], strict,
1618 action, syscall,
1619 chain_len, chain);
1638 action, syscall, chain);
16201639 if (rc == 0 && rc_tmp < 0)
16211640 rc = rc_tmp;
16221641 }
16381657 int db_col_transaction_start(struct db_filter_col *col)
16391658 {
16401659 unsigned int iter;
1641 size_t args_size;
16421660 struct db_filter_snap *snap;
16431661 struct db_filter *filter_o, *filter_s;
16441662 struct db_api_rule_list *rule_o, *rule_s;
16721690 continue;
16731691 do {
16741692 /* copy the rule */
1675 rule_s = malloc(sizeof(*rule_s));
1693 rule_s = db_rule_dup(rule_o);
16761694 if (rule_s == NULL)
16771695 goto trans_start_failure;
1678 args_size = sizeof(*rule_s->args) * rule_o->args_cnt;
1679 rule_s->args = malloc(args_size);
1680 if (rule_s->args == NULL) {
1681 free(rule_s);
1682 goto trans_start_failure;
1683 }
1684 rule_s->action = rule_o->action;
1685 rule_s->syscall = rule_o->syscall;
1686 rule_s->args_cnt = rule_o->args_cnt;
1687 memcpy(rule_s->args, rule_o->args, args_size);
16881696 if (filter_s->rules != NULL) {
16891697 rule_s->prev = filter_s->rules->prev;
16901698 rule_s->next = filter_s->rules;
4242 struct db_api_rule_list {
4343 uint32_t action;
4444 int syscall;
45 struct db_api_arg *args;
46 unsigned int args_cnt;
45 struct db_api_arg args[ARG_COUNT_MAX];
4746
4847 struct db_api_rule_list *prev, *next;
4948 };
137136 uint32_t nnp_enable;
138137 /* SECCOMP_FILTER_FLAG_TSYNC related attributes */
139138 uint32_t tsync_enable;
139 /* allow rules with a -1 syscall value */
140 uint32_t api_tskip;
140141 };
141142
142143 struct db_filter {
188189
189190 int db_action_valid(uint32_t action);
190191
192 struct db_api_rule_list *db_rule_dup(const struct db_api_rule_list *src);
193
191194 struct db_filter_col *db_col_init(uint32_t def_action);
192195 int db_col_reset(struct db_filter_col *col, uint32_t def_action);
193196 void db_col_release(struct db_filter_col *col);
13521352 /* filter out x32 */
13531353 _BPF_INSTR(instr,
13541354 _BPF_OP(state->arch, BPF_JMP + BPF_JGE),
1355 _BPF_JMP_HSH(state->bad_arch_hsh),
1355 _BPF_JMP_NO,
13561356 _BPF_JMP_NO,
13571357 _BPF_K(state->arch, X32_SYSCALL_BIT));
13581358 if (b_head != NULL)
13591359 instr.jf = _BPF_JMP_HSH(b_head->hash);
13601360 else
13611361 instr.jf = _BPF_JMP_HSH(state->def_hsh);
1362 b_new = _blk_append(state, b_new, &instr);
1363 if (b_new == NULL)
1364 goto arch_failure;
1365 /* NOTE: starting with Linux v4.8 the seccomp filters
1366 * are processed both when the syscall is
1367 * initially executed as well as after any
1368 * tracing processes finish so we need to make
1369 * sure we don't trap the -1 syscall which
1370 * tracers can use to skip the syscall, see
1371 * seccomp(2) for more information */
1372 _BPF_INSTR(instr,
1373 _BPF_OP(state->arch, BPF_JMP + BPF_JEQ),
1374 _BPF_JMP_NO,
1375 _BPF_JMP_HSH(state->bad_arch_hsh),
1376 _BPF_K(state->arch, -1));
1377 if (b_head != NULL)
1378 instr.jt = _BPF_JMP_HSH(b_head->hash);
1379 else
1380 instr.jt = _BPF_JMP_HSH(state->def_hsh);
13621381 blk_cnt++;
13631382 } else if (state->arch->token == SCMP_ARCH_X32) {
13641383 /* filter out x86_64 */
0 # Makefile.in generated by automake 1.14.1 from Makefile.am.
0 # Makefile.in generated by automake 1.15.1 from Makefile.am.
11 # @configure_input@
22
3 # Copyright (C) 1994-2013 Free Software Foundation, Inc.
3 # Copyright (C) 1994-2017 Free Software Foundation, Inc.
44
55 # This Makefile.in is free software; the Free Software Foundation
66 # gives unlimited permission to copy and/or distribute it,
3131 # along with this library; if not, see <http://www.gnu.org/licenses>.
3232 #
3333 VPATH = @srcdir@
34 am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
34 am__is_gnu_make = { \
35 if test -z '$(MAKELEVEL)'; then \
36 false; \
37 elif test -n '$(MAKE_HOST)'; then \
38 true; \
39 elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
40 true; \
41 else \
42 false; \
43 fi; \
44 }
3545 am__make_running_with_option = \
3646 case $${target_option-} in \
3747 ?) ;; \
95105 build_triplet = @build@
96106 host_triplet = @host@
97107 subdir = src/python
98 DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am
99108 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
100 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
101 $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
102 $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
103 $(top_srcdir)/configure.ac
109 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_code_coverage.m4 \
110 $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
111 $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
112 $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac
104113 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
105114 $(ACLOCAL_M4)
115 DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
106116 mkinstalldirs = $(install_sh) -d
107117 CONFIG_HEADER = $(top_builddir)/configure.h
108118 CONFIG_CLEAN_FILES =
127137 *) (install-info --version) >/dev/null 2>&1;; \
128138 esac
129139 am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
140 am__DIST_COMMON = $(srcdir)/Makefile.in
130141 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
131142 ACLOCAL = @ACLOCAL@
132143 AMTAR = @AMTAR@
142153 CC = @CC@
143154 CCDEPMODE = @CCDEPMODE@
144155 CFLAGS = @CFLAGS@
156 CODE_COVERAGE_CFLAGS = @CODE_COVERAGE_CFLAGS@
157 CODE_COVERAGE_CPPFLAGS = @CODE_COVERAGE_CPPFLAGS@
158 CODE_COVERAGE_CXXFLAGS = @CODE_COVERAGE_CXXFLAGS@
159 CODE_COVERAGE_ENABLED = @CODE_COVERAGE_ENABLED@
160 CODE_COVERAGE_LDFLAGS = @CODE_COVERAGE_LDFLAGS@
161 CODE_COVERAGE_LIBS = @CODE_COVERAGE_LIBS@
145162 CPP = @CPP@
146163 CPPFLAGS = @CPPFLAGS@
147164 CYGPATH_W = @CYGPATH_W@
156173 EGREP = @EGREP@
157174 EXEEXT = @EXEEXT@
158175 FGREP = @FGREP@
176 GCOV = @GCOV@
177 GENHTML = @GENHTML@
159178 GREP = @GREP@
160179 INSTALL = @INSTALL@
161180 INSTALL_DATA = @INSTALL_DATA@
162181 INSTALL_PROGRAM = @INSTALL_PROGRAM@
163182 INSTALL_SCRIPT = @INSTALL_SCRIPT@
164183 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
184 LCOV = @LCOV@
165185 LD = @LD@
166186 LDFLAGS = @LDFLAGS@
167187 LIBOBJS = @LIBOBJS@
282302 echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/python/Makefile'; \
283303 $(am__cd) $(top_srcdir) && \
284304 $(AUTOMAKE) --foreign src/python/Makefile
285 .PRECIOUS: Makefile
286305 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
287306 @case '$?' in \
288307 *config.status*) \
458477 mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
459478 tags-am uninstall uninstall-am
460479
480 .PRECIOUS: Makefile
481
461482
462483 all-local: build
463484
5353 SCMP_FLTATR_ACT_BADARCH
5454 SCMP_FLTATR_CTL_NNP
5555 SCMP_FLTATR_CTL_TSYNC
56 SCMP_FLTATR_API_TSKIP
5657
5758 cdef enum scmp_compare:
5859 SCMP_CMP_NE
00 #
11 # Seccomp Library Python Bindings
22 #
3 # Copyright (c) 2012,2013 Red Hat <pmoore@redhat.com>
3 # Copyright (c) 2012,2013,2017 Red Hat <pmoore@redhat.com>
44 # Author: Paul Moore <paul@paul-moore.com>
55 #
66
6767 f.load()
6868 """
6969 __author__ = 'Paul Moore <paul@paul-moore.com>'
70 __date__ = "7 January 2013"
71
70 __date__ = "3 February 2017"
71
72 from cpython.version cimport PY_MAJOR_VERSION
7273 from libc.stdint cimport uint32_t
7374 import errno
7475
7576 cimport libseccomp
77
78 def c_str(string):
79 """ Convert a Python string to a C string.
80
81 Arguments:
82 string - the Python string
83
84 Description:
85 Convert the Python string into a form usable by C taking into consideration
86 the Python major version, e.g. Python 2.x or Python 3.x.
87 See http://docs.cython.org/en/latest/src/tutorial/strings.html for more
88 information.
89 """
90 if PY_MAJOR_VERSION < 3:
91 return string
92 else:
93 return bytes(string, "ascii")
7694
7795 KILL = libseccomp.SCMP_ACT_KILL
7896 TRAP = libseccomp.SCMP_ACT_TRAP
120138 cdef char *ret_str
121139
122140 if isinstance(syscall, basestring):
123 return libseccomp.seccomp_syscall_resolve_name_rewrite(arch, syscall)
141 return libseccomp.seccomp_syscall_resolve_name_rewrite(arch,
142 c_str(syscall))
124143 elif isinstance(syscall, int):
125144 ret_str = libseccomp.seccomp_syscall_resolve_num_arch(arch, syscall)
126145 if ret_str is NULL:
217236 else:
218237 self._token = 0;
219238 elif isinstance(arch, basestring):
220 self._token = libseccomp.seccomp_arch_resolve_name(arch)
239 self._token = libseccomp.seccomp_arch_resolve_name(c_str(arch))
221240 else:
222241 raise TypeError("Architecture must be an int or str type")
223242 if self._token == 0:
245264 ACT_BADARCH = libseccomp.SCMP_FLTATR_ACT_BADARCH
246265 CTL_NNP = libseccomp.SCMP_FLTATR_CTL_NNP
247266 CTL_TSYNC = libseccomp.SCMP_FLTATR_CTL_TSYNC
267 API_TSKIP = libseccomp.SCMP_FLTATR_API_TSKIP
248268
249269 cdef class Arg:
250270 """ Python object representing a SyscallFilter syscall argument.
4040
4141 sys_num = resolve_syscall(Arch(), "open")
4242 sys_name = resolve_syscall(Arch(), sys_num)
43 if (sys_name != "open"):
43 if (sys_name != b"open"):
4444 raise RuntimeError("Test failure")
4545 sys_num = resolve_syscall(Arch(), "read")
4646 sys_name = resolve_syscall(Arch(), sys_num)
47 if (sys_name != "read"):
47 if (sys_name != b"read"):
4848 raise RuntimeError("Test failure")
4949
5050 test()
3232 if action == TRAP:
3333 util.install_trap()
3434 f = SyscallFilter(action)
35 f.add_rule(ALLOW, "getpid")
3536 f.add_rule(ALLOW, "rt_sigreturn")
3637 f.add_rule(ALLOW, "sigreturn")
3738 f.add_rule(ALLOW, "exit_group")
4646 f.add_rule(ALLOW, "rt_sigaction")
4747 f.add_rule(ALLOW, "rt_sigreturn")
4848 f.add_rule(ALLOW, "sigreturn")
49 f.add_rule(ALLOW, "sigaltstack")
4950 f.add_rule(ALLOW, "brk")
5051 f.add_rule(ALLOW, "exit_group")
5152 f.load()
53
5254 try:
5355 util.write_file("/dev/null")
5456 except OSError as ex:
3434 quit(1)
3535 util.install_trap()
3636
37 fd = os.open("/dev/null", os.O_WRONLY|os.O_CREAT, 0600)
37 fd = os.open("/dev/null", os.O_WRONLY|os.O_CREAT)
3838
3939 f = SyscallFilter(TRAP)
4040 # NOTE: additional syscalls required for python
4242 f.add_rule(ALLOW, "close")
4343 f.add_rule(ALLOW, "rt_sigaction")
4444 f.add_rule(ALLOW, "rt_sigreturn")
45 f.add_rule(ALLOW, "sigaltstack")
4546 f.add_rule(ALLOW, "exit_group")
4647 f.add_rule(ALLOW, "brk")
4748 f.load()
4849
4950 try:
50 if not os.write(fd, "testing") == len("testing"):
51 if not os.write(fd, b"testing") == len("testing"):
5152 raise IOError("failed to write the full test string")
5253 quit(160)
5354 except OSError as ex:
4747 f.add_rule(ALLOW, "rt_sigaction")
4848 f.add_rule(ALLOW, "rt_sigreturn")
4949 f.add_rule(ALLOW, "sigreturn")
50 f.add_rule(ALLOW, "sigaltstack")
5051 f.add_rule(ALLOW, "brk")
5152 f.add_rule(ALLOW, "exit_group")
5253 f.load()
0 /**
1 * Seccomp Library test program
2 *
3 * Copyright (c) 2017 Red Hat <pmoore@redhat.com>
4 * Author: Paul Moore <paul@paul-moore.com>
5 */
6
7 /*
8 * This library is free software; you can redistribute it and/or modify it
9 * under the terms of version 2.1 of the GNU Lesser General Public License as
10 * published by the Free Software Foundation.
11 *
12 * This library is distributed in the hope that it will be useful, but WITHOUT
13 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
15 * for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public License
18 * along with this library; if not, see <http://www.gnu.org/licenses>.
19 */
20
21 /*
22 * Just like mode 1 seccomp we allow 4 syscalls:
23 * read, write, exit, and rt_sigreturn
24 */
25
26 #include <errno.h>
27 #include <unistd.h>
28
29 #include <seccomp.h>
30
31 #include "util.h"
32
33 int main(int argc, char *argv[])
34 {
35 int rc;
36 struct util_options opts;
37 scmp_filter_ctx ctx = NULL;
38
39 rc = util_getopt(argc, argv, &opts);
40 if (rc < 0)
41 goto out;
42
43 ctx = seccomp_init(SCMP_ACT_KILL);
44 if (ctx == NULL)
45 return ENOMEM;
46
47 rc = seccomp_arch_remove(ctx, SCMP_ARCH_NATIVE);
48 if (rc != 0)
49 goto out;
50
51 rc = seccomp_arch_add(ctx, SCMP_ARCH_X86);
52 if (rc != 0)
53 goto out;
54 rc = seccomp_arch_add(ctx, SCMP_ARCH_X86_64);
55 if (rc != 0)
56 goto out;
57
58 rc = seccomp_attr_set(ctx, SCMP_FLTATR_API_TSKIP, 1);
59 if (rc != 0)
60 goto out;
61
62 rc = seccomp_syscall_priority(ctx, -1, 100);
63 if (rc != 0)
64 goto out;
65
66 rc = seccomp_rule_add(ctx, SCMP_ACT_ALLOW, -1, 0);
67 if (rc != 0)
68 goto out;
69
70 rc = util_filter_output(&opts, ctx);
71 if (rc)
72 goto out;
73
74 out:
75 seccomp_release(ctx);
76 return (rc < 0 ? -rc : rc);
77 }
0 #!/usr/bin/env python
1
2 #
3 # Seccomp Library test program
4 #
5 # Copyright (c) 2017 Red Hat <pmoore@redhat.com>
6 # Author: Paul Moore <paul@paul-moore.com>
7 #
8
9 #
10 # This library is free software; you can redistribute it and/or modify it
11 # under the terms of version 2.1 of the GNU Lesser General Public License as
12 # published by the Free Software Foundation.
13 #
14 # This library is distributed in the hope that it will be useful, but WITHOUT
15 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
16 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
17 # for more details.
18 #
19 # You should have received a copy of the GNU Lesser General Public License
20 # along with this library; if not, see <http://www.gnu.org/licenses>.
21 #
22
23 import argparse
24 import sys
25
26 import util
27
28 from seccomp import *
29
30 def test(args):
31 f = SyscallFilter(KILL)
32 f.remove_arch(Arch())
33 f.add_arch(Arch("x86"))
34 f.add_arch(Arch("x86_64"))
35 f.set_attr(Attr.API_TSKIP, 1)
36 f.syscall_priority(-1, 100)
37 f.add_rule(ALLOW, -1)
38 return f
39
40 args = util.get_opt()
41 ctx = test(args)
42 util.filter_output(args, ctx)
43
44 # kate: syntax python;
45 # kate: indent-mode python; space-indent on; indent-width 4; mixedindent off;
0 #
1 # libseccomp regression test automation data
2 #
3 # Copyright (c) 2017 Red Hat <pmoore@redhat.com>
4 # Author: Paul Moore <paul@paul-moore.com>
5 #
6
7 test type: bpf-sim
8
9 # Testname Arch Syscall Arg0 Arg1 Arg2 Arg3 Arg4 Arg5 Result
10 35-sim-negative_one +x86 -1 N N N N N N ALLOW
11 35-sim-negative_one +x86_64 -1 N N N N N N ALLOW
12 35-sim-negative_one +x32 -1 N N N N N N ALLOW
13
14 test type: bpf-valgrind
15
16 # Testname
17 35-sim-negative_one
1515 # along with this library; if not, see <http://www.gnu.org/licenses>.
1616 #
1717
18 AM_LDFLAGS = -static
19 LDADD = util.la ../src/libseccomp.la
18 @CODE_COVERAGE_RULES@
19
20 if CODE_COVERAGE_ENABLED
21 DBG_STATIC =
22 else
23 DBG_STATIC = -static
24 endif
25
26 AM_LDFLAGS = ${DBG_STATIC}
27
28 LDADD = util.la ../src/libseccomp.la ${CODE_COVERAGE_LIBS}
2029
2130 check_LTLIBRARIES = util.la
2231 util_la_SOURCES = util.c util.h
6069 30-sim-socket_syscalls \
6170 31-basic-version_check \
6271 32-live-tsync_allow \
63 33-sim-socket_syscalls_be
72 33-sim-socket_syscalls_be \
73 35-sim-negative_one
6474
6575 EXTRA_DIST_TESTPYTHON = \
6676 util.py \
96106 30-sim-socket_syscalls.py \
97107 31-basic-version_check.py \
98108 32-live-tsync_allow.py \
99 33-sim-socket_syscalls_be.py
109 33-sim-socket_syscalls_be.py \
110 35-sim-negative_one.py
100111
101112 EXTRA_DIST_TESTCFGS = \
102113 01-sim-allow.tests \
131142 30-sim-socket_syscalls.tests \
132143 31-basic-version_check.tests \
133144 32-live-tsync_allow.tests \
134 33-sim-socket_syscalls_be.tests
145 33-sim-socket_syscalls_be.tests \
146 35-sim-negative_one.tests
135147
136148 EXTRA_DIST_TESTSCRIPTS = regression testdiff testgen
137149
0 # Makefile.in generated by automake 1.14.1 from Makefile.am.
0 # Makefile.in generated by automake 1.15.1 from Makefile.am.
11 # @configure_input@
22
3 # Copyright (C) 1994-2013 Free Software Foundation, Inc.
3 # Copyright (C) 1994-2017 Free Software Foundation, Inc.
44
55 # This Makefile.in is free software; the Free Software Foundation
66 # gives unlimited permission to copy and/or distribute it,
3131 # along with this library; if not, see <http://www.gnu.org/licenses>.
3232 #
3333 VPATH = @srcdir@
34 am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
34 am__is_gnu_make = { \
35 if test -z '$(MAKELEVEL)'; then \
36 false; \
37 elif test -n '$(MAKE_HOST)'; then \
38 true; \
39 elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
40 true; \
41 else \
42 false; \
43 fi; \
44 }
3545 am__make_running_with_option = \
3646 case $${target_option-} in \
3747 ?) ;; \
115125 27-sim-bpf_blk_state$(EXEEXT) 28-sim-arch_x86$(EXEEXT) \
116126 29-sim-pseudo_syscall$(EXEEXT) 30-sim-socket_syscalls$(EXEEXT) \
117127 31-basic-version_check$(EXEEXT) 32-live-tsync_allow$(EXEEXT) \
118 33-sim-socket_syscalls_be$(EXEEXT)
128 33-sim-socket_syscalls_be$(EXEEXT) \
129 35-sim-negative_one$(EXEEXT)
119130 EXTRA_PROGRAMS = 00-test$(EXEEXT)
120131 subdir = tests
121 DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
122 $(top_srcdir)/build-aux/depcomp
123132 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
124 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
125 $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
126 $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
127 $(top_srcdir)/configure.ac
133 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_code_coverage.m4 \
134 $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
135 $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
136 $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac
128137 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
129138 $(ACLOCAL_M4)
139 DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
130140 mkinstalldirs = $(install_sh) -d
131141 CONFIG_HEADER = $(top_builddir)/configure.h
132142 CONFIG_CLEAN_FILES =
144154 nodist_00_test_OBJECTS = 00-test.$(OBJEXT)
145155 00_test_OBJECTS = $(nodist_00_test_OBJECTS)
146156 00_test_LDADD = $(LDADD)
147 00_test_DEPENDENCIES = util.la ../src/libseccomp.la
157 am__DEPENDENCIES_1 =
158 00_test_DEPENDENCIES = util.la ../src/libseccomp.la \
159 $(am__DEPENDENCIES_1)
148160 01_sim_allow_SOURCES = 01-sim-allow.c
149161 01_sim_allow_OBJECTS = 01-sim-allow.$(OBJEXT)
150162 01_sim_allow_LDADD = $(LDADD)
151 01_sim_allow_DEPENDENCIES = util.la ../src/libseccomp.la
163 01_sim_allow_DEPENDENCIES = util.la ../src/libseccomp.la \
164 $(am__DEPENDENCIES_1)
152165 02_sim_basic_SOURCES = 02-sim-basic.c
153166 02_sim_basic_OBJECTS = 02-sim-basic.$(OBJEXT)
154167 02_sim_basic_LDADD = $(LDADD)
155 02_sim_basic_DEPENDENCIES = util.la ../src/libseccomp.la
168 02_sim_basic_DEPENDENCIES = util.la ../src/libseccomp.la \
169 $(am__DEPENDENCIES_1)
156170 03_sim_basic_chains_SOURCES = 03-sim-basic_chains.c
157171 03_sim_basic_chains_OBJECTS = 03-sim-basic_chains.$(OBJEXT)
158172 03_sim_basic_chains_LDADD = $(LDADD)
159 03_sim_basic_chains_DEPENDENCIES = util.la ../src/libseccomp.la
173 03_sim_basic_chains_DEPENDENCIES = util.la ../src/libseccomp.la \
174 $(am__DEPENDENCIES_1)
160175 04_sim_multilevel_chains_SOURCES = 04-sim-multilevel_chains.c
161176 04_sim_multilevel_chains_OBJECTS = 04-sim-multilevel_chains.$(OBJEXT)
162177 04_sim_multilevel_chains_LDADD = $(LDADD)
163 04_sim_multilevel_chains_DEPENDENCIES = util.la ../src/libseccomp.la
178 04_sim_multilevel_chains_DEPENDENCIES = util.la ../src/libseccomp.la \
179 $(am__DEPENDENCIES_1)
164180 05_sim_long_jumps_SOURCES = 05-sim-long_jumps.c
165181 05_sim_long_jumps_OBJECTS = 05-sim-long_jumps.$(OBJEXT)
166182 05_sim_long_jumps_LDADD = $(LDADD)
167 05_sim_long_jumps_DEPENDENCIES = util.la ../src/libseccomp.la
183 05_sim_long_jumps_DEPENDENCIES = util.la ../src/libseccomp.la \
184 $(am__DEPENDENCIES_1)
168185 06_sim_actions_SOURCES = 06-sim-actions.c
169186 06_sim_actions_OBJECTS = 06-sim-actions.$(OBJEXT)
170187 06_sim_actions_LDADD = $(LDADD)
171 06_sim_actions_DEPENDENCIES = util.la ../src/libseccomp.la
188 06_sim_actions_DEPENDENCIES = util.la ../src/libseccomp.la \
189 $(am__DEPENDENCIES_1)
172190 07_sim_db_bug_looping_SOURCES = 07-sim-db_bug_looping.c
173191 07_sim_db_bug_looping_OBJECTS = 07-sim-db_bug_looping.$(OBJEXT)
174192 07_sim_db_bug_looping_LDADD = $(LDADD)
175 07_sim_db_bug_looping_DEPENDENCIES = util.la ../src/libseccomp.la
193 07_sim_db_bug_looping_DEPENDENCIES = util.la ../src/libseccomp.la \
194 $(am__DEPENDENCIES_1)
176195 08_sim_subtree_checks_SOURCES = 08-sim-subtree_checks.c
177196 08_sim_subtree_checks_OBJECTS = 08-sim-subtree_checks.$(OBJEXT)
178197 08_sim_subtree_checks_LDADD = $(LDADD)
179 08_sim_subtree_checks_DEPENDENCIES = util.la ../src/libseccomp.la
198 08_sim_subtree_checks_DEPENDENCIES = util.la ../src/libseccomp.la \
199 $(am__DEPENDENCIES_1)
180200 09_sim_syscall_priority_pre_SOURCES = 09-sim-syscall_priority_pre.c
181201 09_sim_syscall_priority_pre_OBJECTS = \
182202 09-sim-syscall_priority_pre.$(OBJEXT)
183203 09_sim_syscall_priority_pre_LDADD = $(LDADD)
184204 09_sim_syscall_priority_pre_DEPENDENCIES = util.la \
185 ../src/libseccomp.la
205 ../src/libseccomp.la $(am__DEPENDENCIES_1)
186206 10_sim_syscall_priority_post_SOURCES = 10-sim-syscall_priority_post.c
187207 10_sim_syscall_priority_post_OBJECTS = \
188208 10-sim-syscall_priority_post.$(OBJEXT)
189209 10_sim_syscall_priority_post_LDADD = $(LDADD)
190210 10_sim_syscall_priority_post_DEPENDENCIES = util.la \
191 ../src/libseccomp.la
211 ../src/libseccomp.la $(am__DEPENDENCIES_1)
192212 11_basic_basic_errors_SOURCES = 11-basic-basic_errors.c
193213 11_basic_basic_errors_OBJECTS = 11-basic-basic_errors.$(OBJEXT)
194214 11_basic_basic_errors_LDADD = $(LDADD)
195 11_basic_basic_errors_DEPENDENCIES = util.la ../src/libseccomp.la
215 11_basic_basic_errors_DEPENDENCIES = util.la ../src/libseccomp.la \
216 $(am__DEPENDENCIES_1)
196217 12_sim_basic_masked_ops_SOURCES = 12-sim-basic_masked_ops.c
197218 12_sim_basic_masked_ops_OBJECTS = 12-sim-basic_masked_ops.$(OBJEXT)
198219 12_sim_basic_masked_ops_LDADD = $(LDADD)
199 12_sim_basic_masked_ops_DEPENDENCIES = util.la ../src/libseccomp.la
220 12_sim_basic_masked_ops_DEPENDENCIES = util.la ../src/libseccomp.la \
221 $(am__DEPENDENCIES_1)
200222 13_basic_attrs_SOURCES = 13-basic-attrs.c
201223 13_basic_attrs_OBJECTS = 13-basic-attrs.$(OBJEXT)
202224 13_basic_attrs_LDADD = $(LDADD)
203 13_basic_attrs_DEPENDENCIES = util.la ../src/libseccomp.la
225 13_basic_attrs_DEPENDENCIES = util.la ../src/libseccomp.la \
226 $(am__DEPENDENCIES_1)
204227 14_sim_reset_SOURCES = 14-sim-reset.c
205228 14_sim_reset_OBJECTS = 14-sim-reset.$(OBJEXT)
206229 14_sim_reset_LDADD = $(LDADD)
207 14_sim_reset_DEPENDENCIES = util.la ../src/libseccomp.la
230 14_sim_reset_DEPENDENCIES = util.la ../src/libseccomp.la \
231 $(am__DEPENDENCIES_1)
208232 15_basic_resolver_SOURCES = 15-basic-resolver.c
209233 15_basic_resolver_OBJECTS = 15-basic-resolver.$(OBJEXT)
210234 15_basic_resolver_LDADD = $(LDADD)
211 15_basic_resolver_DEPENDENCIES = util.la ../src/libseccomp.la
235 15_basic_resolver_DEPENDENCIES = util.la ../src/libseccomp.la \
236 $(am__DEPENDENCIES_1)
212237 16_sim_arch_basic_SOURCES = 16-sim-arch_basic.c
213238 16_sim_arch_basic_OBJECTS = 16-sim-arch_basic.$(OBJEXT)
214239 16_sim_arch_basic_LDADD = $(LDADD)
215 16_sim_arch_basic_DEPENDENCIES = util.la ../src/libseccomp.la
240 16_sim_arch_basic_DEPENDENCIES = util.la ../src/libseccomp.la \
241 $(am__DEPENDENCIES_1)
216242 17_sim_arch_merge_SOURCES = 17-sim-arch_merge.c
217243 17_sim_arch_merge_OBJECTS = 17-sim-arch_merge.$(OBJEXT)
218244 17_sim_arch_merge_LDADD = $(LDADD)
219 17_sim_arch_merge_DEPENDENCIES = util.la ../src/libseccomp.la
245 17_sim_arch_merge_DEPENDENCIES = util.la ../src/libseccomp.la \
246 $(am__DEPENDENCIES_1)
220247 18_sim_basic_whitelist_SOURCES = 18-sim-basic_whitelist.c
221248 18_sim_basic_whitelist_OBJECTS = 18-sim-basic_whitelist.$(OBJEXT)
222249 18_sim_basic_whitelist_LDADD = $(LDADD)
223 18_sim_basic_whitelist_DEPENDENCIES = util.la ../src/libseccomp.la
250 18_sim_basic_whitelist_DEPENDENCIES = util.la ../src/libseccomp.la \
251 $(am__DEPENDENCIES_1)
224252 19_sim_missing_syscalls_SOURCES = 19-sim-missing_syscalls.c
225253 19_sim_missing_syscalls_OBJECTS = 19-sim-missing_syscalls.$(OBJEXT)
226254 19_sim_missing_syscalls_LDADD = $(LDADD)
227 19_sim_missing_syscalls_DEPENDENCIES = util.la ../src/libseccomp.la
255 19_sim_missing_syscalls_DEPENDENCIES = util.la ../src/libseccomp.la \
256 $(am__DEPENDENCIES_1)
228257 20_live_basic_die_SOURCES = 20-live-basic_die.c
229258 20_live_basic_die_OBJECTS = 20-live-basic_die.$(OBJEXT)
230259 20_live_basic_die_LDADD = $(LDADD)
231 20_live_basic_die_DEPENDENCIES = util.la ../src/libseccomp.la
260 20_live_basic_die_DEPENDENCIES = util.la ../src/libseccomp.la \
261 $(am__DEPENDENCIES_1)
232262 21_live_basic_allow_SOURCES = 21-live-basic_allow.c
233263 21_live_basic_allow_OBJECTS = 21-live-basic_allow.$(OBJEXT)
234264 21_live_basic_allow_LDADD = $(LDADD)
235 21_live_basic_allow_DEPENDENCIES = util.la ../src/libseccomp.la
265 21_live_basic_allow_DEPENDENCIES = util.la ../src/libseccomp.la \
266 $(am__DEPENDENCIES_1)
236267 22_sim_basic_chains_array_SOURCES = 22-sim-basic_chains_array.c
237268 22_sim_basic_chains_array_OBJECTS = \
238269 22-sim-basic_chains_array.$(OBJEXT)
239270 22_sim_basic_chains_array_LDADD = $(LDADD)
240 22_sim_basic_chains_array_DEPENDENCIES = util.la ../src/libseccomp.la
271 22_sim_basic_chains_array_DEPENDENCIES = util.la ../src/libseccomp.la \
272 $(am__DEPENDENCIES_1)
241273 23_sim_arch_all_le_basic_SOURCES = 23-sim-arch_all_le_basic.c
242274 23_sim_arch_all_le_basic_OBJECTS = 23-sim-arch_all_le_basic.$(OBJEXT)
243275 23_sim_arch_all_le_basic_LDADD = $(LDADD)
244 23_sim_arch_all_le_basic_DEPENDENCIES = util.la ../src/libseccomp.la
276 23_sim_arch_all_le_basic_DEPENDENCIES = util.la ../src/libseccomp.la \
277 $(am__DEPENDENCIES_1)
245278 24_live_arg_allow_SOURCES = 24-live-arg_allow.c
246279 24_live_arg_allow_OBJECTS = 24-live-arg_allow.$(OBJEXT)
247280 24_live_arg_allow_LDADD = $(LDADD)
248 24_live_arg_allow_DEPENDENCIES = util.la ../src/libseccomp.la
281 24_live_arg_allow_DEPENDENCIES = util.la ../src/libseccomp.la \
282 $(am__DEPENDENCIES_1)
249283 25_sim_multilevel_chains_adv_SOURCES = 25-sim-multilevel_chains_adv.c
250284 25_sim_multilevel_chains_adv_OBJECTS = \
251285 25-sim-multilevel_chains_adv.$(OBJEXT)
252286 25_sim_multilevel_chains_adv_LDADD = $(LDADD)
253287 25_sim_multilevel_chains_adv_DEPENDENCIES = util.la \
254 ../src/libseccomp.la
288 ../src/libseccomp.la $(am__DEPENDENCIES_1)
255289 26_sim_arch_all_be_basic_SOURCES = 26-sim-arch_all_be_basic.c
256290 26_sim_arch_all_be_basic_OBJECTS = 26-sim-arch_all_be_basic.$(OBJEXT)
257291 26_sim_arch_all_be_basic_LDADD = $(LDADD)
258 26_sim_arch_all_be_basic_DEPENDENCIES = util.la ../src/libseccomp.la
292 26_sim_arch_all_be_basic_DEPENDENCIES = util.la ../src/libseccomp.la \
293 $(am__DEPENDENCIES_1)
259294 27_sim_bpf_blk_state_SOURCES = 27-sim-bpf_blk_state.c
260295 27_sim_bpf_blk_state_OBJECTS = 27-sim-bpf_blk_state.$(OBJEXT)
261296 27_sim_bpf_blk_state_LDADD = $(LDADD)
262 27_sim_bpf_blk_state_DEPENDENCIES = util.la ../src/libseccomp.la
297 27_sim_bpf_blk_state_DEPENDENCIES = util.la ../src/libseccomp.la \
298 $(am__DEPENDENCIES_1)
263299 28_sim_arch_x86_SOURCES = 28-sim-arch_x86.c
264300 28_sim_arch_x86_OBJECTS = 28-sim-arch_x86.$(OBJEXT)
265301 28_sim_arch_x86_LDADD = $(LDADD)
266 28_sim_arch_x86_DEPENDENCIES = util.la ../src/libseccomp.la
302 28_sim_arch_x86_DEPENDENCIES = util.la ../src/libseccomp.la \
303 $(am__DEPENDENCIES_1)
267304 29_sim_pseudo_syscall_SOURCES = 29-sim-pseudo_syscall.c
268305 29_sim_pseudo_syscall_OBJECTS = 29-sim-pseudo_syscall.$(OBJEXT)
269306 29_sim_pseudo_syscall_LDADD = $(LDADD)
270 29_sim_pseudo_syscall_DEPENDENCIES = util.la ../src/libseccomp.la
307 29_sim_pseudo_syscall_DEPENDENCIES = util.la ../src/libseccomp.la \
308 $(am__DEPENDENCIES_1)
271309 30_sim_socket_syscalls_SOURCES = 30-sim-socket_syscalls.c
272310 30_sim_socket_syscalls_OBJECTS = 30-sim-socket_syscalls.$(OBJEXT)
273311 30_sim_socket_syscalls_LDADD = $(LDADD)
274 30_sim_socket_syscalls_DEPENDENCIES = util.la ../src/libseccomp.la
312 30_sim_socket_syscalls_DEPENDENCIES = util.la ../src/libseccomp.la \
313 $(am__DEPENDENCIES_1)
275314 31_basic_version_check_SOURCES = 31-basic-version_check.c
276315 31_basic_version_check_OBJECTS = 31-basic-version_check.$(OBJEXT)
277316 31_basic_version_check_LDADD = $(LDADD)
278 31_basic_version_check_DEPENDENCIES = util.la ../src/libseccomp.la
317 31_basic_version_check_DEPENDENCIES = util.la ../src/libseccomp.la \
318 $(am__DEPENDENCIES_1)
279319 32_live_tsync_allow_SOURCES = 32-live-tsync_allow.c
280320 32_live_tsync_allow_OBJECTS = 32-live-tsync_allow.$(OBJEXT)
281321 32_live_tsync_allow_LDADD = $(LDADD)
282 32_live_tsync_allow_DEPENDENCIES = util.la ../src/libseccomp.la
322 32_live_tsync_allow_DEPENDENCIES = util.la ../src/libseccomp.la \
323 $(am__DEPENDENCIES_1)
283324 33_sim_socket_syscalls_be_SOURCES = 33-sim-socket_syscalls_be.c
284325 33_sim_socket_syscalls_be_OBJECTS = \
285326 33-sim-socket_syscalls_be.$(OBJEXT)
286327 33_sim_socket_syscalls_be_LDADD = $(LDADD)
287 33_sim_socket_syscalls_be_DEPENDENCIES = util.la ../src/libseccomp.la
328 33_sim_socket_syscalls_be_DEPENDENCIES = util.la ../src/libseccomp.la \
329 $(am__DEPENDENCIES_1)
330 35_sim_negative_one_SOURCES = 35-sim-negative_one.c
331 35_sim_negative_one_OBJECTS = 35-sim-negative_one.$(OBJEXT)
332 35_sim_negative_one_LDADD = $(LDADD)
333 35_sim_negative_one_DEPENDENCIES = util.la ../src/libseccomp.la \
334 $(am__DEPENDENCIES_1)
288335 miniseq_SOURCES = miniseq.c
289336 miniseq_OBJECTS = miniseq.$(OBJEXT)
290337 miniseq_DEPENDENCIES =
337384 26-sim-arch_all_be_basic.c 27-sim-bpf_blk_state.c \
338385 28-sim-arch_x86.c 29-sim-pseudo_syscall.c \
339386 30-sim-socket_syscalls.c 31-basic-version_check.c \
340 32-live-tsync_allow.c 33-sim-socket_syscalls_be.c miniseq.c
387 32-live-tsync_allow.c 33-sim-socket_syscalls_be.c \
388 35-sim-negative_one.c miniseq.c
341389 DIST_SOURCES = $(util_la_SOURCES) 01-sim-allow.c 02-sim-basic.c \
342390 03-sim-basic_chains.c 04-sim-multilevel_chains.c \
343391 05-sim-long_jumps.c 06-sim-actions.c 07-sim-db_bug_looping.c \
352400 26-sim-arch_all_be_basic.c 27-sim-bpf_blk_state.c \
353401 28-sim-arch_x86.c 29-sim-pseudo_syscall.c \
354402 30-sim-socket_syscalls.c 31-basic-version_check.c \
355 32-live-tsync_allow.c 33-sim-socket_syscalls_be.c miniseq.c
403 32-live-tsync_allow.c 33-sim-socket_syscalls_be.c \
404 35-sim-negative_one.c miniseq.c
356405 am__can_run_installinfo = \
357406 case $$AM_UPDATE_INFO_DIR in \
358407 n|no|NO) false;; \
399448 std=''; \
400449 fi; \
401450 }
451 am__DIST_COMMON = $(srcdir)/Makefile.in \
452 $(top_srcdir)/build-aux/depcomp
402453 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
403454 ACLOCAL = @ACLOCAL@
404455 AMTAR = @AMTAR@
405456 AM_CFLAGS = @AM_CFLAGS@
406457 AM_CPPFLAGS = @AM_CPPFLAGS@
407458 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
408 AM_LDFLAGS = -static
459 AM_LDFLAGS = ${DBG_STATIC}
409460 AR = @AR@
410461 AUTOCONF = @AUTOCONF@
411462 AUTOHEADER = @AUTOHEADER@
414465 CC = @CC@
415466 CCDEPMODE = @CCDEPMODE@
416467 CFLAGS = @CFLAGS@
468 CODE_COVERAGE_CFLAGS = @CODE_COVERAGE_CFLAGS@
469 CODE_COVERAGE_CPPFLAGS = @CODE_COVERAGE_CPPFLAGS@
470 CODE_COVERAGE_CXXFLAGS = @CODE_COVERAGE_CXXFLAGS@
471 CODE_COVERAGE_ENABLED = @CODE_COVERAGE_ENABLED@
472 CODE_COVERAGE_LDFLAGS = @CODE_COVERAGE_LDFLAGS@
473 CODE_COVERAGE_LIBS = @CODE_COVERAGE_LIBS@
417474 CPP = @CPP@
418475 CPPFLAGS = @CPPFLAGS@
419476 CYGPATH_W = @CYGPATH_W@
428485 EGREP = @EGREP@
429486 EXEEXT = @EXEEXT@
430487 FGREP = @FGREP@
488 GCOV = @GCOV@
489 GENHTML = @GENHTML@
431490 GREP = @GREP@
432491 INSTALL = @INSTALL@
433492 INSTALL_DATA = @INSTALL_DATA@
434493 INSTALL_PROGRAM = @INSTALL_PROGRAM@
435494 INSTALL_SCRIPT = @INSTALL_SCRIPT@
436495 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
496 LCOV = @LCOV@
437497 LD = @LD@
438498 LDFLAGS = @LDFLAGS@
439499 LIBOBJS = @LIBOBJS@
523583 top_build_prefix = @top_build_prefix@
524584 top_builddir = @top_builddir@
525585 top_srcdir = @top_srcdir@
526 LDADD = util.la ../src/libseccomp.la
586 @CODE_COVERAGE_ENABLED_FALSE@DBG_STATIC = -static
587 @CODE_COVERAGE_ENABLED_TRUE@DBG_STATIC =
588 LDADD = util.la ../src/libseccomp.la ${CODE_COVERAGE_LIBS}
527589 check_LTLIBRARIES = util.la
528590 util_la_SOURCES = util.c util.h
529591 util_la_LDFLAGS = -module
563625 30-sim-socket_syscalls.py \
564626 31-basic-version_check.py \
565627 32-live-tsync_allow.py \
566 33-sim-socket_syscalls_be.py
628 33-sim-socket_syscalls_be.py \
629 35-sim-negative_one.py
567630
568631 EXTRA_DIST_TESTCFGS = \
569632 01-sim-allow.tests \
598661 30-sim-socket_syscalls.tests \
599662 31-basic-version_check.tests \
600663 32-live-tsync_allow.tests \
601 33-sim-socket_syscalls_be.tests
664 33-sim-socket_syscalls_be.tests \
665 35-sim-negative_one.tests
602666
603667 EXTRA_DIST_TESTSCRIPTS = regression testdiff testgen
604668 EXTRA_DIST_TESTVALGRIND = valgrind_test.supp
625689 echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tests/Makefile'; \
626690 $(am__cd) $(top_srcdir) && \
627691 $(AUTOMAKE) --foreign tests/Makefile
628 .PRECIOUS: Makefile
629692 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
630693 @case '$?' in \
631694 *config.status*) \
802865 33-sim-socket_syscalls_be$(EXEEXT): $(33_sim_socket_syscalls_be_OBJECTS) $(33_sim_socket_syscalls_be_DEPENDENCIES) $(EXTRA_33_sim_socket_syscalls_be_DEPENDENCIES)
803866 @rm -f 33-sim-socket_syscalls_be$(EXEEXT)
804867 $(AM_V_CCLD)$(LINK) $(33_sim_socket_syscalls_be_OBJECTS) $(33_sim_socket_syscalls_be_LDADD) $(LIBS)
868
869 35-sim-negative_one$(EXEEXT): $(35_sim_negative_one_OBJECTS) $(35_sim_negative_one_DEPENDENCIES) $(EXTRA_35_sim_negative_one_DEPENDENCIES)
870 @rm -f 35-sim-negative_one$(EXEEXT)
871 $(AM_V_CCLD)$(LINK) $(35_sim_negative_one_OBJECTS) $(35_sim_negative_one_LDADD) $(LIBS)
805872
806873 miniseq$(EXEEXT): $(miniseq_OBJECTS) $(miniseq_DEPENDENCIES) $(EXTRA_miniseq_DEPENDENCIES)
807874 @rm -f miniseq$(EXEEXT)
847914 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/31-basic-version_check.Po@am__quote@
848915 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/32-live-tsync_allow.Po@am__quote@
849916 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/33-sim-socket_syscalls_be.Po@am__quote@
917 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/35-sim-negative_one.Po@am__quote@
850918 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/miniseq.Po@am__quote@
851919 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/util.Plo@am__quote@
852920
11791247 mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
11801248 tags tags-am uninstall uninstall-am
11811249
1250 .PRECIOUS: Makefile
1251
1252
1253 @CODE_COVERAGE_RULES@
11821254
11831255 check-build:
11841256 ${MAKE} ${AM_MAKEFLAGS} ${check_PROGRAMS}
4949 if (get_number(argv[1], &first) || get_number(argv[2], &last))
5050 return 1;
5151
52 for (cur = first; cur <= last; cur++)
53 printf("%" PRIu64 "\n", cur);
52 for (cur = first; cur != last; cur++)
53 printf("%" PRId64 "\n", cur);
54 printf("%" PRId64 "\n", cur);
5455
5556 return 0;
5657 }
8181 -s SINGLE_TEST specifies individual test number to be run
8282 -t [TEMP_DIR] specifies directory to create temporary files in
8383 -T [TEST_TYPE] only run tests matching the specified type
84 can also be set via LIBSECCOMP_TSTCFG_TYPE env variable
8485 -v specifies that verbose output be provided
8586 EOF
8687 }
277278 local line=($3)
278279 local testname=${line[0]}
279280 local stress_count=${line[1]}
281
282 # check for stress count configuration via environment variables
283 [[ -n $LIBSECCOMP_TSTCFG_STRESSCNT ]] && \
284 stress_count=$LIBSECCOMP_TSTCFG_STRESSCNT
280285
281286 for i in $(get_seq 1 $stress_count); do
282287 local sys=$(generate_random_data)
469474
470475 # get low and high syscall values and convert them to numbers
471476 low_syscall=$(get_range $LOW "${line[2]}")
472 if [[ ! $low_syscall =~ ^[0-9]+$ ]]; then
477 if [[ ! $low_syscall =~ ^\-?[0-9]+$ ]]; then
473478 low_syscall=$($GLBL_SYS_RESOLVER -a $simarch -t \
474479 $low_syscall)
475480 if [[ $? -ne 0 ]]; then
480485 fi
481486 fi
482487 high_syscall=$(get_range $HIGH "${line[2]}")
483 if [[ ! $high_syscall =~ ^[0-9]+$ ]]; then
488 if [[ ! $high_syscall =~ ^\-?[0-9]+$ ]]; then
484489 high_syscall=$($GLBL_SYS_RESOLVER -a $simarch -t \
485490 $high_syscall)
486491 if [[ $? -ne 0 ]]; then
960965 single_list=()
961966 fi
962967
968 # check for configuration via environment variables
969 [[ -z $type && -n $LIBSECCOMP_TSTCFG_TYPE ]] && type=$LIBSECCOMP_TSTCFG_TYPE
970
963971 # open log file for append (default to stdout)
964972 if [[ -n $logfile ]]; then
965973 logfd=3
9999 Description:
100100 Open the specified file, write a string to the file, and close the file.
101101 """
102 fd = os.open(path, os.O_WRONLY|os.O_CREAT, 0600)
103 if not os.write(fd, "testing") == len("testing"):
102 fd = os.open(str(path), os.O_WRONLY|os.O_CREAT)
103 if not os.write(fd, b"testing") == len("testing"):
104104 raise IOError("failed to write the full test string in write_file()")
105105 os.close(fd)
106106
0 # Makefile.in generated by automake 1.14.1 from Makefile.am.
0 # Makefile.in generated by automake 1.15.1 from Makefile.am.
11 # @configure_input@
22
3 # Copyright (C) 1994-2013 Free Software Foundation, Inc.
3 # Copyright (C) 1994-2017 Free Software Foundation, Inc.
44
55 # This Makefile.in is free software; the Free Software Foundation
66 # gives unlimited permission to copy and/or distribute it,
3333
3434
3535 VPATH = @srcdir@
36 am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
36 am__is_gnu_make = { \
37 if test -z '$(MAKELEVEL)'; then \
38 false; \
39 elif test -n '$(MAKE_HOST)'; then \
40 true; \
41 elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
42 true; \
43 else \
44 false; \
45 fi; \
46 }
3747 am__make_running_with_option = \
3848 case $${target_option-} in \
3949 ?) ;; \
100110 noinst_PROGRAMS = scmp_arch_detect$(EXEEXT) scmp_bpf_disasm$(EXEEXT) \
101111 scmp_bpf_sim$(EXEEXT)
102112 subdir = tools
103 DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
104 $(top_srcdir)/build-aux/depcomp
105113 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
106 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
107 $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
108 $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
109 $(top_srcdir)/configure.ac
114 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_code_coverage.m4 \
115 $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
116 $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
117 $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac
110118 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
111119 $(ACLOCAL_M4)
120 DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
112121 mkinstalldirs = $(install_sh) -d
113122 CONFIG_HEADER = $(top_builddir)/configure.h
114123 CONFIG_CLEAN_FILES =
210219 done | $(am__uniquify_input)`
211220 ETAGS = etags
212221 CTAGS = ctags
222 am__DIST_COMMON = $(srcdir)/Makefile.in \
223 $(top_srcdir)/build-aux/depcomp
213224 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
214225 ACLOCAL = @ACLOCAL@
215226 AMTAR = @AMTAR@
225236 CC = @CC@
226237 CCDEPMODE = @CCDEPMODE@
227238 CFLAGS = @CFLAGS@
239 CODE_COVERAGE_CFLAGS = @CODE_COVERAGE_CFLAGS@
240 CODE_COVERAGE_CPPFLAGS = @CODE_COVERAGE_CPPFLAGS@
241 CODE_COVERAGE_CXXFLAGS = @CODE_COVERAGE_CXXFLAGS@
242 CODE_COVERAGE_ENABLED = @CODE_COVERAGE_ENABLED@
243 CODE_COVERAGE_LDFLAGS = @CODE_COVERAGE_LDFLAGS@
244 CODE_COVERAGE_LIBS = @CODE_COVERAGE_LIBS@
228245 CPP = @CPP@
229246 CPPFLAGS = @CPPFLAGS@
230247 CYGPATH_W = @CYGPATH_W@
239256 EGREP = @EGREP@
240257 EXEEXT = @EXEEXT@
241258 FGREP = @FGREP@
259 GCOV = @GCOV@
260 GENHTML = @GENHTML@
242261 GREP = @GREP@
243262 INSTALL = @INSTALL@
244263 INSTALL_DATA = @INSTALL_DATA@
245264 INSTALL_PROGRAM = @INSTALL_PROGRAM@
246265 INSTALL_SCRIPT = @INSTALL_SCRIPT@
247266 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
267 LCOV = @LCOV@
248268 LD = @LD@
249269 LDFLAGS = @LDFLAGS@
250270 LIBOBJS = @LIBOBJS@
362382 echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tools/Makefile'; \
363383 $(am__cd) $(top_srcdir) && \
364384 $(AUTOMAKE) --foreign tools/Makefile
365 .PRECIOUS: Makefile
366385 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
367386 @case '$?' in \
368387 *config.status*) \
718737 mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
719738 tags tags-am uninstall uninstall-am uninstall-binPROGRAMS
720739
740 .PRECIOUS: Makefile
741
721742
722743 # Tell versions [3.59,3.63) of GNU make to not export all variables.
723744 # Otherwise a system limit (for SysV at least) may be exceeded.